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)
 
CoreExport Quat LinearExtrapolate (TimeValue t0, TimeValue t1, const Quat &val0, const Quat &val1, const Quat &endVal)
 
CoreExport Quat RepeatExtrapolate (Interval range, TimeValue t, const Quat &startVal, const Quat &endVal, const Quat &cycleVal)
 
CoreExport Quat IdentityExtrapolate (TimeValue endPoint, TimeValue t, const Quat &endVal)
 
CoreExport ScaleValue LinearExtrapolate (TimeValue t0, TimeValue t1, const ScaleValue &val0, const ScaleValue &val1, const ScaleValue &endVal)
 
CoreExport ScaleValue RepeatExtrapolate (Interval range, TimeValue t, const ScaleValue &startVal, const ScaleValue &endVal, const ScaleValue &cycleVal)
 
CoreExport ScaleValue IdentityExtrapolate (TimeValue endPoint, TimeValue t, const ScaleValue &endVal)
 
CoreExport Matrix3 LinearExtrapolate (TimeValue t0, TimeValue t1, const Matrix3 &val0, const Matrix3 &val1, const Matrix3 &endVal)
 
CoreExport Matrix3 RepeatExtrapolate (Interval range, TimeValue t, const Matrix3 &startVal, const Matrix3 &endVal, const Matrix3 &cycleVal)
 
CoreExport Matrix3 IdentityExtrapolate (TimeValue endPoint, TimeValue t, const Matrix3 &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)
 
Template Extrapolation Functions

template<class T >
LinearExtrapolate (TimeValue t0, TimeValue t1, const T &val0, const T &val1, const T &endVal)
 
template<class T >
RepeatExtrapolate (Interval range, TimeValue t, const T &startVal, const T &endVal, const T &cycleVal)
 
CoreExport Point3 RepeatExtrapolate (Interval range, TimeValue t, const Point3 &startVal, const Point3 &endVal, const Point3 &cycleVal)
 
template<class T >
IdentityExtrapolate (TimeValue endPoint, TimeValue t, const T &endVal)
 
High-level Animation Control
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)
 
Animation Key Mode Methods
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)
 

Additional Controller Related Functions

