13 #ifndef _FBXSDK_SCENE_ANIMATION_CURVE_H_
14 #define _FBXSDK_SCENE_ANIMATION_CURVE_H_
37 eTangentAuto = 0x00000100,
38 eTangentTCB = 0x00000200,
39 eTangentUser = 0x00000400,
40 eTangentGenericBreak = 0x00000800,
41 eTangentBreak = eTangentGenericBreak|eTangentUser,
42 eTangentAutoBreak = eTangentGenericBreak|eTangentAuto,
43 eTangentGenericClamp = 0x00001000,
44 eTangentGenericTimeIndependent = 0x00002000,
45 eTangentGenericClampProgressive = 0x00004000|eTangentGenericTimeIndependent
51 eInterpolationConstant = 0x00000002,
52 eInterpolationLinear = 0x00000004,
53 eInterpolationCubic = 0x00000008
59 eWeightedNone = 0x00000000,
60 eWeightedRight = 0x01000000,
61 eWeightedNextLeft = 0x02000000,
62 eWeightedAll = eWeightedRight|eWeightedNextLeft
68 eConstantStandard = 0x00000000,
69 eConstantNext = 0x00000100
75 eVelocityNone = 0x00000000,
76 eVelocityRight = 0x10000000,
77 eVelocityNextLeft = 0x20000000,
78 eVelocityAll = eVelocityRight|eVelocityNextLeft
84 eTangentShowNone = 0x00000000,
85 eTangentShowLeft = 0x00100000,
86 eTangentShowRight = 0x00200000,
87 eTangentShowBoth = eTangentShowLeft|eTangentShowRight
100 eNextLeftVelocity = 5,
115 mHasVelocity =
false;
149 virtual void Set(
FbxTime pTime,
float pValue) = 0;
162 virtual void SetTCB(
FbxTime pTime,
float pValue,
float pData0 = 0.0f,
float pData1 = 0.0f,
float pData2 = 0.0f) = 0;
167 virtual float GetValue()
const = 0;
172 virtual void SetValue(
float pValue) = 0;
327 virtual void SetBreak(
bool pVal) = 0;
335 virtual bool GetBreak()
const = 0;
355 FBX_ASSERT(mAllocatorFct !=
NULL);
356 mImpl = (*mAllocatorFct)();
364 FBX_ASSERT(mAllocatorFct !=
NULL);
365 mImpl = (*mAllocatorFct)();
375 FBX_ASSERT(mAllocatorFct !=
NULL);
376 mImpl = (*mAllocatorFct)();
384 FBX_ASSERT(mCopyAllocatorFct !=
NULL);
386 mImpl = mCopyAllocatorFct(pFKey.
GetImpl());
393 FBX_ASSERT(mDeallocatorFct !=
NULL);
394 (*mDeallocatorFct)(mImpl);
433 mImpl->Set(pTime, pValue);
447 void SetTCB(
FbxTime pTime,
float pValue,
float pData0 = 0.0f,
float pData1 = 0.0f,
float pData2 = 0.0f)
450 mImpl->SetTCB(pTime, pValue, pData0, pData1, pData2);
458 return mImpl->GetValue();
466 mImpl->SetValue(pValue);
475 return mImpl->GetInterpolation();
483 mImpl->SetInterpolation(pInterpolation);
494 return mImpl->GetTangentMode(pIncludeOverrides);
502 mImpl->SetTangentMode(pTangentMode);
511 return mImpl->GetTangentWeightMode();
549 mImpl->SetTangentWeightMode(pTangentWeightMode, pMask);
564 mImpl->SetTangentWeightAndAdjustTangent(pIndex, pWeight);
573 return mImpl->GetTangentVelocityMode();
587 mImpl->SetTangentVelocityMode(pTangentVelocityMode, pMask);
597 return mImpl->GetConstantMode();
606 mImpl->SetConstantMode(pMode);
625 return mImpl->GetDataFloat(pIndex);
641 mImpl->SetDataFloat(pIndex, pValue);
650 mImpl->SetTangentVisibility(pVisibility);
659 return mImpl->GetTangentVisibility();
670 mImpl->SetBreak(pVal);
681 return mImpl->GetBreak();
805 virtual void ResizeKeyBuffer(
int pKeyCount) = 0;
810 virtual void KeyModifyBegin () = 0;
815 virtual void KeyModifyEnd () = 0;
881 virtual bool KeyRemove(
int pStartIndex,
int pEndIndex) = 0;
898 virtual int KeyInsert (
FbxTime pTime,
int* pLast =
NULL ) = 0;
913 virtual double KeyFind (
FbxTime pTime,
int* pLast =
NULL) = 0;
919 virtual bool KeyScaleValue (
float pMultValue) = 0;
925 virtual bool KeyScaleValueAndTangent (
float pMultValue) = 0;
950 virtual void KeySet(
int pKeyIndex,
FbxTime pTime,
float pValue,
FbxAnimCurveDef::EInterpolationType pInterpolation =
FbxAnimCurveDef::eInterpolationCubic,
FbxAnimCurveDef::ETangentMode pTangentMode =
FbxAnimCurveDef::eTangentAuto,
float pData0 = 0.0,
float pData1 = 0.0,
FbxAnimCurveDef::EWeightedMode pTangentWeightMode =
FbxAnimCurveDef::eWeightedNone,
float pWeight0 =
FbxAnimCurveDef::sDEFAULT_WEIGHT,
float pWeight1 =
FbxAnimCurveDef::sDEFAULT_WEIGHT,
float pVelocity0 =
FbxAnimCurveDef::sDEFAULT_VELOCITY,
float pVelocity1 =
FbxAnimCurveDef::sDEFAULT_VELOCITY) = 0;
964 virtual void KeySetTCB(
int pKeyIndex,
FbxTime pTime,
float pValue,
float pData0 = 0.0f,
float pData1 = 0.0f,
float pData2 = 0.0f) = 0;
1021 virtual float KeyGetValue(
int pKeyIndex)
const = 0;
1027 virtual void KeySetValue(
int pKeyIndex,
float pValue) = 0;
1033 virtual void KeyIncValue(
int pKeyIndex,
float pValue) = 0;
1040 virtual void KeyMultValue(
int pKeyIndex,
float pValue) = 0;
1048 virtual void KeyMultTangent(
int pKeyIndex,
float pValue) = 0;
1069 virtual void KeySetBreak(
int pKeyIndex,
bool pVal) = 0;
1077 virtual bool KeyGetBreak(
int pKeyIndex)
const = 0;
1090 virtual float KeyGetLeftDerivative(
int pIndex) = 0;
1101 virtual void KeySetLeftDerivative(
int pIndex,
float pValue) = 0;
1110 virtual float KeyGetLeftAuto(
int pIndex,
bool pApplyOvershootProtection =
false) = 0;
1131 virtual void KeySetLeftDerivativeInfo(
int pIndex,
const FbxAnimCurveTangentInfo& pValue,
bool pForceDerivative =
false) = 0;
1139 virtual float KeyGetRightDerivative(
int pIndex) = 0;
1150 virtual void KeySetRightDerivative(
int pIndex,
float pValue) = 0;
1159 virtual float KeyGetRightAuto(
int pIndex,
bool pApplyOvershootProtection =
false) = 0;
1180 virtual void KeySetRightDerivativeInfo(
int pIndex,
const FbxAnimCurveTangentInfo& pValue,
bool pForceDerivative =
false) = 0;
1188 virtual bool KeyIsLeftTangentWeighted(
int pIndex)
const = 0;
1196 virtual bool KeyIsRightTangentWeighted(
int pIndex)
const = 0;
1204 virtual float KeyGetLeftTangentWeight(
int pIndex)
const = 0;
1212 virtual float KeyGetRightTangentWeight(
int pIndex)
const = 0;
1225 virtual void KeySetLeftTangentWeight(
int pIndex,
float pWeight,
bool pAdjustTan =
false ) = 0;
1238 virtual void KeySetRightTangentWeight(
int pIndex,
float pWeight,
bool pAdjustTan =
false ) = 0;
1246 virtual float KeyGetLeftTangentVelocity(
int pIndex)
const = 0;
1254 virtual float KeyGetRightTangentVelocity(
int pIndex)
const = 0;
1297 virtual float EvaluateLeftDerivative (
FbxTime pTime,
int* pLast =
NULL) = 0;
1308 virtual float EvaluateRightDerivative (
FbxTime pTime,
int* pLast =
NULL) = 0;
1329 virtual void CopyFrom(
FbxAnimCurve& pSource,
bool pWithKeys =
true) = 0;
1336 virtual float GetValue(
int pCurveNodeIndex=0) = 0;
1343 virtual void SetValue(
float pValue,
int pCurveNodeIndex=0) = 0;
1349 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1350 virtual KFCurve* GetKFCurve() = 0;
1351 virtual bool Store(
FbxIO* pFileObject,
bool pLegacyVersion=
false) = 0;
1352 virtual bool Retrieve(
FbxIO* pFileObject) = 0;
void SetTangentWeightAndAdjustTangent(FbxAnimCurveDef::EDataIndex pIndex, double pWeight)
Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays clos...
FbxAnimCurveDef::ETangentMode GetTangentMode(bool pIncludeOverrides=false)
Get key's tangent mode.
FBX SDK environment definition.
EConstantMode
Key constant mode.
FbxAnimCurveDef::EInterpolationType GetInterpolation()
Get key's interpolation type.
Both left and right tangents have velocity.
static const float sDEFAULT_WEIGHT
This is the base class interface for the FBX animation curve keys.
bool GetBreak() const
Get if the tangent has a break.
virtual int KeyGetCount() const =0
Get the number of keys.
This is the base class for implementing animation curves.
void SetConstantMode(FbxAnimCurveDef::EConstantMode pMode)
Set key's constant mode.
void SetTangentMode(FbxAnimCurveDef::ETangentMode pTangentMode)
Set tangent mode.
FbxAnimCurveDef::EWeightedMode GetTangentWeightMode() const
Get key's tangent weight mode.
virtual ~FbxAnimCurveKey_Impl()
Destructor.
static const float sMIN_WEIGHT
virtual FbxTime GetTime() const
Get time value.
EInterpolationType
Key interpolation type.
Both left and right tangents are weighted.
FbxAnimCurveKey(FbxTime pTime)
Constructor with time.
Auto key (spline cardinal).
FbxAnimCurveKey & operator=(const FbxAnimCurveKey &pFKey)
Assignment operator.
Cubic progression to next key.
FbxAnimCurveDef::ETangentVisibility GetTangentVisibility() const
Return tangent visibility mode.
EDataIndex
FbxAnimCurveKey data indices for cubic interpolation tangent information.
ETangentMode
Key tangent mode for cubic interpolation.
virtual bool KeyRemove(int pIndex)=0
Remove key at given index.
FbxAnimCurveTangentInfo()
void SetTangentVelocityMode(FbxAnimCurveDef::EVelocityMode pTangentVelocityMode, FbxAnimCurveDef::EVelocityMode pMask=FbxAnimCurveDef::eVelocityAll)
Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode)...
static const float sMAX_WEIGHT
void SetTangentWeightMode(FbxAnimCurveDef::EWeightedMode pTangentWeightMode, FbxAnimCurveDef::EWeightedMode pMask=FbxAnimCurveDef::eWeightedAll)
Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode)...
FbxAnimCurveKey()
Constructor with no argument.
void SetDataFloat(FbxAnimCurveDef::EDataIndex pIndex, float pValue)
Set the value of specified data of the key.
Class to encapsulate time units.
virtual int KeyAdd(FbxTime pTime, FbxAnimCurveKeyBase &pKey, int *pLast=NULL)=0
Add a key at given time.
This class contains the description of a 3D scene.
virtual void KeySetTime(int pKeyIndex, FbxTime pTime)=0
Set key time.
void SetTCB(FbxTime pTime, float pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f)
Set a key with cubic interpolation, TCB tangent mode.
EWeightedMode
Weighted mode.
#define FBXSDK_ABSTRACT_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new abstract class derived from FbxObject.
FbxAnimCurveDef::EConstantMode GetConstantMode() const
Get key constant mode.
void SetValue(float pValue)
Set the key value.
virtual bool GetTimeInterval(FbxTimeSpan &pTimeInterval)
Find out start and end time of the animation curve.
virtual float Evaluate(FbxTime pTime, int *pLast=NULL)=0
Evaluate curve value at a given time.
float GetDataFloat(FbxAnimCurveDef::EDataIndex pIndex) const
Get the value of specified data of the key.
Tangent has default weights of 0.333; we define this state as not weighted.
void SetTangentVisibility(FbxAnimCurveDef::ETangentVisibility pVisibility)
Set tangent visibility mode.
FbxTime GetTime() const
Get time value.
virtual float EvaluateIndex(double pIndex)=0
Evaluate curve value at the given key index.
virtual FbxTime KeyGetTime(int) const
Get key time.
FbxIO represents an FBX file.
An animation curve, defined by a collection of keys (FbxAnimCurveKey), and indicating how a value cha...
This is the interface for the FBX animation curve keys.
void Set(FbxTime pTime, float pValue)
Set time and value of key.
float GetValue() const
Get the key value.
void SetBreak(bool pVal)
Turn on or turn off the tangent break.
void SetInterpolation(FbxAnimCurveDef::EInterpolationType pInterpolation)
Set key's interpolation type.
virtual void KeyClear()=0
Remove all the keys and free buffer memory.
Definitions used for the FBX animation curves and keys.
FbxAnimCurveKey_Impl * GetImpl() const
Get key implementation.
Class to encapsulate time intervals.
virtual void SetTime(const FbxTime &pTime)
Set time value.
ETangentVisibility
Tangent visibility.
This is the interface for implementation of animation key objects.
~FbxAnimCurveKey()
Destructor.
EVelocityMode
Velocity mode. Velocity settings speed up or slow down animation on either side of a key without chan...
virtual bool KeySet(int pIndex, FbxAnimCurveKeyBase &pKey)=0
Set key at given index.
void SetTime(const FbxTime &pTime)
Set time value.
FbxAnimCurveKey(FbxAnimCurveKey const &pFKey)
Copy constructor.
static const float sDEFAULT_VELOCITY
FbxAnimCurveDef::EVelocityMode GetTangentVelocityMode() const
Get key's tangent velocity mode.
FbxAnimCurveKey(FbxTime pTime, float pVal)
Constructor with time and value.