JointParams Class Reference

JointParams Class Reference

#include <interpik.h>

Class Description

See also
Class AnimProperty, Class Control, Class InterpCtrlUI.

Description:
This class handles the data storage and user interface for inverse kinematic joint parameters. The default 3ds Max controllers use this data structure to store their IK information. Plug-in controllers don't have to unless they want to.

Note the following is a dialog proc for handling joint parameters that is exported for use by plug-ins.

BOOL CALLBACK JointParamDlgProc(HWND hWnd,UINT message,

WPARAM wParam,LPARAM lParam);
Data Members:
float *min, *max;

Pointers to an array of floats corresponding to the number of degrees of freedom These are the From and To parameters.

float *damping;

Pointer to an array of floating point Damping parameters for each degree of freedom.

float scale;

This is a scale factor applied to the values in the spinner edit fields. This is to make them more sensible to the user. For example a percentage that is stored internally as 0.0 to 1.0 could be presented to the user as 0.0 to 100.0 by using a scale of 100.

DWORD flags;

One or more of the following values:

JNT_XACTIVE

JNT_YACTIVE

JNT_ZACTIVE

JNT_XLIMITED

JNT_YLIMITED

JNT_ZLIMITED

JNT_XEASE

JNT_YEASE

JNT_ZEASE

JNT_LIMITEXACT

JNT_ROLLOPEN

JNT_ROT

JNT_POS

int dofs;

The number of degrees of freedom the plug-in has.
Operators:
+ Inheritance diagram for JointParams:

Public Member Functions

CoreExport JointParams (DWORD type=JNT_POS, int dofs=3, float s=1.0f)
 
CoreExport JointParams (const JointParams &j)
 
CoreExport ~JointParams ()
 
DWORD ID ()
 
CoreExport JointParamsoperator= (JointParams &j)
 
CoreExport BOOL IsDefault ()
 
CoreExport IOResult Save (ISave *isave)
 
CoreExport IOResult Load (ILoad *iload)
 
CoreExport float ConstrainInc (int index, float v, float delta)
 
BOOL Active (int i)
 
BOOL Limited (int i)
 
BOOL Ease (int i)
 
BOOL Spring (int i)
 
DWORD Type ()
 
BOOL RollupOpen ()
 
void SetActive (int i, BOOL s)
 
void SetLimited (int i, BOOL s)
 
void SetEase (int i, BOOL s)
 
void SetSpring (int i, BOOL s)
 
void SetType (DWORD type)
 
void SetRollOpen (BOOL open)
 
virtual CoreExport void SpinnerChange (InterpCtrlUI *ui, WORD id, ISpinnerControl *spin, BOOL interactive)
 
CoreExport void InitDialog (InterpCtrlUI *ui)
 
CoreExport void EndDialog (InterpCtrlUI *ui, BOOL dontDel=FALSE)
 
CoreExport void SpinnerDown (InterpCtrlUI *ui, WORD id, ISpinnerControl *spin)
 
CoreExport void SpinnerUp (InterpCtrlUI *ui, WORD id, ISpinnerControl *spin, BOOL accept)
 
CoreExport void Command (InterpCtrlUI *ui, WORD notify, WORD id, HWND hCtrl)
 
CoreExport void EnableDisable (InterpCtrlUI *ui)
 
CoreExport void MirrorConstraints (int axis)
 
JointParams2GetJointParams2Interface ()
 
- Public Member Functions inherited from AnimProperty
virtual BOOL DontDelete ()
 
virtual ~AnimProperty ()
 

Public Attributes

float * min
 
float * max
 
float * damping
 
float * spring
 
float * stens
 
float scale
 
DWORD flags
 
int dofs
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

CoreExport JointParams ( DWORD  type = JNT_POS,
int  dofs = 3,
float  s = 1.0f 
)
Remarks
Constructor. The data members are initialized to the values passed.
Remarks
Constructor. The data members are initialized to those of the JointParam passed.
Remarks
Destructor.

Member Function Documentation

DWORD ID ( )
inlinevirtual
Remarks
Implemented by the System.

Returns the ID of the AnimProperty - PROPID_JOINTPARAMS

Implements AnimProperty.

158 {return PROPID_JOINTPARAMS;}
#define PROPID_JOINTPARAMS
Definition: interpik.h:30
CoreExport JointParams& operator= ( JointParams j)
Remarks
Assignment operator.
CoreExport BOOL IsDefault ( )
Remarks
Implemented by the System.

Returns TRUE if the current state of the parameters are the defaults.
CoreExport IOResult Save ( ISave isave)
Remarks
Implemented by the System.

This method may be called to save the joint properties to the 3ds Max file.
Parameters:
ISave *isave

This pointer may be used to call methods to write data to disk. See Class ISave.
Returns
One of the following values:

IO_OK - The result was acceptable - no errors.

IO_ERROR - This is returned if an error occured.
CoreExport IOResult Load ( ILoad iload)
Remarks
Implemented by the System.

This method is called to load the joint properties from the 3ds Max file.
Parameters:
ILoad *iload

This pointer may be used to call methods to load data from disk. See Class ILoad.
Returns
One of the following values:

IO_OK - The result was acceptable - no errors.

IO_ERROR - This is returned if an error occured.
CoreExport float ConstrainInc ( int  index,
float  v,
float  delta 
)
Remarks
Implemented by the System.

This method applies constraints to the given delta based on parameters and the current value v. It uses the current min/max limits to constrain the result: v+delta so that v+delta < max and v+delta > min. It returns a new delta such that the previous will both be TRUE. If ease is turned on, then the values will be slowed down as they approach the limits. It also applies the damping if turned on.
Parameters:
int index

This is the index of the parameter. For example on a position controller the index could be 0 (x), 1 (y), or 2 (z).

float v

The current value of the parameter.

float delta

The increment to apply.
Returns
A new delta value. Usually it will return delta, but if the value was constrained, then the value may be smaller or larger.
BOOL Active ( int  i)
inline
Remarks
Implemented by the System.

Returns TRUE if the specified joint is active; otherwise FALSE.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z
Returns
TRUE if the joint is active; otherwise FALSE.
222 {return (flags&(JNT_XACTIVE<<i))?TRUE:FALSE;}
#define JNT_XACTIVE
Definition: interpik.h:34
DWORD flags
Definition: interpik.h:145
BOOL Limited ( int  i)
inline
Remarks
Implemented by the System.

Returns TRUE if the joint is limited; otherwise FALSE.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z
Returns
TRUE if the joint is limited; otherwise FALSE.
232 {return (flags&(JNT_XLIMITED<<i))?TRUE:FALSE;}
#define JNT_XLIMITED
Definition: interpik.h:37
DWORD flags
Definition: interpik.h:145
BOOL Ease ( int  i)
inline
Remarks
Implemented by the System.

Returns TRUE if the joint has the Ease property set; otherwise FALSE.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z
Returns
TRUE if the joint has the Ease property set; otherwise FALSE.
243 {return (flags&(JNT_XEASE<<i))?TRUE:FALSE;}
DWORD flags
Definition: interpik.h:145
#define JNT_XEASE
Definition: interpik.h:40
BOOL Spring ( int  i)
inline
244 {return (flags&(JNT_XSPRING<<i))?TRUE:FALSE;}
#define JNT_XSPRING
Definition: interpik.h:43
DWORD flags
Definition: interpik.h:145
DWORD Type ( )
inline
Remarks
Implemented by the System.

Returns the type of joint, sliding or rotation. This will either be JNT_POS for sliding joints of JNT_ROT for rotational joints.
249 {return flags & (JNT_POS|JNT_ROT);}
#define JNT_POS
Definition: interpik.h:54
#define JNT_ROT
Definition: interpik.h:53
DWORD flags
Definition: interpik.h:145
BOOL RollupOpen ( )
inline
Remarks
Implemented by the System.

Returns TRUE if the rollup page if open; otherwise FALSE.
252 {return (flags&JNT_ROLLOPEN)?TRUE:FALSE;}
DWORD flags
Definition: interpik.h:145
#define JNT_ROLLOPEN
Definition: interpik.h:52
void SetActive ( int  i,
BOOL  s 
)
inline
Remarks
Implemented by the System.

Sets the specified joint to the specified active or inactive state.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z

BOOL s

TRUE to set the joint active; otherwise FALSE.
263 {if (s) flags|=(JNT_XACTIVE<<i); else flags&=~(JNT_XACTIVE<<i);}
#define JNT_XACTIVE
Definition: interpik.h:34
DWORD flags
Definition: interpik.h:145
void SetLimited ( int  i,
BOOL  s 
)
inline
Remarks
Implemented by the System.

