control.h File Reference

control.h File Reference

#include "maxheap.h"
#include "plugapi.h"
#include "assert1.h"
#include "matrix3.h"
#include "quat.h"
#include "interval.h"
#include "ref.h"
#include "box3.h"
#include "bitarray.h"
#include "AnimPropertyID.h"
#include "containers/Array.h"

Classes

class  ScaleValue
 
struct  TMComponentsArg
 
class  Matrix3Indirect
 
class  DelayedMatrix3
 
struct  DelayedMatrix3::DelayedOp
 
struct  DelayedMatrix3::OpQueue
 
class  DelayedNodeMat
 
class  EaseCurveList
 
class  EaseCurveAnimProp
 
class  MultCurveList
 
class  MultCurveAnimProp
 
class  CtrlHitRecord
 class CtrlHitRecord More...
 
class  CtrlHitLog
 class CtrlHitLog More...
 
class  IKEnumCallback
 
class  IKDeriv
 
class  IKClipObject
 
class  InitJointData
 
class  InitJointData2
 
class  InitJointData3
 

class InitJointData3 : public InitJointData2

More...
 
class  DOFParams
 
class  Control
 
class  StdControl
 
class  SetXFormPacket
 
class  SetMorphTargetPacket
 
class  MorphControl
 
class  MasterPointControl
 
struct  Slot
 
class  TempStore
 

Macros

#define ORT_BEFORE   1
 
#define ORT_AFTER   2
 
#define ORT_CONSTANT   1
 Tracks values before or after the range of keys remains constant. More...
 
#define ORT_CYCLE   2
 Causes the key pattern to repeat cyclically. More...
 
#define ORT_LOOP   3
 The same as ORT_CYCLE with continuity. More...
 
#define ORT_OSCILLATE   4
 This reverses the range of keys values to cause the pattern to oscillate. More...
 
#define ORT_LINEAR   5
 Takes the slope at the end key in the range and extrapolate with that slope. More...
 
#define ORT_IDENTITY   6
 This only is used when mapping time to time. More...
 
#define ORT_RELATIVE_REPEAT   7
 Causes the key pattern to repeat with the first key taking off where the last key left off. More...
 
#define KEY_MODE_NO_BUFFER   1
 
#define GetEaseListInterface(anim)   ((EaseCurveList*)anim->GetInterface(I_EASELIST))
 
#define GetMultListInterface(anim)   ((MultCurveList*)anim->GetInterface(I_MULTLIST))
 
#define POSITION_DERIV   (1<<0)
 
#define ROTATION_DERIV   (1<<1)
 
#define COPYPASTE_IKPOS   1
 
#define COPYPASTE_IKROT   2
 
#define DEF_SPRINGTENS   (0.02f)
 
#define CONTROLBASE_CHUNK   0x8499
 
#define INORT_CHUNK   0x3000
 
#define OUTORT_CHUNK   0x3001
 
#define CONT_DISABLED_CHUNK   0x3002
 
#define CONT_FLAGS_CHUNK   0x3003
 
#define INHERIT_POS_X   (1<<0)
 
#define INHERIT_POS_Y   (1<<1)
 
#define INHERIT_POS_Z   (1<<2)
 
#define INHERIT_ROT_X   (1<<3)
 
#define INHERIT_ROT_Y   (1<<4)
 
#define INHERIT_ROT_Z   (1<<5)
 
#define INHERIT_SCL_X   (1<<6)
 
#define INHERIT_SCL_Y   (1<<7)
 
#define INHERIT_SCL_Z   (1<<8)
 
#define INHERIT_ALL   511
 

Enumerations

enum  GetSetMethod { CTRL_RELATIVE, CTRL_ABSOLUTE }
 
enum  SetXFormCommand { XFORM_MOVE, XFORM_ROTATE, XFORM_SCALE, XFORM_SET }
 

Functions

CoreExport void ApplyScaling (Matrix3 &m, const ScaleValue &v)
 
CoreExport void InitControlLists ()
 
CoreExport ScaleValue operator+ (const ScaleValue &s0, const ScaleValue &s1)
 
