Defines a key within an animation curve.
#include <kfcurve.h>
Public Member Functions |
|
KFCurveKey () | |
KFBX_FCURVE_INLINE void | Set (KTime pTime, kFCurveDouble pValue, kFCurveInterpolation pInterpolation=KFCURVE_INTERPOLATION_CUBIC, kFCurveTangeantMode pTangentMode=KFCURVE_TANGEANT_AUTO, kFCurveDouble pData0=0.0, kFCurveDouble pData1=0.0, kFCurveTangeantWeightMode pTangentWeightMode=KFCURVE_WEIGHTED_NONE, kFCurveDouble pWeight0=KFCURVE_DEFAULT_WEIGHT, kFCurveDouble pWeight1=KFCURVE_DEFAULT_WEIGHT, kFCurveDouble pVelocity0=KFCURVE_DEFAULT_VELOCITY, kFCurveDouble pVelocity1=KFCURVE_DEFAULT_VELOCITY) |
Set a key. |
|
KFBX_FCURVE_INLINE void | SetTCB (KTime pTime, kFCurveDouble pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f) |
Set a key with cubic interpolation, TCB
tangent mode. |
|
KFBX_FCURVE_INLINE void | Set (KFCurveKey &pSource) |
Key assignment. |
|
KFBX_FCURVE_INLINE kFCurveInterpolation |
GetInterpolation () const |
Get key's interpolation type. |
|
KFBX_FCURVE_INLINE void | SetInterpolation (kFCurveInterpolation pInterpolation) |
Set key's interpolation type. |
|
KFBX_FCURVE_INLINE kFCurveConstantMode |
GetConstantMode () const |
Get key's constant mode. |
|
KFBX_FCURVE_INLINE kFCurveTangeantMode |
GetTangeantMode (bool pIncludeOverrides=false) const |
Get key's tangent mode. |
|
KFBX_FCURVE_INLINE kFCurveTangeantWeightMode |
GetTangeantWeightMode () const |
Get key's tangent weight mode. |
|
KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode |
GetTangeantVelocityMode () const |
Get key's tangent velocity mode. |
|
KFBX_FCURVE_INLINE void | SetConstantMode (kFCurveConstantMode pMode) |
Set key's constant mode. |
|
KFBX_FCURVE_INLINE void | SetTangeantMode (kFCurveTangeantMode pTangent, bool pIgnoreAutoTimeIndepedentConversion=false) |
Set key's tangent mode. |
|
KFBX_FCURVE_INLINE void | SetTangeantWeightMode (kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL) |
Set key's tangent weight mode as double
value (cubic interpolation, non TCB tangent mode). |
|
KFBX_FCURVE_INLINE void | SetTangeantVelocityMode (kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask=KFCURVE_VELOCITY_ALL) |
Set key's tangent velocity mode as double
value (cubic interpolation, non TCB tangent mode). |
|
KFBX_FCURVE_INLINE void | SetTangentWeightAndAdjustTangent (EKFCurveDataIndex pIndex, kFCurveDouble pWeight) |
Adjust the actual tangent of the key so that
the tangent control point (tangent extremity) stays closer to where
it should be. |
|
KFBX_FCURVE_INLINE kFCurveDouble | GetDataDouble (EKFCurveDataIndex pIndex) const |
Get key data as double value (cubic
interpolation, non TCB tangent mode). |
|
KFBX_FCURVE_INLINE void | SetDataDouble (EKFCurveDataIndex pIndex, kFCurveDouble pValue) |
Set data as double value (cubic
interpolation, non TCB tangent mode). |
|
KFBX_FCURVE_INLINE float | GetDataFloat (EKFCurveDataIndex pIndex) const |
Get key data in the case of a cubic
interpolation with TCB tangent mode. |
|
KFBX_FCURVE_INLINE void | SetDataFloat (EKFCurveDataIndex pIndex, float pValue) |
Set data value in the case of a cubic
interpolation with TCB tangent mode. |
|
KFBX_FCURVE_INLINE float * | GetDataPtr () const |
Get key data as a pointer. |
|
KFBX_FCURVE_INLINE kFCurveDouble | GetValue () const |
Get key value. |
|
KFBX_FCURVE_INLINE void | SetValue (kFCurveDouble pValue) |
Set key value. |
|
KFBX_FCURVE_INLINE void | IncValue (kFCurveDouble pValue) |
Increment key value. |
|
KFBX_FCURVE_INLINE void | MultValue (kFCurveDouble pValue) |
Multiply key value. |
|
KFBX_FCURVE_INLINE KTime | GetTime () const |
Get key time. |
|
KFBX_FCURVE_INLINE void | SetTime (KTime pTime) |
Set key time. |
|
KFBX_FCURVE_INLINE void | IncTime (KTime pTime) |
Increment key time. |
|
KFBX_FCURVE_INLINE void | SetSelected (bool pSelected) |
Set if key is currently selected. |
|
KFBX_FCURVE_INLINE bool | GetSelected () const |
Return if key is currently selected.
|
|
KFBX_FCURVE_INLINE void | SetMarkedForManipulation (bool pMark) |
Set if key is currently marked for
manipulation. |
|
KFBX_FCURVE_INLINE bool | GetMarkedForManipulation () const |
Return if key is currently marked for
manipulation. |
|
KFBX_FCURVE_INLINE void | SetTangeantVisibility (kFCurveTangeantVisibility pVisibility) |
Set tangent visibility mode. |
|
KFBX_FCURVE_INLINE kFCurveTangeantVisibility |
GetTangeantVisibility () const |
Return tangent visibility mode. |
|
KFBX_FCURVE_INLINE void | SetBreak (bool pVal) |
Set or unset the tangent break. |
|
KFBX_FCURVE_INLINE bool | GetBreak () const |
Get if the tangent has a break. |
|
KFBX_FCURVE_INLINE void | Init () |
Initialize key. |
|
Friends |
|
class | KFCurve |
KFCurveKey | ( | ) | [inline] |
KFBX_FCURVE_INLINE void Set | ( | KTime | pTime, |
kFCurveDouble | pValue, | ||
kFCurveInterpolation | pInterpolation =
KFCURVE_INTERPOLATION_CUBIC , |
||
kFCurveTangeantMode | pTangentMode =
KFCURVE_TANGEANT_AUTO , |
||
kFCurveDouble | pData0 = 0.0 , |
||
kFCurveDouble | pData1 = 0.0 , |
||
kFCurveTangeantWeightMode | pTangentWeightMode =
KFCURVE_WEIGHTED_NONE , |
||
kFCurveDouble | pWeight0 =
KFCURVE_DEFAULT_WEIGHT , |
||
kFCurveDouble | pWeight1 =
KFCURVE_DEFAULT_WEIGHT , |
||
kFCurveDouble | pVelocity0 =
KFCURVE_DEFAULT_VELOCITY , |
||
kFCurveDouble | pVelocity1 =
KFCURVE_DEFAULT_VELOCITY |
||
) |
Set a key.
Use SetTCB() to set a key with cubic interpolation and TCB tangent mode.
pTime | Key time. |
pValue | Key value. |
pInterpolation | Key interpolation type. Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC |
pTangentMode | Key tangent mode (meaningful for cubic interpolation only). Valid tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK |
pData0 | Right slope. |
pData1 | Next left slope. |
pTangentWeightMode | Weight mode, if used. Weight modes are: KFCURVE_WEIGHTED_NONE, KFCURVE_WEIGHTED_RIGHT, KFCURVE_WEIGHTED_NEXT_LEFT, KFCURVE_WEIGHTED_ALL. |
pWeight0 | Right slope weight. |
pWeight1 | Next left slope weight. |
pVelocity0 | Right velocity. |
pVelocity1 | Next left velocity. |
Definition at line 2616 of file kfcurve.h.
{ K_ASSERT (pInterpolation != KFCURVE_INTERPOLATION_CUBIC || pTangeantMode != KFCURVE_TANGEANT_TCB); SetTime (pTime); SetValue (pValue); SetInterpolation (pInterpolation); SetTangeantMode (pTangeantMode); SetDataDouble (KFCURVEKEY_RIGHT_SLOPE, pData0); SetDataDouble (KFCURVEKEY_NEXT_LEFT_SLOPE, pData1); SetTangeantWeightMode (pTangeantWeightMode); SetDataDouble (KFCURVEKEY_RIGHT_WEIGHT, pWeight0); SetDataDouble (KFCURVEKEY_NEXT_LEFT_WEIGHT, pWeight1); SetDataDouble (KFCURVEKEY_RIGHT_VELOCITY, pVelocity0); SetDataDouble (KFCURVEKEY_NEXT_LEFT_VELOCITY, pVelocity1); SetTangeantVisibility (KFCURVE_TANGEANT_SHOW_NONE); }
KFBX_FCURVE_INLINE void SetTCB | ( | KTime | pTime, |
kFCurveDouble | pValue, | ||
float | pData0 = 0.0f , |
||
float | pData1 = 0.0f , |
||
float | pData2 =
0.0f |
||
) |
Set a key with cubic interpolation, TCB tangent mode.
pTime | Key time. |
pValue | Key value. |
pData0 | Tension. |
pData1 | Continuity. |
pData2 | Bias. |
Definition at line 2659 of file kfcurve.h.
{ SetTime (pTime); SetValue (pValue); SetInterpolation (KFCURVE_INTERPOLATION_CUBIC); SetTangeantMode (KFCURVE_TANGEANT_TCB); SetDataFloat (KFCURVEKEY_TCB_TENSION, pData1); SetDataFloat (KFCURVEKEY_TCB_CONTINUITY, pData2); SetDataFloat (KFCURVEKEY_TCB_BIAS, pData3); SetTangeantVisibility (KFCURVE_TANGEANT_SHOW_NONE); }
KFBX_FCURVE_INLINE void Set | ( | KFCurveKey & | pSource | ) |
Key assignment.
pSource | Source key to be copied. |
Definition at line 2672 of file kfcurve.h.
{ memcpy(this, &iSource, sizeof(KFCurveKey)); }
KFBX_FCURVE_INLINE kFCurveInterpolation GetInterpolation | ( | ) | const |
Get key's interpolation type.
Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT Constant value until next key. KFCURVE_INTERPOLATION_LINEAR Linear progression to next key. KFCURVE_INTERPOLATION_CUBIC Cubic progression to next key.
Definition at line 2682 of file kfcurve.h.
{ return mFlags & KFCURVE_INTERPOLATION_ALL; }
KFBX_FCURVE_INLINE void SetInterpolation | ( | kFCurveInterpolation | pInterpolation | ) |
Set key's interpolation type.
pInterpolation | Key interpolation type. Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC |
Definition at line 2710 of file kfcurve.h.
{ K_ASSERT_MSG( (pInterpolation == KFCURVE_INTERPOLATION_CUBIC) || (pInterpolation == KFCURVE_INTERPOLATION_LINEAR) || (pInterpolation == KFCURVE_INTERPOLATION_CONSTANT) ,"Wrong interpolation type." ); if( (((mFlags & KFCURVE_INTERPOLATION_ALL)!=KFCURVE_INTERPOLATION_CUBIC)) && pInterpolation == KFCURVE_INTERPOLATION_CUBIC ) { // Clear weighting information SetTangeantWeightMode( KFCURVE_WEIGHTED_NONE); SetDataDouble (KFCURVEKEY_RIGHT_WEIGHT, KFCURVE_DEFAULT_WEIGHT); SetDataDouble (KFCURVEKEY_NEXT_LEFT_WEIGHT, KFCURVE_DEFAULT_WEIGHT); SetTangeantVelocityMode(KFCURVE_VELOCITY_NONE); SetDataDouble( KFCURVEKEY_RIGHT_VELOCITY, KFCURVE_DEFAULT_VELOCITY); SetDataDouble( KFCURVEKEY_NEXT_LEFT_VELOCITY, KFCURVE_DEFAULT_VELOCITY); } mFlags = (mFlags & ~KFCURVE_INTERPOLATION_ALL) | (pInterpolation & KFCURVE_INTERPOLATION_ALL); }
KFBX_FCURVE_INLINE kFCurveConstantMode GetConstantMode | ( | ) | const |
Get key's constant mode.
Definition at line 2736 of file kfcurve.h.
{ return mFlags & KFCURVE_CONSTANT_ALL; }
KFBX_FCURVE_INLINE kFCurveTangeantMode GetTangeantMode | ( | bool | pIncludeOverrides =
false |
) | const |
Get key's tangent mode.
pIncludeOverrides | Include override flags: Break, Clamp, Clamp progressive, Time-Independent. This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredictable value. Tangent modes are: KFCURVE_TANGEANT_AUTO Auto key (spline cardinal). KFCURVE_TANGEANT_TCB Spline TCB (Tension, Continuity, Bias) KFCURVE_TANGEANT_USER Next slope at the left equal to slope at the right. KFCURVE_TANGEANT_BREAK Independent left and right slopes, with next slope at the left equal to slope at the right. KFCURVE_TANGEANT_AUTO_BREAK Independent left and right slopes, with auto key. |
Definition at line 2753 of file kfcurve.h.
{ if( pIncludeOverrides ) { return mFlags & KFCURVE_TANGEANT_ALL; } else { return mFlags & KFCURVE_TANGEANT_TYPE_MASK; } }
KFBX_FCURVE_INLINE kFCurveTangeantWeightMode GetTangeantWeightMode | ( | ) | const |
Get key's tangent weight mode.
This method is meaningful for cubic interpolation only. Tangent weight modes are: KFCURVE_WEIGHTED_NONE Tangent has default weights of 0.333; we define this state as not weighted. KFCURVE_WEIGHTED_RIGHT Right tangent is weighted. KFCURVE_WEIGHTED_NEXT_LEFT Left tangent is weighted. KFCURVE_WEIGHTED_ALL Both left and right tangents are weighted.
Definition at line 2816 of file kfcurve.h.
{ return mFlags & KFCURVE_WEIGHTED_ALL; }
KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode | ( | ) | const |
Get key's tangent velocity mode.
This method is meaningful for cubic interpolation only. Tangent velocity modes are: KFCURVE_VELOCITY_NONE No velocity (default). KFCURVE_VELOCITY_RIGHT Right tangent has velocity. KFCURVE_VELOCITY_NEXT_LEFT Left tangent has velocity. KFCURVE_VELOCITY_ALL Both left and right tangents have velocity.
Definition at line 2839 of file kfcurve.h.
{ return mFlags & KFCURVE_VELOCITY_ALL; }
KFBX_FCURVE_INLINE void SetConstantMode | ( | kFCurveConstantMode | pMode | ) |
Set key's constant mode.
This method is meaningful for constant interpolation only.
pMode | Key constant mode. Constant modes are: KFCURVE_CONSTANT_STANDARD Curve value is constant between this key and the next KFCURVE_CONSTANT_NEXT Curve value is constant, with next key's value |
Definition at line 2774 of file kfcurve.h.
{ K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CONSTANT) || (pMode == KFCURVE_CONSTANT_STANDARD) || (pMode == KFCURVE_CONSTANT_NEXT),"Wrong constant mode."); mFlags = (mFlags & ~KFCURVE_CONSTANT_ALL) | (pMode & KFCURVE_CONSTANT_ALL); }
KFBX_FCURVE_INLINE void SetTangeantMode | ( | kFCurveTangeantMode | pTangent, |
bool | pIgnoreAutoTimeIndepedentConversion
= false |
||
) |
Set key's tangent mode.
This method is meaningful for cubic interpolation only.
pTangent | Key tangent mode. Tangent modes are: KFCURVE_TANGEANT_AUTO Auto key (spline cardinal). KFCURVE_TANGEANT_TCB Spline TCB (Tension, Continuity, Bias) KFCURVE_TANGEANT_USER Next slope at the left equal to slope at the right. KFCURVE_TANGEANT_BREAK Independent left and right slopes, with next slope at the left equal to slope at the right. KFCURVE_TANGEANT_AUTO_BREAK Independent left and right slopes, with auto key. |
pIgnoreAutoTimeIndepedentConversion | true ignore the auto time independent conversion flag. |
Definition at line 2797 of file kfcurve.h.
{ K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) || !(pTangeant & ~KFCURVE_TANGEANT_ALL), "Wrong tangeant mode." ); K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CONSTANT) || !(pTangeant & ~KFCURVE_CONSTANT_ALL), "Wrong tangeant mode." ); // Convert Auto to Time-Independent. if (! pIgnoreAutoTimeIndepedentConversion && KFCurve::sConvertAutoTimeIndepedent && (mFlags & KFCURVE_INTERPOLATION_CUBIC) && (pTangeant & KFCURVE_TANGEANT_AUTO)) { pTangeant = pTangeant | KFCURVE_GENERIC_TIME_INDEPENDENT; } mFlags = (mFlags & ~(KFCURVE_TANGEANT_ALL|KFCURVE_CONSTANT_ALL)) | (pTangeant & (KFCURVE_TANGEANT_ALL|KFCURVE_CONSTANT_ALL) ); }
KFBX_FCURVE_INLINE void SetTangeantWeightMode | ( | kFCurveTangeantWeightMode | pTangentWeightMode, |
kFCurveTangeantWeightMode | pMask =
KFCURVE_WEIGHTED_ALL |
||
) |
Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode).
This method is meaningful for cubic interpolation only.
pTangentWeightMode | Weight mode. Values are: KFCURVE_WEIGHTED_NONE Tangent has default weights of 0.333; we define this state as not weighted. KFCURVE_WEIGHTED_RIGHT Right tangent is weighted. KFCURVE_WEIGHTED_NEXT_LEFT Left tangent is weighted. KFCURVE_WEIGHTED_ALL Both left and right tangents are weighted. |
pMask | Used to select the affected tangents. Mask values are: KFCURVE_WEIGHTED_RIGHT, KFCURVE_WEIGHTED_NEXT_LEFT, KFCURVE_WEIGHTED_ALL. |
Definition at line 2827 of file kfcurve.h.
{ pMask &= KFCURVE_WEIGHTED_ALL; mFlags = (mFlags & ~pMask) | (pTangent & pMask); }
KFBX_FCURVE_INLINE void SetTangeantVelocityMode | ( | kFCurveTangeantVelocityMode | pTangentVelocityMode, |
kFCurveTangeantVelocityMode | pMask =
KFCURVE_VELOCITY_ALL |
||
) |
Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
This method is meaningful for cubic interpolation only.
pTangentVelocityMode | Velocity mode. Values are: KFCURVE_VELOCITY_NONE No velocity (default). KFCURVE_VELOCITY_RIGHT Right tangent has velocity. KFCURVE_VELOCITY_NEXT_LEFT Left tangent has velocity. KFCURVE_VELOCITY_ALL Both left and right tangents have velocity. |
pMask | Used to select the affected tangents. Mask values are: KFCURVE_VELOCITY_RIGHT, KFCURVE_VELOCITY_NEXT_LEFT, KFCURVE_VELOCITY_ALL. |
Definition at line 2868 of file kfcurve.h.
{ pMask &= KFCURVE_VELOCITY_ALL; mFlags = (mFlags & ~pMask) | (pTangent & pMask); }
KFBX_FCURVE_INLINE void SetTangentWeightAndAdjustTangent | ( | EKFCurveDataIndex | pIndex, |
kFCurveDouble | pWeight | ||
) |
Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays closer to where it should be.
This is required because the weight value gets imprecise when it is small (it is stored as a fixed point value). This method must be called when setting the weight coming from a source where the precision is the same. It must be called after the tangent value has been set.
pIndex | FCurveDataIndex KFCURVEKEY_RIGHT_SLOPE KFCURVEKEY_NEXT_LEFT_SLOPE KFCURVEKEY_WEIGHTS KFCURVEKEY_RIGHT_WEIGHT KFCURVEKEY_NEXT_LEFT_WEIGHT KFCURVEKEY_VELOCITY KFCURVEKEY_RIGHT_VELOCITY KFCURVEKEY_NEXT_LEFT_VELOCITY KFCURVEKEY_TCB_TENSION KFCURVEKEY_TCB_CONTINUITY KFCURVEKEY_TCB_BIAS KFCURVEKEY_RIGHT_AUTO KFCURVEKEY_NEXT_LEFT_AUTO |
pWeight | New tangent weight value. |
Definition at line 2853 of file kfcurve.h.
{ #ifdef KFCURVE_FLOAT TangentWeightAndAdjustTangent(pIndex, pWeight, mData); #else TangentWeightAndAdjustTangent(pIndex, pWeight, mData, mWeight); #endif }
KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble | ( | EKFCurveDataIndex | pIndex | ) | const |
Get key data as double value (cubic interpolation, non TCB tangent mode).
Warning: Slope data is inconsistent for automatic tangent mode. Use KFCurve::EvaluateLeftDerivative() and KFCurve::EvaluateRightDerivative() to find slope values. Using this method for other than cubic interpolated key (linear, constant) will return unpredictable values. For a TCB tangent mode key, use KFCurve::GetDataFloat() instead.
pIndex | Data index: KFCURVEKEY_RIGHT_SLOPE Index of the right derivative. KFCURVEKEY_NEXT_LEFT_SLOPE Index of the left derivative for the next key. KFCURVEKEY_RIGHT_WEIGHT Index of weight on right tangent. KFCURVEKEY_NEXT_LEFT_WEIGHT Index of weight on next key's left tangent. |
Definition at line 2920 of file kfcurve.h.
{ if( pIndex < KFCURVEKEY_WEIGHTS ) { return mData[pIndex]; } else { #ifdef KFCURVE_FLOAT return (kFCurveDouble)(((kInt16*)(&mData[KFCURVEKEY_WEIGHTS]))[pIndex-KFCURVEKEY_WEIGHTS])/(kFCurveDouble)KFCURVE_WEIGHT_DIVIDER; #else return (kFCurveDouble)mWeight[pIndex-KFCURVEKEY_WEIGHTS]/(kFCurveDouble)KFCURVE_WEIGHT_DIVIDER; #endif } }
KFBX_FCURVE_INLINE void SetDataDouble | ( | EKFCurveDataIndex | pIndex, |
kFCurveDouble | pValue | ||
) |
Set data as double value (cubic interpolation, non TCB tangent mode).
Warning: Slope data is inconsistent for automatic tangent mode. Therefore, it is irrelevant to use this method on automatic tangent mode keys. Using this method for other than cubic interpolated key (linear, constant) is irrelevant. For a TCB tangent mode key, use KFCurve::SetDataFloat() instead.
pIndex | Data index: KFCURVEKEY_RIGHT_SLOPE Index of the right derivative KFCURVEKEY_NEXT_LEFT_SLOPE Index of the left derivative for the next key. KFCURVEKEY_RIGHT_WEIGHT Index of weight on right tangent. KFCURVEKEY_NEXT_LEFT_WEIGHT Index of weight on next key's left tangent. |
pValue | The data value to set (a slope or a weight). |
Definition at line 2961 of file kfcurve.h.
{ if( pIndex < KFCURVEKEY_RIGHT_WEIGHT ) { mData[pIndex] = pValue; } else { if( (pIndex == KFCURVEKEY_RIGHT_WEIGHT || pIndex == KFCURVEKEY_NEXT_LEFT_WEIGHT ) && pValue > KFCURVE_MAX_WEIGHT ) { pValue = KFCURVE_MAX_WEIGHT; } else if( (pIndex == KFCURVEKEY_RIGHT_WEIGHT || pIndex == KFCURVEKEY_NEXT_LEFT_WEIGHT ) && pValue < KFCURVE_MIN_WEIGHT ) { pValue = KFCURVE_MIN_WEIGHT; } #ifdef KFCURVE_FLOAT (((kInt16*)(&mData[KFCURVEKEY_WEIGHTS]))[pIndex-KFCURVEKEY_WEIGHTS]) = (kInt16)(pValue*KFCURVE_WEIGHT_DIVIDER); #else mWeight[pIndex-KFCURVEKEY_WEIGHTS] = pValue*KFCURVE_WEIGHT_DIVIDER; #endif } }
KFBX_FCURVE_INLINE float GetDataFloat | ( | EKFCurveDataIndex | pIndex | ) | const |
Get key data in the case of a cubic interpolation with TCB tangent mode.
Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredictable values.
pIndex | Data index: either KFCURVEKEY_TCB_TENSION Tension KFCURVEKEY_TCB_CONTINUITY Continuity, or KFCURVEKEY_TCB_BIAS Bias. |
Definition at line 2991 of file kfcurve.h.
{ return ( (float *)&mData[0])[pIndex]; }
KFBX_FCURVE_INLINE void SetDataFloat | ( | EKFCurveDataIndex | pIndex, |
float | pValue | ||
) |
Set data value in the case of a cubic interpolation with TCB tangent mode.
Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredictable values.
pIndex | Data index, either KFCURVEKEY_TCB_TENSION Tension KFCURVEKEY_TCB_CONTINUITY Continuity, or KFCURVEKEY_TCB_BIAS Bias. |
pValue | Data value to set. |
Definition at line 3001 of file kfcurve.h.
{
((float *)&mData[0])[pIndex] = pValue;
}
KFBX_FCURVE_INLINE float * GetDataPtr | ( | ) | const |
KFBX_FCURVE_INLINE kFCurveDouble GetValue | ( | ) | const |
KFBX_FCURVE_INLINE void SetValue | ( | kFCurveDouble | pValue | ) |
KFBX_FCURVE_INLINE void IncValue | ( | kFCurveDouble | pValue | ) |
KFBX_FCURVE_INLINE void MultValue | ( | kFCurveDouble | pValue | ) |
KFBX_FCURVE_INLINE KTime GetTime | ( | ) | const |
KFBX_FCURVE_INLINE void SetTime | ( | KTime | pTime | ) |
Set key time.
pTime | Key time (time at which this key is occurring). |
Definition at line 3075 of file kfcurve.h.
{ K_ASSERT_MSG( pTime != KTIME_MINUS_INFINITE && pTime != KTIME_INFINITE, "Key at infinite!" ); mTime=pTime; }
KFBX_FCURVE_INLINE void IncTime | ( | KTime | pTime | ) |
KFBX_FCURVE_INLINE void SetSelected | ( | bool | pSelected | ) |
Set if key is currently selected.
pSelected | Selection flag. |
Definition at line 3099 of file kfcurve.h.
{ mFlags = pSelected ? (mFlags & ~KFCURVE_SELECT_ALL) | KFCURVE_SELECT_POINT : (mFlags & ~KFCURVE_SELECT_ALL); }
KFBX_FCURVE_INLINE bool GetSelected | ( | ) | const |
Return if key is currently selected.
Definition at line 3109 of file kfcurve.h.
{ return (mFlags & KFCURVE_SELECT_POINT) ? true : false; }
KFBX_FCURVE_INLINE void SetMarkedForManipulation | ( | bool | pMark | ) |
Set if key is currently marked for manipulation.
pMark | Mark flag. |
Definition at line 3119 of file kfcurve.h.
{ mFlags = pSelected ? (mFlags & ~KFCURVE_MARKED_ALL) | KFCURVE_MARKED_FOR_MANIP : (mFlags & ~KFCURVE_MARKED_ALL); }
KFBX_FCURVE_INLINE bool GetMarkedForManipulation | ( | ) | const |
Return if key is currently marked for manipulation.
Definition at line 3129 of file kfcurve.h.
{ return (mFlags & KFCURVE_MARKED_FOR_MANIP) ? true : false; }
KFBX_FCURVE_INLINE void SetTangeantVisibility | ( | kFCurveTangeantVisibility | pVisibility | ) |
Set tangent visibility mode.
This would indicate what part of the tangent is visible in a graphical interface. This method is relevant for cubic interpolation only.
pVisibility | Tangent visibility mode. Tangent visibility modes are: KFCURVE_TANGEANT_SHOW_NONE No tangent is visible. KFCURVE_TANGEANT_SHOW_LEFT Left tangent is visible. KFCURVE_TANGEANT_SHOW_RIGHT Right tangent is visible. KFCURVE_TANGEANT_SHOW_BOTH Both left and right tangents are visible. |
Definition at line 2884 of file kfcurve.h.
{ K_ASSERT_MSG( (pVisibility == KFCURVE_TANGEANT_SHOW_NONE) || (pVisibility == KFCURVE_TANGEANT_SHOW_LEFT) || (pVisibility == KFCURVE_TANGEANT_SHOW_RIGHT) || (pVisibility == KFCURVE_TANGEANT_SHOW_BOTH) ,"Wrong visibility type." ); mFlags = (mFlags & ~KFCURVE_TANGEANT_SHOW_BOTH) | (pVisibility & KFCURVE_TANGEANT_SHOW_BOTH); }
KFBX_FCURVE_INLINE kFCurveTangeantVisibility GetTangeantVisibility | ( | ) | const |
Return tangent visibility mode.
This method is relevant for cubic interpolation only.
Definition at line 2899 of file kfcurve.h.
{ return mFlags & KFCURVE_TANGEANT_SHOW_BOTH; }
KFBX_FCURVE_INLINE void SetBreak | ( | bool | pVal | ) |
Set or unset the tangent break.
When this flag is set (KFCURVE_GENERIC_BREAK), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal. This method is relevant for User (KFCURVE_TANGEANT_USER) and Auto (KFCURVE_TANGEANT_AUTO) tangent modes only.
pVal | Break flag (true or false ). |
Definition at line 3163 of file kfcurve.h.
{ K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) || (GetTangeantMode() == KFCURVE_TANGEANT_BREAK) || (GetTangeantMode() == KFCURVE_TANGEANT_AUTO) || (GetTangeantMode() == KFCURVE_TANGEANT_AUTO_BREAK) || (GetTangeantMode() == KFCURVE_TANGEANT_USER) ,"Wrong tangent mode." ); if(pVal) mFlags = mFlags | KFCURVE_GENERIC_BREAK ; else mFlags = mFlags & ~KFCURVE_GENERIC_BREAK ; }
KFBX_FCURVE_INLINE bool GetBreak | ( | ) | const |
Get if the tangent has a break.
When this flag is set (KFCURVE_GENERIC_BREAK), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal. This method is relevant for User (KFCURVE_TANGEANT_USER) and Auto (KFCURVE_TANGEANT_AUTO) tangent modes only.
true
or false
).Definition at line 3193 of file kfcurve.h.
{ K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) || (GetTangeantMode() == KFCURVE_TANGEANT_BREAK) || (GetTangeantMode() == KFCURVE_TANGEANT_AUTO) || (GetTangeantMode() == KFCURVE_TANGEANT_AUTO_BREAK) || (GetTangeantMode() == KFCURVE_TANGEANT_USER) ,"Wrong tangent mode." ); if( ((mFlags & KFCURVE_GENERIC_BREAK ) == KFCURVE_GENERIC_BREAK)) return true; else return false; }
KFBX_FCURVE_INLINE void Init | ( | ) |
Initialize key.
Definition at line 3141 of file kfcurve.h.
{ mValue = 0.0; mTime = KTIME_ZERO; mFlags = 0; }
friend class KFCurve [friend] |