#include
<kfbxanimcurvekfcurve.h>
This class, for the time being, encapsulates the old KFCurve structure. However, in a near future, this will become the main animation curve object of the SDK and the implementation is subject to change.
Definition at line 412 of file kfbxanimcurvekfcurve.h.
Key management. |
|
void | ResizeKeyBuffer (int pKeyCount) |
Resize curve buffer to hold a certain number
of key. |
|
void | KeyModifyBegin () |
Call this function prior to modifying the
keys of this curve. |
|
void | KeyModifyEnd () |
Call this function after modification of the
keys of this curve. |
|
void | KeyShrink () |
Minimize use of buffer memory. |
|
virtual void | KeyClear () |
Remove all the keys and free buffer memory.
|
|
virtual int | KeyGetCount () const |
Get the number of keys. |
|
int | KeyAdd (KTime pTime, KFbxAnimCurveKeyBase &pKey, int *pLast=NULL) |
Add a key at given time. |
|
int | KeyAdd (KTime pTime, int *pLast=NULL) |
Add a key at given time. |
|
bool | KeySet (int pIndex, KFbxAnimCurveKeyBase &pKey) |
Set key at given index. |
|
bool | KeyRemove (int pIndex) |
Remove key at given index. |
|
int | KeyInsert (KTime pTime, int *pLast=NULL) |
Insert a key at given time. |
|
double | KeyFind (KTime pTime, int *pLast=NULL) |
Find key index for a given time. |
|
bool | KeyScaleValue (float pMultValue) |
Scale value of all keys. |
|
bool | KeyScaleValueAndTangent (float pMultValue) |
Scale value and tangent of all keys.
|
|
Key Manipulation |
|
void | KeySet (int pKeyIndex, KTime pTime, float pValue, KFbxAnimCurveDef::EInterpolationType pInterpolation=KFbxAnimCurveDef::eINTERPOLATION_CUBIC, KFbxAnimCurveDef::ETangentMode pTangentMode=KFbxAnimCurveDef::eTANGENT_AUTO, float pData0=0.0, float pData1=0.0, KFbxAnimCurveDef::EWeightedMode pTangentWeightMode=KFbxAnimCurveDef::eWEIGHTED_NONE, float pWeight0=KFbxAnimCurveDef::kDEFAULT_WEIGHT, float pWeight1=KFbxAnimCurveDef::kDEFAULT_WEIGHT, float pVelocity0=KFbxAnimCurveDef::kDEFAULT_VELOCITY, float pVelocity1=KFbxAnimCurveDef::kDEFAULT_VELOCITY) |
Set a key. |
|
void | KeySetTCB (int pKeyIndex, KTime pTime, float pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f) |
Set a key with cubic interpolation, TCB
tangent mode. |
|
KFbxAnimCurveDef::EInterpolationType | KeyGetInterpolation (int pKeyIndex) const |
Get key interpolation type. |
|
void | KeySetInterpolation (int pKeyIndex, KFbxAnimCurveDef::EInterpolationType pInterpolation) |
Set key interpolation type. |
|
KFbxAnimCurveDef::EConstantMode | KeyGetConstantMode (int pKeyIndex) const |
Get key constant mode. |
|
KFbxAnimCurveDef::ETangentMode | KeyGetTangentMode (int pKeyIndex, bool pIncludeOverrides=false) const |
Get key tangent mode. |
|
void | KeySetConstantMode (int pKeyIndex, KFbxAnimCurveDef::EConstantMode pMode) |
Set key constant mode. |
|
void | KeySetTangentMode (int pKeyIndex, KFbxAnimCurveDef::ETangentMode pTangent) |
Set key tangent mode. |
|
KFbxAnimCurveKey | KeyGet (int pIndex) const |
Get key at given index. |
|
float | KeyGetValue (int pKeyIndex) const |
Get key value. |
|
void | KeySetValue (int pKeyIndex, float pValue) |
Set key value. |
|
void | KeyIncValue (int pKeyIndex, float pValue) |
Increment key value. |
|
void | KeyMultValue (int pKeyIndex, float pValue) |
Multiply key value. |
|
void | KeyMultTangent (int pKeyIndex, float pValue) |
Multiply key tangents. |
|
virtual KTime | KeyGetTime (int pKeyIndex) const |
Get key time. |
|
virtual void | KeySetTime (int pKeyIndex, KTime pTime) |
Set key time. |
|
void | KeySetBreak (int pKeyIndex, bool pVal) |
Set/Unset Break tangent Only valid for User
and Auto keys. |
|
bool | KeyGetBreak (int pKeyIndex) const |
Get if tangent is break Only valid for User
and Auto keys. |
|
Key Tangent Management |
|
float | KeyGetLeftDerivative (int pIndex) |
Get the left derivative of a key. |
|
void | KeySetLeftDerivative (int pIndex, float pValue) |
Set the left derivative of a key. |
|
float | KeyGetLeftAuto (int pIndex, bool pApplyOvershootProtection=false) |
Get the left auto parametric of a key.
|
|
KFCurveTangeantInfo | KeyGetLeftDerivativeInfo (kFCurveIndex pIndex) |
Get the left derivative info of a key.
|
|
void | KeySetLeftDerivativeInfo (kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative=false) |
Set the left derivative info of a key.
|
|
float | KeyGetRightDerivative (int pIndex) |
Get the right derivative of a key. |
|
void | KeySetRightDerivative (int pIndex, float pValue) |
Set the right derivative of a key. |
|
float | KeyGetRightAuto (int pIndex, bool pApplyOvershootProtection=false) |
Get the right auto parametric of a key.
|
|
KFCurveTangeantInfo | KeyGetRightDerivativeInfo (kFCurveIndex pIndex) |
Get the right derivative info of a key.
|
|
void | KeySetRightDerivativeInfo (kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative=false) |
Set the right derivative info of a key.
|
|
bool | KeyIsLeftTangentWeighted (int pIndex) const |
Get the left tangent weight mode of a key.
|
|
bool | KeyIsRightTangentWeighted (int pIndex) const |
Get the right tangent weight mode of a key.
|
|
float | KeyGetLeftTangentWeight (int pIndex) const |
Get the weight value component of the left
tangent of a key. |
|
float | KeyGetRightTangentWeight (int pIndex) const |
Get the weight value component of the right
tangent of a key. |
|
void | KeySetLeftTangentWeight (int pIndex, float pWeight, bool pAdjustTan=false) |
Set the left tangent weight of a key.
|
|
void | KeySetRightTangentWeight (int pIndex, float pWeight, bool pAdjustTan=false) |
Set the right tangent weight of a key.
|
|
float | KeyGetLeftTangentVelocity (int pIndex) const |
Get the velocity value component of the left
tangent of a key. |
|
float | KeyGetRightTangentVelocity (int pIndex) const |
Get the velocity value component of the
right tangent of a key. |
|
Evaluation and Analysis |
|
virtual float | Evaluate (KTime pTime, int *pLast=NULL) |
Evaluate function curve value at a given
time. |
|
virtual float | EvaluateIndex (double pIndex) |
Evaluate function curve value at the given
key index. |
|
float | EvaluateLeftDerivative (KTime pTime, int *pLast=NULL) |
Evaluate function left derivative at given
time. |
|
float | EvaluateRightDerivative (KTime pTime, int *pLast=NULL) |
Evaluate function right derivative at given
time. |
|
Utility functions. |
|
virtual bool | GetTimeInterval (KTime &pStart, KTime &pStop) |
Find out start and end time of the animation
curve. |
|
void | SetColor (float *pColor) |
Set the display color of the KFCurve.
|
|
float * | GetColor () |
Get the display color of the KFCurve.
|
|
KFCurve * | GetKFCurve () |
Returns the pointer to KFCurve. |
|
void | CopyFrom (KFbxAnimCurve &pSource, bool pWithKeys=true) |
Copy curve content into current curve.
|
|
Public Member Functions |
|
float | GetValue () const |
Get default value. |
float GetValue | ( | ) | const |
Get default value.
Default value is used when there is no key in the function curve.
void ResizeKeyBuffer | ( | int | pKeyCount | ) | [virtual] |
Resize curve buffer to hold a certain number of key.
pKeyCount | Number of key the curve will eventually hold. |
Implements KFbxAnimCurve.
void KeyModifyBegin | ( | ) | [virtual] |
Call this function prior to modifying the keys of this curve.
Implements KFbxAnimCurve.
void KeyModifyEnd | ( | ) | [virtual] |
Call this function after modification of the keys of this curve.
Implements KFbxAnimCurve.
void KeyShrink | ( | ) |
Minimize use of buffer memory.
virtual void KeyClear | ( | ) | [virtual] |
Remove all the keys and free buffer memory.
Implements KFbxAnimCurve.
virtual int KeyGetCount | ( | ) | const [virtual] |
int KeyAdd | ( | KTime | pTime, | |
KFbxAnimCurveKeyBase & | pKey, | |||
int * | pLast = NULL |
|||
) | [virtual] |
Add a key at given time.
Function KFbxAnimCurveFCurve::KeyInsert() SHOULD be used instead if the key is to be added in the curve and not at the end. This function does not respect the interpolation type and tangents of the neighboring keys. If there is already a key at the given time, the key is modified and no new key is added.
pTime | Time to add the key. | |
pKey | Key to add. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
Add a key at given time.
pTime | Time to add the key. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
Definition at line 481 of file kfbxanimcurvekfcurve.h.
References KFbxAnimCurve::KeyAdd().
bool KeySet | ( | int | pIndex, | |
KFbxAnimCurveKeyBase & | pKey | |||
) | [virtual] |
Set key at given index.
pIndex | Index of where the key should be set | |
pKey | the key to set |
true
if key time is superior to previous key and
inferior to next key.Implements KFbxAnimCurve.
bool KeyRemove | ( | int | pIndex | ) | [virtual] |
Remove key at given index.
pIndex | Index of key to remove. |
Implements KFbxAnimCurve.
Insert a key at given time.
This function SHOULD be used instead of KFbxAnimCurveFCurve::KeyAdd() if the key is to be added in the curve and not at the end. It inserts the key in respect to the interpolation type and tangents of the neighboring keys. If there is already a key a the given time, the key is modified and no new key is added.
pTime | Time to insert the key. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
Find key index for a given time.
pTime | Time of the key looked for. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
bool KeyScaleValue | ( | float | pMultValue | ) | [virtual] |
Scale value of all keys.
pMultValue | Scale applied on key values. |
true
on success.Implements KFbxAnimCurve.
bool KeyScaleValueAndTangent | ( | float | pMultValue | ) | [virtual] |
Scale value and tangent of all keys.
pMultValue | Scale applied on key values and tangents. |
true
on success.Implements KFbxAnimCurve.
void KeySet | ( | int | pKeyIndex, | |
KTime | pTime, | |||
float | pValue, | |||
KFbxAnimCurveDef::EInterpolationType | pInterpolation =
KFbxAnimCurveDef::eINTERPOLATION_CUBIC , |
|||
KFbxAnimCurveDef::ETangentMode | pTangentMode =
KFbxAnimCurveDef::eTANGENT_AUTO , |
|||
float | pData0 = 0.0 , |
|||
float | pData1 = 0.0 , |
|||
KFbxAnimCurveDef::EWeightedMode | pTangentWeightMode =
KFbxAnimCurveDef::eWEIGHTED_NONE , |
|||
float | pWeight0 = KFbxAnimCurveDef::kDEFAULT_WEIGHT , |
|||
float | pWeight1 = KFbxAnimCurveDef::kDEFAULT_WEIGHT , |
|||
float | pVelocity0 = KFbxAnimCurveDef::kDEFAULT_VELOCITY , |
|||
float | pVelocity1 = KFbxAnimCurveDef::kDEFAULT_VELOCITY |
|||
) | [virtual] |
Set a key.
Use SetTCB() to set a key with cubic interpolation and TCB tangent type.
pKeyIndex | Key index | |
pTime | Key time. | |
pValue | Key value. | |
pInterpolation | Key interpolation type. | |
pTangentMode | Key tangent mode (meaningful for cubic interpolation only). | |
pData0 | Right slope. | |
pData1 | Next left slope. | |
pTangentWeightMode | Weight mode. | |
pWeight0 | Right slope weight. | |
pWeight1 | Next left slope weight. | |
pVelocity0 | Right velocity. | |
pVelocity1 | Next left velocity. |
Implements KFbxAnimCurve.
void KeySetTCB | ( | int | pKeyIndex, | |
KTime | pTime, | |||
float | pValue, | |||
float | pData0 = 0.0f , |
|||
float | pData1 = 0.0f , |
|||
float | pData2 = 0.0f |
|||
) | [virtual] |
Set a key with cubic interpolation, TCB tangent mode.
pKeyIndex | Key index | |
pTime | Key time. | |
pValue | Key value. | |
pData0 | Tension. | |
pData1 | Continuity. | |
pData2 | Bias. |
Implements KFbxAnimCurve.
KFbxAnimCurveDef::EInterpolationType KeyGetInterpolation | ( | int | pKeyIndex | ) | const [virtual] |
Get key interpolation type.
pKeyIndex | Key index |
Implements KFbxAnimCurve.
void KeySetInterpolation | ( | int | pKeyIndex, | |
KFbxAnimCurveDef::EInterpolationType | pInterpolation | |||
) | [virtual] |
Set key interpolation type.
pKeyIndex | Key index | |
pInterpolation | Key interpolation type. |
Implements KFbxAnimCurve.
KFbxAnimCurveDef::EConstantMode KeyGetConstantMode | ( | int | pKeyIndex | ) | const [virtual] |
Get key constant mode.
Warning: This method is meaningful for constant interpolation only. Using this method for non constant interpolated key will return unpredicted value.
pKeyIndex | Key index |
Implements KFbxAnimCurve.
KFbxAnimCurveDef::ETangentMode KeyGetTangentMode | ( | int | pKeyIndex, | |
bool | pIncludeOverrides =
false |
|||
) | const [virtual] |
Get key tangent mode.
pKeyIndex | ||
pIncludeOverrides | Warning: This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredicted value. |
Implements KFbxAnimCurve.
void KeySetConstantMode | ( | int | pKeyIndex, | |
KFbxAnimCurveDef::EConstantMode | pMode | |||
) | [virtual] |
Set key constant mode.
Warning: This method is meaningful for constant interpolation only.
pKeyIndex | Key index | |
pMode | Key constant mode. |
Implements KFbxAnimCurve.
void KeySetTangentMode | ( | int | pKeyIndex, | |
KFbxAnimCurveDef::ETangentMode | pTangent | |||
) | [virtual] |
Set key tangent mode.
Warning: This method is meaningful for cubic interpolation only.
pKeyIndex | Key index | |
pTangent | Key tangent mode. |
Implements KFbxAnimCurve.
KFbxAnimCurveKey KeyGet | ( | int | pIndex | ) | const [virtual] |
Get key at given index.
pIndex | The index. |
Implements KFbxAnimCurve.
float KeyGetValue | ( | int | pKeyIndex | ) | const [virtual] |
void KeySetValue | ( | int | pKeyIndex, | |
float | pValue | |||
) | [virtual] |
void KeyIncValue | ( | int | pKeyIndex, | |
float | pValue | |||
) | [virtual] |
Increment key value.
pKeyIndex | Key index. | |
pValue | Value by which key value is incremented. |
Implements KFbxAnimCurve.
void KeyMultValue | ( | int | pKeyIndex, | |
float | pValue | |||
) | [virtual] |
Multiply key value.
pKeyIndex | Key index. | |
pValue | Value by which the key value is multiplied. |
Implements KFbxAnimCurve.
void KeyMultTangent | ( | int | pKeyIndex, | |
float | pValue | |||
) | [virtual] |
Multiply key tangents.
Note: When multiplying a key value, tangents must be multiplied to conserve the same topology.
pKeyIndex | Key index. | |
pValue | Value by which key tangents are multiplied. |
Implements KFbxAnimCurve.
Get key time.
pKeyIndex | Key index. |
Implements KFbxAnimCurve.
Set key time.
pKeyIndex | Key index. | |
pTime | Key time (time at which this key is occurring). |
Implements KFbxAnimCurve.
void KeySetBreak | ( | int | pKeyIndex, | |
bool | pVal | |||
) | [virtual] |
Set/Unset Break tangent Only valid for User and Auto keys.
pKeyIndex | Key index. | |
pVal | Break flag. |
Implements KFbxAnimCurve.
bool KeyGetBreak | ( | int | pKeyIndex | ) | const [virtual] |
Get if tangent is break Only valid for User and Auto keys.
pKeyIndex | Key index. |
Implements KFbxAnimCurve.
float KeyGetLeftDerivative | ( | int | pIndex | ) | [virtual] |
Get the left derivative of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
void KeySetLeftDerivative | ( | int | pIndex, | |
float | pValue | |||
) | [virtual] |
Set the left derivative of a key.
pIndex | Index of key. | |
pValue | Left derivative. |
Implements KFbxAnimCurve.
float KeyGetLeftAuto | ( | int | pIndex, | |
bool | pApplyOvershootProtection =
false |
|||
) | [virtual] |
Get the left auto parametric of a key.
pIndex | Index of key. | |
pApplyOvershootProtection | Clamp is taken into account. |
Implements KFbxAnimCurve.
KFCurveTangeantInfo KeyGetLeftDerivativeInfo | ( | kFCurveIndex | pIndex | ) | [virtual] |
Get the left derivative info of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
void KeySetLeftDerivativeInfo | ( | kFCurveIndex | pIndex, | |
KFCurveTangeantInfo | pValue, | |||
bool | pForceDerivative =
false |
|||
) | [virtual] |
Set the left derivative info of a key.
pIndex | Index of key. | |
pValue | Left derivative. | |
pForceDerivative |
Implements KFbxAnimCurve.
float KeyGetRightDerivative | ( | int | pIndex | ) | [virtual] |
Get the right derivative of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
void KeySetRightDerivative | ( | int | pIndex, | |
float | pValue | |||
) | [virtual] |
Set the right derivative of a key.
pIndex | Index of key. | |
pValue | Right derivative. |
Implements KFbxAnimCurve.
float KeyGetRightAuto | ( | int | pIndex, | |
bool | pApplyOvershootProtection =
false |
|||
) | [virtual] |
Get the right auto parametric of a key.
pIndex | Index of key. | |
pApplyOvershootProtection | Clamp is taken into account. |
Implements KFbxAnimCurve.
KFCurveTangeantInfo KeyGetRightDerivativeInfo | ( | kFCurveIndex | pIndex | ) | [virtual] |
Get the right derivative info of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
void KeySetRightDerivativeInfo | ( | kFCurveIndex | pIndex, | |
KFCurveTangeantInfo | pValue, | |||
bool | pForceDerivative =
false |
|||
) | [virtual] |
Set the right derivative info of a key.
pIndex | Index of key. | |
pValue | Right derivative. | |
pForceDerivative |
Implements KFbxAnimCurve.
bool KeyIsLeftTangentWeighted | ( | int | pIndex | ) | const [virtual] |
Get the left tangent weight mode of a key.
pIndex | Index of key. |
true
if the key is weighted.Implements KFbxAnimCurve.
bool KeyIsRightTangentWeighted | ( | int | pIndex | ) | const [virtual] |
Get the right tangent weight mode of a key.
pIndex | Index of key. |
true
if the key is weighted.Implements KFbxAnimCurve.
float KeyGetLeftTangentWeight | ( | int | pIndex | ) | const [virtual] |
Get the weight value component of the left tangent of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
float KeyGetRightTangentWeight | ( | int | pIndex | ) | const [virtual] |
Get the weight value component of the right tangent of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
void KeySetLeftTangentWeight | ( | int | pIndex, | |
float | pWeight, | |||
bool | pAdjustTan = false |
|||
) | [virtual] |
Set the left tangent weight of a key.
pIndex | Index of key. | |
pWeight | Weight value. | |
pAdjustTan | When set to true , recompute the tangent height to
compensate for very small weights. |
The pAdjustTan option will only produce correct results provided that the tangent has already been set before calling this function.
Implements KFbxAnimCurve.
void KeySetRightTangentWeight | ( | int | pIndex, | |
float | pWeight, | |||
bool | pAdjustTan = false |
|||
) | [virtual] |
Set the right tangent weight of a key.
pIndex | Index of key. | |
pWeight | Weight value. | |
pAdjustTan | When set to true , recompute the tangent height to
compensate for very small weights. |
The pAdjustTan option will only produce correct results provided that the tangent has already been set before calling this function.
Implements KFbxAnimCurve.
float KeyGetLeftTangentVelocity | ( | int | pIndex | ) | const [virtual] |
Get the velocity value component of the left tangent of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
float KeyGetRightTangentVelocity | ( | int | pIndex | ) | const [virtual] |
Get the velocity value component of the right tangent of a key.
pIndex | Index of key. |
Implements KFbxAnimCurve.
Evaluate function curve value at a given time.
pTime | Time of evaluation. If time falls between two keys, function curve value is interpolated according to previous key interpolation type and tangent mode if relevant. | |
pLast | Index of the last processed key. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
virtual float EvaluateIndex | ( | double | pIndex | ) | [virtual] |
Evaluate function curve value at the given key index.
pIndex | Any value between 0 and KFCurve::KeyGetCount() - 1. If this index falls between keys, the function curve value is interpolated according to previous key interpolation type and tangent mode if relevant. |
Implements KFbxAnimCurve.
Evaluate function left derivative at given time.
pTime | Time of evaluation. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
Evaluate function right derivative at given time.
pTime | Time of evaluation. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
Implements KFbxAnimCurve.
Find out start and end time of the animation curve.
This function retrieves the Curve's time span.
pStart | Reference to receive start time. | |
pStop | Reference to receive end time. |
true
on success, false
otherwise.Implements KFbxAnimCurve.
void SetColor | ( | float * | pColor | ) |
Set the display color of the KFCurve.
pColor | The Desired color. |
float* GetColor | ( | ) |
Get the display color of the KFCurve.
KFCurve* GetKFCurve | ( | ) | [virtual] |
void CopyFrom | ( | KFbxAnimCurve & | pSource, | |
bool | pWithKeys = true |
|||
) | [virtual] |
Copy curve content into current curve.
pSource | Source curve. | |
pWithKeys | If true , clear keys in current function curve and
copy keys from source function curve. If false , keys
in current function curve are left as is. |
Implements KFbxAnimCurve.