CoreExport ScaleValue operator- (const ScaleValue &s0, const ScaleValue &s1)
 
CoreExport ScaleValue operator* (const ScaleValue &s, float f)
 
CoreExport ScaleValue operator* (float f, const ScaleValue &s)
 
CoreExport ScaleValue operator+ (const ScaleValue &s, float f)
 
CoreExport ScaleValue operator+ (float f, const ScaleValue &s)
 
bool IsInitJointData3 (InitJointData2 *jd)
 
InitJointData3DowncastToJointData3 (InitJointData2 *jd)
 
TimeValue CycleTime (Interval i, TimeValue t)
 
int NumCycles (Interval i, TimeValue t)
 
template<class T >
LinearExtrapolate (TimeValue t0, TimeValue t1, T &val0, T &val1, T &endVal)
 
template<class T >
RepeatExtrapolate (Interval range, TimeValue t, T &startVal, T &endVal, T &cycleVal)
 
template<class T >
IdentityExtrapolate (TimeValue endPoint, TimeValue t, T &endVal)
 
CoreExport Quat LinearExtrapolate (TimeValue t0, TimeValue t1, Quat &val0, Quat &val1, Quat &endVal)
 
CoreExport Quat RepeatExtrapolate (Interval range, TimeValue t, Quat &startVal, Quat &endVal, Quat &cycleVal)
 
CoreExport Quat IdentityExtrapolate (TimeValue endPoint, TimeValue t, Quat &endVal)
 
CoreExport ScaleValue LinearExtrapolate (TimeValue t0, TimeValue t1, ScaleValue &val0, ScaleValue &val1, ScaleValue &endVal)
 
CoreExport ScaleValue RepeatExtrapolate (Interval range, TimeValue t, ScaleValue &startVal, ScaleValue &endVal, ScaleValue &cycleVal)
 
CoreExport ScaleValue IdentityExtrapolate (TimeValue endPoint, TimeValue t, ScaleValue &endVal)
 
template<class T >
LinearInterpolate (const T &v0, const T &v1, float u)
 
Quat LinearInterpolate (const Quat &v0, const Quat &v1, float u)
 
ScaleValue LinearInterpolate (const ScaleValue &v0, const ScaleValue &v1, float u)
 
Interval TestInterval (Interval iv, DWORD flags)
 
Quat ScaleQuat (Quat q, float s)
 
CoreExport int Animating ()
 
CoreExport void AnimateOn ()
 
CoreExport void AnimateOff ()
 
CoreExport void SuspendAnimate ()
 
CoreExport void ResumeAnimate ()
 
CoreExport BOOL AreWeAnimating (const TimeValue &t)
 
CoreExport BOOL AreWeKeying (const TimeValue &t)
 
CoreExport TimeValue GetAnimStart ()
 
CoreExport TimeValue GetAnimEnd ()
 
CoreExport void SetAnimStart (TimeValue s)
 
CoreExport void SetAnimEnd (TimeValue e)
 
CoreExport ControlNewDefaultFloatController ()
 
CoreExport ControlNewDefaultPoint3Controller ()
 
CoreExport ControlNewDefaultMatrix3Controller ()
 
CoreExport ControlNewDefaultPositionController ()
 
CoreExport ControlNewDefaultRotationController ()
 
CoreExport ControlNewDefaultScaleController ()
 
CoreExport ControlNewDefaultBoolController ()
 
CoreExport ControlNewDefaultColorController ()
 
CoreExport ControlNewDefaultMasterPointController ()
 
CoreExport ControlNewDefaultPoint4Controller ()
 
CoreExport ControlNewDefaultFRGBAController ()
 
CoreExport ControlNewDefaultPoint2Controller ()
 
CoreExport ControlCreateInterpFloat ()
 
CoreExport ControlCreateInterpPosition ()
 
CoreExport ControlCreateInterpPoint3 ()
 
CoreExport ControlCreateInterpRotation ()
 
CoreExport ControlCreateInterpScale ()
 
CoreExport ControlCreatePRSControl ()
 
CoreExport ControlCreateLookatControl ()
 
CoreExport ControlCreateMasterPointControl ()
 
