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;
57 typedef struct bDeformGroup {
58 struct bDeformGroup *next, *prev;
60 void *data; /* Temporary data, most likely a pointer to the bone - no need to delete */
65 typedef struct BoundBox {
69 /* OcInfo and LBuf structs are for the Enji gameengine */
71 typedef struct OcInfo {
83 typedef struct Object {
87 int par1, par2, par3; /* can be vertexnrs */
88 char parsubstr[32]; /* String describing subobject info */
90 struct Object *parent, *track;
94 struct bAction *action;
98 struct bConstraintChannel *activecon;
99 ListBase constraintChannels;
105 struct Material **mat;
107 /* rot en drot have to be together! (transform('r' en 's')) */
108 float loc[3], dloc[3], orig[3];
109 float size[3], dsize[3];
110 float rot[3], drot[3];
111 float quat[4], dquat[4];
113 float parentinv[4][4];
114 float imat[4][4]; /* for during render, old game engine, temporally: ipokeys of transform */
116 unsigned int lay; /* copy of Base */
117 short flag; /* copy of Base */
118 short colbits; /* when zero, from obdata */
119 char transflag, ipoflag;
120 char trackflag, upflag;
121 short ipowin, scaflag; /* ipowin: blocktype last ipowindow */
122 short scavisflag, boundtype;
124 short dupon, dupoff, dupsta, dupend;
128 /* during realtime */
130 /* note that inertia is only called inertia for historical reasons
131 * and is not changed to avoid DNA surgery. It actually reflects the
132 * Size value in the GameButtons (= radius) */
134 float mass, damping, inertia;
135 /* The form factor k is introduced to give the user more control
136 * and to fix incompatibility problems.
137 * For rotational symmetric objects, the inertia value can be
138 * expressed as: Theta = k * m * r^2
139 * where m = Mass, r = Radius
140 * For a Sphere, the form factor is by default = 0.4
143 float formfactor, softtime; /* softtime temp for softbody, remove it before release! */
144 float rdamping, sizefac;
147 char totcol; /* copy of mesh or curve or meta */
150 ScriptLink scriptlink;
153 ListBase controllers;
160 unsigned short actdef; /* current deformation group */
163 * Settings for game objects
164 * bit 0: Object has dynamic behaviour
165 * bit 2: Object is evaluated by the gameengine
166 * bit 6: Use Fh settings in Materials
167 * bit 7: Use face normal to rotate Object
168 * bit 8: Friction is anisotropic
169 * bit 9: Object is a ghost
170 * bit 10: Do rigid body dynamics.
171 * bit 11: Use bounding object for physics
176 * bit 15: Always ignore activity culling
179 short softflag, dummy; /* temporal stuff softbody experiment */
180 float anisotropicFriction[3];
182 ListBase constraints;
186 struct PartDeflect *pd; /* particle deflector/attractor/collision data */
187 struct SoftBody *soft; /* if exists, saved in file */
193 float toonedge, smoothresh; /* smoothresh is phong interpolation ray_shadow correction in render */
197 typedef struct ObHook {
198 struct ObHook *next, *prev;
200 struct Object *parent;
201 float parentinv[4][4]; /* matrix making current transform unmodified */
202 float mat[4][4]; /* temp matrix while hooking */
203 float cent[3]; /* visualization of hook */
204 float falloff; /* if not zero, falloff is distance where influence zero */
209 int totindex, curindex; /* curindex is cache for fast lookup */
210 short type, active; /* active is only first hook, for button menu */
215 /* this work object is defined in object.c */
216 extern Object workob;
219 /* **************** OBJECT ********************* */
221 /* used many places... should be specialized */
237 #define OB_LATTICE 22
239 /* 23 and 24 are for life and sector (old file compat.) */
240 #define OB_ARMATURE 25
242 /* partype: eerste 5 bits: type */
254 /* char! transflag */
255 #define OB_OFFS_LOCAL 1
257 #define OB_NEG_SCALE 4
258 #define OB_DUPLI (8+16)
259 #define OB_DUPLIFRAMES 8
260 #define OB_DUPLIVERTS 16
261 #define OB_DUPLIROT 32
262 #define OB_DUPLINOSPEED 64
264 #define OB_POWERTRACK 128
268 #define OB_DRAWKEYSEL 2
270 #define OB_OFFS_MAT 8
271 #define OB_OFFS_VKEY 16
272 #define OB_OFFS_PATH 32
273 #define OB_OFFS_PARENT 64
274 #define OB_OFFS_PARTICLE 128
277 /* trackflag / upflag */
285 /* gameflag in game.h */
288 #define OB_BOUNDBOX 1
293 #define OB_TOON_MONO 6
294 #define OB_TOON_COLOR 7
295 #define OB_TOON_TRANSP 8
296 #define OB_TOON_FLAT 9
297 #define OB_TOON_SMOOTH 10
301 #define OB_TEXSPACE 4
302 #define OB_DRAWNAME 8
303 #define OB_DRAWIMAGE 16
304 #define OB_DRAWWIRE 32 /* for solid+wire display */
307 #define OB_BOUND_BOX 0
308 #define OB_BOUND_SPHERE 1
309 #define OB_BOUND_CYLINDER 2
310 #define OB_BOUND_CONE 3
311 #define OB_BOUND_POLYH 4
312 #define OB_BOUND_POLYT 5
314 /* also needed for base!!!!! or rather, thy interfere....*/
315 /* base->flag and ob->flag */
318 #define BA_WHERE_UPDATE 8
319 #define BA_DISP_UPDATE 16
321 #define OB_GONNA_MOVE 32
322 #define BA_FROMSET 128
323 #define OB_DO_IMAT 256
324 #define OB_FROMDUPLI 512
326 #define OB_RADIO 2048
327 #define OB_FROMGROUP 4096
328 #define OB_POSEMODE 8192
334 #define OB_INERTIA_LOCK_X 8
335 #define OB_INERTIA_LOCK_Y 16
336 #define OB_INERTIA_LOCK_Z 32
338 #define OB_ROT_FH 128
339 #define OB_ANISOTROPIC_FRICTION 256
341 #define OB_RIGID_BODY 1024
342 #define OB_BOUNDS 2048
344 #define OB_COLLISION_RESPONSE 4096
345 #define OB_SECTOR 8192
346 #define OB_PROP 16384
347 #define OB_MAINACTOR 32768
350 #define OB_NEVER_DO_ACTIVITY_CULLING 1
352 #define OB_LIFE (OB_PROP|OB_DYNAMIC|OB_ACTOR|OB_MAINACTOR|OB_CHILD)
355 #define OB_VIS_SENS 1
356 #define OB_VIS_CONT 2
360 #define OB_SHOWSENS 64
361 #define OB_SHOWACT 128
362 #define OB_ADDSENS 256
363 #define OB_ADDCONT 512
364 #define OB_ADDACT 1024
365 #define OB_SHOWCONT 2048
367 /* ob->softflag in DNA_object_force.h */