KPriFCurveKeyAttr stores the additional attributes for KFCurveKey.
For most motion capture curves, all the keys will have default attribute values. It is not necessary to store those default value for each key. See KFCurveKey for all function documentation.
#include <kfcurve.h>
Public Member Functions |
|
KPriFCurveKeyAttr () | |
KFBX_FCURVE_INLINE void | Set (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) |
KFBX_FCURVE_INLINE void | SetTCB (float pData0=0.0f, float pData1=0.0f, float pData2=0.0f) |
KFBX_FCURVE_INLINE void | Set (KFCurveKey &pSource) |
KFBX_FCURVE_INLINE kFCurveInterpolation |
GetInterpolation () const |
KFBX_FCURVE_INLINE void | SetInterpolation (kFCurveInterpolation pInterpolation) |
KFBX_FCURVE_INLINE kFCurveConstantMode |
GetConstantMode () const |
KFBX_FCURVE_INLINE kFCurveTangeantMode |
GetTangeantMode (bool pIncludeOverrides=false) const |
KFBX_FCURVE_INLINE kFCurveTangeantWeightMode |
GetTangeantWeightMode () const |
KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode |
GetTangeantVelocityMode () const |
KFBX_FCURVE_INLINE void | SetConstantMode (kFCurveConstantMode pMode) |
KFBX_FCURVE_INLINE void | SetTangeantMode (kFCurveTangeantMode pTangent, bool pIgnoreAutoTimeIndepedentConversion=false) |
KFBX_FCURVE_INLINE void | SetTangeantWeightMode (kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL) |
KFBX_FCURVE_INLINE void | SetTangentWeightAndAdjustTangent (EKFCurveDataIndex pIndex, kFCurveDouble pWeight) |
KFBX_FCURVE_INLINE void | SetTangeantVelocityMode (kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask=KFCURVE_VELOCITY_ALL) |
KFBX_FCURVE_INLINE kFCurveDouble | GetDataDouble (EKFCurveDataIndex pIndex) const |
KFBX_FCURVE_INLINE void | SetDataDouble (EKFCurveDataIndex pIndex, kFCurveDouble pValue) |
KFBX_FCURVE_INLINE float | GetDataFloat (EKFCurveDataIndex pIndex) const |
KFBX_FCURVE_INLINE void | SetDataFloat (EKFCurveDataIndex pIndex, float pValue) |
KFBX_FCURVE_INLINE float * | GetDataPtr () const |
KFBX_FCURVE_INLINE void | SetSelected (bool pSelected) |
KFBX_FCURVE_INLINE bool | GetSelected () const |
KFBX_FCURVE_INLINE void | SetMarkedForManipulation (bool pMark) |
KFBX_FCURVE_INLINE bool | GetMarkedForManipulation () const |
KFBX_FCURVE_INLINE void | SetTangeantVisibility (kFCurveTangeantVisibility pVisibility) |
KFBX_FCURVE_INLINE kFCurveTangeantVisibility |
GetTangeantVisibility () const |
KFBX_FCURVE_INLINE void | SetBreak (bool pVal) |
KFBX_FCURVE_INLINE bool | GetBreak () const |
KFBX_FCURVE_INLINE bool | IsEqual (const KPriFCurveKeyAttr &pRsh) const |
KFBX_FCURVE_INLINE void | IncRefCount () |
KFBX_FCURVE_INLINE void | DecRefCount () |
KFBX_FCURVE_INLINE kUInt32 | GetRefCount () const |
Public Attributes |
|
kUInt32 | mFlags |
float | mData [4] |
kUInt32 | mRefCount |
KPriFCurveKeyAttr | ( | ) | [inline] |
KFBX_FCURVE_INLINE void Set | ( | 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 |
||
) |
Definition at line 2572 of file kfcurve.h.
{ K_ASSERT (pInterpolation != KFCURVE_INTERPOLATION_CUBIC || pTangeantMode != KFCURVE_TANGEANT_TCB); 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 | ( | float | pData0 = 0.0f , |
float | pData1 = 0.0f , |
||
float | pData2 =
0.0f |
||
) |
Definition at line 2649 of file kfcurve.h.
{ 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 | ) |
KFBX_FCURVE_INLINE kFCurveInterpolation GetInterpolation | ( | ) | const |
Definition at line 2677 of file kfcurve.h.
{ return mFlags & KFCURVE_INTERPOLATION_ALL; }
KFBX_FCURVE_INLINE void SetInterpolation | ( | kFCurveInterpolation | pInterpolation | ) |
Definition at line 2688 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 |
Definition at line 2731 of file kfcurve.h.
{ return mFlags & KFCURVE_CONSTANT_ALL; }
KFBX_FCURVE_INLINE kFCurveTangeantMode GetTangeantMode | ( | bool | pIncludeOverrides =
false |
) | const |
Definition at line 2741 of file kfcurve.h.
{ if( pIncludeOverrides ) { return mFlags & KFCURVE_TANGEANT_ALL; } else { return mFlags & KFCURVE_TANGEANT_TYPE_MASK; } }
KFBX_FCURVE_INLINE kFCurveTangeantWeightMode GetTangeantWeightMode | ( | ) | const |
Definition at line 2811 of file kfcurve.h.
{ return mFlags & KFCURVE_WEIGHTED_ALL; }
KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode | ( | ) | const |
Definition at line 2834 of file kfcurve.h.
{ return mFlags & KFCURVE_VELOCITY_ALL; }
KFBX_FCURVE_INLINE void SetConstantMode | ( | kFCurveConstantMode | pMode | ) |
Definition at line 2765 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 |
||
) |
Definition at line 2783 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 |
||
) |
Definition at line 2821 of file kfcurve.h.
{ pMask &= KFCURVE_WEIGHTED_ALL; mFlags = (mFlags & ~pMask) | (pTangent & pMask); }
KFBX_FCURVE_INLINE void SetTangentWeightAndAdjustTangent | ( | EKFCurveDataIndex | pIndex, |
kFCurveDouble | pWeight | ||
) |
Definition at line 2844 of file kfcurve.h.
{ #ifdef KFCURVE_FLOAT TangentWeightAndAdjustTangent(pIndex, pWeight, mData); #else TangentWeightAndAdjustTangent(pIndex, pWeight, mData, mWeight); #endif }
KFBX_FCURVE_INLINE void SetTangeantVelocityMode | ( | kFCurveTangeantVelocityMode | pTangentVelocityMode, |
kFCurveTangeantVelocityMode | pMask =
KFCURVE_VELOCITY_ALL |
||
) |
Definition at line 2862 of file kfcurve.h.
{ pMask &= KFCURVE_VELOCITY_ALL; mFlags = (mFlags & ~pMask) | (pTangent & pMask); }
KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble | ( | EKFCurveDataIndex | pIndex | ) | const |
Definition at line 2904 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 | ||
) |
Definition at line 2936 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 |
KFBX_FCURVE_INLINE void SetDataFloat | ( | EKFCurveDataIndex | pIndex, |
float | pValue | ||
) |
KFBX_FCURVE_INLINE float * GetDataPtr | ( | ) | const |
KFBX_FCURVE_INLINE void SetSelected | ( | bool | pSelected | ) |
Definition at line 3094 of file kfcurve.h.
{ mFlags = pSelected ? (mFlags & ~KFCURVE_SELECT_ALL) | KFCURVE_SELECT_POINT : (mFlags & ~KFCURVE_SELECT_ALL); }
KFBX_FCURVE_INLINE bool GetSelected | ( | ) | const |
Definition at line 3104 of file kfcurve.h.
{ return (mFlags & KFCURVE_SELECT_POINT) ? true : false; }
KFBX_FCURVE_INLINE void SetMarkedForManipulation | ( | bool | pMark | ) |
Definition at line 3114 of file kfcurve.h.
{ mFlags = pSelected ? (mFlags & ~KFCURVE_MARKED_ALL) | KFCURVE_MARKED_FOR_MANIP : (mFlags & ~KFCURVE_MARKED_ALL); }
KFBX_FCURVE_INLINE bool GetMarkedForManipulation | ( | ) | const |
Definition at line 3124 of file kfcurve.h.
{ return (mFlags & KFCURVE_MARKED_FOR_MANIP) ? true : false; }
KFBX_FCURVE_INLINE void SetTangeantVisibility | ( | kFCurveTangeantVisibility | pVisibility | ) |
Definition at line 2874 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 |
Definition at line 2894 of file kfcurve.h.
{ return mFlags & KFCURVE_TANGEANT_SHOW_BOTH; }
KFBX_FCURVE_INLINE void SetBreak | ( | bool | pVal | ) |
Definition at line 3148 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 tangeant mode." ); if(pVal) mFlags = mFlags | KFCURVE_GENERIC_BREAK ; else mFlags = mFlags & ~KFCURVE_GENERIC_BREAK ; }
KFBX_FCURVE_INLINE bool GetBreak | ( | ) | const |
Definition at line 3178 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 bool IsEqual | ( | const KPriFCurveKeyAttr & | pRsh | ) | const |
Definition at line 3208 of file kfcurve.h.
{ // To Modify, don't need to check the data for some Flags. return (this == &pRsh) || mFlags == pRsh.mFlags && mData[0] == pRsh.mData[0] && mData[1] == pRsh.mData[1] && #ifdef KFCURVE_FLOAT mData[2] == pRsh.mData[2] && mData[3] == pRsh.mData[3]; #else mWeight[0] == pRsh.mWeight[0] && mWeight[1] == pRsh.mWeight[1] && mVelocity[0] == pRsh.mVelocity[0] && mVelocity[1] == pRsh.mVelocity[1]; #endif }
KFBX_FCURVE_INLINE void IncRefCount | ( | ) |
KFBX_FCURVE_INLINE void DecRefCount | ( | ) |
KFBX_FCURVE_INLINE kUInt32 GetRefCount | ( | ) | const |
float mData[4] |