CoreExport ControlCreateInterpPoint4 ()
 
CoreExport ControlCreateInterpPoint2 ()
 
CoreExport void SetDefaultController (SClass_ID sid, ClassDesc *desc)
 
CoreExport ClassDescGetDefaultController (SClass_ID sid)
 
CoreExport void SetDefaultColorController (ClassDesc *desc)
 
CoreExport void SetDefaultFRGBAController (ClassDesc *desc)
 
CoreExport void SetDefaultBoolController (ClassDesc *desc)
 
CoreExport BOOL GetSetKeyMode ()
 
CoreExport void SetSetKeyMode (BOOL onOff)
 
CoreExport void SuspendSetKeyMode ()
 
CoreExport void ResumeSetKeyMode ()
 
CoreExport BOOL GetSetKeySuspended ()
 
CoreExport BOOL GetSetKeyModeStatus ()
 
CoreExport BOOL IsSetKeyModeFeatureEnabled ()
 

Variables

const DWORD bJointData3 = (1 << 0)
 
CoreExport TempStore tmpStore
 

Macro Definition Documentation

#define ORT_BEFORE   1
#define ORT_AFTER   2
#define KEY_MODE_NO_BUFFER   1
#define GetEaseListInterface (   anim)    ((EaseCurveList*)anim->GetInterface(I_EASELIST))
#define GetMultListInterface (   anim)    ((MultCurveList*)anim->GetInterface(I_MULTLIST))
#define POSITION_DERIV   (1<<0)
#define ROTATION_DERIV   (1<<1)
#define COPYPASTE_IKPOS   1
#define COPYPASTE_IKROT   2
#define DEF_SPRINGTENS   (0.02f)
#define CONTROLBASE_CHUNK   0x8499
#define INORT_CHUNK   0x3000
#define OUTORT_CHUNK   0x3001
#define CONT_DISABLED_CHUNK   0x3002
#define CONT_FLAGS_CHUNK   0x3003
#define INHERIT_POS_X   (1<<0)
#define INHERIT_POS_Y   (1<<1)
#define INHERIT_POS_Z   (1<<2)
#define INHERIT_ROT_X   (1<<3)
#define INHERIT_ROT_Y   (1<<4)
#define INHERIT_ROT_Z   (1<<5)
#define INHERIT_SCL_X   (1<<6)
#define INHERIT_SCL_Y   (1<<7)
#define INHERIT_SCL_Z   (1<<8)
#define INHERIT_ALL   511

Enumeration Type Documentation

Enumerator
CTRL_RELATIVE 
CTRL_ABSOLUTE 
Definition: control.h:987
Definition: control.h:987
Enumerator
XFORM_MOVE 
XFORM_ROTATE 
XFORM_SCALE 
XFORM_SET 
Definition: control.h:2696
Definition: control.h:2696
Definition: control.h:2696
Definition: control.h:2696

Function Documentation

