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

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
937 {
938  return (jd->flags & bJointData3);
939 }
DWORD flags
Definition: control.h:869
const DWORD bJointData3
Definition: control.h:885
InitJointData3* DowncastToJointData3 ( InitJointData2 jd)
inline
942 {
943  return IsInitJointData3(jd) ? (InitJointData3*)jd : NULL;
944 }
class InitJointData3 : public InitJointData2
Definition: control.h:913
#define NULL
Definition: autoptr.h:20
bool IsInitJointData3(InitJointData2 *jd)
Definition: control.h:936
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.
2864  {
2865  int res, dur = i.Duration()-1;
2866  if (dur<=0) return t;
2867  res = (t-i.Start())%dur;
2868  if (t<i.Start()) {
2869  return i.End()+res;
2870  } else {
2871  return i.Start()+res;
2872  }
2873  }
TimeValue Start() const
Definition: interval.h:120
TimeValue Duration() const
Definition: interval.h:127
TimeValue End() const
Definition: interval.h:122
int NumCycles ( Interval  i,
TimeValue  t 
)
inline
Remarks
Returns the number of times the TimeValue cycles through the interval.
2876  {
2877  int dur = i.Duration()-1;
2878  if (dur<=0) return 1;
2879  if (t<i.Start()) {
2880  return (abs(t-i.Start())/dur)+1;
2881  } else
2882  if (t>i.End()) {
2883  return (abs(t-i.End())/dur)+1;
2884  } else {
2885  return 0;
2886  }
2887  }
TimeValue Start() const
Definition: interval.h:120
TimeValue Duration() const
Definition: interval.h:127
TimeValue End() const
Definition: interval.h:122
T LinearExtrapolate ( TimeValue  t0,
TimeValue  t1,
T &  val0,
T &  val1,
T &  endVal 
)
Remarks
Performs a linear extrapolation and returns the result.
2896 {
2897  return (T)(endVal + (val1-val0) * float(t1-t0));
2898 }
T RepeatExtrapolate ( Interval  range,
TimeValue  t,
T &  startVal,
T &  endVal,
T &  cycleVal 
)
Remarks
Performs a repeat extrapolation and returns the result. This will cycle the time t into the interval range.
2905 {
2906  int cycles = NumCycles(range,t);
2907  T delta;
2908  if (t<range.Start()) {
2909  delta = startVal - endVal;
2910  } else {
2911  delta = endVal - startVal;
2912  }
2913  return (T)(cycleVal + delta * float(cycles));
2914 }
int NumCycles(Interval i, TimeValue t)
Definition: control.h:2875
TimeValue Start() const
Definition: interval.h:120
T IdentityExtrapolate ( TimeValue  endPoint,
TimeValue  t,
T &  endVal 
)
Remarks
Performs a linear extrapolation using a slope of one and a point, and returns the result.
2917 {
2918  return (T)(endVal + float(t-endPoint));
2919 }
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 
)
2931 {
2932  return (T)((1.0f-u)*v0 + u*v1);
2933 }
Quat LinearInterpolate ( const Quat v0,
const Quat v1,
float  u 
)
inline
2937  {
2938  return Slerp(v0,v1,u);
2939  }
Quat Slerp(const Quat &p, const Quat &q, float t)
ScaleValue LinearInterpolate ( const ScaleValue v0,
const ScaleValue v1,
float  u 
)
inline
2943  {
2944  ScaleValue res;
2945  res.s = ((float)1.0-u)*v0.s + u*v1.s;
2946  res.q = Slerp(v0.q,v1.q,u);
2947  return res;
2948  }
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
Remarks
Takes an interval and checks the flags and modifies the interval based on the state of the flags.
2952  {
2953  TimeValue start = iv.Start();
2954  TimeValue end = iv.End();
2955  if (!(flags&TIME_INCLEFT)) {
2956  start++;
2957  }
2958  if (!(flags&TIME_INCRIGHT)) {
2959  end--;
2960  }
2961  if (end<start) {
2962  iv.SetEmpty();
2963  } else {
2964  iv.Set(start,end);
2965  }
2966  return iv;
2967  }
void Set(TimeValue s, TimeValue e)
Definition: interval.h:98
TimeValue Start() const
Definition: interval.h:120
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:112
TimeValue End() const
Definition: interval.h:122
Quat ScaleQuat ( Quat  q,
float  s 
)
inline
Remarks
Returns a quaternion scaled by the specified factor. This scales the 'angle' of the quaternion.
2970  {
2971  float angle;
2972  Point3 axis;
2973  AngAxisFromQ(q,&angle,axis);
2974  return QFromAngAxis(angle*s,axis);
2975  }
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)