Public Member Functions | Public Attributes

JointParams Class Reference

Search for all occurrences

Detailed 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:

#include <interpik.h>

Inheritance diagram for JointParams:
Inheritance graph
[legend]

List of all members.

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 JointParams operator= (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)
JointParams2 GetJointParams2Interface ()

Public Attributes

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

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.
CoreExport JointParams ( const JointParams j )
Remarks:
Constructor. The data members are initialized to those of the JointParam passed.
CoreExport ~JointParams ( )
Remarks:
Destructor.

Member Function Documentation

DWORD ID ( ) [inline, virtual]
Remarks:
Implemented by the System.

Returns the ID of the AnimProperty - PROPID_JOINTPARAMS

Implements AnimProperty.

{return PROPID_JOINTPARAMS;}
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.
{return (flags&(JNT_XACTIVE<<i))?TRUE:FALSE;}
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.
{return (flags&(JNT_XLIMITED<<i))?TRUE:FALSE;}
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.
{return (flags&(JNT_XEASE<<i))?TRUE:FALSE;}
BOOL Spring ( int  i ) [inline]
{return (flags&(JNT_XSPRING<<i))?TRUE:FALSE;}
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.
{return flags & (JNT_POS|JNT_ROT);}
BOOL RollupOpen ( ) [inline]
Remarks:
Implemented by the System.

Returns TRUE if the rollup page if open; otherwise FALSE.
{return (flags&JNT_ROLLOPEN)?TRUE:FALSE;}
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.
{if (s) flags|=(JNT_XACTIVE<<i); else flags&=~(JNT_XACTIVE<<i);}
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.
{if (s) flags|=(JNT_XLIMITED<<i); else flags&=~(JNT_XLIMITED<<i);}
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.
{if (s) flags|=(JNT_XEASE<<i); else flags&=~(JNT_XEASE<<i);}
void SetSpring ( int  i,
BOOL  s 
) [inline]
{if (s) flags|=(JNT_XSPRING<<i); else flags&=~(JNT_XSPRING<<i);}
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.
{flags&=~(JNT_POS|JNT_ROT);flags|=type;}
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.
{if (open) flags|=JNT_ROLLOPEN; else flags&= ~JNT_ROLLOPEN;}
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]
{if (flags & JNT_PARAMS2) return (JointParams2*)this; else return NULL;}

Member Data Documentation

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

JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams
JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams JointParams