Limits (Degrees of Freedom)

Limits (Degrees of Freedom)

Module description

This section describes the functions used to set up limits (Degrees of Freedom) for a character.

See also
~{ Degrees of Freedom }~.

Enumerations

enum  HIKLimitActiveMask {
  HIKActiveMinX = 1 << 0, HIKActiveMinY = 1 << 1, HIKActiveMinZ = 1 << 2, HIKActiveMaxX = 1 << 3,
  HIKActiveMaxY = 1 << 4, HIKActiveMaxZ = 1 << 5, HIKActiveMinX = 1 << 0, HIKActiveMinY = 1 << 1,
  HIKActiveMinZ = 1 << 2, HIKActiveMaxX = 1 << 3, HIKActiveMaxY = 1 << 4, HIKActiveMaxZ = 1 << 5
}
 Lists the possible types of limits that can be activated for a Node. More...
 
enum  HIKRotationOrder {
  HIKOrderEulerXYZ = 0, HIKOrderEulerXYX, HIKOrderEulerXZY, HIKOrderEulerXZX,
  HIKOrderEulerYZX, HIKOrderEulerYZY, HIKOrderEulerYXZ, HIKOrderEulerYXY,
  HIKOrderEulerZXY, HIKOrderEulerZXZ, HIKOrderEulerZYX, HIKOrderEulerZYZ,
  HIKOrderSphericXYZ, HIKOrderEulerXYZ = 0, HIKOrderEulerXYX, HIKOrderEulerXZY,
  HIKOrderEulerXZX, HIKOrderEulerYZX, HIKOrderEulerYZY, HIKOrderEulerYXZ,
  HIKOrderEulerYXY, HIKOrderEulerZXY, HIKOrderEulerZXZ, HIKOrderEulerZYX,
  HIKOrderEulerZYZ, HIKOrderSphericXYZ
}
 Lists the possible rotation orders for the values set in the HIKSetRotationOrder() function. More...
 

Functions

void HIKSetMinXYZRotationfv (HIKCharacter *pCharacter, int pNodeId, const float pMin[3], int pMinActiveMask)
 Set the minimum rotation for the Node pNodeId. More...
 
void HIKSetMinXYZRotationdv (HIKCharacter *pCharacter, int pNodeId, const double pMin[3], int pMinActiveMask)
 Set the minimum rotation for the Node pNodeId. More...
 
void HIKSetMaxXYZRotationfv (HIKCharacter *pCharacter, int pNodeId, const float pMax[3], int pMaxActiveMask)
 Set the maximum rotation for the Node pNodeId. More...
 
void HIKSetMaxXYZRotationdv (HIKCharacter *pCharacter, int pNodeId, const double pMax[3], int pMaxActiveMask)
 Set the maximum rotation for the Node pNodeId. More...
 
void HIKSetRotationOrder (HIKCharacter *pCharacter, int pNodeId, eHIKRotationOrder pRotationOrder)
 Sets the order in which the axes are specified in the limits set for Node pNodeId. More...
 
void HIKSetPreQfv (HIKCharacter *pCharacter, int pNodeId, const float pPreQ[4])
 Apply the pre rotation pPreQ to Node pNodeId. More...
 
void HIKSetPreQdv (HIKCharacter *pCharacter, int pNodeId, const double pPreQ[4])
 Apply the pre rotation pPreQ to Node pNodeId. More...
 
void HIKSetPostQfv (HIKCharacter *pCharacter, int pNodeId, const float pPostQ[4])
 Apply the post rotation pPostQ to the Node pNodeId. More...
 
void HIKSetPostQdv (HIKCharacter *pCharacter, int pNodeId, const double pPostQ[4])
 Apply the post rotation pPostQ to the Node pNodeId. More...
 
void HIKSetLimitsfv (HIKCharacter *pCharacter, int pNodeId, const float pMin[3], const float pMax[3], const float pPreQ[4], const float pPostQ[4], int pActiveMask, eHIKRotationOrder pRotationOrder)
 Set up limits for Node pNodeId. More...
 