CoreExport TempStore tmpStore
 
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)
 

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:1004
Definition: control.h:1004
Enumerator
XFORM_MOVE 
XFORM_ROTATE 
XFORM_SCALE 
XFORM_SET 
Definition: control.h:2591
Definition: control.h:2591
Definition: control.h:2591
Definition: control.h:2591

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
940 {
941  return (jd->flags & bJointData3);
942 }
DWORD flags
Definition: control.h:872
const DWORD bJointData3
Definition: control.h:888
InitJointData3* DowncastToJointData3 ( InitJointData2 jd)
inline
945 {
946  return IsInitJointData3(jd) ? (InitJointData3*)jd : NULL;
947 }
class InitJointData3 : public InitJointData2
Definition: control.h:916
#define NULL
Definition: autoptr.h:18
bool IsInitJointData3(InitJointData2 *jd)
Definition: control.h:939
TimeValue CycleTime ( Interval  i,
TimeValue  t 
)
inline
Remarks
Returns a TimeValue that is the specified time mod of the interval length. The returned time is somewhere within the interval passed. This cycles the time so that it appears within the interval.
2958  {
2959  int res, dur = i.Duration()-1;
2960  if (dur<=0) return t;
2961  res = (t-i.Start())%dur;
2962  if (t<i.Start()) {
2963  return i.End()+res;
2964  } else {
2965  return i.Start()+res;
2966  }
2967  }
TimeValue Start() const
Definition: interval.h:134
TimeValue Duration() const
Definition: interval.h:141
TimeValue End() const
Definition: interval.h:136
int NumCycles ( Interval  i,
TimeValue  t 
)
inline
Remarks
Returns the number of times the TimeValue cycles through the interval.
2970  {
2971  int dur = i.Duration()-1;
2972  if (dur<=0) return 1;
2973  if (t<i.Start()) {
2974  return (abs(t-i.Start())/dur)+1;
2975  } else
2976  if (t>i.End()) {
2977  return (abs(t-i.End())/dur)+1;
2978  } else {
2979  return 0;
2980  }
2981  }
TimeValue Start() const
Definition: interval.h:134
TimeValue Duration() const
Definition: interval.h:141
TimeValue End() const
Definition: interval.h:136
T LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
const T &  val0,
const T &  val1,
const T &  endVal 
)
Remarks
Performs a linear extrapolation and returns the result.
2993 {
2994  return (T)(endVal + (val1-val0) * float(t1-t0));
2995 }
T RepeatExtrapolate ( Interval  range,
TimeValue  t,
const T &  startVal,
const T &  endVal,
const T &  cycleVal 
)
Remarks
Performs a repeat extrapolation and returns the result. This will cycle the time t into the interval range.
3002 {
3003  int cycles = NumCycles(range,t);
3004  T delta;
3005  if (t<range.Start()) {
3006  delta = startVal - endVal;
3007  } else {
3008  delta = endVal - startVal;
3009  }
3010  return (T)(cycleVal + delta * float(cycles));
3011 }
int NumCycles(Interval i, TimeValue t)
Definition: control.h:2969
TimeValue Start() const
Definition: interval.h:134
CoreExport Point3 RepeatExtrapolate ( Interval  range,
TimeValue  t,
const Point3 startVal,
const Point3 endVal,
const Point3 cycleVal 
)
T IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
const T &  endVal 
)
Remarks
Performs a linear extrapolation using a slope of one and a point, and returns the result.
3017 {
3018  return (T)(endVal + float(t-endPoint));
3019 }
CoreExport Quat LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
const Quat val0,
const Quat val1,
const Quat endVal 
)
CoreExport Quat RepeatExtrapolate ( Interval  range,
TimeValue  t,
const Quat startVal,
const Quat endVal,
const Quat cycleVal 
)
CoreExport Quat IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
const Quat endVal 
)
CoreExport ScaleValue LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
const ScaleValue val0,
const ScaleValue val1,
const ScaleValue endVal 
)
CoreExport ScaleValue RepeatExtrapolate ( Interval  range,
TimeValue  t,
const ScaleValue startVal,
const ScaleValue endVal,
const ScaleValue cycleVal 
)
CoreExport ScaleValue IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
const ScaleValue endVal 
)
CoreExport Matrix3 LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
const Matrix3 val0,
const Matrix3 val1,
const Matrix3 endVal 
)
CoreExport Matrix3 RepeatExtrapolate ( Interval  range,
TimeValue  t,
const Matrix3 startVal,
const Matrix3 endVal,
const Matrix3 cycleVal 
)
CoreExport Matrix3 IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
const Matrix3 endVal 
)
T LinearInterpolate ( const T &  v0,
const T &  v1,
float  u 
)
3037 {
3038  return (T)((1.0f-u)*v0 + u*v1);
3039 }
Quat LinearInterpolate ( const Quat v0,
const Quat v1,
float  u 
)
inline
3043  {
3044  return Slerp(v0,v1,u);
3045  }
Quat Slerp(const Quat &p, const Quat &q, float t)
ScaleValue LinearInterpolate ( const ScaleValue v0,
const ScaleValue v1,
float  u 
)
inline
3049  {
3050  ScaleValue res;
3051  res.s = ((float)1.0-u)*v0.s + u*v1.s;
3052  res.q = Slerp(v0.q,v1.q,u);
3053  return res;
3054  }
Quat Slerp(const Quat &p, const Quat &q, float t)
Definition: control.h:72
Point3 s
Definition: control.h:76
Quat q
Definition: control.h:77
Interval TestInterval ( Interval  iv,
DWORD  flags 
)
inline
Remarks
Takes an interval and checks the flags and modifies the interval based on the state of the flags.
3058  {
3059  TimeValue start = iv.Start();
3060  TimeValue end = iv.End();
3061  if (!(flags&TIME_INCLEFT)) {
3062  start++;
3063  }
3064  if (!(flags&TIME_INCRIGHT)) {
3065  end--;
3066  }
3067  if (end<start) {
3068  iv.SetEmpty();
3069  } else {
3070  iv.Set(start,end);
3071  }
3072  return iv;
3073  }
void Set(TimeValue s, TimeValue e)
Definition: interval.h:112
TimeValue Start() const
Definition: interval.h:134
int TimeValue
Definition: maxtypes.h:109
#define TIME_INCLEFT
Definition: TrackFlags.h:53
#define TIME_INCRIGHT
Definition: TrackFlags.h:54
void SetEmpty()
Definition: interval.h:126
TimeValue End() const
Definition: interval.h:136
Quat ScaleQuat ( Quat  q,
float  s 
)
inline
Remarks
Returns a quaternion scaled by the specified factor. This scales the 'angle' of the quaternion.
3076  {
3077  float angle;
3078  Point3 axis;
3079  AngAxisFromQ(q,&angle,axis);
3080  return QFromAngAxis(angle*s,axis);
3081  }
void AngAxisFromQ(const Quat &q, float *ang, Point3 &axis)
Definition: point3.h:55
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)