KFCurveKey
#include<kfcurve.h>

List of all members.

Detailed Description

Defines a key within a function curve.

Remarks:
Implementation was made for performance. Keep in mind that there is no check for consistency and memory management ever made throughout the methods' code. This class must be used with a good understanding of its interface. Default constructor is used, which does not initialize data member. If an instance has to be initialized, use functionKFCurveKey::Set().

Definition at line308of filekfcurve.h.


Public Member Functions

KFBX_FCURVE_INLINE void Set(KTimepTime, 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(KTimepTime, 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()
 Get key interpolation type.
KFBX_FCURVE_INLINE void SetInterpolation(kFCurveInterpolation pInterpolation)
 Set key interpolation type.
KFBX_FCURVE_INLINE
kFCurveConstantMode 
GetConstantMode()
 Get key constant mode.
KFBX_FCURVE_INLINE
kFCurveTangeantMode 
GetTangeantMode(bool pIncludeOverrides=false)
 Get key tangent mode.
KFBX_FCURVE_INLINE
kFCurveTangeantWeightMode 
GetTangeantWeightMode()
 Get key tangent weight mode.
KFBX_FCURVE_INLINE
kFCurveTangeantVelocityMode 
GetTangeantVelocityMode()
 Get key tangent velocity mode.
KFBX_FCURVE_INLINE void SetConstantMode(kFCurveConstantMode pMode)
 Set key constant mode.
KFBX_FCURVE_INLINE void SetTangeantMode(kFCurveTangeantMode pTangent)
 Set key tangent mode.
KFBX_FCURVE_INLINE void SetTangeantWeightMode(kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL)
 Set key 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 tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble(EKFCurveDataIndexpIndex)
 Get key data as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE void SetDataDouble(EKFCurveDataIndexpIndex, kFCurveDouble pValue)
 Set data as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE float GetDataFloat(EKFCurveDataIndexpIndex)
 Get key data as float value (cubic interpolation, TCB tangent mode).
KFBX_FCURVE_INLINE void SetDataFloat(EKFCurveDataIndexpIndex, float pValue)
 Set data as float value (cubic interpolation, TCB tangent mode).
KFBX_FCURVE_INLINE float * GetDataPtr()
 Get key data as a pointer Warning: not supported in 'double' mode.
KFBX_FCURVE_INLINE kFCurveDouble GetValue()
 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 void MultTangeant(kFCurveDouble pValue)
 Multiply key tangents.
KFBX_FCURVE_INLINEKTime GetTime()
 Get key time.
KFBX_FCURVE_INLINE void SetTime(KTimepTime)
 Set key time.
KFBX_FCURVE_INLINE void IncTime(KTimepTime)
 Increment key time.
KFBX_FCURVE_INLINE void SetSelected(bool pSelected)
 Set if key is currently selected.
KFBX_FCURVE_INLINE bool GetSelected()
 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()
 Return if key is currently marked for manipulation.
KFBX_FCURVE_INLINE void SetTangeantVisibility(kFCurveTangeantVisibility pVisibility)
 Set tangent visibility mode.
KFBX_FCURVE_INLINE
kFCurveTangeantVisibility 
GetTangeantVisibility()
 Return tangent visibility mode.
KFBX_FCURVE_INLINE void SetBreak(bool pVal)
 Set/Unset Break tangent Only valid for User and Auto keys.
KFBX_FCURVE_INLINE bool GetBreak()
 Get if tangent is break Only valid for User and Auto keys.

Member Function Documentation

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.

UseSetTCB()to set a key with cubic interpolation and TCB tangent type.

Parameters:
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). Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK
pData0 Right slope.
pData1 Next left slope.
pTangentWeightMode Weight mode if used 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 line2102of filekfcurve.h.

ReferencesKFCURVE_INTERPOLATION_CUBIC, andKFCURVE_TANGEANT_TCB.

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.

Parameters:
pTime Key time.
pValue Key value.
pData0 Tension.
pData1 Continuity.
pData2 Bias.

Definition at line2136of filekfcurve.h.

ReferencesKFCURVE_INTERPOLATION_CUBIC,KFCURVE_TANGEANT_TCB,SetDataFloat(),SetInterpolation(),SetTangeantMode(),SetTangeantVisibility(),SetTime(), andSetValue().

KFBX_FCURVE_INLINE void Set(KFCurveKeypSource ) 

Key assignment.

Parameters:
pSource Source key to be copied.

Definition at line2149of filekfcurve.h.

KFBX_FCURVE_INLINE kFCurveInterpolation GetInterpolation( ) 

Get key interpolation type.

Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

Definition at line2168of filekfcurve.h.

ReferencesKFCURVE_INTERPOLATION_ALL.

Referenced byGetBreak(),MultTangeant(),SetBreak(),SetConstantMode(), andSetTangeantMode().

KFBX_FCURVE_INLINE void SetInterpolation(kFCurveInterpolation pInterpolation ) 

Set key interpolation type.

Parameters:
pInterpolation Key interpolation type. Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

Definition at line2174of filekfcurve.h.

ReferencesKFCURVE_INTERPOLATION_ALL,KFCURVE_INTERPOLATION_CUBIC,KFCURVE_INTERPOLATION_LINEAR,SetDataDouble(),SetTangeantVelocityMode(), andSetTangeantWeightMode().

Referenced bySetTCB().

KFBX_FCURVE_INLINE kFCurveConstantMode GetConstantMode( ) 

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. Constant modes are: KFCURVE_CONSTANT_STANDARD KFCURVE_CONSTANT_NEXT

Returns:
Key constant mode.

Definition at line2196of filekfcurve.h.

KFBX_FCURVE_INLINE kFCurveTangeantMode GetTangeantMode(bool pIncludeOverrides=false ) 

Get key tangent mode.

Parameters:
pIncludeOverrides Warning: This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredicted value. Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_AUTO_BREAK KFCURVE_TANGEANT_TCB, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK
Returns:
Key tangent mode.

Definition at line2201of filekfcurve.h.

Referenced byGetBreak(),MultTangeant(), andSetBreak().

KFBX_FCURVE_INLINE kFCurveTangeantWeightMode GetTangeantWeightMode( ) 

Get key tangent weight mode.

Warning: This method is meaningful for cubic interpolation only. Tangent weight modes are: KFCURVE_WEIGHTED_NONE, KFCURVE_WEIGHTED_RIGHT, KFCURVE_WEIGHTED_NEXT_LEFT, KFCURVE_WEIGHTED_ALL

Definition at line2231of filekfcurve.h.

KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode( ) 

Get key tangent velocity mode.

Warning: This method is meaningful for cubic interpolation only. Tangent weight modes are: KFCURVE_VELOCITY_NONE, KFCURVE_VELOCITY_RIGHT, KFCURVE_VELOCITY_NEXT_LEFT, KFCURVE_VELOCITY_ALL

Definition at line2243of filekfcurve.h.

KFBX_FCURVE_INLINE void SetConstantMode(kFCurveConstantMode pMode ) 

Set key constant mode.

Warning: This method is meaningful for constant interpolation only.

Parameters:
pMode Key consant mode. Constant modes are: KFCURVE_CONSTANT_STANDARD KFCURVE_CONSTANT_NEXT

Definition at line2213of filekfcurve.h.

ReferencesGetInterpolation().

KFBX_FCURVE_INLINE void SetTangeantMode(kFCurveTangeantMode pTangent ) 

Set key tangent mode.

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangent Key tangent mode. Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_AUTO_BREAK KFCURVE_TANGEANT_TCB, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK

Definition at line2222of filekfcurve.h.

ReferencesGetInterpolation(), andKFCURVE_INTERPOLATION_CUBIC.

Referenced bySetTCB().

KFBX_FCURVE_INLINE void SetTangeantWeightMode(kFCurveTangeantWeightMode pTangentWeightMode,
kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL 
)

Set key tangent weight mode as double value (cubic interpolation, non TCB tangent mode).

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangentWeightMode Weight mode KFCURVE_WEIGHTED_NONE KFCURVE_WEIGHTED_RIGHT KFCURVE_WEIGHTED_NEXT_LEFT KFCURVE_WEIGHTED_ALL
pMask Used to select the affected tangents KFCURVE_WEIGHTED_RIGHT KFCURVE_WEIGHTED_NEXT_LEFT KFCURVE_WEIGHTED_ALL

Definition at line2236of filekfcurve.h.

Referenced bySetInterpolation().

KFBX_FCURVE_INLINE void SetTangeantVelocityMode(kFCurveTangeantVelocityMode pTangentVelocityMode,
kFCurveTangeantVelocityMode pMask=KFCURVE_VELOCITY_ALL 
)

Set key tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangentVelocityMode Weight mode KFCURVE_VELOCITY_NONE KFCURVE_VELOCITY_RIGHT KFCURVE_VELOCITY_NEXT_LEFT KFCURVE_VELOCITY_ALL
pMask Used to select the affected tangents KFCURVE_VELOCITY_RIGHT KFCURVE_VELOCITY_NEXT_LEFT KFCURVE_VELOCITY_ALL

Definition at line2248of filekfcurve.h.

Referenced bySetInterpolation().

KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble(EKFCurveDataIndex pIndex ) 

Get key data as double value (cubic interpolation, non TCB tangent mode).

Warning: Using this method for other than cubic interpolated key (linear, constant) will return unpredicted values. Warning: Slope data is inconsistent for automatic tangent mode. UseKFCurve::EvaluateLeftDerivative()andKFCurve::EvaluateRightDerivative()to find slope values. Warning: Using this method for TCB tangent mode key will return unpredicted values. Use KFCurve::GetDataFloat() instead.

Parameters:
pIndex Data index, either KFCURVEKEY_RIGHT_SLOPE, KFCURVEKEY_NEXT_LEFT_SLOPE. KFCURVEKEY_NEXT_RIGHT_WEIGHT. KFCURVEKEY_NEXT_LEFT_WEIGHT

Definition at line2272of filekfcurve.h.

Referenced byMultTangeant().

KFBX_FCURVE_INLINE void SetDataDouble(EKFCurveDataIndex pIndex,
kFCurveDouble pValue 
)

Set data as double value (cubic interpolation, non TCB tangent mode).

Warning: Using this method for other than cubic interpolated key (linear, constant) is irrelevant. Warning: Slope data is inconsistent for automatic tangent mode. Therefore, it is irrelevant to use this method on automatic tangent mode keys. Warning: Using this method for a TCB tangent mode key will result in unpredictable curve behavior for this key. Use KFCurve::SetDataFloat() instead.

Parameters:
pIndex Data index, either KFCURVEKEY_RIGHT_SLOPE, KFCURVEKEY_NEXT_LEFT_SLOPE. KFCURVEKEY_NEXT_RIGHT_WEIGHT. KFCURVEKEY_NEXT_LEFT_WEIGHT
pValue The data value to set (a slope or a weight).

Definition at line2289of filekfcurve.h.

Referenced byMultTangeant(), andSetInterpolation().

KFBX_FCURVE_INLINE float GetDataFloat(EKFCurveDataIndex pIndex ) 

Get key data as float value (cubic interpolation, TCB tangent mode).

Warning: Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredicted values.

Parameters:
pIndex Data index, either KFCURVEKEY_TCB_TENSION, KFCURVEKEY_TCB_CONTINUITY or KFCURVEKEY_TCB_BIAS.

Definition at line2315of filekfcurve.h.

KFBX_FCURVE_INLINE void SetDataFloat(EKFCurveDataIndex pIndex,
float pValue 
)

Set data as float value (cubic interpolation, TCB tangent mode).

Warning: Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredicted values.

Parameters:
pIndex Data index, either KFCURVEKEY_TCB_TENSION, KFCURVEKEY_TCB_CONTINUITY or KFCURVEKEY_TCB_BIAS.
pValue The data value to set.

Definition at line2321of filekfcurve.h.

Referenced bySetTCB().

KFBX_FCURVE_INLINE float * GetDataPtr( ) 

Get key data as a pointer Warning: not supported in 'double' mode.

Definition at line2326of filekfcurve.h.

KFBX_FCURVE_INLINE kFCurveDouble GetValue( ) 

Get key value.

Definition at line2332of filekfcurve.h.

KFBX_FCURVE_INLINE void SetValue(kFCurveDouble pValue ) 

Set key value.

Parameters:
pValue Key value to set.

Definition at line2338of filekfcurve.h.

Referenced bySetTCB().

KFBX_FCURVE_INLINE void IncValue(kFCurveDouble pValue ) 

Increment key value.

Parameters:
pValue Value by which key value is incremented.

Definition at line2344of filekfcurve.h.

KFBX_FCURVE_INLINE void MultValue(kFCurveDouble pValue ) 

Multiply key value.

Parameters:
pValue Value by which the key value is multiplied.

Definition at line2349of filekfcurve.h.

KFBX_FCURVE_INLINE void MultTangeant(kFCurveDouble pValue ) 

Multiply key tangents.

Note: When multiplying a key value, tangents must be multiplied to conserve the same topology.

Parameters:
pValue Value by which key tangents are multiplied.

Definition at line2354of filekfcurve.h.

ReferencesGetDataDouble(),GetInterpolation(),GetTangeantMode(),KFCURVE_INTERPOLATION_CUBIC,KFCURVE_TANGEANT_BREAK,KFCURVE_TANGEANT_TCB,KFCURVE_TANGEANT_USER, andSetDataDouble().

KFBX_FCURVE_INLINEKTimeGetTime( ) 

Get key time.

Returns:
Key time (time at which this key is occurring).

Definition at line2376of filekfcurve.h.

KFBX_FCURVE_INLINE void SetTime(KTime pTime ) 

Set key time.

Parameters:
pTime Key time (time at which this key is occurring).

Definition at line2382of filekfcurve.h.

Referenced bySetTCB().

KFBX_FCURVE_INLINE void IncTime(KTime pTime ) 

Increment key time.

Parameters:
pTime Time value by which the key time is incremented.

Definition at line2390of filekfcurve.h.

KFBX_FCURVE_INLINE void SetSelected(bool pSelected ) 

Set if key is currently selected.

Parameters:
pSelected Selection flag.

Definition at line2396of filekfcurve.h.

KFBX_FCURVE_INLINE bool GetSelected( ) 

Return if key is currently selected.

Returns:
Selection flag.

Definition at line2402of filekfcurve.h.

KFBX_FCURVE_INLINE void SetMarkedForManipulation(bool pMark ) 

Set if key is currently marked for manipulation.

Parameters:
pMark Mark flag.

Definition at line2408of filekfcurve.h.

KFBX_FCURVE_INLINE bool GetMarkedForManipulation( ) 

Return if key is currently marked for manipulation.

Returns:
Mark flag.

Definition at line2414of filekfcurve.h.

KFBX_FCURVE_INLINE void SetTangeantVisibility(kFCurveTangeantVisibility pVisibility ) 

Set tangent visibility mode.

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pVisibility Tangent visibility mode. Tangent visibility modes are: KFCURVE_TANGEANT_SHOW_NONE KFCURVE_TANGEANT_SHOW_LEFT KFCURVE_TANGEANT_SHOW_RIGHT

Definition at line2255of filekfcurve.h.

Referenced bySetTCB().

KFBX_FCURVE_INLINE kFCurveTangeantVisibility GetTangeantVisibility( ) 

Return tangent visibility mode.

Warning: This method is meaningful for cubic interpolation only.

Returns:
Tangent visibility mode. Tangent visibility modes are: KFCURVE_TANGEANT_SHOW_NONE KFCURVE_TANGEANT_SHOW_LEFT KFCURVE_TANGEANT_SHOW_RIGHT

Definition at line2266of filekfcurve.h.

KFBX_FCURVE_INLINE void SetBreak(bool pVal ) 

Set/Unset Break tangent Only valid for User and Auto keys.

Parameters:
pVal The break flag.

Definition at line2428of filekfcurve.h.

ReferencesGetInterpolation(),GetTangeantMode(),KFCURVE_GENERIC_BREAK,KFCURVE_INTERPOLATION_CUBIC,KFCURVE_TANGEANT_BREAK, andKFCURVE_TANGEANT_USER.

KFBX_FCURVE_INLINE bool GetBreak( ) 

Get if tangent is break Only valid for User and Auto keys.

Definition at line2443of filekfcurve.h.

ReferencesGetInterpolation(),GetTangeantMode(),KFCURVE_GENERIC_BREAK,KFCURVE_INTERPOLATION_CUBIC,KFCURVE_TANGEANT_BREAK, andKFCURVE_TANGEANT_USER.