void HIKSetLimitsdv (HIKCharacter *pCharacter, int pNodeId, const double pMin[3], const double pMax[3], const double pPreQ[4], const double pPostQ[4], int pActiveMask, eHIKRotationOrder pRotationOrder)
 Set up limits for Node pNodeId. More...
 
void HIKSetTranslationLimitsf (HIKCharacter *pCharacter, int pNodeId, float pMin, float pMax, bool pActive)
 Set the translation limits for Node pNodeId. More...
 
void HIKSetTranslationLimitsd (HIKCharacter *pCharacter, int pNodeId, double pMin, double pMax, bool pActive)
 Set the translation limits for Node pNodeId. More...
 
void HIKGetLimitsfv (const HIKCharacter *pCharacter, int pNodeId, float pMin[3], float pMax[3], float pPreQ[4], float pPostQ[4], int &pActiveMask, eHIKRotationOrder &pRotationOrder)
 Retrieve the limits set for Node pNodeId. More...
 
void HIKGetLimitsdv (const HIKCharacter *pCharacter, int pNodeId, double pMin[3], double pMax[3], double pPreQ[4], double pPostQ[4], int &pActiveMask, eHIKRotationOrder &pRotationOrder)
 Retrieve the limits set for Node pNodeId. More...
 

Enumeration Type Documentation

Lists the possible types of limits that can be activated for a Node.

See HIKSetMinXYZRotationfv(), HIKSetMaxXYZRotationfv(), and HIKSetLimitsfv().

Enumerator
HIKActiveMinX 

Activate minimum limit on X axis.

HIKActiveMinY 

Activate minimum limit on Y axis.

HIKActiveMinZ 

Activate minimum limit on Z axis.

HIKActiveMaxX 

Activate maximum limit on X axis.

HIKActiveMaxY 

Activate maximum limit on Y axis.

HIKActiveMaxZ 

Activate maximum limit on Z axis.

HIKActiveMinX 

Activate minimum limit on X axis.

HIKActiveMinY 

Activate minimum limit on Y axis.

HIKActiveMinZ 

Activate minimum limit on Z axis.

HIKActiveMaxX 

Activate maximum limit on X axis.

HIKActiveMaxY 

Activate maximum limit on Y axis.

HIKActiveMaxZ 

Activate maximum limit on Z axis.

Definition at line 650 of file humanik.h.

651 {
652  HIKActiveMinX = 1 << 0,
653  HIKActiveMinY = 1 << 1,
654  HIKActiveMinZ = 1 << 2,
655  HIKActiveMaxX = 1 << 3,
656  HIKActiveMaxY = 1 << 4,
657  HIKActiveMaxZ = 1 << 5
658 };
Activate maximum limit on Y axis.
Definition: humanik.h:656
Activate maximum limit on X axis.
Definition: humanik.h:655
Activate minimum limit on X axis.
Definition: humanik.h:652
Activate minimum limit on Y axis.
Definition: humanik.h:653
Activate maximum limit on Z axis.
Definition: humanik.h:657
Activate minimum limit on Z axis.
Definition: humanik.h:654

Lists the possible rotation orders for the values set in the HIKSetRotationOrder() function.

Enumerator
HIKOrderEulerXYZ 

Euler x, y, z.

HIKOrderEulerXYX 

Euler x, y, x.

HIKOrderEulerXZY 

Euler x, z, y.

HIKOrderEulerXZX 

Euler x, z, x.

HIKOrderEulerYZX 

Euler y, z, x.

HIKOrderEulerYZY 

Euler y, z, y.

HIKOrderEulerYXZ 

Euler y, x, z.

HIKOrderEulerYXY 

Euler y, x, y.

HIKOrderEulerZXY 

Euler z, x, y.

HIKOrderEulerZXZ 

Euler z, x, z.

HIKOrderEulerZYX 

Euler z, y, x.

HIKOrderEulerZYZ 

Euler z, y, z.

