|
Blender
V2.59
|
00001 /* 00002 * $Id: DNA_actuator_types.h 37455 2011-06-13 17:08:33Z dfelinto $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00034 #ifndef DNA_ACTUATOR_TYPES_H 00035 #define DNA_ACTUATOR_TYPES_H 00036 00037 struct Object; 00038 struct Mesh; 00039 struct Scene; 00040 struct Group; 00041 struct Text; 00042 00043 /* ****************** ACTUATORS ********************* */ 00044 00045 /* unused now, moved to editobjectactuator in 2.02. Still needed for dna */ 00046 typedef struct bAddObjectActuator { 00047 int time, pad; 00048 struct Object *ob; 00049 } bAddObjectActuator; 00050 00051 typedef struct bActionActuator { 00052 struct bAction *act; /* Pointer to action */ 00053 short type, flag; /* Playback type */ // not in use 00054 float sta, end; /* Start & End frames */ 00055 char name[32]; /* For property-driven playback */ 00056 char frameProp[32]; /* Set this property to the actions current frame */ 00057 short blendin; /* Number of frames of blending */ 00058 short priority; /* Execution priority */ 00059 short end_reset; /* Ending the actuator (negative pulse) wont reset the the action to its starting frame */ 00060 short strideaxis; /* Displacement axis */ 00061 float stridelength; /* Displacement incurred by cycle */ // not in use 00062 } bActionActuator; 00063 00064 typedef struct Sound3D 00065 { 00066 float min_gain; 00067 float max_gain; 00068 float reference_distance; 00069 float max_distance; 00070 float rolloff_factor; 00071 float cone_inner_angle; 00072 float cone_outer_angle; 00073 float cone_outer_gain; 00074 } Sound3D; 00075 00076 typedef struct bSoundActuator { 00077 short flag, sndnr; 00078 int pad1, pad2; 00079 short pad3[2]; 00080 float volume, pitch; 00081 struct bSound *sound; 00082 struct Sound3D sound3D; 00083 short type, pad4; 00084 short pad5, pad6[1]; 00085 } bSoundActuator; 00086 00087 typedef struct bEditObjectActuator { 00088 int time; 00089 short type, flag; 00090 struct Object *ob; 00091 struct Mesh *me; 00092 char name[32]; 00093 float linVelocity[3]; /* initial lin. velocity on creation */ 00094 float angVelocity[3]; /* initial ang. velocity on creation */ 00095 float mass; 00096 short localflag; /* flag for the lin & ang. vel: apply locally */ 00097 short dyn_operation; 00098 } bEditObjectActuator; 00099 00100 typedef struct bSceneActuator { 00101 short type, pad1; 00102 int pad; 00103 struct Scene *scene; 00104 struct Object *camera; 00105 } bSceneActuator; 00106 00107 typedef struct bPropertyActuator { 00108 int pad, type; 00109 char name[32], value[32]; 00110 struct Object *ob; 00111 } bPropertyActuator; 00112 00113 typedef struct bObjectActuator { 00114 short flag, type, otype; 00115 short damping; 00116 float forceloc[3], forcerot[3]; 00117 float pad[3], pad1[3]; 00118 float dloc[3], drot[3]; /* angle in radians */ 00119 float linearvelocity[3], angularvelocity[3]; 00120 struct Object *reference; 00121 } bObjectActuator; 00122 00123 typedef struct bIpoActuator { 00124 short flag, type; 00125 float sta, end; 00126 char name[32]; 00127 char frameProp[32]; /* Set this property to the actions current frame */ 00128 00129 short pad1, pad2, pad3, pad4; 00130 00131 } bIpoActuator; 00132 00133 typedef struct bCameraActuator { 00134 struct Object *ob; 00135 float height, min, max; 00136 float damping; 00137 short pad1, axis; 00138 float pad2; 00139 } bCameraActuator ; 00140 00141 typedef struct bConstraintActuator { 00142 short type, mode; 00143 short flag, damp; 00144 short time, rotdamp; 00145 int pad; 00146 float minloc[3], maxloc[3]; 00147 float minrot[3], maxrot[3]; 00148 char matprop[32]; 00149 } bConstraintActuator; 00150 00151 typedef struct bGroupActuator { 00152 short flag, type; 00153 int sta, end; 00154 char name[32]; /* property or groupkey */ 00155 00156 short pad[3], cur, butsta, butend;/* not referenced, can remove? */ 00157 /* struct Group *group; not used, remove */ 00158 00159 } bGroupActuator; 00160 00161 /* I added a few extra fields here, to facilitate conversions */ 00162 typedef struct bRandomActuator { 00163 int seed; 00164 int distribution; 00165 int int_arg_1; 00166 int int_arg_2; 00167 float float_arg_1; 00168 float float_arg_2; 00169 char propname[32]; 00170 } bRandomActuator; 00171 00172 typedef struct bMessageActuator { 00173 char toPropName[32]; /* Send to all objects with this propertyname. Empty to broadcast. */ 00174 struct Object *toObject;/* (Possible future use) pointer to a single destination object. */ 00175 char subject[32]; /* Message Subject to send. */ 00176 short bodyType, pad1; /* bodyType is either 'User defined text' or PropName */ 00177 int pad2; 00178 char body[32]; /* Either User Defined Text or our PropName to send value of */ 00179 } bMessageActuator; 00180 00181 typedef struct bGameActuator { 00182 short flag, type; 00183 int sta, end; 00184 char filename[64]; 00185 char loadaniname[64]; 00186 } bGameActuator; 00187 00188 typedef struct bVisibilityActuator { 00192 int flag; 00193 } bVisibilityActuator; 00194 00195 typedef struct bTwoDFilterActuator{ 00196 char pad[4]; 00197 /* Tells what type of 2D Filter */ 00198 short type; 00199 /* (flag == 0) means 2D filter is activate and 00200 (flag != 0) means 2D filter is inactive */ 00201 short flag; 00202 int int_arg; 00203 /* a float argument */ 00204 float float_arg; 00205 struct Text *text; 00206 }bTwoDFilterActuator; 00207 00208 typedef struct bParentActuator { 00209 char pad[2]; 00210 short flag; 00211 int type; 00212 struct Object *ob; 00213 } bParentActuator; 00214 00215 typedef struct bStateActuator { 00216 int type; /* 0=Set, 1=Add, 2=Rem, 3=Chg */ 00217 unsigned int mask; /* the bits to change */ 00218 } bStateActuator; 00219 00220 typedef struct bArmatureActuator { 00221 char posechannel[32]; 00222 char constraint[32]; 00223 int type; /* 0=run, 1=enable, 2=disable, 3=set target, 4=set weight */ 00224 float weight; 00225 struct Object *target; 00226 struct Object *subtarget; 00227 } bArmatureActuator; 00228 00229 typedef struct bActuator { 00230 struct bActuator *next, *prev, *mynew; 00231 short type; 00235 short flag; 00236 short otype, go; 00237 char name[32]; 00238 00242 void *data; 00243 00247 struct Object *ob; 00248 00249 } bActuator; 00250 00251 /* objectactuator->flag */ 00252 #define ACT_FORCE_LOCAL 1 00253 #define ACT_TORQUE_LOCAL 2 00254 #define ACT_SERVO_LIMIT_X 2 00255 #define ACT_DLOC_LOCAL 4 00256 #define ACT_SERVO_LIMIT_Y 4 00257 #define ACT_DROT_LOCAL 8 00258 #define ACT_SERVO_LIMIT_Z 8 00259 #define ACT_LIN_VEL_LOCAL 16 00260 #define ACT_ANG_VEL_LOCAL 32 00261 //#define ACT_ADD_LIN_VEL_LOCAL 64 00262 #define ACT_ADD_LIN_VEL 64 00263 00264 /* objectactuator->type */ 00265 #define ACT_OBJECT_NORMAL 0 00266 #define ACT_OBJECT_SERVO 1 00267 00268 /* actuator->type */ 00269 #define ACT_OBJECT 0 00270 #define ACT_IPO 1 00271 #define ACT_LAMP 2 00272 #define ACT_CAMERA 3 00273 #define ACT_MATERIAL 4 00274 #define ACT_SOUND 5 00275 #define ACT_PROPERTY 6 00276 /* these two obsolete since 2.02 */ 00277 #define ACT_ADD_OBJECT 7 00278 #define ACT_END_OBJECT 8 00279 00280 #define ACT_CONSTRAINT 9 00281 #define ACT_EDIT_OBJECT 10 00282 #define ACT_SCENE 11 00283 #define ACT_GROUP 12 00284 #define ACT_RANDOM 13 00285 #define ACT_MESSAGE 14 00286 #define ACT_ACTION 15 /* __ NLA */ 00287 #define ACT_GAME 17 00288 #define ACT_VISIBILITY 18 00289 #define ACT_2DFILTER 19 00290 #define ACT_PARENT 20 00291 #define ACT_SHAPEACTION 21 00292 #define ACT_STATE 22 00293 #define ACT_ARMATURE 23 00294 00295 /* actuator flag */ 00296 #define ACT_SHOW 1 00297 #define ACT_DEL 2 00298 #define ACT_NEW 4 00299 #define ACT_LINKED 8 00300 #define ACT_VISIBLE 16 00301 #define ACT_PIN 32 00302 00303 /* link codes */ 00304 #define LINK_SENSOR 0 00305 #define LINK_CONTROLLER 1 00306 #define LINK_ACTUATOR 2 00307 00308 /* keyboardsensor->type */ 00309 #define SENS_ALL_KEYS 1 00310 00311 /* actionactuator->type */ 00312 #define ACT_ACTION_PLAY 0 00313 #define ACT_ACTION_PINGPONG 1 00314 #define ACT_ACTION_FLIPPER 2 00315 #define ACT_ACTION_LOOP_STOP 3 00316 #define ACT_ACTION_LOOP_END 4 00317 #define ACT_ACTION_KEY2KEY 5 00318 #define ACT_ACTION_FROM_PROP 6 00319 #define ACT_ACTION_MOTION 7 00320 00321 /* ipoactuator->type */ 00322 #define ACT_IPO_PLAY 0 00323 #define ACT_IPO_PINGPONG 1 00324 #define ACT_IPO_FLIPPER 2 00325 #define ACT_IPO_LOOP_STOP 3 00326 #define ACT_IPO_LOOP_END 4 00327 #define ACT_IPO_KEY2KEY 5 00328 #define ACT_IPO_FROM_PROP 6 00329 00330 /* groupactuator->type */ 00331 #define ACT_GROUP_PLAY 0 00332 #define ACT_GROUP_PINGPONG 1 00333 #define ACT_GROUP_FLIPPER 2 00334 #define ACT_GROUP_LOOP_STOP 3 00335 #define ACT_GROUP_LOOP_END 4 00336 #define ACT_GROUP_FROM_PROP 5 00337 #define ACT_GROUP_SET 6 00338 00339 /* ipoactuator->flag */ 00340 #define ACT_IPOFORCE (1 << 0) 00341 #define ACT_IPOEND (1 << 1) 00342 #define ACT_IPOLOCAL (1 << 2) 00343 #define ACT_IPOCHILD (1 << 4) 00344 #define ACT_IPOADD (1 << 5) 00345 00346 /* ipoactuator->flag for k2k */ 00347 #define ACT_K2K_PREV 1 00348 #define ACT_K2K_CYCLIC 2 00349 #define ACT_K2K_PINGPONG 4 00350 #define ACT_K2K_HOLD 8 00351 00352 /* property actuator->type */ 00353 #define ACT_PROP_ASSIGN 0 00354 #define ACT_PROP_ADD 1 00355 #define ACT_PROP_COPY 2 00356 #define ACT_PROP_TOGGLE 3 00357 00358 /* constraint flag */ 00359 #define ACT_CONST_NONE 0 00360 #define ACT_CONST_LOCX 1 00361 #define ACT_CONST_LOCY 2 00362 #define ACT_CONST_LOCZ 4 00363 #define ACT_CONST_ROTX 8 00364 #define ACT_CONST_ROTY 16 00365 #define ACT_CONST_ROTZ 32 00366 #define ACT_CONST_NORMAL 64 00367 #define ACT_CONST_MATERIAL 128 00368 #define ACT_CONST_PERMANENT 256 00369 #define ACT_CONST_DISTANCE 512 00370 #define ACT_CONST_LOCAL 1024 00371 #define ACT_CONST_DOROTFH 2048 00372 00373 /* constraint mode */ 00374 #define ACT_CONST_DIRPX 1 00375 #define ACT_CONST_DIRPY 2 00376 #define ACT_CONST_DIRPZ 4 00377 #define ACT_CONST_DIRNX 8 00378 #define ACT_CONST_DIRNY 16 00379 #define ACT_CONST_DIRNZ 32 00380 00381 /* constraint type */ 00382 #define ACT_CONST_TYPE_LOC 0 00383 #define ACT_CONST_TYPE_DIST 1 00384 #define ACT_CONST_TYPE_ORI 2 00385 #define ACT_CONST_TYPE_FH 3 00386 00387 /* editObjectActuator->type */ 00388 #define ACT_EDOB_ADD_OBJECT 0 00389 #define ACT_EDOB_END_OBJECT 1 00390 #define ACT_EDOB_REPLACE_MESH 2 00391 #define ACT_EDOB_TRACK_TO 3 00392 #define ACT_EDOB_DYNAMICS 4 00393 00394 /* editObjectActuator->localflag */ 00395 #define ACT_EDOB_LOCAL_LINV 2 00396 #define ACT_EDOB_LOCAL_ANGV 4 00397 00398 /* editObjectActuator->flag */ 00399 #define ACT_TRACK_3D 1 00400 00401 /* editObjectActuator->flag for replace mesh actuator */ 00402 #define ACT_EDOB_REPLACE_MESH_NOGFX 2 /* use for replace mesh actuator */ 00403 #define ACT_EDOB_REPLACE_MESH_PHYS 4 00404 00405 /* editObjectActuator->dyn_operation */ 00406 #define ACT_EDOB_RESTORE_DYN 0 00407 #define ACT_EDOB_SUSPEND_DYN 1 00408 #define ACT_EDOB_ENABLE_RB 2 00409 #define ACT_EDOB_DISABLE_RB 3 00410 #define ACT_EDOB_SET_MASS 4 00411 00412 00413 /* SceneActuator->type */ 00414 #define ACT_SCENE_RESTART 0 00415 #define ACT_SCENE_SET 1 00416 #define ACT_SCENE_CAMERA 2 00417 #define ACT_SCENE_ADD_FRONT 3 00418 #define ACT_SCENE_ADD_BACK 4 00419 #define ACT_SCENE_REMOVE 5 00420 #define ACT_SCENE_SUSPEND 6 00421 #define ACT_SCENE_RESUME 7 00422 00423 00424 /* randomAct->distribution */ 00425 #define ACT_RANDOM_BOOL_CONST 0 00426 #define ACT_RANDOM_BOOL_UNIFORM 1 00427 #define ACT_RANDOM_BOOL_BERNOUILLI 2 00428 #define ACT_RANDOM_INT_CONST 3 00429 #define ACT_RANDOM_INT_UNIFORM 4 00430 #define ACT_RANDOM_INT_POISSON 5 00431 #define ACT_RANDOM_FLOAT_CONST 6 00432 #define ACT_RANDOM_FLOAT_UNIFORM 7 00433 #define ACT_RANDOM_FLOAT_NORMAL 8 00434 #define ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL 9 00435 00436 /* SoundActuator->flag */ 00437 #define ACT_SND_3D_SOUND 1 00438 00439 /* SoundActuator->type */ 00440 #define ACT_SND_PLAY_STOP_SOUND 0 00441 #define ACT_SND_PLAY_END_SOUND 1 00442 #define ACT_SND_LOOP_STOP_SOUND 2 00443 #define ACT_SND_LOOP_END_SOUND 3 00444 #define ACT_SND_LOOP_BIDIRECTIONAL_SOUND 4 00445 #define ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND 5 00446 00447 /* messageactuator->type */ 00448 #define ACT_MESG_MESG 0 00449 #define ACT_MESG_PROP 1 00450 00451 /* gameactuator->type */ 00452 #define ACT_GAME_LOAD 0 00453 #define ACT_GAME_START 1 00454 #define ACT_GAME_RESTART 2 00455 #define ACT_GAME_QUIT 3 00456 #define ACT_GAME_SAVECFG 4 00457 #define ACT_GAME_LOADCFG 5 00458 00459 /* visibilityact->flag */ 00460 /* Set means the object will become invisible */ 00461 #define ACT_VISIBILITY_INVISIBLE (1 << 0) 00462 #define ACT_VISIBILITY_RECURSIVE (1 << 1) 00463 #define ACT_VISIBILITY_OCCLUSION (1 << 2) 00464 00465 /* twodfilter->type */ 00466 #define ACT_2DFILTER_ENABLED -2 00467 #define ACT_2DFILTER_DISABLED -1 00468 #define ACT_2DFILTER_NOFILTER 0 00469 #define ACT_2DFILTER_MOTIONBLUR 1 00470 #define ACT_2DFILTER_BLUR 2 00471 #define ACT_2DFILTER_SHARPEN 3 00472 #define ACT_2DFILTER_DILATION 4 00473 #define ACT_2DFILTER_EROSION 5 00474 #define ACT_2DFILTER_LAPLACIAN 6 00475 #define ACT_2DFILTER_SOBEL 7 00476 #define ACT_2DFILTER_PREWITT 8 00477 #define ACT_2DFILTER_GRAYSCALE 9 00478 #define ACT_2DFILTER_SEPIA 10 00479 #define ACT_2DFILTER_INVERT 11 00480 #define ACT_2DFILTER_CUSTOMFILTER 12 00481 #define ACT_2DFILTER_NUMBER_OF_FILTERS 13 00482 00483 /* parentactuator->type */ 00484 #define ACT_PARENT_SET 0 00485 #define ACT_PARENT_REMOVE 1 00486 00487 /* parentactuator->flag */ 00488 #define ACT_PARENT_COMPOUND 1 00489 #define ACT_PARENT_GHOST 2 00490 00491 /* armatureactuator->type */ 00492 #define ACT_ARM_RUN 0 00493 #define ACT_ARM_ENABLE 1 00494 #define ACT_ARM_DISABLE 2 00495 #define ACT_ARM_SETTARGET 3 00496 #define ACT_ARM_SETWEIGHT 4 00497 /* update this define if more type are addedd */ 00498 #define ACT_ARM_MAXTYPE 4 00499 00500 /* stateactuator->type */ 00501 #define ACT_STATE_SET 0 00502 #define ACT_STATE_ADD 1 00503 #define ACT_STATE_REMOVE 2 00504 #define ACT_STATE_CHANGE 3 00505 00506 /* cameraactuator->axis */ 00507 #define ACT_CAMERA_X (float)'x' 00508 #define ACT_CAMERA_Y (float)'y' 00509 00510 #endif 00511 00512