aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h')
-rw-r--r--src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h164
1 files changed, 164 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h
new file mode 100644
index 0000000..3db23df
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h
@@ -0,0 +1,164 @@
1/* $Id$ */
2
3/*
4 libg3d - 3D object loading library
5
6 Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21*/
22
23#ifndef __G3D_PRIMITIVE_H__
24#define __G3D_PRIMITIVE_H__
25
26#include <g3d/types.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif /* ifdef __cplusplus */
31
32/**
33 * SECTION:primitive
34 * @short_description: 3D primitive generation functions
35 * @include: g3d/primitive.h
36 *
37 * Primitives are objects containing basic 3D geometrical structures. A
38 * variety of them can be created using these functions.
39 */
40
41/**
42 * g3d_primitive_box:
43 * @width: the width of the box
44 * @height: the height of the box
45 * @depth: the depth of the box
46 * @material: the material to use for all faces
47 *
48 * Generates an object containing a box.
49 *
50 * Returns: the box object
51 */
52EAPI
53G3DObject *g3d_primitive_box(G3DFloat width, G3DFloat height, G3DFloat depth,
54 G3DMaterial *material);
55
56#ifndef G3D_DISABLE_DEPRECATED
57/**
58 * g3d_primitive_cube:
59 * @width: the width of the box
60 * @height: the height of the box
61 * @depth: the depth of the box
62 * @material: the material to use for all faces
63 *
64 * Generates an object containing a box. It is deprecated and now a wrapper for
65 * g3d_primitive_box().
66 *
67 * Returns: the box object
68 */
69EAPI
70G3DObject *g3d_primitive_cube(G3DFloat width, G3DFloat height, G3DFloat depth,
71 G3DMaterial *material);
72#endif
73
74/**
75 * g3d_primitive_cylinder:
76 * @radius: the radius of the cylinder
77 * @height: the height of the side faces
78 * @sides: number of side faces (number of circle segments)
79 * @top: add top faces
80 * @bottom: add bottom faces
81 * @material: material to use for faces
82 *
83 * Generates an object containing a cylinder.
84 *
85 * Returns: cylinder object
86 */
87EAPI
88G3DObject *g3d_primitive_cylinder(G3DFloat radius, G3DFloat height,
89 guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material);
90
91/**
92 * g3d_primitive_tube:
93 * @r_in: inner radius
94 * @r_out: outer radius
95 * @height: the height of the side faces
96 * @sides: number of side faces (number of circle segments)
97 * @top: add top faces
98 * @bottom: add bottom faces
99 * @material: material to use for faces
100 *
101 * Generates an object containing a tube (a cylinder with a hole).
102 *
103 * Returns: tube object
104 */
105EAPI
106G3DObject *g3d_primitive_tube(G3DFloat r_in, G3DFloat r_out, G3DFloat height,
107 guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material);
108
109/**
110 * g3d_primitive_sphere:
111 * @radius: radius
112 * @vseg: number of vertical segments
113 * @hseg: number of horizontal segments
114 * @material: material to use for faces
115 *
116 * Generates an object containing a sphere.
117 *
118 * Returns: sphere object
119 */
120EAPI
121G3DObject *g3d_primitive_sphere(G3DFloat radius, guint32 vseg, guint32 hseg,
122 G3DMaterial *material);
123
124/**
125 * g3d_primitive_box_strip_2d:
126 * @vcnt: number of control points
127 * @vdata: 2-dimensional control point data (2 * vcnt * gdouble)
128 * @height: height of resulting strip (y component)
129 * @width: width of strip (corner diameter)
130 * @material: material to use for faces
131 *
132 * Generates a strip of box segments defined by corner center points
133 * using two-dimensional data (x/z plane).
134 *
135 * Returns: strip object
136 */
137EAPI
138G3DObject *g3d_primitive_box_strip_2d(guint32 vcnt, gdouble *vdata,
139 gdouble height, gdouble width, G3DMaterial *material);
140
141/**
142 * g3d_primitive_mesh:
143 * @m: number of vertices in m direction
144 * @n: number of vertices in n direction
145 * @wrap_m: wrap around in m direction
146 * @wrap_n: wrap around in n direction
147 * @material: material to use for faces
148 *
149 * Generate a mesh consisting of m * n vertices. The vertex data is
150 * initialized with (0.0, 0.0, 0.0) and has to be set to something
151 * useful.
152 *
153 * Returns: mesh object
154 */
155EAPI
156G3DObject *g3d_primitive_mesh(guint32 m, guint32 n, gboolean wrap_m,
157 gboolean wrap_n, G3DMaterial *material);
158
159#ifdef __cplusplus
160}
161#endif /* ifdef __cplusplus */
162
163#endif /* __G3D_PRIMITIVE_H__ */
164