HIKOrderSphericXYZ 

Spheric x, y, z.

HIKOrderEulerXYZ 

Euler x, y, z.

HIKOrderEulerXYX 

Euler x, y, x.

HIKOrderEulerXZY 

Euler x, z, y.

HIKOrderEulerXZX 

Euler x, z, x.

HIKOrderEulerYZX 

Euler y, z, x.

HIKOrderEulerYZY 

Euler y, z, y.

HIKOrderEulerYXZ 

Euler y, x, z.

HIKOrderEulerYXY 

Euler y, x, y.

HIKOrderEulerZXY 

Euler z, x, y.

HIKOrderEulerZXZ 

Euler z, x, z.

HIKOrderEulerZYX 

Euler z, y, x.

HIKOrderEulerZYZ 

Euler z, y, z.

HIKOrderSphericXYZ 

Spheric x, y, z.

+ Examples:

Definition at line 664 of file humanik.h.

665 {
666  HIKOrderEulerXYZ = 0,
679 };
Spheric x, y, z.
Definition: humanik.h:678
Euler y, z, x.
Definition: humanik.h:670
Euler y, x, y.
Definition: humanik.h:673
Euler x, y, x.
Definition: humanik.h:667
Euler y, x, z.
Definition: humanik.h:672
Euler y, z, y.
Definition: humanik.h:671
Euler x, z, x.
Definition: humanik.h:669
Euler z, x, z.
Definition: humanik.h:675
Euler z, y, z.
Definition: humanik.h:677
Euler x, z, y.
Definition: humanik.h:668
Euler z, x, y.
Definition: humanik.h:674
Euler x, y, z.
Definition: humanik.h:666
Euler z, y, x.
Definition: humanik.h:676

Function Documentation

void HIKGetLimitsdv ( const HIKCharacter pCharacter,
int  pNodeId,
double  pMin[3],
double  pMax[3],
double  pPreQ[4],
double  pPostQ[4],
int pActiveMask,
eHIKRotationOrder pRotationOrder 
)

Retrieve the limits set for Node pNodeId.

Parameters
pCharacterThe character you want to query.
pNodeIdThe unique ID of the Node you want to query. See the HIKNodeId enumeration for possible values.
pMinThe minimum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes are stored in this array depends on the value set for the pRotationOrder parameter.
pMaxThe maximum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes are stored in this array depends on the value set for the pRotationOrder parameter.
pPreQA quaternion that defines the pre-rotation offset, which HumanIK will apply to the rotation of this Node before testing whether the orientation of the Node lies within the minimum and maximum limits.
pPostQA quaternion that defines the post-rotation offset, which HumanIK will apply to the rotation of this Node after testing whether the orientation of the Node lies within the minimum and maximum limits.
pActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values.
pRotationOrderAn element from the HIKRotationOrder enumeration that indicates the order in which the X, Y and Z axes are listed in the pMin and pMax parameters.
void HIKGetLimitsfv ( const HIKCharacter pCharacter,
int  pNodeId,
float  pMin[3],
float  pMax[3],
float  pPreQ[4],
float  pPostQ[4],
int pActiveMask,
eHIKRotationOrder pRotationOrder 
)

Retrieve the limits set for Node pNodeId.

Parameters
pCharacterThe character you want to query.
pNodeIdThe unique ID of the Node you want to query. See the HIKNodeId enumeration for possible values.
pMinThe minimum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes are stored in this array depends on the value set for the pRotationOrder parameter.
pMaxThe maximum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes are stored in this array depends on the value set for the pRotationOrder parameter.
pPreQA quaternion that defines the pre-rotation offset, which HumanIK will apply to the rotation of this Node before testing whether the orientation of the Node lies within the minimum and maximum limits.
pPostQA quaternion that defines the post-rotation offset, which HumanIK will apply to the rotation of this Node after testing whether the orientation of the Node lies within the minimum and maximum limits.
pActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values.
pRotationOrderAn element from the HIKRotationOrder enumeration that indicates the order in which the X, Y and Z axes are listed in the pMin and pMax parameters.
void HIKSetLimitsdv ( HIKCharacter pCharacter,
int  pNodeId,
const double  pMin[3],
const double  pMax[3],
const double  pPreQ[4],
const double  pPostQ[4],
int  pActiveMask,
eHIKRotationOrder  pRotationOrder 
)

