blob: 923a0e373fc0015fc1664f76a375fef8916fb7d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#ifndef HONEY_PRIMITIVES_H
#define HONEY_PRIMITIVES H
/** @file primitives.h
*
* @brief Define various common primitive objects.
*/
#include "common.h"
#include "mesh.h"
/** @brief Push table of lua bindings for creating primitives to the stack. */
void honey_setup_primitives(lua_State* L);
/** @brief Create a textured plane.
*
* This function creates a plane with vertex positions in attribute 0,
* vertex normals in attribute 1, and UV coordinates in attribute 2.
*
* @param[out] mesh Pointer to the destination mesh
* @param[in] width Desired width of the plane (x-axis)
* @param[in] height Desired height of the plane (y-axis)
*
* @return 0 (HONEY_OK) on success, and an error code otherwise.
*/
honey_result honey_mesh_new_textured_plane(honey_mesh* mesh,
float width,
float height);
/** @brief Create a cube.
*
* This function creates a cube with vertex positions in attribute 0.
*
* @param[out] mesh Pointer to the destination mesh
* @param[in] width Desired width of the cube (x-axis)
* @param[in] height Desired height of the cube (y-axis)
* @param[in] depth Desired depth of the cube (z-axis)
*
* @return Success or failure code
*/
honey_result honey_mesh_new_cube(honey_mesh* mesh,
float width,
float height,
float depth);
/** @brief Create a textured cube.
*
* This function creates a cube with vertex positions in attribute 0,
* and texture coordinates in attribute 1.
*
* @param[out] mesh Pointer to the destination mesh
* @param[in] width Desired width of the cube (x-axis)
* @param[in] height Desired height of the cube (y-axis)
* @param[in] depth Desired depth of the cube (z-axis)
*
* @return Success or failure code
*/
honey_result honey_mesh_new_textured_cube(honey_mesh* mesh,
float width,
float height,
float depth);
#endif
|