Sets the specified joint to the specified limited or not limited state.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z

BOOL s

TRUE to set the joint as limited; otherwise FALSE.
274 {if (s) flags|=(JNT_XLIMITED<<i); else flags&=~(JNT_XLIMITED<<i);}
#define JNT_XLIMITED
Definition: interpik.h:37
DWORD flags
Definition: interpik.h:145
void SetEase ( int  i,
BOOL  s 
)
inline
Remarks
Implemented by the System.

Sets the specified joint to the specified eased or not eased state.
Parameters:
int i

One of the following values:

0 = X

1 = Y

2 = Z

BOOL s

TRUE to set the joint as eased; otherwise FALSE.
285 {if (s) flags|=(JNT_XEASE<<i); else flags&=~(JNT_XEASE<<i);}
DWORD flags
Definition: interpik.h:145
#define JNT_XEASE
Definition: interpik.h:40
void SetSpring ( int  i,
BOOL  s 
)
inline
286 {if (s) flags|=(JNT_XSPRING<<i); else flags&=~(JNT_XSPRING<<i);}
#define JNT_XSPRING
Definition: interpik.h:43
DWORD flags
Definition: interpik.h:145
void SetType ( DWORD  type)
inline
Remarks
Implemented by the System.

Sets the type of joint.
Parameters:
DWORD type

Specifies the type of joint. One of the following values:

JNT_POS - Sliding joint.

JNT_ROT - Rotating joint.
294 {flags&=~(JNT_POS|JNT_ROT);flags|=type;}
#define JNT_POS
Definition: interpik.h:54
#define JNT_ROT
Definition: interpik.h:53
DWORD flags
Definition: interpik.h:145
void SetRollOpen ( BOOL  open)
inline
Remarks
Implemented by the System.

Set the rollup page as open or closed.
Parameters:
BOOL open

TRUE to open the page; FALSE to close it.
300 {if (open) flags|=JNT_ROLLOPEN; else flags&= ~JNT_ROLLOPEN;}
DWORD flags
Definition: interpik.h:145
#define JNT_ROLLOPEN
Definition: interpik.h:52
virtual CoreExport void SpinnerChange ( InterpCtrlUI ui,
WORD  id,
ISpinnerControl spin,
BOOL  interactive 
)
virtual
Remarks
This is called when the user is interactively manipulating one of the spinner controls or enters a value into a spinner's edit field. This method has a default implementation.
Parameters:
InterpCtrlUI *ui

This is simply a container class to hold some data while the controllers parameters are being edited.

WORD id

The spinner control id.

ISpinnerControl *spin

A pointer to the spinner control.

BOOL interactive

TRUE if the user is doing an interactive adjustment; otherwise FALSE.

CoreExport void InitDialog ( InterpCtrlUI ui)
Remarks
Implemented by the System.

This is used internally.
CoreExport void EndDialog ( InterpCtrlUI ui,
BOOL  dontDel = FALSE 
)
Remarks
Implemented by the System.

This is used internally.
CoreExport void SpinnerDown ( InterpCtrlUI ui,
WORD  id,
ISpinnerControl spin 
)
Remarks
Implemented by the System.

This is used internally.
CoreExport void SpinnerUp ( InterpCtrlUI ui,
WORD  id,
ISpinnerControl spin,
BOOL  accept 
)
Remarks
Implemented by the System.

This is used internally.
CoreExport void Command ( InterpCtrlUI ui,
WORD  notify,
WORD  id,
HWND  hCtrl 
)
Remarks
Implemented by the System.

This is used internally.
CoreExport void EnableDisable ( InterpCtrlUI ui)
Remarks
Implemented by the System.

This is used internally.
CoreExport void MirrorConstraints ( int  axis)
JointParams2* GetJointParams2Interface ( )
inline
343 {if (flags & JNT_PARAMS2) return (JointParams2*)this; else return NULL;}
#define JNT_PARAMS2
Definition: interpik.h:47
#define NULL
Definition: autoptr.h:18
Definition: interpik.h:358
DWORD flags
Definition: interpik.h:145

Member Data Documentation

float* min
float * max
float* damping
float* spring
float* stens
float scale
DWORD flags
int dofs