diff options
Diffstat (limited to '')
-rw-r--r-- | src/others/mimesh/libg3d-0.0.8/include/g3d/object.h | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h new file mode 100644 index 0000000..97dfefc --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h | |||
@@ -0,0 +1,151 @@ | |||
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_OBJECT_H__ | ||
24 | #define __G3D_OBJECT_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:object | ||
34 | * @short_description: Object manipulation | ||
35 | * @include: g3d/object.h | ||
36 | * | ||
37 | * Objects are parts of a model. In most file formats vertices and faces are | ||
38 | * grouped in some way into objects. Objects can be hierarchical, so what a | ||
39 | * model contains is basically an object tree. | ||
40 | */ | ||
41 | |||
42 | /** | ||
43 | * g3d_object_free: | ||
44 | * @object: the object to free | ||
45 | * | ||
46 | * Frees all memory allocated for that object. | ||
47 | */ | ||
48 | EAPI | ||
49 | void g3d_object_free(G3DObject *object); | ||
50 | |||
51 | /** | ||
52 | * g3d_object_radius: | ||
53 | * @object: the object to measure | ||
54 | * | ||
55 | * Calculates the radius of the object. This is the maximum from the | ||
56 | * center to a vertex. | ||
57 | * | ||
58 | * Returns: the radius of the given object | ||
59 | */ | ||
60 | EAPI | ||
61 | gdouble g3d_object_radius(G3DObject *object); | ||
62 | |||
63 | /** | ||
64 | * g3d_object_scale: | ||
65 | * @object: the object to scale | ||
66 | * @scale: scale factor | ||
67 | * | ||
68 | * Resizes the object by the factor @scale. | ||
69 | * | ||
70 | * Returns: TRUE on success, FALSE else | ||
71 | */ | ||
72 | EAPI | ||
73 | gboolean g3d_object_scale(G3DObject *object, G3DFloat scale); | ||
74 | |||
75 | /** | ||
76 | * g3d_object_transform: | ||
77 | * @object: the object to transform | ||
78 | * @matrix: the transformation matrix | ||
79 | * | ||
80 | * Multiplies all vertices of the object with the transformation matrix. | ||
81 | * | ||
82 | * Returns: TRUE on success, FALSE else | ||
83 | */ | ||
84 | EAPI | ||
85 | gboolean g3d_object_transform(G3DObject *object, G3DMatrix *matrix); | ||
86 | |||
87 | /** | ||
88 | * g3d_object_transform_normals: | ||
89 | * @object: the object to transform | ||
90 | * @matrix: the transformation matrix | ||
91 | * | ||
92 | * Multiplies all normals of the object with the transformation matrix. | ||
93 | * | ||
94 | * Returns: TRUE on success, FALSE else | ||
95 | */ | ||
96 | EAPI | ||
97 | gboolean g3d_object_transform_normals(G3DObject *object, G3DMatrix *matrix); | ||
98 | |||
99 | /** | ||
100 | * g3d_object_duplicate: | ||
101 | * @object: the object to duplicate | ||
102 | * | ||
103 | * Duplicates an object with all vertices, faces and materials. | ||
104 | * | ||
105 | * Returns: the new clone object | ||
106 | */ | ||
107 | EAPI | ||
108 | G3DObject *g3d_object_duplicate(G3DObject *object); | ||
109 | |||
110 | /** | ||
111 | * g3d_object_optimize: | ||
112 | * @object: the object to optimize | ||
113 | * | ||
114 | * Puts all vertex and face information into special arrays for faster | ||
115 | * rendering. It is deprecated and should not be used. | ||
116 | * | ||
117 | * Returns: TRUE on success, FALSE else | ||
118 | */ | ||
119 | EAPI | ||
120 | gboolean g3d_object_optimize(G3DObject *object); | ||
121 | |||
122 | /** | ||
123 | * g3d_object_smooth: | ||
124 | * @object: the object to smooth | ||
125 | * | ||
126 | * FIXME: unimplemented. | ||
127 | * | ||
128 | * Returns: TRUE on success, FALSE else | ||
129 | */ | ||
130 | EAPI | ||
131 | gboolean g3d_object_smooth(G3DObject *object); | ||
132 | |||
133 | /** | ||
134 | * g3d_object_merge: | ||
135 | * @o1: first and target object | ||
136 | * @o2: second object | ||
137 | * | ||
138 | * Merges both objects into @o1. | ||
139 | * FIXME: needs cleanup | ||
140 | * | ||
141 | * Returns: TRUE on success, FALSE else | ||
142 | */ | ||
143 | EAPI | ||
144 | gboolean g3d_object_merge(G3DObject *o1, G3DObject *o2); | ||
145 | |||
146 | #ifdef __cplusplus | ||
147 | } | ||
148 | #endif /* ifdef __cplusplus */ | ||
149 | |||
150 | #endif /* __G3D_OBJECT_H__ */ | ||
151 | |||