CoreExport void ApplyScaling ( Matrix3 m,
const ScaleValue v 
)
CoreExport void InitControlLists ( )
CoreExport ScaleValue operator+ ( const ScaleValue s0,
const ScaleValue s1 
)
Remarks
Returns the sum of two ScaleValues. This still multiplies since scale values are multiplicative not additive.
CoreExport ScaleValue operator- ( const ScaleValue s0,
const ScaleValue s1 
)
Remarks
Returns the difference of two ScaleValues.
CoreExport ScaleValue operator* ( const ScaleValue s,
float  f 
)
Remarks
Multiplication of a ScaleValue and a float.
CoreExport ScaleValue operator* ( float  f,
const ScaleValue s 
)
Remarks
Multiplication of a ScaleValue and a float.
CoreExport ScaleValue operator+ ( const ScaleValue s,
float  f 
)
Remarks
Returns the sum of a ScaleValue and a float. This adds f to s.x, s.y, and s.z.
CoreExport ScaleValue operator+ ( float  f,
const ScaleValue s 
)
Remarks
Returns the sum of a ScaleValue and a float.
bool IsInitJointData3 ( InitJointData2 jd)
inline
923 {
924  return (jd->flags & bJointData3);
925 }
DWORD flags
Definition: control.h:855
const DWORD bJointData3
Definition: control.h:871
InitJointData3* DowncastToJointData3 ( InitJointData2 jd)
inline
928 {
929  return IsInitJointData3(jd) ? (InitJointData3*)jd : NULL;
930 }
class InitJointData3 : public InitJointData2
Definition: control.h:899
#define NULL
Definition: autoptr.h:20
bool IsInitJointData3(InitJointData2 *jd)
Definition: control.h:922
TimeValue CycleTime ( Interval  i,
TimeValue  t 
)
inline
3061  {
3062  int res, dur = i.Duration()-1;
3063  if (dur<=0) return t;
3064  res = (t-i.Start())%dur;
3065  if (t<i.Start()) {
3066  return i.End()+res;
3067  } else {
3068  return i.Start()+res;
3069  }
3070  }
TimeValue Start() const
Definition: interval.h:112
TimeValue Duration() const
Definition: interval.h:119
TimeValue End() const
Definition: interval.h:114
int NumCycles ( Interval  i,
TimeValue  t 
)
inline
3073  {
3074  int dur = i.Duration()-1;
3075  if (dur<=0) return 1;
3076  if (t<i.Start()) {
3077  return (abs(t-i.Start())/dur)+1;
3078  } else
3079  if (t>i.End()) {
3080  return (abs(t-i.End())/dur)+1;
3081  } else {
3082  return 0;
3083  }
3084  }
TimeValue Start() const
Definition: interval.h:112
TimeValue Duration() const
Definition: interval.h:119
TimeValue End() const
Definition: interval.h:114
T LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
T &  val0,
T &  val1,
T &  endVal 
)
3092 {
3093  return (T)(endVal + (val1-val0) * float(t1-t0));
3094 }
T RepeatExtrapolate ( Interval  range,
TimeValue  t,
T &  startVal,
T &  endVal,
T &  cycleVal 
)
3101 {
3102  int cycles = NumCycles(range,t);
3103  T delta;
3104  if (t<range.Start()) {
3105  delta = startVal - endVal;
3106  } else {
3107  delta = endVal - startVal;
3108  }
3109  return (T)(cycleVal + delta * float(cycles));
3110 }
int NumCycles(Interval i, TimeValue t)
Definition: control.h:3072
TimeValue Start() const
Definition: interval.h:112
T IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
T &  endVal 
)
3113 {
3114  return (T)(endVal + float(t-endPoint));
3115 }
CoreExport Quat LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
Quat val0,
Quat val1,
Quat endVal 
)
CoreExport Quat RepeatExtrapolate ( Interval  range,
TimeValue  t,
Quat startVal,
Quat endVal,
Quat cycleVal 
)
CoreExport Quat IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
Quat endVal 
)
CoreExport ScaleValue LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
ScaleValue val0,
ScaleValue val1,
ScaleValue endVal 
)
CoreExport ScaleValue RepeatExtrapolate ( Interval  range,
TimeValue  t,
ScaleValue startVal,
ScaleValue endVal,
ScaleValue cycleVal 
)
CoreExport ScaleValue IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
ScaleValue endVal 
)
T LinearInterpolate ( const T &  v0,
const T &  v1,
float  u 
)
3127 {
3128  return (T)((1.0f-u)*v0 + u*v1);
3129 }
Quat LinearInterpolate ( const Quat v0,
const Quat v1,
float  u 
)
inline
3133  {
3134  return Slerp(v0,v1,u);
3135  }
Quat Slerp(const Quat &p, const Quat &q, float t)
ScaleValue LinearInterpolate ( const ScaleValue v0,
const ScaleValue v1,
float  u 
)
inline
3139  {
3140  ScaleValue res;
3141  res.s = ((float)1.0-u)*v0.s + u*v1.s;
3142  res.q = Slerp(v0.q,v1.q,u);
3143  return res;
3144  }
Quat Slerp(const Quat &p, const Quat &q, float t)
Definition: control.h:74
Point3 s
Definition: control.h:78
Quat q
Definition: control.h:79
Interval TestInterval ( Interval  iv,
DWORD  flags 
)
inline
3148  {
3149  TimeValue start = iv.Start();
3150  TimeValue end = iv.End();
3151  if (!(flags&TIME_INCLEFT)) {
3152  start++;
3153  }
3154  if (!(flags&TIME_INCRIGHT)) {
3155  end--;
3156  }
3157  if (end<start) {
3158  iv.SetEmpty();
3159  } else {
3160  iv.Set(start,end);
3161  }
3162  return iv;
3163  }
void Set(TimeValue s, TimeValue e)
Definition: interval.h:90
short flags
Definition: functions.h:174
TimeValue Start() const
Definition: interval.h:112
int TimeValue
Definition: maxtypes.h:111
#define TIME_INCLEFT
Definition: TrackFlags.h:55
#define TIME_INCRIGHT
Definition: TrackFlags.h:56
void SetEmpty()
Definition: interval.h:104
TimeValue End() const
Definition: interval.h:114
Quat ScaleQuat ( Quat  q,
float  s 
)
inline
3166  {
3167  float angle;
3168  Point3 axis;
3169  AngAxisFromQ(q,&angle,axis);
3170  return QFromAngAxis(angle*s,axis);
3171  }
void AngAxisFromQ(const Quat &q, float *ang, Point3 &axis)
Definition: point3.h:50
Quat QFromAngAxis(float ang, const Point3 &axis)
CoreExport int Animating ( )
CoreExport void AnimateOn ( )
CoreExport void AnimateOff ( )
CoreExport void SuspendAnimate ( )
CoreExport void ResumeAnimate ( )
CoreExport BOOL AreWeAnimating ( const TimeValue t)
CoreExport BOOL AreWeKeying ( const TimeValue t)
CoreExport TimeValue GetAnimStart ( )
CoreExport TimeValue GetAnimEnd ( )
CoreExport void SetAnimStart ( TimeValue  s)
CoreExport void SetAnimEnd ( TimeValue  e)
CoreExport Control* NewDefaultFloatController ( )
CoreExport Control* NewDefaultPoint3Controller ( )
CoreExport Control* NewDefaultMatrix3Controller ( )
CoreExport Control* NewDefaultPositionController ( )
CoreExport Control* NewDefaultRotationController ( )
CoreExport Control* NewDefaultScaleController ( )
CoreExport Control* NewDefaultBoolController ( )
CoreExport Control* NewDefaultColorController ( )
CoreExport Control* NewDefaultMasterPointController ( )
CoreExport Control* NewDefaultPoint4Controller ( )
CoreExport Control* NewDefaultFRGBAController ( )
CoreExport Control* NewDefaultPoint2Controller ( )
CoreExport Control* CreateInterpFloat ( )
CoreExport Control* CreateInterpPosition ( )
CoreExport Control* CreateInterpPoint3 ( )
CoreExport Control* CreateInterpRotation ( )
CoreExport Control* CreateInterpScale ( )
CoreExport Control* CreatePRSControl ( )
CoreExport Control* CreateLookatControl ( )
CoreExport Control* CreateMasterPointControl ( )
CoreExport Control* CreateInterpPoint4 ( )
CoreExport Control* CreateInterpPoint2 ( )
CoreExport void SetDefaultController ( SClass_ID  sid,
ClassDesc desc 
)
CoreExport ClassDesc* GetDefaultController ( SClass_ID  sid)
CoreExport void SetDefaultColorController ( ClassDesc desc)
CoreExport void SetDefaultFRGBAController ( ClassDesc desc)
CoreExport void SetDefaultBoolController ( ClassDesc desc)
CoreExport BOOL GetSetKeyMode ( )
CoreExport void SetSetKeyMode ( BOOL  onOff)
CoreExport void SuspendSetKeyMode ( )
CoreExport void ResumeSetKeyMode ( )
CoreExport BOOL GetSetKeySuspended ( )
CoreExport BOOL GetSetKeyModeStatus ( )
CoreExport BOOL IsSetKeyModeFeatureEnabled ( )

Variable Documentation

const DWORD bJointData3 = (1 << 0)