Set up limits for Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node you want to set up. See the HIKNodeId enumeration for possible values.
pMinDetermines the minimum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes should be represented in this array depends on the value set for the pRotationOrder parameter.
pMaxDetermines the maximum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes should be represented in this array depends on the value set for the pRotationOrder parameter.
pPreQA quaternion that defines the pre-rotation offset, which HumanIK will apply to the rotation of this Node before testing whether the orientation of the Node lies within the minimum and maximum limits.
pPostQA quaternion that defines the post-rotation offset, which HumanIK will apply to the rotation of this Node after testing whether the orientation of the Node lies within the minimum and maximum limits.
pActiveMaskBit mask that determines which axes are activated. This mask may include any one or more of the elements in the HIKLimitActiveMask enumeration. You can combine multiple values using the | operator (bitwise OR).
pRotationOrderAn element from the HIKRotationOrder enumeration that indicates the order in which the X, Y and Z axes are listed in the pMin and pMax parameters. This rotation order also determines the order in which HumanIK calculates Euler rotations. Changing this order can help to avoid or alleviate issues with gimbal locking.

HumanIK always interprets the first axis in this rotation order as the roll axis for the Node. This axis should align with the bone attached to the joint, controlling the way that bone rolls or twists around its center.
void HIKSetLimitsfv ( HIKCharacter pCharacter,
int  pNodeId,
const float  pMin[3],
const float  pMax[3],
const float  pPreQ[4],
const float  pPostQ[4],
int  pActiveMask,
eHIKRotationOrder  pRotationOrder 
)

Set up limits for Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node you want to set up. See the HIKNodeId enumeration for possible values.
pMinDetermines the minimum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes should be represented in this array depends on the value set for the pRotationOrder parameter.
pMaxDetermines the maximum rotation, in radians, that the joint can achieve around each axis. The order in which the X, Y and Z axes should be represented in this array depends on the value set for the pRotationOrder parameter.
pPreQA quaternion that defines the pre-rotation offset, which HumanIK will apply to the rotation of this Node before testing whether the orientation of the Node lies within the minimum and maximum limits.
pPostQA quaternion that defines the post-rotation offset, which HumanIK will apply to the rotation of this Node after testing whether the orientation of the Node lies within the minimum and maximum limits.
pActiveMaskBit mask that determines which axes are activated. This mask may include any one or more of the elements in the HIKLimitActiveMask enumeration. You can combine multiple values using the | operator (bitwise OR).
pRotationOrderAn element from the HIKRotationOrder enumeration that indicates the order in which the X, Y and Z axes are listed in the pMin and pMax parameters. This rotation order also determines the order in which HumanIK calculates Euler rotations. Changing this order can help to avoid or alleviate issues with gimbal locking.

HumanIK always interprets the first axis in this rotation order as the roll axis for the Node. This axis should align with the bone attached to the joint, controlling the way that bone rolls or twists around its center.
void HIKSetMaxXYZRotationdv ( HIKCharacter pCharacter,
int  pNodeId,
const double  pMax[3],
int  pMaxActiveMask 
)

Set the maximum rotation for the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set a maximum rotation. See the HIKNodeId enumeration for possible values.
pMaxThe maximum rotation to allow for this Node. This is a vector in radians.
pMaxActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values. You can combine multiple values using the bitwise "OR" operator.
+ Examples:
void HIKSetMaxXYZRotationfv ( HIKCharacter pCharacter,
int  pNodeId,
const float  pMax[3],
int  pMaxActiveMask 
)

