Blender V2.61 - r43446

DNA_constraint_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): 2007, Joshua Leung, major recode
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  * Constraint DNA data
00027  */
00028 
00033 #ifndef DNA_CONSTRAINT_TYPES_H
00034 #define DNA_CONSTRAINT_TYPES_H
00035 
00036 #include "DNA_defs.h"
00037 #include "DNA_ID.h"
00038 #include "DNA_listBase.h"
00039 
00040 struct Action;
00041 struct Text;
00042 struct Ipo;
00043 
00044 /* channels reside in Object or Action (ListBase) constraintChannels */
00045 // XXX depreceated... old AnimSys
00046 typedef struct bConstraintChannel {
00047     struct bConstraintChannel *next, *prev;
00048     struct Ipo          *ipo;
00049     short       flag;
00050     char        name[30];
00051 } bConstraintChannel;
00052 
00053 /* A Constraint */
00054 typedef struct bConstraint {
00055     struct bConstraint *next, *prev;
00056     
00057     void        *data;      /*  Constraint data (a valid constraint type) */
00058     short       type;       /*  Constraint type */
00059     short       flag;       /*  Flag - General Settings */
00060     
00061     char        ownspace;   /*  Space that owner should be evaluated in     */
00062     char        tarspace;   /*  Space that target should be evaluated in (only used if 1 target) */
00063     
00064     char        name[64];   /*  Constraint name, MAX_NAME */
00065     
00066     short       pad;
00067     
00068     float       enforce;    /*  Amount of influence exherted by constraint (0.0-1.0) */
00069     float       headtail;   /*  Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/
00070     
00071     struct Ipo *ipo    DNA_DEPRECATED;      /* local influence ipo or driver */  /* old animation system, deprecated for 2.5 */
00072     
00073     /* below are readonly fields that are set at runtime by the solver for use in the GE (only IK atm) */
00074     float       lin_error;      /* residual error on constraint expressed in blender unit*/
00075     float       rot_error;      /* residual error on constraint expressed in radiant */
00076 } bConstraint;
00077 
00078 
00079 /* Multiple-target constraints ---------------------  */
00080 
00081 /* This struct defines a constraint target.
00082  * It is used during constraint solving regardless of how many targets the
00083  * constraint has.
00084  */
00085 typedef struct bConstraintTarget {
00086     struct bConstraintTarget *next, *prev;
00087 
00088     struct Object *tar;         /* object to use as target */
00089     char subtarget[64];     /* subtarget - pchan or vgroup name, MAX_ID_NAME-2 */
00090     
00091     float matrix[4][4];     /* matrix used during constraint solving - should be cleared before each use */
00092     
00093     short space;            /* space that target should be evaluated in (overrides bConstraint->tarspace) */
00094     short flag;             /* runtime settings (for editor, etc.) */
00095     short type;             /* type of target (B_CONSTRAINT_OB_TYPE) */
00096     short rotOrder;         /* rotation order for target (as defined in BLI_math.h) */
00097 } bConstraintTarget;
00098 
00099 /* bConstraintTarget -> flag */
00100 typedef enum B_CONSTRAINT_TARGET_FLAG {
00101     CONSTRAINT_TAR_TEMP = (1<<0)        /* temporary target-struct that needs to be freed after use */
00102 } B_CONSTRAINT_TARGET_FLAG;
00103 
00104 /* bConstraintTarget/bConstraintOb -> type */
00105 typedef enum B_CONSTRAINT_OB_TYPE {
00106     CONSTRAINT_OBTYPE_OBJECT = 1,   /*  string is ""                */
00107     CONSTRAINT_OBTYPE_BONE,         /*  string is bone-name     */
00108     CONSTRAINT_OBTYPE_VERT,         /*  string is vertex-group name     */
00109     CONSTRAINT_OBTYPE_CV            /*  string is vertex-group name - is not available until curves get vgroups */
00110 } B_CONSTRAINT_OB_TYPE;
00111 
00112 
00113 
00114 /* Python Script Constraint */
00115 typedef struct bPythonConstraint {  
00116     struct Text *text;      /* text-buffer (containing script) to execute */
00117     IDProperty *prop;       /* 'id-properties' used to store custom properties for constraint */
00118     
00119     int flag;               /* general settings/state indicators accessed by bitmapping */
00120     int tarnum;             /* number of targets - usually only 1-3 are needed */
00121     
00122     ListBase targets;       /* a list of targets that this constraint has (bConstraintTarget-s) */
00123     
00124     struct Object *tar;     /* target from previous implementation (version-patch sets this to NULL on file-load) */
00125     char subtarget[64];     /* subtarger from previous implentation (version-patch sets this to "" on file-load), MAX_ID_NAME-2 */
00126 } bPythonConstraint;
00127 
00128 
00129 /* Inverse-Kinematics (IK) constraint
00130  * This constraint supports a variety of mode determine by the type field
00131  * according to B_CONSTRAINT_IK_TYPE.
00132  * Some fields are used by all types, some are specific to some types
00133  * This is indicated in the comments for each field
00134  */
00135 typedef struct bKinematicConstraint {
00136     struct Object       *tar;           /* All: target object in case constraint needs a target */
00137     short       iterations;     /* All: Maximum number of iterations to try */
00138     short       flag;           /* All & CopyPose: some options Like CONSTRAINT_IK_TIP */
00139     short       rootbone;       /* All: index to rootbone, if zero go all the way to mother bone */
00140     short       max_rootbone;   /* CopyPose: for auto-ik, maximum length of chain */
00141     char        subtarget[64];  /* All: String to specify sub-object target, MAX_ID_NAME-2 */
00142     struct Object       *poletar;           /* All: Pole vector target */
00143     char        polesubtarget[64];  /* All: Pole vector sub-object target, MAX_ID_NAME-2 */
00144     float       poleangle;          /* All: Pole vector rest angle */
00145     float       weight;         /* All: Weight of constraint in IK tree */
00146     float       orientweight;   /* CopyPose: Amount of rotation a target applies on chain */
00147     float       grabtarget[3];  /* CopyPose: for target-less IK */
00148     short       type;           /* subtype of IK constraint: B_CONSTRAINT_IK_TYPE */
00149     short       mode;           /* Distance: how to limit in relation to clamping sphere: LIMITDIST_.. */
00150     float       dist;           /* Distance: distance (radius of clamping sphere) from target */
00151 } bKinematicConstraint;
00152 
00153 typedef enum B_CONSTRAINT_IK_TYPE {
00154     CONSTRAINT_IK_COPYPOSE = 0,     /* 'standard' IK constraint: match position and/or orientation of target */
00155     CONSTRAINT_IK_DISTANCE          /* maintain distance with target */
00156 } B_CONSTRAINT_IK_TYPE;
00157 
00158 
00159 /* Spline IK Constraint 
00160  * Aligns 'n' bones to the curvature defined by the curve,
00161  * with the chain ending on the bone that owns this constraint, 
00162  * and starting on the nth parent.
00163  */
00164 typedef struct bSplineIKConstraint {
00165         /* target(s) */
00166     struct Object *tar;     /* curve object (with follow path enabled) which drives the bone chain */
00167     
00168         /* binding details */
00169     float       *points;    /* array of numpoints items, denoting parametric positions along curve that joints should follow */
00170     short       numpoints;  /* number of points to bound in points array */
00171     short       chainlen;   /* number of bones ('n') that are in the chain */
00172     
00173         /* settings */  
00174     short flag;             /* general settings for constraint */
00175     short xzScaleMode;      /* method used for determining the x & z scaling of the bones */
00176 } bSplineIKConstraint;
00177 
00178 
00179 /* Single-target subobject constraints ---------------------  */
00180 
00181 /* Track To Constraint */
00182 typedef struct bTrackToConstraint {
00183     struct Object       *tar;
00184     int         reserved1; /* I'll be using reserved1 and reserved2 as Track and Up flags,
00185                             * not sure if that's what they were intented for anyway.
00186                             * Not sure either if it would create backward incompatibility if I were to rename them.
00187                             * - theeth*/
00188     int         reserved2;
00189     int         flags;
00190     int         pad;
00191     char        subtarget[64];  /* MAX_ID_NAME-2 */
00192 } bTrackToConstraint;
00193 
00194 /* Copy Rotation Constraint */
00195 typedef struct bRotateLikeConstraint {
00196     struct Object       *tar;
00197     int         flag;
00198     int         reserved1;
00199     char        subtarget[64];  /* MAX_ID_NAME-2 */
00200 } bRotateLikeConstraint;
00201 
00202 /* Copy Location Constraint */
00203 typedef struct bLocateLikeConstraint {
00204     struct Object       *tar;
00205     int         flag;
00206     int         reserved1;
00207     char        subtarget[64];  /* MAX_ID_NAME-2 */
00208 } bLocateLikeConstraint;
00209 
00210 /* Copy Scale Constraint */
00211 typedef struct bSizeLikeConstraint {
00212     struct Object       *tar;
00213     int         flag;
00214     int         reserved1;
00215     char        subtarget[64];  /* MAX_ID_NAME-2 */
00216 } bSizeLikeConstraint;
00217 
00218 /* Maintain Volume Constraint */
00219 typedef struct bSameVolumeConstraint {
00220     int         flag;
00221     float       volume;
00222 } bSameVolumeConstraint;
00223 
00224 /* Copy Transform Constraint */
00225 typedef struct bTransLikeConstraint {
00226     struct Object *tar;
00227     char        subtarget[64];  /* MAX_ID_NAME-2 */
00228 } bTransLikeConstraint;
00229 
00230 /* Floor Constraint */
00231 typedef struct bMinMaxConstraint {
00232     struct Object *tar;
00233     int         minmaxflag;
00234     float       offset;
00235     int         flag;
00236     short       sticky, stuck, pad1, pad2; /* for backward compatibility */
00237     float       cache[3];
00238     char        subtarget[64];  /* MAX_ID_NAME-2 */
00239 } bMinMaxConstraint;
00240 
00241 /* Action Constraint */
00242 typedef struct bActionConstraint {
00243     struct Object       *tar;
00244     short       type;   /* what transform 'channel' drives the result */
00245     short       local;  /* was used in versions prior to the Constraints recode */
00246     int         start;
00247     int         end;
00248     float       min;
00249     float       max;
00250     int         pad;
00251     struct bAction  *act;
00252     char        subtarget[64];  /* MAX_ID_NAME-2 */
00253 } bActionConstraint;
00254 
00255 /* Locked Axis Tracking constraint */
00256 typedef struct bLockTrackConstraint {
00257     struct Object       *tar;
00258     int         trackflag;
00259     int         lockflag;
00260     char        subtarget[64];  /* MAX_ID_NAME-2 */
00261 } bLockTrackConstraint;
00262 
00263 /* Damped Tracking constraint */
00264 typedef struct bDampTrackConstraint {
00265     struct Object       *tar;
00266     int         trackflag;
00267     int         pad;
00268     char        subtarget[64];  /* MAX_ID_NAME-2 */
00269 } bDampTrackConstraint;
00270 
00271 /* Follow Path constraints */
00272 typedef struct bFollowPathConstraint {
00273     struct Object       *tar;       /* Must be path object */
00274     
00275     float       offset;         /* Offset in time on the path (in frames), when NOT using 'fixed position' */
00276     float       offset_fac;     /* Parametric offset factor defining position along path, when using 'fixed position' */
00277     
00278     int         followflag;
00279     
00280     short       trackflag;
00281     short       upflag;
00282 } bFollowPathConstraint;
00283 
00284 /* Stretch to constraint */
00285 typedef struct bStretchToConstraint {
00286     struct Object       *tar;
00287     int         volmode; 
00288     int         plane;
00289     float       orglength;
00290     float       bulge;
00291     char        subtarget[64];  /* MAX_ID_NAME-2 */
00292 } bStretchToConstraint;
00293 
00294 /* Rigid Body constraint */
00295 typedef struct bRigidBodyJointConstraint {
00296     struct Object       *tar;
00297     struct Object       *child;
00298     int         type;
00299     float       pivX;
00300     float       pivY;
00301     float       pivZ;
00302     float       axX;
00303     float       axY;
00304     float       axZ;
00305     float       minLimit[6];
00306     float       maxLimit[6];
00307     float       extraFz;
00308     short       flag;
00309     short       pad;
00310     short       pad1;
00311     short       pad2;
00312 } bRigidBodyJointConstraint;
00313 
00314 /* Clamp-To Constraint */
00315 typedef struct bClampToConstraint {
00316     struct Object       *tar;           /* 'target' must be a curve */
00317     int         flag;           /* which axis/plane to compare owner's location on  */
00318     int         flag2;          /* for legacy reasons, this is flag2. used for any extra settings */
00319 } bClampToConstraint;
00320 
00321 /* Child Of Constraint */
00322 typedef struct bChildOfConstraint {
00323     struct Object       *tar;           /* object which will act as parent (or target comes from) */
00324     int         flag;           /* settings */
00325     int         pad;
00326     float       invmat[4][4];   /* parent-inverse matrix to use */
00327     char        subtarget[64];  /* string to specify a subobject target, MAX_ID_NAME-2 */
00328 } bChildOfConstraint;
00329 
00330 /* Generic Transform->Transform Constraint */
00331 typedef struct bTransformConstraint {
00332     struct Object       *tar;           /* target (i.e. 'driver' object/bone) */
00333     char        subtarget[64];      /* MAX_ID_NAME-2 */
00334     
00335     short       from, to;       /* can be loc(0) , rot(1),  or size(2) */
00336     char        map[3];         /* defines which target-axis deform is copied by each owner-axis */
00337     char        expo;           /* extrapolate motion? if 0, confine to ranges */
00338     
00339     float       from_min[3];    /* from_min/max defines range of target transform   */
00340     float       from_max[3];    /*  to map on to to_min/max range.          */
00341     
00342     float       to_min[3];      /* range of motion on owner caused by target  */
00343     float       to_max[3];  
00344 } bTransformConstraint;
00345 
00346 /* Pivot Constraint */
00347 typedef struct bPivotConstraint {
00348     /* Pivot Point:
00349      *  Either target object + offset, or just offset is used
00350      */
00351     struct Object       *tar;           /* target object (optional) */
00352     char        subtarget[64];      /* subtarget name (optional), MAX_ID_NAME-2 */
00353     float       offset[3];      /* offset from the target to use, regardless of whether it exists */
00354     
00355     /* Rotation-driven activation:
00356      *  This option provides easier one-stop setups for footrolls
00357      */
00358     short       rotAxis;        /* rotation axes to consider for this (ePivotConstraint_Axis) */
00359     
00360     /* General flags */
00361     short       flag;           /* ePivotConstraint_Flag */
00362 } bPivotConstraint;
00363 
00364 /* transform limiting constraints - zero target ----------------------------  */
00365 /* Limit Location Constraint */
00366 typedef struct bLocLimitConstraint {
00367     float       xmin, xmax;
00368     float       ymin, ymax;
00369     float       zmin, zmax;
00370     short       flag;
00371     short       flag2;
00372 } bLocLimitConstraint;
00373 
00374 /* Limit Rotation Constraint */
00375 typedef struct bRotLimitConstraint {
00376     float       xmin, xmax;
00377     float       ymin, ymax;
00378     float       zmin, zmax;
00379     short       flag;
00380     short       flag2;
00381 } bRotLimitConstraint;
00382 
00383 /* Limit Scaling Constraint */
00384 typedef struct bSizeLimitConstraint {
00385     float       xmin, xmax;
00386     float       ymin, ymax;
00387     float       zmin, zmax;
00388     short       flag;
00389     short       flag2;
00390 } bSizeLimitConstraint;
00391 
00392 /* Limit Distance Constraint */
00393 typedef struct bDistLimitConstraint {
00394     struct Object       *tar;
00395     char        subtarget[64];      /* MAX_ID_NAME-2 */
00396     
00397     float       dist;           /* distance (radius of clamping sphere) from target */
00398     float       soft;           /* distance from clamping-sphere to start applying 'fade' */
00399     
00400     short       flag;           /* settings */
00401     short       mode;           /* how to limit in relation to clamping sphere */
00402     int         pad;
00403 } bDistLimitConstraint;
00404 
00405 /* ShrinkWrap Constraint */
00406 typedef struct bShrinkwrapConstraint {
00407     struct Object       *target;
00408     float       dist;           /* distance to kept from target */
00409     short       shrinkType;     /* shrink type (look on MOD shrinkwrap for values) */
00410     char        projAxis;       /* axis to project over UP_X, UP_Y, UP_Z */
00411     char        pad[9];
00412 } bShrinkwrapConstraint;
00413 
00414 /* Follow Track constraints */
00415 typedef struct bFollowTrackConstraint {
00416     struct MovieClip    *clip;
00417     char    track[64];  /* MAX_NAME */
00418     int     flag, pad;
00419     char        object[64]; /* MAX_NAME */
00420     struct Object *camera;
00421     struct Object *depth_ob;
00422 } bFollowTrackConstraint;
00423 
00424 /* Camera Solver constraints */
00425 typedef struct bCameraSolverConstraint {
00426     struct MovieClip    *clip;
00427     int     flag, pad;
00428 } bCameraSolverConstraint;
00429 
00430 /* Camera Solver constraints */
00431 typedef struct bObjectSolverConstraint {
00432     struct MovieClip    *clip;
00433     int     flag, pad;
00434     char        object[64]; /* MAX_NAME */
00435     float       invmat[4][4];   /* parent-inverse matrix to use */
00436     struct Object *camera;
00437 } bObjectSolverConstraint;
00438 
00439 /* ------------------------------------------ */
00440 
00441 /* bConstraint->type 
00442  *  - Do not ever change the order of these, or else files could get
00443  *    broken as their correct value cannot be resolved
00444  */
00445 typedef enum eBConstraint_Types {
00446     CONSTRAINT_TYPE_NULL = 0,           /* Invalid/legacy constraint */
00447     CONSTRAINT_TYPE_CHILDOF,            /* Unimplemented non longer :) - during constraints recode, Aligorith */
00448     CONSTRAINT_TYPE_TRACKTO,
00449     CONSTRAINT_TYPE_KINEMATIC,
00450     CONSTRAINT_TYPE_FOLLOWPATH,
00451     CONSTRAINT_TYPE_ROTLIMIT,           /* Unimplemented no longer :) - Aligorith */
00452     CONSTRAINT_TYPE_LOCLIMIT,           /* Unimplemented no longer :) - Aligorith */
00453     CONSTRAINT_TYPE_SIZELIMIT,          /* Unimplemented no longer :) - Aligorith */
00454     CONSTRAINT_TYPE_ROTLIKE,    
00455     CONSTRAINT_TYPE_LOCLIKE,    
00456     CONSTRAINT_TYPE_SIZELIKE,
00457     CONSTRAINT_TYPE_PYTHON,             /* Unimplemented no longer :) - Aligorith. Scripts */
00458     CONSTRAINT_TYPE_ACTION,
00459     CONSTRAINT_TYPE_LOCKTRACK,          /* New Tracking constraint that locks an axis in place - theeth */
00460     CONSTRAINT_TYPE_DISTLIMIT,          /* limit distance */
00461     CONSTRAINT_TYPE_STRETCHTO,          /* claiming this to be mine :) is in tuhopuu bjornmose */ 
00462     CONSTRAINT_TYPE_MINMAX,             /* floor constraint */
00463     CONSTRAINT_TYPE_RIGIDBODYJOINT,     /* rigidbody constraint */
00464     CONSTRAINT_TYPE_CLAMPTO,            /* clampto constraint */    
00465     CONSTRAINT_TYPE_TRANSFORM,          /* transformation (loc/rot/size -> loc/rot/size) constraint */  
00466     CONSTRAINT_TYPE_SHRINKWRAP,         /* shrinkwrap (loc/rot) constraint */
00467     CONSTRAINT_TYPE_DAMPTRACK,          /* New Tracking constraint that minimises twisting */
00468     CONSTRAINT_TYPE_SPLINEIK,           /* Spline-IK - Align 'n' bones to a curve */
00469     CONSTRAINT_TYPE_TRANSLIKE,          /* Copy transform matrix */
00470     CONSTRAINT_TYPE_SAMEVOL,            /* Maintain volume during scaling */
00471     CONSTRAINT_TYPE_PIVOT,              /* Pivot Constraint */
00472     CONSTRAINT_TYPE_FOLLOWTRACK,        /* Follow Track Constraint */
00473     CONSTRAINT_TYPE_CAMERASOLVER,       /* Camera Solver Constraint */
00474     CONSTRAINT_TYPE_OBJECTSOLVER,       /* Object Solver Constraint */
00475     
00476     /* NOTE: no constraints are allowed to be added after this */
00477     NUM_CONSTRAINT_TYPES
00478 } eBConstraint_Types; 
00479 
00480 /* bConstraint->flag */
00481 /* flags 0x2 (1<<1) and 0x8 (1<<3) were used in past */
00482 /* flag 0x20 (1<<5) was used to indicate that a constraint was evaluated using a 'local' hack for posebones only  */
00483 typedef enum eBConstraint_Flags {
00484         /* expand for UI */
00485     CONSTRAINT_EXPAND =     (1<<0), 
00486         /* pre-check for illegal object name or bone name */
00487     CONSTRAINT_DISABLE =    (1<<2), 
00488         /* to indicate which Ipo should be shown, maybe for 3d access later too */  
00489     CONSTRAINT_ACTIVE =     (1<<4), 
00490         /* to indicate that the owner's space should only be changed into ownspace, but not out of it */
00491     CONSTRAINT_SPACEONCE =  (1<<6),
00492         /* influence ipo is on constraint itself, not in action channel */
00493     CONSTRAINT_OWN_IPO  = (1<<7),
00494         /* indicates that constraint was added locally (i.e.  didn't come from the proxy-lib) */
00495     CONSTRAINT_PROXY_LOCAL = (1<<8),
00496         /* indicates that constraint is temporarily disabled (only used in GE) */
00497     CONSTRAINT_OFF = (1<<9)
00498 } eBConstraint_Flags;
00499 
00500 /* bConstraint->ownspace/tarspace */
00501 typedef enum eBConstraint_SpaceTypes {
00502         /* default for all - worldspace */
00503     CONSTRAINT_SPACE_WORLD = 0,
00504         /* for objects (relative to parent/without parent influence), 
00505          * for bones (along normals of bone, without parent/restpositions) 
00506          */
00507     CONSTRAINT_SPACE_LOCAL, /* = 1 */
00508         /* for posechannels - pose space  */
00509     CONSTRAINT_SPACE_POSE, /* = 2 */
00510          /* for posechannels - local with parent  */
00511     CONSTRAINT_SPACE_PARLOCAL, /* = 3 */
00512         /* for files from between 2.43-2.46 (should have been parlocal) */
00513     CONSTRAINT_SPACE_INVALID /* = 4. do not exchange for anything! */
00514 } eBConstraint_SpaceTypes;
00515 
00516 /* bConstraintChannel.flag */
00517 // XXX depreceated... old AnimSys
00518 typedef enum eConstraintChannel_Flags {
00519     CONSTRAINT_CHANNEL_SELECT =     (1<<0),
00520     CONSTRAINT_CHANNEL_PROTECTED =  (1<<1)
00521 } eConstraintChannel_Flags;
00522 
00523 /* -------------------------------------- */
00524 
00525 /* bRotateLikeConstraint.flag */
00526 typedef enum eCopyRotation_Flags {
00527     ROTLIKE_X           = (1<<0),
00528     ROTLIKE_Y           = (1<<1),
00529     ROTLIKE_Z           = (1<<2),
00530     ROTLIKE_X_INVERT    = (1<<4),
00531     ROTLIKE_Y_INVERT    = (1<<5),
00532     ROTLIKE_Z_INVERT    = (1<<6),
00533     ROTLIKE_OFFSET      = (1<<7)
00534 } eCopyRotation_Flags;
00535 
00536 /* bLocateLikeConstraint.flag */
00537 typedef enum eCopyLocation_Flags {
00538     LOCLIKE_X           = (1<<0),
00539     LOCLIKE_Y           = (1<<1),
00540     LOCLIKE_Z           = (1<<2),
00541         /* LOCLIKE_TIP is a depreceated option... use headtail=1.0f instead */
00542     LOCLIKE_TIP         = (1<<3),
00543     LOCLIKE_X_INVERT    = (1<<4),
00544     LOCLIKE_Y_INVERT    = (1<<5),
00545     LOCLIKE_Z_INVERT    = (1<<6),
00546     LOCLIKE_OFFSET      = (1<<7)
00547 } eCopyLocation_Flags;
00548  
00549 /* bSizeLikeConstraint.flag */
00550 typedef enum eCopyScale_Flags {
00551     SIZELIKE_X      = (1<<0),
00552     SIZELIKE_Y      = (1<<1),
00553     SIZELIKE_Z      = (1<<2), 
00554     SIZELIKE_OFFSET = (1<<3)
00555 } eCopyScale_Flags;
00556 
00557 /* bSameVolumeConstraint.flag */
00558 typedef enum eSameVolume_Modes {
00559     SAMEVOL_X       = 0,
00560     SAMEVOL_Y,
00561     SAMEVOL_Z
00562 } eSameVolume_Modes;
00563 
00564 /* Locked-Axis Values (Locked Track) */
00565 typedef enum eLockAxis_Modes {
00566     LOCK_X  = 0,
00567     LOCK_Y,
00568     LOCK_Z
00569 } eLockAxis_Modes;
00570 
00571 /* Up-Axis Values (TrackTo and Locked Track) */
00572 typedef enum eUpAxis_Modes {
00573     UP_X    = 0,
00574     UP_Y,
00575     UP_Z
00576 } eUpAxis_Modes;
00577 
00578 /* Tracking axis (TrackTo, Locked Track, Damped Track) and minmax (floor) constraint */
00579 typedef enum eTrackToAxis_Modes {
00580     TRACK_X     = 0,
00581     TRACK_Y,
00582     TRACK_Z,
00583     TRACK_nX,
00584     TRACK_nY,
00585     TRACK_nZ
00586 } eTrackToAxis_Modes;
00587 
00588 /* FollowPath flags */
00589 typedef enum eFollowPath_Flags {
00590     FOLLOWPATH_FOLLOW   = (1<<0),
00591     FOLLOWPATH_STATIC   = (1<<1),
00592     FOLLOWPATH_RADIUS   = (1<<2)
00593 } eFollowPath_Flags;
00594 
00595 /* bTrackToConstraint->flags */
00596 typedef enum eTrackTo_Flags {
00597     TARGET_Z_UP     = (1<<0)
00598 } eTrackTo_Flags;
00599 
00600 /* Strech To Constraint -> volmode */
00601 typedef enum eStretchTo_VolMode {
00602     VOLUME_XZ   = 0,
00603     VOLUME_X,
00604     VOLUME_Z,
00605     NO_VOLUME
00606 } eStretchTo_VolMode;
00607 
00608 /* Stretch To Constraint -> plane mode */
00609 typedef enum eStretchTo_PlaneMode {
00610     PLANE_X     = 0,
00611     PLANE_Y,
00612     PLANE_Z
00613 } eStretchTo_PlaneMode;
00614 
00615 /* Clamp-To Constraint ->flag */
00616 typedef enum eClampTo_Modes {
00617     CLAMPTO_AUTO = 0,
00618     CLAMPTO_X,
00619     CLAMPTO_Y,
00620     CLAMPTO_Z
00621 } eClampTo_Modes;
00622 
00623 /* ClampTo Constraint ->flag2 */
00624 typedef enum eClampTo_Flags {
00625     CLAMPTO_CYCLIC  = (1<<0)
00626 } eClampTo_Flags;
00627 
00628 /* bKinematicConstraint->flag */
00629 typedef enum eKinematic_Flags {
00630     CONSTRAINT_IK_TIP           = (1<<0),
00631     CONSTRAINT_IK_ROT           = (1<<1),
00632     /* targetless */
00633     CONSTRAINT_IK_AUTO          = (1<<2),
00634     /* autoik */
00635     CONSTRAINT_IK_TEMP          = (1<<3),
00636     CONSTRAINT_IK_STRETCH       = (1<<4),
00637     CONSTRAINT_IK_POS           = (1<<5),
00638     CONSTRAINT_IK_SETANGLE      = (1<<6),
00639     CONSTRAINT_IK_GETANGLE      = (1<<7),
00640     /* limit axis */
00641     CONSTRAINT_IK_NO_POS_X      = (1<<8),
00642     CONSTRAINT_IK_NO_POS_Y      = (1<<9),
00643     CONSTRAINT_IK_NO_POS_Z      = (1<<10),
00644     CONSTRAINT_IK_NO_ROT_X      = (1<<11),
00645     CONSTRAINT_IK_NO_ROT_Y      = (1<<12),
00646     CONSTRAINT_IK_NO_ROT_Z      = (1<<13),
00647     /* axis relative to target */
00648     CONSTRAINT_IK_TARGETAXIS    = (1<<14)
00649 } eKinematic_Flags;
00650 
00651 /* bSplineIKConstraint->flag */
00652 typedef enum eSplineIK_Flags {
00653     /* chain has been attached to spline */
00654     CONSTRAINT_SPLINEIK_BOUND           = (1<<0),
00655     /* root of chain is not influenced by the constraint */
00656     CONSTRAINT_SPLINEIK_NO_ROOT         = (1<<1),
00657     /* bones in the chain should not scale to fit the curve */
00658     CONSTRAINT_SPLINEIK_SCALE_LIMITED   = (1<<2),
00659     /* evenly distribute the bones along the path regardless of length */
00660     CONSTRAINT_SPLINEIK_EVENSPLITS      = (1<<3),   
00661     /* don't adjust the x and z scaling of the bones by the curve radius */
00662     CONSTRAINT_SPLINEIK_NO_CURVERAD = (1<<4)
00663 } eSplineIK_Flags;
00664 
00665 /* bSplineIKConstraint->xzScaleMode */
00666 typedef enum eSplineIK_XZScaleModes {
00667     /* no x/z scaling */
00668     CONSTRAINT_SPLINEIK_XZS_NONE            = 0,
00669     /* bones in the chain should take their x/z scales from the original scaling */
00670     CONSTRAINT_SPLINEIK_XZS_ORIGINAL,
00671     /* x/z scales are the inverse of the y-scale */
00672     CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC
00673 } eSplineIK_XZScaleModes;
00674 
00675 /* MinMax (floor) flags */
00676 typedef enum eFloor_Flags {
00677     MINMAX_STICKY   = (1<<0),
00678     MINMAX_STUCK    = (1<<1),
00679     MINMAX_USEROT   = (1<<2)
00680 } eFloor_Flags;
00681 
00682 /* transform limiting constraints -> flag2 */
00683 typedef enum eTransformLimits_Flags2 {
00684     /* not used anymore - for older Limit Location constraints only */
00685     LIMIT_NOPARENT  = (1<<0),
00686     /* for all Limit constraints - allow to be used during transform? */
00687     LIMIT_TRANSFORM = (1<<1)
00688 } eTransformLimits_Flags2;
00689 
00690 /* transform limiting constraints -> flag (own flags)  */
00691 typedef enum eTransformLimits_Flags {
00692     LIMIT_XMIN = (1<<0),
00693     LIMIT_XMAX = (1<<1),
00694     LIMIT_YMIN = (1<<2),
00695     LIMIT_YMAX = (1<<3),
00696     LIMIT_ZMIN = (1<<4),
00697     LIMIT_ZMAX = (1<<5)
00698 } eTransformLimits_Flags;
00699 
00700 /* limit rotation constraint -> flag (own flags) */
00701 typedef enum eRotLimit_Flags {
00702     LIMIT_XROT = (1<<0),
00703     LIMIT_YROT = (1<<1),
00704     LIMIT_ZROT = (1<<2)
00705 } eRotLimit_Flags;
00706 
00707 /* distance limit constraint */
00708     /* bDistLimitConstraint->flag */
00709 typedef enum eDistLimit_Flag {
00710     /* "soft" cushion effect when reaching the limit sphere */ // NOT IMPLEMENTED!
00711     LIMITDIST_USESOFT   = (1<<0),
00712     /* as for all Limit constraints - allow to be used during transform? */
00713     LIMITDIST_TRANSFORM = (1<<1)
00714 } eDistLimit_Flag;
00715 
00716     /* bDistLimitConstraint->mode */
00717 typedef enum eDistLimit_Modes {
00718     LIMITDIST_INSIDE = 0,
00719     LIMITDIST_OUTSIDE,
00720     LIMITDIST_ONSURFACE
00721 } eDistLimit_Modes;
00722     
00723 /* python constraint -> flag */
00724 typedef enum ePyConstraint_Flags {
00725     PYCON_USETARGETS    = (1<<0),
00726     PYCON_SCRIPTERROR   = (1<<1)
00727 } ePyConstraint_Flags;
00728 
00729 /* ChildOf Constraint -> flag */
00730 typedef enum eChildOf_Flags {
00731     CHILDOF_LOCX    = (1<<0),
00732     CHILDOF_LOCY    = (1<<1),
00733     CHILDOF_LOCZ    = (1<<2),
00734     CHILDOF_ROTX    = (1<<3),
00735     CHILDOF_ROTY    = (1<<4),
00736     CHILDOF_ROTZ    = (1<<5),
00737     CHILDOF_SIZEX   = (1<<6),
00738     CHILDOF_SIZEY   = (1<<7),
00739     CHILDOF_SIZEZ   = (1<<8),
00740     CHILDOF_ALL     = 511
00741 } eChildOf_Flags;
00742 
00743 /* Pivot Constraint */
00744     /* Restrictions for Pivot Constraint axis to consider for enabling constraint */
00745 typedef enum ePivotConstraint_Axis {
00746     /* do not consider this activity-clamping */
00747     PIVOTCON_AXIS_NONE = -1,    
00748     
00749     /* consider -ve x-axis rotations */
00750     PIVOTCON_AXIS_X_NEG,
00751     /* consider -ve y-axis rotations */
00752     PIVOTCON_AXIS_Y_NEG,
00753     /* consider -ve z-axis rotations */
00754     PIVOTCON_AXIS_Z_NEG,
00755     
00756     /* consider +ve x-axis rotations */
00757     PIVOTCON_AXIS_X,
00758     /* consider +ve y-axis rotations */
00759     PIVOTCON_AXIS_Y,
00760     /* consider +ve z-axis rotations */
00761     PIVOTCON_AXIS_Z
00762 } ePivotConstraint_Axis;
00763 
00764     /* settings for Pivot Constraint in general */
00765 typedef enum ePivotConstraint_Flag {
00766     /* offset is to be interpreted as being a fixed-point in space */
00767     PIVOTCON_FLAG_OFFSET_ABS    = (1<<0),
00768     /* rotation-based activation uses negative rotation to drive result */
00769     PIVOTCON_FLAG_ROTACT_NEG    = (1<<1)
00770 } ePivotConstraint_Flag;
00771 
00772 typedef enum eFollowTrack_Flags {
00773     FOLLOWTRACK_ACTIVECLIP  = (1<<0),
00774     FOLLOWTRACK_USE_3D_POSITION = (1<<1)
00775 } eFollowTrack_Flags;
00776 
00777 /* CameraSolver Constraint -> flag */
00778 typedef enum eCameraSolver_Flags {
00779     CAMERASOLVER_ACTIVECLIP = (1<<0)
00780 } eCameraSolver_Flags;
00781 
00782 /* ObjectSolver Constraint -> flag */
00783 typedef enum eObjectSolver_Flags {
00784     OBJECTSOLVER_ACTIVECLIP = (1<<0)
00785 } eObjectSolver_Flags;
00786 
00787 /* Rigid-Body Constraint */
00788 #define CONSTRAINT_DRAW_PIVOT 0x40
00789 #define     CONSTRAINT_DISABLE_LINKED_COLLISION 0x80
00790 
00791 /* important: these defines need to match up with PHY_DynamicTypes headerfile */
00792 #define     CONSTRAINT_RB_BALL      1
00793 #define     CONSTRAINT_RB_HINGE     2
00794 #define     CONSTRAINT_RB_CONETWIST 4
00795 #define     CONSTRAINT_RB_VEHICLE   11
00796 #define     CONSTRAINT_RB_GENERIC6DOF 12
00797 
00798 #endif