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

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
935 {
936  return (jd->flags & bJointData3);
937 }
DWORD flags
Definition: control.h:867
const DWORD bJointData3
Definition: control.h:883
InitJointData3* DowncastToJointData3 ( InitJointData2 jd)
inline
940 {
941  return IsInitJointData3(jd) ? (InitJointData3*)jd : NULL;
942 }
class InitJointData3 : public InitJointData2
Definition: control.h:911
#define NULL
Definition: autoptr.h:18
bool IsInitJointData3(InitJointData2 *jd)
Definition: control.h:934
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.
2957  {
2958  int res, dur = i.Duration()-1;
2959  if (dur<=0) return t;
2960  res = (t-i.Start())%dur;
2961  if (t<i.Start()) {
2962  return i.End()+res;
2963  } else {
2964  return i.Start()+res;
2965  }
2966  }
TimeValue Start() const
Definition: interval.h:126
TimeValue Duration() const
Definition: interval.h:133
TimeValue End() const
Definition: interval.h:128
int NumCycles ( Interval  i,
TimeValue  t 
)
inline
Remarks
Returns the number of times the TimeValue cycles through the interval.
2969  {
2970  int dur = i.Duration()-1;
2971  if (dur<=0) return 1;
2972  if (t<i.Start()) {
2973  return (abs(t-i.Start())/dur)+1;
2974  } else
2975  if (t>i.End()) {
2976  return (abs(t-i.End())/dur)+1;
2977  } else {
2978  return 0;
2979  }
2980  }
TimeValue Start() const
Definition: interval.h:126
TimeValue Duration() const
Definition: interval.h:133
TimeValue End() const
Definition: interval.h:128
T LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
const T &  val0,
const T &  val1,
const T &  endVal 
)
Remarks
Performs a linear extrapolation and returns the result.
2992 {
2993  return (T)(endVal + (val1-val0) * float(t1-t0));
2994 }
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.
3001 {
3002  int cycles = NumCycles(range,t);
3003  T delta;
3004  if (t<range.Start()) {
3005  delta = startVal - endVal;
3006  } else {
3007  delta = endVal - startVal;
3008  }
3009  return (T)(cycleVal + delta * float(cycles));
3010 }
int NumCycles(Interval i, TimeValue t)
Definition: control.h:2968
TimeValue Start() const
Definition: interval.h:126
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.
3016 {
3017  return (T)(endVal + float(t-endPoint));
3018 }
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 
)
3036 {
3037  return (T)((1.0f-u)*v0 + u*v1);
3038 }
Quat LinearInterpolate ( const Quat v0,
const Quat v1,
float  u 
)
inline
3042  {
3043  return Slerp(v0,v1,u);
3044  }
Quat Slerp(const Quat &p, const Quat &q, float t)
ScaleValue LinearInterpolate ( const ScaleValue v0,
const ScaleValue v1,
float  u 
)
inline
3048  {
3049  ScaleValue res;
3050  res.s = ((float)1.0-u)*v0.s + u*v1.s;
3051  res.q = Slerp(v0.q,v1.q,u);
3052  return res;
3053  }
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.
3057  {
3058  TimeValue start = iv.Start();
3059  TimeValue end = iv.End();
3060  if (!(flags&TIME_INCLEFT)) {
3061  start++;
3062  }
3063  if (!(flags&TIME_INCRIGHT)) {
3064  end--;
3065  }
3066  if (end<start) {
3067  iv.SetEmpty();
3068  } else {
3069  iv.Set(start,end);
3070  }
3071  return iv;
3072  }
void Set(TimeValue s, TimeValue e)
Definition: interval.h:104
TimeValue Start() const
Definition: interval.h:126
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:118
TimeValue End() const
Definition: interval.h:128
Quat ScaleQuat ( Quat  q,
float  s 
)
inline
Remarks
Returns a quaternion scaled by the specified factor. This scales the 'angle' of the quaternion.
3075  {
3076  float angle;
3077  Point3 axis;
3078  AngAxisFromQ(q,&angle,axis);
3079  return QFromAngAxis(angle*s,axis);
3080  }
void AngAxisFromQ(const Quat &q, float *ang, Point3 &axis)
Definition: point3.h:51
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)