2 * blenlib/DNA_object_types.h (mar-2001 nzc)
4 * Object is a sort of wrapper for general info.
8 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version. The Blender
14 * Foundation also sells licenses for use in proprietary software under
15 * the Blender License. See http://www.blender.org/BL/ for information
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
28 * All rights reserved.
30 * The Original Code is: all of this file.
32 * Contributor(s): none yet.
34 * ***** END GPL/BL DUAL LICENSE BLOCK *****
36 #ifndef DNA_OBJECT_TYPES_H
37 #define DNA_OBJECT_TYPES_H
39 #include "DNA_listBase.h"
41 #include "DNA_scriptlink_types.h"
53 struct bConstraintChannel;
55 typedef struct bDeformGroup {
56 struct bDeformGroup *next, *prev;
58 void *data; /* Temporary data, most likely a pointer to the bone - no need to delete */
63 typedef struct BoundBox {
67 /* OcInfo and LBuf structs are for the Enji gameengine */
69 typedef struct OcInfo {
80 typedef struct Object {
84 int par1, par2, par3; /* can be vertexnrs */
85 char parsubstr[32]; /* String describing subobject info */
87 struct Object *parent, *track;
91 struct bAction *action;
95 struct bConstraintChannel *activecon;
96 ListBase constraintChannels;
102 struct Material **mat;
104 /* rot en drot have to be together! (transform('r' en 's')) */
105 float loc[3], dloc[3], orig[3];
106 float size[3], dsize[3];
107 float rot[3], drot[3];
108 float quat[4], dquat[4];
110 float parentinv[4][4];
111 float imat[4][4]; /* for during render, old game engine, temporally: ipokeys of transform */
113 unsigned int lay; /* copy of Base */
114 short flag; /* copy of Base */
115 short colbits; /* when zero, from obdata */
116 char transflag, ipoflag;
117 char trackflag, upflag;
118 short ipowin, scaflag; /* ipowin: blocktype last ipowindow */
119 short scavisflag, boundtype;
121 short dupon, dupoff, dupsta, dupend;
125 /* during realtime */
127 /* note that inertia is only called inertia for historical reasons
128 * and is not changed to avoid DNA surgery. It actually reflects the
129 * Size value in the GameButtons (= radius) */
131 float mass, damping, inertia;
132 /* The form factor k is introduced to give the user more control
133 * and to fix incompatibility problems.
134 * For rotational symmetric objects, the inertia value can be
135 * expressed as: Theta = k * m * r^2
136 * where m = Mass, r = Radius
137 * For a Sphere, the form factor is by default = 0.4
140 float formfactor, dummy_1;
141 float rdamping, sizefac;
144 char totcol; /* copy of mesh or curve or meta */
147 ScriptLink scriptlink;
150 ListBase controllers;
157 unsigned short actdef; /* current deformation group */
160 * Settings for game objects
161 * bit 0: Object has dynamic behaviour
162 * bit 2: Object is evaluated by the gameengine
163 * bit 6: Use Fh settings in Materials
164 * bit 7: Use face normal to rotate Object
165 * bit 8: Friction is anisotropic
166 * bit 9: Object is a ghost
167 * bit 10: Do rigid body dynamics.
168 * bit 11: Use bounding object for physics
173 * bit 15: Always ignore activity culling
177 float anisotropicFriction[3];
179 ListBase constraints;
187 float toonedge, pad2;
190 /* this work object is defined in object.c */
191 extern Object workob;
194 /* **************** OBJECT ********************* */
196 /* used many places... should be specialized */
212 #define OB_LATTICE 22
214 /* 23 and 24 are for life and sector (old file compat.) */
215 #define OB_ARMATURE 25
217 /* partype: eerste 5 bits: type */
229 /* char! transflag */
230 #define OB_OFFS_LOCAL 1
232 #define OB_NEG_SCALE 4
233 #define OB_DUPLI (8+16)
234 #define OB_DUPLIFRAMES 8
235 #define OB_DUPLIVERTS 16
236 #define OB_DUPLIROT 32
237 #define OB_DUPLINOSPEED 64
239 #define OB_POWERTRACK 128
243 #define OB_DRAWKEYSEL 2
245 #define OB_OFFS_MAT 8
246 #define OB_OFFS_VKEY 16
247 #define OB_OFFS_PATH 32
248 #define OB_OFFS_PARENT 64
249 #define OB_OFFS_PARTICLE 128
252 /* trackflag / upflag */
260 /* gameflag in game.h */
263 #define OB_BOUNDBOX 1
268 #define OB_TOON_MONO 6
269 #define OB_TOON_COLOR 7
270 #define OB_TOON_TRANSP 8
271 #define OB_TOON_FLAT 9
272 #define OB_TOON_SMOOTH 10
276 #define OB_TEXSPACE 4
277 #define OB_DRAWNAME 8
278 #define OB_DRAWIMAGE 16
279 #define OB_DRAWWIRE 32 /* for solid+wire display */
282 #define OB_BOUND_BOX 0
283 #define OB_BOUND_SPHERE 1
284 #define OB_BOUND_CYLINDER 2
285 #define OB_BOUND_CONE 3
286 #define OB_BOUND_POLYH 4
288 /* also needed for base!!!!! or rather, thy interfere....*/
289 /* base->flag and ob->flag */
292 #define BA_WHERE_UPDATE 8
293 #define BA_DISP_UPDATE 16
295 #define OB_GONNA_MOVE 32
296 #define BA_FROMSET 128
297 #define OB_DO_IMAT 256
298 #define OB_FROMDUPLI 512
300 #define OB_RADIO 2048
301 #define OB_FROMGROUP 4096
307 #define OB_INERTIA_LOCK_X 8
308 #define OB_INERTIA_LOCK_Y 16
309 #define OB_INERTIA_LOCK_Z 32
311 #define OB_ROT_FH 128
312 #define OB_ANISOTROPIC_FRICTION 256
314 #define OB_RIGID_BODY 1024
315 #define OB_BOUNDS 2048
317 #define OB_COLLISION_RESPONSE 4096
318 #define OB_SECTOR 8192
319 #define OB_PROP 16384
320 #define OB_MAINACTOR 32768
323 #define OB_NEVER_DO_ACTIVITY_CULLING 1
325 #define OB_LIFE (OB_PROP|OB_DYNAMIC|OB_ACTOR|OB_MAINACTOR|OB_CHILD)
328 #define OB_VIS_SENS 1
329 #define OB_VIS_CONT 2
333 #define OB_SHOWSENS 64
334 #define OB_SHOWACT 128
335 #define OB_ADDSENS 256
336 #define OB_ADDCONT 512
337 #define OB_ADDACT 1024
338 #define OB_SHOWCONT 2048