Set the maximum rotation for the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set a maximum rotation. See the HIKNodeId enumeration for possible values.
pMaxThe maximum rotation to allow for this Node. This is a vector in radians.
pMaxActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values. You can combine multiple values using the bitwise "OR" operator.
void HIKSetMinXYZRotationdv ( HIKCharacter pCharacter,
int  pNodeId,
const double  pMin[3],
int  pMinActiveMask 
)

Set the minimum rotation for the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set a minimum rotation. See the HIKNodeId enumeration for possible values.
pMinThe minimum rotation to allow for this Node. This is a vector in radians.
pMinActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values. You can combine multiple values using the bitwise "OR" operator.
+ Examples:
void HIKSetMinXYZRotationfv ( HIKCharacter pCharacter,
int  pNodeId,
const float  pMin[3],
int  pMinActiveMask 
)

Set the minimum rotation for the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set a minimum rotation. See the HIKNodeId enumeration for possible values.
pMinThe minimum rotation to allow for this Node. This is a vector in radians.
pMinActiveMaskBit mask that determines which axes are activated. See the HIKLimitActiveMask enumeration for possible values. You can combine multiple values using the bitwise "OR" operator.
void HIKSetPostQdv ( HIKCharacter pCharacter,
int  pNodeId,
const double  pPostQ[4] 
)

Apply the post rotation pPostQ to the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set the post rotation. See the HIKNodeId enumeration for possible values.
pPostQThe post rotation to apply. This is a quaternion that must be normalized.
+ Examples:
void HIKSetPostQfv ( HIKCharacter pCharacter,
int  pNodeId,
const float  pPostQ[4] 
)

Apply the post rotation pPostQ to the Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set the post rotation. See the HIKNodeId enumeration for possible values.
pPostQThe post rotation to apply. This is a quaternion that must be normalized.
void HIKSetPreQdv ( HIKCharacter pCharacter,
int  pNodeId,
const double  pPreQ[4] 
)

Apply the pre rotation pPreQ to Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set the pre rotation. See the HIKNodeId enumeration for possible values.
pPreQThe pre rotation to apply. This is a quaternion that must be normalized.
+ Examples:
void HIKSetPreQfv ( HIKCharacter pCharacter,
int  pNodeId,
const float  pPreQ[4] 
)

Apply the pre rotation pPreQ to Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set the pre rotation. See the HIKNodeId enumeration for possible values.
pPreQThe pre rotation to apply. This is a quaternion that must be normalized.
void HIKSetRotationOrder ( HIKCharacter pCharacter,
int  pNodeId,
eHIKRotationOrder  pRotationOrder 
)

Sets the order in which the axes are specified in the limits set for Node pNodeId.

Parameters
pCharacterThe character you want to set up.
pNodeIdThe unique ID of the Node for which you want to set the rotation order. See the HIKNodeId enumeration for possible values.
pRotationOrderThe rotation order to set. See the HIKRotationOrder enumeration for possible values.
+ Examples:
void HIKSetTranslationLimitsd ( HIKCharacter pCharacter,
int  pNodeId,
double  pMin,
double  pMax,
bool  pActive 
)

Set the translation limits for Node pNodeId.

Parameters
pCharacterThe character you want to set the translation limits on.
pNodeIdThe unique ID of the Node you want to set. See the HIKNodeId enumeration for possible values.
pMinThe minimum length that the joint can squash to.
pMaxThe maximum length that the joint can stretch to.
pActiveIndicates whether translation limits sjhould be activated or not for this joint.
void HIKSetTranslationLimitsf ( HIKCharacter pCharacter,
int  pNodeId,
float  pMin,
float  pMax,
bool  pActive 
)

Set the translation limits for Node pNodeId.

Parameters
pCharacterThe character you want to set the translation limits on.
pNodeIdThe unique ID of the Node you want to set. See the HIKNodeId enumeration for possible values.
pMinThe minimum length that the joint can squash to.
pMaxThe maximum length that the joint can stretch to.
pActiveIndicates whether translation limits sjhould be activated or not for this joint.
+ Examples: