|
@@ -143,35 +143,29 @@ struct aiQuatKey
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** Defines how an animation channel behaves outside the defined time
|
|
/** Defines how an animation channel behaves outside the defined time
|
|
* range. This corresponds to aiNodeAnim::mPreState and
|
|
* range. This corresponds to aiNodeAnim::mPreState and
|
|
- * aiNodeAnim::mPostState.
|
|
|
|
- */
|
|
|
|
|
|
+ * aiNodeAnim::mPostState.*/
|
|
enum aiAnimBehaviour
|
|
enum aiAnimBehaviour
|
|
{
|
|
{
|
|
- /** The value from the default node transformation is taken
|
|
|
|
- */
|
|
|
|
|
|
+ /** The value from the default node transformation is taken*/
|
|
aiAnimBehaviour_DEFAULT = 0x0,
|
|
aiAnimBehaviour_DEFAULT = 0x0,
|
|
|
|
|
|
- /** The nearest key value is used without interpolation
|
|
|
|
- */
|
|
|
|
|
|
+ /** The nearest key value is used without interpolation */
|
|
aiAnimBehaviour_CONSTANT = 0x1,
|
|
aiAnimBehaviour_CONSTANT = 0x1,
|
|
|
|
|
|
/** The value of the nearest two keys is linearly
|
|
/** The value of the nearest two keys is linearly
|
|
- * extrapolated for the current time value.
|
|
|
|
- */
|
|
|
|
|
|
+ * extrapolated for the current time value.*/
|
|
aiAnimBehaviour_LINEAR = 0x2,
|
|
aiAnimBehaviour_LINEAR = 0x2,
|
|
|
|
|
|
/** The animation is repeated.
|
|
/** The animation is repeated.
|
|
*
|
|
*
|
|
* If the animation key go from n to m and the current
|
|
* If the animation key go from n to m and the current
|
|
- * time is t, use the value at (t-n) % (|m-n|).
|
|
|
|
- */
|
|
|
|
|
|
+ * time is t, use the value at (t-n) % (|m-n|).*/
|
|
aiAnimBehaviour_REPEAT = 0x3,
|
|
aiAnimBehaviour_REPEAT = 0x3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** This value is not used, it is just here to force the
|
|
/** This value is not used, it is just here to force the
|
|
- * the compiler to map this enum to a 32 Bit integer
|
|
|
|
- */
|
|
|
|
|
|
+ * the compiler to map this enum to a 32 Bit integer */
|
|
_aiAnimBehaviour_Force32Bit = 0x8fffffff
|
|
_aiAnimBehaviour_Force32Bit = 0x8fffffff
|
|
};
|
|
};
|
|
|
|
|
|
@@ -187,13 +181,11 @@ enum aiAnimBehaviour
|
|
* @note All keys are returned in their correct, chronological order.
|
|
* @note All keys are returned in their correct, chronological order.
|
|
* Duplicate keys don't pass the validation step. Most likely there
|
|
* Duplicate keys don't pass the validation step. Most likely there
|
|
* will be no negative time values, but they are not forbidden ( so you should
|
|
* will be no negative time values, but they are not forbidden ( so you should
|
|
- * be able to handle them )
|
|
|
|
- */
|
|
|
|
|
|
+ * be able to handle them ) */
|
|
struct aiNodeAnim
|
|
struct aiNodeAnim
|
|
{
|
|
{
|
|
/** The name of the node affected by this animation. The node
|
|
/** The name of the node affected by this animation. The node
|
|
- * must exist and it must be unique.
|
|
|
|
- */
|
|
|
|
|
|
+ * must exist and it must be unique.*/
|
|
C_STRUCT aiString mNodeName;
|
|
C_STRUCT aiString mNodeName;
|
|
|
|
|
|
/** The number of position keys */
|
|
/** The number of position keys */
|
|
@@ -203,8 +195,7 @@ struct aiNodeAnim
|
|
* specified as 3D vector. The array is mNumPositionKeys in size.
|
|
* specified as 3D vector. The array is mNumPositionKeys in size.
|
|
*
|
|
*
|
|
* If there are position keys, there will also be at least one
|
|
* If there are position keys, there will also be at least one
|
|
- * scaling and one rotation key.
|
|
|
|
- */
|
|
|
|
|
|
+ * scaling and one rotation key.*/
|
|
C_STRUCT aiVectorKey* mPositionKeys;
|
|
C_STRUCT aiVectorKey* mPositionKeys;
|
|
|
|
|
|
/** The number of rotation keys */
|
|
/** The number of rotation keys */
|
|
@@ -215,8 +206,7 @@ struct aiNodeAnim
|
|
* mNumRotationKeys in size.
|
|
* mNumRotationKeys in size.
|
|
*
|
|
*
|
|
* If there are rotation keys, there will also be at least one
|
|
* If there are rotation keys, there will also be at least one
|
|
- * scaling and one position key.
|
|
|
|
- */
|
|
|
|
|
|
+ * scaling and one position key. */
|
|
C_STRUCT aiQuatKey* mRotationKeys;
|
|
C_STRUCT aiQuatKey* mRotationKeys;
|
|
|
|
|
|
|
|
|
|
@@ -227,8 +217,7 @@ struct aiNodeAnim
|
|
* specified as 3D vector. The array is mNumScalingKeys in size.
|
|
* specified as 3D vector. The array is mNumScalingKeys in size.
|
|
*
|
|
*
|
|
* If there are scaling keys, there will also be at least one
|
|
* If there are scaling keys, there will also be at least one
|
|
- * position and one rotation key.
|
|
|
|
- */
|
|
|
|
|
|
+ * position and one rotation key.*/
|
|
C_STRUCT aiVectorKey* mScalingKeys;
|
|
C_STRUCT aiVectorKey* mScalingKeys;
|
|
|
|
|
|
|
|
|
|
@@ -236,16 +225,14 @@ struct aiNodeAnim
|
|
* key is encountered.
|
|
* key is encountered.
|
|
*
|
|
*
|
|
* The default value is aiAnimBehaviour_DEFAULT (the original
|
|
* The default value is aiAnimBehaviour_DEFAULT (the original
|
|
- * transformation matrix of the affected node is used).
|
|
|
|
- */
|
|
|
|
|
|
+ * transformation matrix of the affected node is used).*/
|
|
C_ENUM aiAnimBehaviour mPreState;
|
|
C_ENUM aiAnimBehaviour mPreState;
|
|
|
|
|
|
/** Defines how the animation behaves after the last
|
|
/** Defines how the animation behaves after the last
|
|
* key was processed.
|
|
* key was processed.
|
|
*
|
|
*
|
|
* The default value is aiAnimBehaviour_DEFAULT (the original
|
|
* The default value is aiAnimBehaviour_DEFAULT (the original
|
|
- * transformation matrix of the affected node is taken).
|
|
|
|
- */
|
|
|
|
|
|
+ * transformation matrix of the affected node is taken).*/
|
|
C_ENUM aiAnimBehaviour mPostState;
|
|
C_ENUM aiAnimBehaviour mPostState;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
#ifdef __cplusplus
|
|
@@ -269,32 +256,26 @@ struct aiNodeAnim
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** An animation consists of keyframe data for a number of nodes. For
|
|
/** An animation consists of keyframe data for a number of nodes. For
|
|
- * each node affected by the animation a separate series of data is given.
|
|
|
|
- */
|
|
|
|
|
|
+ * each node affected by the animation a separate series of data is given.*/
|
|
struct aiAnimation
|
|
struct aiAnimation
|
|
{
|
|
{
|
|
/** The name of the animation. If the modeling package this data was
|
|
/** The name of the animation. If the modeling package this data was
|
|
* exported from does support only a single animation channel, this
|
|
* exported from does support only a single animation channel, this
|
|
- * name is usually empty (length is zero).
|
|
|
|
- */
|
|
|
|
|
|
+ * name is usually empty (length is zero). */
|
|
C_STRUCT aiString mName;
|
|
C_STRUCT aiString mName;
|
|
|
|
|
|
- /** Duration of the animation in ticks.
|
|
|
|
- */
|
|
|
|
|
|
+ /** Duration of the animation in ticks. */
|
|
double mDuration;
|
|
double mDuration;
|
|
|
|
|
|
- /** Ticks per second. 0 if not specified in the imported file
|
|
|
|
- */
|
|
|
|
|
|
+ /** Ticks per second. 0 if not specified in the imported file */
|
|
double mTicksPerSecond;
|
|
double mTicksPerSecond;
|
|
|
|
|
|
/** The number of bone animation channels. Each channel affects
|
|
/** The number of bone animation channels. Each channel affects
|
|
- * a single node.
|
|
|
|
- */
|
|
|
|
|
|
+ * a single node. */
|
|
unsigned int mNumChannels;
|
|
unsigned int mNumChannels;
|
|
|
|
|
|
/** The node animation channels. Each channel affects a single node.
|
|
/** The node animation channels. Each channel affects a single node.
|
|
- * The array is mNumChannels in size.
|
|
|
|
- */
|
|
|
|
|
|
+ * The array is mNumChannels in size. */
|
|
C_STRUCT aiNodeAnim** mChannels;
|
|
C_STRUCT aiNodeAnim** mChannels;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
#ifdef __cplusplus
|
|
@@ -326,13 +307,11 @@ struct aiAnimation
|
|
// some C++ utilities for inter- and extrapolation
|
|
// some C++ utilities for inter- and extrapolation
|
|
namespace Assimp {
|
|
namespace Assimp {
|
|
|
|
|
|
-
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
-/** @brief Utility class to simplify interpolations of various data types.
|
|
|
|
|
|
+/** @brief CPP-API: Utility class to simplify interpolations of various data types.
|
|
*
|
|
*
|
|
* The type of interpolation is choosen automatically depending on the
|
|
* The type of interpolation is choosen automatically depending on the
|
|
- * types of the arguments.
|
|
|
|
- */
|
|
|
|
|
|
+ * types of the arguments. */
|
|
template <typename T>
|
|
template <typename T>
|
|
struct Interpolator
|
|
struct Interpolator
|
|
{
|
|
{
|
|
@@ -341,8 +320,7 @@ struct Interpolator
|
|
*
|
|
*
|
|
* The interpolation algorithm depends on the type of the operands.
|
|
* The interpolation algorithm depends on the type of the operands.
|
|
* aiQuaternion's and aiQuatKey's SLERP, the rest does a simple
|
|
* aiQuaternion's and aiQuatKey's SLERP, the rest does a simple
|
|
- * linear interpolation.
|
|
|
|
- */
|
|
|
|
|
|
+ * linear interpolation. */
|
|
void operator () (T& out,const T& a, const T& b, float d) const {
|
|
void operator () (T& out,const T& a, const T& b, float d) const {
|
|
out = a + (b-a)*d;
|
|
out = a + (b-a)*d;
|
|
}
|
|
}
|