Public Member Functions | Public Attributes

KPriFCurveKeyAttr Struct Reference

Search for all occurrences

Detailed Description

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.

Definition at line 399 of file kfcurve.h.

#include <kfcurve.h>

List of all members.

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

Constructor & Destructor Documentation

KPriFCurveKeyAttr ( ) [inline]

Definition at line 401 of file kfcurve.h.

: mFlags(0) {}

Member Function Documentation

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

Definition at line 2677 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetInterpolation ( kFCurveInterpolation  pInterpolation )
KFBX_FCURVE_INLINE kFCurveConstantMode GetConstantMode ( ) const

Definition at line 2731 of file kfcurve.h.

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.

KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode ( ) const

Definition at line 2834 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetConstantMode ( kFCurveConstantMode  pMode )
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

Definition at line 2986 of file kfcurve.h.

{
    return ( (float *)&mData[0])[pIndex];
}
KFBX_FCURVE_INLINE void SetDataFloat ( EKFCurveDataIndex  pIndex,
float  pValue 
)

Definition at line 2996 of file kfcurve.h.

{
    ((float *)&mData[0])[pIndex] = pValue;
}
KFBX_FCURVE_INLINE float * GetDataPtr ( ) const

Definition at line 3006 of file kfcurve.h.

{
    return (float*)mData;
}
KFBX_FCURVE_INLINE void SetSelected ( bool  pSelected )
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 )
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.

KFBX_FCURVE_INLINE void SetBreak ( bool  pVal )
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 ( )

Definition at line 3226 of file kfcurve.h.

{
    ++mRefCount;
}
KFBX_FCURVE_INLINE void DecRefCount ( )

Definition at line 3231 of file kfcurve.h.

{
    --mRefCount;
}
KFBX_FCURVE_INLINE kUInt32 GetRefCount ( ) const

Definition at line 3236 of file kfcurve.h.

{
    return mRefCount;
}

Member Data Documentation

Definition at line 447 of file kfcurve.h.

float mData[4]

Definition at line 449 of file kfcurve.h.

Definition at line 455 of file kfcurve.h.


The documentation for this struct was generated from the following file: