Header file for Creature solver.
This file contains solver primitives for running IK on creatures (non human and non quadrued)
Definition in file hikcreature.h.
Classes | |
struct | sHIKCreatureChainDefinition |
struct | sHIKCreatureSectionDefinition |
struct | sHIKCreatureDefinition |
Typedefs | |
typedef struct sHIKCreatureChainDefinition | HIKCreatureChainDefinition |
typedef struct sHIKCreatureSectionDefinition | HIKCreatureSectionDefinition |
typedef struct sHIKCreatureDefinition | HIKCreatureDefinition |
Functions | |
HIKCreature * | HIKCreatureCreate (const HIKCreatureDefinition *pCreatureDefinition, HIKMalloc pMalloc, const char *pValidationString) |
Create a new HIKCreature. More... | |
bool | HIKCreatureCharacterizeGeometry (HIKCreature *pCreature) |
Set up and initialize creature pCreature for solving. More... | |
bool | HIKCreatureSetCharacterizeNodeStateTQSfv (HIKCreature *pCreature, int pElementId, int pNodeId, const float pT[4], const float pQ[4], const float pS[4]) |
Set the translation, orientation and scaling for the Node pNodeId when the character is standing in the default stance. More... | |
bool | HIKCreatureSetHasParentOffset (HIKCreature *pCreature, int pChainId, int pNodeId) |
Only relevant when working in local coordinates. More... | |
bool | HIKCreatureSetHasLimits (HIKCreature *pCreature, int pChainId, int pNodeId) |
Declares a chain node implements limits. More... | |
bool | HIKCreatureSetParentOffsetfv (HIKCreature *pCreature, int pElementId, int pNodeId, const float pT[4], const float pQ[4], const float pS[4]) |
Only relevant when working in local coordinates. More... | |
bool | HIKCreatureGetParentOffsetfv (const HIKCreature *pCreature, int pElementId, int pNodeId, float pT[4], float pQ[4], float pS[4]) |
Retrieve the parent offset set for Node pNodeId . More... | |
bool | HIKCreatureSetLimitsfv (HIKCreature *pCreature, int pElementId, 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... | |
HIKCreatureState * | HIKCreatureStateCreate (const HIKCreature *pCreature, HIKMalloc pMalloc) |
Create a new HIKCreatureState. More... | |
HIKCreatureEffectorSetState * | HIKCreatureEffectorSetStateCreate (const HIKCreature *pCreature, HIKMalloc pMalloc) |
Create a new HIKCreatureEffectorSetState. More... | |
void | HIKCreatureGetDefaultState (const HIKCreature *pCreature, HIKCreatureState *pCreatureState) |
Retrieve the default natural stance for creature pCreature , storing it in HIKCreatureState pCreatureState . More... | |
void | HIKCreatureSetNodeStateTQSfv (const HIKCreature *pCreature, HIKCreatureState *pCreatureState, int pElementId, int pNodeId, const float pT[4], const float pQ[4], const float pS[4]) |
Set the translation (T), quaternion rotation (Q) and scaling (S) in global space of Node pNodeId from Chain pChainId in HIKCreatureState pCreatureState . More... | |
void | HIKCreatureGetNodeStateTQSfv (const HIKCreature *pCreature, const HIKCreatureState *pCreatureState, int pElementId, int pNodeId, float pT[4], float pQ[4], float pS[4]) |
Retrieve the translation (T), quaternion rotation (Q) and scaling (S) in global space of Node pNodeId from Chain pChainId in HIKCreatureState pCreatureState . More... | |
bool | HIKCreatureSetStateTransformTQS (const HIKCreature *pCreature, HIKCreatureState *pCreatureState, const HIKDataDescription *pDataDescription, const void *pDataSet) |
Set the translation (T), quaternion rotation (Q) and scaling (S) of multiple Nodes from data set pDataSet , interpreted according to data description pDataDescription . More... | |
bool | HIKCreatureGetStateTransformTQS (const HIKCreature *pCreature, HIKCreatureState *pCreatureState, const HIKDataDescription *pDataDescription, void *pDataSet) |
Retrieve the translation (T), quaternion rotation (Q) and scaling (S) of multiple Nodes from HIKCreatureState pCreatureState , writing them to memory in data set pDataSet according to data description pDataDescription . More... | |
void | HIKEffectorSetFromCreature (const HIKCreature *pCreature, HIKCreatureEffectorSetState *pEffectorSetState, const HIKCreatureState *pCreatureState) |
Set up HIKCreatureEffectorSetState pEffectorSetState to match creature pCreature in HIKCreatureState pCreatureState . More... | |
void | HIKCreatureGetEffectorStateTQSfv (const HIKCreatureEffectorSetState *pEffectorSetState, int pEffectorIndex, float pT[4], float pQ[4], float pS[4]) |
Retrieve the translation (T), quaternion rotation (Q) and scaling (S) in global space of Effector pEffectorIndex in HIKCreatureEffectorSetState pEffectorSetState . More... | |
void | HIKCreatureSetEffectorStateTQSfv (HIKCreatureEffectorSetState *pEffectorSetState, int pEffectorIndex, const float pT[4], const float pQ[4], const float pS[4]) |
Set the translation (T), quaternion rotation (Q) and scaling (S) in global space of Effector pEffectorIndex in HIKCreatureEffectorSetState pEffectorSetState . More... | |
void | HIKCreatureSetTranslationActive (HIKCreatureEffectorSetState *pEffectorSetState, int pEffectorIndex, float pValue) |
Set the Reach Translation constraint for Effector pEffectorIndex . More... | |
void | HIKCreatureSetRotationActive (HIKCreatureEffectorSetState *pEffectorSetState, int pEffectorIndex, float pValue) |
Set the Reach Rotation constraint for Effector pEffectorIndex . More... | |
void | HIKCreatureSetPull (HIKCreatureEffectorSetState *pEffectorSetState, int pEffectorIndex, float pValue) |
Set the Pull constraint for Effector pEffectorIndex . More... | |
void | HIKCreatureSolveForEffectorSet (HIKCreature *pCreature, HIKCreatureState *pCreatureState, HIKCreatureEffectorSetState *pEffectorSetState) |
Solve creature pCreature with HIKCreatureEffectorSetState pEffectorSetState and initial HIKCreatureState pCreatureState , storing results in pCreatureState . More... | |
void | HIKCreatureSetChainStiffness (HIKCreature *pCreature, int pChainId, float pValue) |
Sets how stiff a chain should behave (* Only relevant when doing FBIK) More... | |
void | HIKCreatureSetChainCompressionResistance (HIKCreature *pCreature, int pChainId, float pValue) |
Sets how resistant a chain should behave when being compressed (* Only relevant when doing FBIK) More... | |
void | HIKCreatureSetSectionExtraPull (HIKCreature *pCreature, int pSectionId, float pValue) |
Sets how a section should emphasizes its pull (* Only relevant when doing FBIK) More... | |
void | HIKCreatureEnableFBIK (HIKCreatureEffectorSetState *pEffectorSetState, bool pValue) |
Enable or disable FullBodyIK solving on the creature. More... | |
void | HIKCreatureEnableTorque (HIKCreatureEffectorSetState *pEffectorSetState, bool pValue) |
Enable or disable torque solving on the creature (* Only relevant when doing FBIK) More... | |
void | HIKCreatureSetChainSolvingType (HIKCreature *pCreature, int pChainId, HIKChainSolvingType pValue) |
Set solving type for a specific chain in the creature. More... | |
void | HIKCreatureSetChainProperty (HIKCreature *pCreature, int pChainId, int pPropertyIndex, float pValue) |
Set property for a specific chain in the creature. More... | |
int | HIKCreatureGetChainParentSectionIndex (HIKCreature *pCreature, int pChainId) |
Get parent section index for a chain. More... | |
void | HIKCreatureDestroy (HIKCreature *pCreature, HIKFree pFree) |
Destroy HIKCreature pCreature . More... | |
void | HIKCreatureEffectorSetStateDestroy (HIKCreatureEffectorSetState *pEffectorSetState, HIKFree pFree) |
Destroy HIKCreatureEffectorSetState pEffectorSetState . More... | |
void | HIKCreatureStateDestroy (HIKCreatureState *pCreatureState, HIKFree pFree) |
Destroy HIKCreatureState pCreatureState . More... | |
float | HIKCreatureGetChainLastPull (HIKCreature *pCreature, int pChainId) |
float | HIKCreatureGetChainLastPullLength (HIKCreature *pCreature, int pChainId) |
float | HIKCreatureGetChainLastChainWeightsT (HIKCreature *pCreature, int pChainId) |
void | HIKCreatureGetChainLastChainPullDir (HIKCreature *pCreature, int pChainId, int pIter, float pT[4]) |
float | HIKCreatureGetChainLastChainErrT (HIKCreature *pCreature, int pChainId, int pIter) |
void | HIKCreatureGetChainLastChainErrQ (HIKCreature *pCreature, int pChainId, int pIter, float pQ[4]) |
void | HIKCreatureGetSectionLastSumErr (HIKCreature *pCreature, int pSectionId, int pIter, float pT[4]) |
float | HIKCreatureGetSectionLastSectionErrWeightT (HIKCreature *pCreature, int pSectionId, int pIter) |
float | HIKCreatureGetSectionLastSectionWeights (HIKCreature *pCreature, int pSectionId, int pIter) |
void | HIKCreatureGetSectionLastSectionErrQPull (HIKCreature *pCreature, int pSectionId, int pIter, float pQ[4]) |
void | HIKCreatureGetSectionLastSectionErrQReach (HIKCreature *pCreature, int pSectionId, int pIter, float pQ[4]) |
typedef struct sHIKCreatureChainDefinition HIKCreatureChainDefinition |
typedef struct sHIKCreatureDefinition HIKCreatureDefinition |
typedef struct sHIKCreatureSectionDefinition HIKCreatureSectionDefinition |
enum HIKChainSolvingType |
Definition at line 128 of file hikcreature.h.
enum HIKParamTentacleCCD |
Definition at line 150 of file hikcreature.h.
enum HIKParamTwoBonesIK |
Enumerator | |
---|---|
HIKParamTwoBonesIK_FoldingJointIndex |
Index of the joint to fold in the chain (top = 0); default is 1. |
Definition at line 144 of file hikcreature.h.
bool HIKCreatureCharacterizeGeometry | ( | HIKCreature * | pCreature | ) |
Set up and initialize creature pCreature
for solving.
Call this function after you have called HIKCreatureSetCharacterizeNodeStatefv() for all your creature's Nodes. This function finalizes the default stance and calibrates the engine.
pCcreature | Creature to set up and initialize. |
void HIKCreatureEnableFBIK | ( | HIKCreatureEffectorSetState * | pEffectorSetState, |
bool | pValue | ||
) |
Enable or disable FullBodyIK solving on the creature.
pEffectorSetState | The EffectorSetState you want to set up. |
pValue | Set to TRUE to enable FBIK solving; Set to FALSE to disable FBIK solving |
void HIKCreatureEnableTorque | ( | HIKCreatureEffectorSetState * | pEffectorSetState, |
bool | pValue | ||
) |
Enable or disable torque solving on the creature (* Only relevant when doing FBIK)
pEffectorSetState | The EffectorSetState you want to set up. |
pValue | Set to TRUE to enable torque solving; Set to FALSE to disable torque solving |
void HIKCreatureGetChainLastChainErrQ | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pIter, | ||
float | pQ[4] | ||
) |
float HIKCreatureGetChainLastChainErrT | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pIter | ||
) |
void HIKCreatureGetChainLastChainPullDir | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pIter, | ||
float | pT[4] | ||
) |
float HIKCreatureGetChainLastChainWeightsT | ( | HIKCreature * | pCreature, |
int | pChainId | ||
) |
float HIKCreatureGetChainLastPull | ( | HIKCreature * | pCreature, |
int | pChainId | ||
) |
float HIKCreatureGetChainLastPullLength | ( | HIKCreature * | pCreature, |
int | pChainId | ||
) |
int HIKCreatureGetChainParentSectionIndex | ( | HIKCreature * | pCreature, |
int | pChainId | ||
) |
Get parent section index for a chain.
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain to set up. |
void HIKCreatureGetDefaultState | ( | const HIKCreature * | pCreature, |
HIKCreatureState * | pCreatureState | ||
) |
Retrieve the default natural stance for creature pCreature
, storing it in HIKCreatureState pCreatureState
.
This function always returns the same stance for the given creature. The default stance does not differ before and after you perform a solve.
pCreature | Creature whose default stance is to be retrieved. | |
[out] | pCreatureState | HIKCreatureState to contain the default stance. |
void HIKCreatureGetNodeStateTQSfv | ( | const HIKCreature * | pCreature, |
const HIKCreatureState * | pCreatureState, | ||
int | pElementId, | ||
int | pNodeId, | ||
float | pT[4], | ||
float | pQ[4], | ||
float | pS[4] | ||
) |
Retrieve the translation (T), quaternion rotation (Q) and scaling (S) in global space of Node pNodeId
from Chain pChainId
in HIKCreatureState pCreatureState
.
Values are expressed using separate arrays.
pCreature | HIKCharacter from which you want to retrieve the translation, rotation, and scaling values. | |
pCreatureState | HIKCharacterState from which you want to retrieve the translation, rotation, and scaling values. | |
pElementId | Unique ID of the Element whose data you want to set (chainId or -sectionId-1) | |
pNodeId | Unique ID of the Node whose data you want to retrieve. | |
[out] | pT | Translation value retrieved, in global space. |
[out] | pQ | Rotation value retrieved, in global space. |
[out] | pS | Scaling value retrieved, in global space. |
bool HIKCreatureGetParentOffsetfv | ( | const HIKCreature * | pCreature, |
int | pElementId, | ||
int | pNodeId, | ||
float | pT[4], | ||
float | pQ[4], | ||
float | pS[4] | ||
) |
Retrieve the parent offset set for Node pNodeId
.
This function is needed only if the parent joint is unknown to HumanIK, and if you are using either local space transforms or limits (DoF).
pCreature | The character you want to get. |
pElementId | The unique ID of the Element that you want to set up (ChainId or -SectionId-1). |
pNodeId | The unique ID of the Node that you want to set up. |
pT | The parent node translation offset. |
pQ | The parent node rotation offset, expressed as a quaternion. |
pS | The parent node scaling offset. |
void HIKCreatureGetSectionLastSectionErrQPull | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
int | pIter, | ||
float | pQ[4] | ||
) |
void HIKCreatureGetSectionLastSectionErrQReach | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
int | pIter, | ||
float | pQ[4] | ||
) |
float HIKCreatureGetSectionLastSectionErrWeightT | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
int | pIter | ||
) |
float HIKCreatureGetSectionLastSectionWeights | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
int | pIter | ||
) |
void HIKCreatureGetSectionLastSumErr | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
int | pIter, | ||
float | pT[4] | ||
) |
bool HIKCreatureGetStateTransformTQS | ( | const HIKCreature * | pCreature, |
HIKCreatureState * | pCreatureState, | ||
const HIKDataDescription * | pDataDescription, | ||
void * | pDataSet | ||
) |
Retrieve the translation (T), quaternion rotation (Q) and scaling (S) of multiple Nodes from HIKCreatureState pCreatureState
, writing them to memory in data set pDataSet
according to data description pDataDescription
.
This function is faster than retrieving the data for each Node individually using functions such as HIKCreatureGetNodeStateTQS().
pCreature | HIKCreature from which you want to retrieve the data values. | |
pCreatureState | HIKCreatureState from which you want to retrieve the data values. | |
pDataDescription | Data description defining the memory layout of your data set. | |
[out] | pDataSet | Void pointer to the beginning of your first data block. |
void HIKCreatureSetChainCompressionResistance | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
float | pValue | ||
) |
Sets how resistant a chain should behave when being compressed (* Only relevant when doing FBIK)
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain to set up. |
pValue | The resistance to compression (0.0 means no resistance, 1.0 means maximal resistance) |
void HIKCreatureSetChainProperty | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pPropertyIndex, | ||
float | pValue | ||
) |
Set property for a specific chain in the creature.
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain to set up. |
pPropertyIndex | Property index |
pValue | Chain solving type (see enum above) |
void HIKCreatureSetChainSolvingType | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
HIKChainSolvingType | pValue | ||
) |
Set solving type for a specific chain in the creature.
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain to set up. |
pValue | Chain solving type (see enum above) |
void HIKCreatureSetChainStiffness | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
float | pValue | ||
) |
Sets how stiff a chain should behave (* Only relevant when doing FBIK)
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain to set up. |
pValue | The stiffness (0.0 means no stiffnes, 1.0 means maximal stiffness) |
bool HIKCreatureSetCharacterizeNodeStateTQSfv | ( | HIKCreature * | pCreature, |
int | pElementId, | ||
int | pNodeId, | ||
const float | pT[4], | ||
const float | pQ[4], | ||
const float | pS[4] | ||
) |
Set the translation, orientation and scaling for the Node pNodeId
when the character is standing in the default stance.
pCreature | The creature you want to set up. |
pElementId | The unique ID of the Element that you want to set up (ChainId or -SectionId-1). |
pNodeId | The unique ID of the Node that you want to set up. |
pT | Default stance translation for this joint in global space. |
pQ | Default stance orientation for this joint in global space, expressed as a quaternion. |
pS | Default stance scale for this joint in global space. |
bool HIKCreatureSetHasLimits | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pNodeId | ||
) |
Declares a chain node implements limits.
Has to be called before HIKCreatureCharacterizeGeometry(...) Number of limits for a Chain should be declared in the HIKCreatureChainDefinition structure first.
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain that you want to set up. |
pNodeId | The unique ID of the Node that you want to set up. |
bool HIKCreatureSetHasParentOffset | ( | HIKCreature * | pCreature, |
int | pChainId, | ||
int | pNodeId | ||
) |
Only relevant when working in local coordinates.
Declares a parent offset for a chain node. Has to be called before HIKCreatureCharacterizeGeometry(...) Number of parent offsets for a Chain should be declared in the HIKCreatureChainDefinition structure first.
pCreature | The creature you want to set up. |
pChainId | The unique ID of the Chain that you want to set up. |
pNodeId | The unique ID of the Node that you want to set up. |
bool HIKCreatureSetLimitsfv | ( | HIKCreature * | pCreature, |
int | pElementId, | ||
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
.
pCreature | The creature you want to set up. |
pElementId | The unique ID of the Element that you want to set up (ChainId or -SectionId-1). |
pNodeId | The unique ID of the Node that you want to set up. |
pMin | Determines 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. |
pMax | Determines 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. |
pPreQ | A 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. |
pPostQ | A 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. |
pActiveMask | Bit 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). |
pRotationOrder | An 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 HIKCreatureSetNodeStateTQSfv | ( | const HIKCreature * | pCreature, |
HIKCreatureState * | pCreatureState, | ||
int | pElementId, | ||
int | pNodeId, | ||
const float | pT[4], | ||
const float | pQ[4], | ||
const float | pS[4] | ||
) |
Set the translation (T), quaternion rotation (Q) and scaling (S) in global space of Node pNodeId
from Chain pChainId
in HIKCreatureState pCreatureState
.
Values are expressed using separate arrays.
pCreature | HIKCreature for which you want to set the translation, rotation and scaling values. |
pCreatureState | HIKCreatureState in which you want to set the translation, rotation and scaling values. |
pElementId | Unique ID of the Element whose data you want to set (chainId or -sectionId-1) |
pNodeId | Unique ID of the Node whose data you want to set. |
pT | Translation value to set, in global space. |
pQ | Rotation value to set, in global space. |
pS | Scaling value to set, in global space. |
bool HIKCreatureSetParentOffsetfv | ( | HIKCreature * | pCreature, |
int | pElementId, | ||
int | pNodeId, | ||
const float | pT[4], | ||
const float | pQ[4], | ||
const float | pS[4] | ||
) |
Only relevant when working in local coordinates.
Set the parent offset for Node pNodeId
.
This function is needed only if the parent joint is unknown to HumanIK
pCreature | The creature you want to set up. |
pElementId | The unique ID of the Element that you want to set up (ChainId or -SectionId-1). |
pNodeId | The unique ID of the Node that you want to set up. |
pT | The parent node translation offset, relative to the next HumanIK Node above the parent in the joint chain. |
pQ | The parent node rotation offset, expressed as a quaternion., relative to the next HumanIK Node above the parent in the joint chain. This value must be normalized. You can calculate this offset as follows: pParentQOffset = inverse(HIKParentGQ) * RealParentGQwhere:
|
pS | The parent node scaling offset, relative to the next HumanIK Node above the parent in the joint chain. |
void HIKCreatureSetSectionExtraPull | ( | HIKCreature * | pCreature, |
int | pSectionId, | ||
float | pValue | ||
) |
Sets how a section should emphasizes its pull (* Only relevant when doing FBIK)
pCreature | The creature you want to set up. |
pSectionId | The unique ID of the Section to set up. |
pValue | The extra pull factor (0.0 means no extra pull (default)) |
bool HIKCreatureSetStateTransformTQS | ( | const HIKCreature * | pCreature, |
HIKCreatureState * | pCreatureState, | ||
const HIKDataDescription * | pDataDescription, | ||
const void * | pDataSet | ||
) |
Set the translation (T), quaternion rotation (Q) and scaling (S) of multiple Nodes from data set pDataSet
, interpreted according to data description pDataDescription
.
This function is faster than setting the data for each Node individually using functions such as HIKCreatureSetNodeStateTQS().
pCreature | HIKCreature for which you want to set the data values. |
pCreatureState | HIKCreatureState in which you want to set the data values. |
pDataDescription | Data description defining the memory layout of your data set. |
pDataSet | Void pointer to the beginning of your first data block. |