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 line313of filekfcurve.h.


Public Member Functions

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

Member Function Documentation

KFCURVE_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.

KFCURVE_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.

KFCURVE_INLINE void Set(KFCurveKeypSource ) 

Key assignment.

Parameters:
pSource Source key to be copied.

KFCURVE_INLINE kFCurveInterpolation GetInterpolation( ) 

Get key interpolation type.

Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

KFCURVE_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

KFCURVE_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.

KFCURVE_INLINE kFCurveTangeantMode GetTangeantMode(bool pIncludeOverrides=false ) 

Get key tangent mode.

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.

KFCURVE_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

KFCURVE_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

KFCURVE_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

KFCURVE_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

KFCURVE_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

KFCURVE_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

KFCURVE_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

KFCURVE_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).

KFCURVE_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.

KFCURVE_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.

KFCURVE_INLINE float* GetDataPtr( ) 

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

KFCURVE_INLINE kFCurveDouble GetValue( ) 

Get key value.

KFCURVE_INLINE void SetValue(kFCurveDouble pValue ) 

Set key value.

KFCURVE_INLINE void IncValue(kFCurveDouble pValue ) 

Increment key value.

Parameters:
pValue Value by which key value is incremented.

KFCURVE_INLINE void MultValue(kFCurveDouble pValue ) 

Multiply key value.

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

KFCURVE_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.

KFCURVE_INLINEKTimeGetTime( ) 

Get key time.

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

KFCURVE_INLINE void SetTime(KTime pTime ) 

Set key time.

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

KFCURVE_INLINE void IncTime(KTime pTime ) 

Increment key time.

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

KFCURVE_INLINE void SetSelected(bool pSelected ) 

Set if key is currently selected.

Parameters:
pSelected Selection flag.

KFCURVE_INLINE bool GetSelected( ) 

Return if key is currently selected.

Returns:
Selection flag.

KFCURVE_INLINE void SetMarkedForManipulation(bool pMark ) 

Set if key is currently marked for manipulation.

Parameters:
pMark Mark flag.

KFCURVE_INLINE bool GetMarkedForManipulation( ) 

Return if key is currently marked for manipulation.

Returns:
Mark flag.

KFCURVE_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

KFCURVE_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

KFCURVE_INLINE void SetBreak(bool pVal ) 

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

KFCURVE_INLINE bool GetBreak( ) 

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