Single node animation data container.
| 11 | /// Single node animation data container. |
| 12 | /// </summary> |
| 13 | struct NodeAnimationData |
| 14 | { |
| 15 | public: |
| 16 | /// <summary> |
| 17 | /// The target node name. |
| 18 | /// </summary> |
| 19 | String NodeName; |
| 20 | |
| 21 | /// <summary> |
| 22 | /// The position channel animation. |
| 23 | /// </summary> |
| 24 | LinearCurve<Float3> Position; |
| 25 | |
| 26 | /// <summary> |
| 27 | /// The rotation channel animation. |
| 28 | /// </summary> |
| 29 | LinearCurve<Quaternion> Rotation; |
| 30 | |
| 31 | /// <summary> |
| 32 | /// The scale channel animation. |
| 33 | /// </summary> |
| 34 | LinearCurve<Float3> Scale; |
| 35 | |
| 36 | public: |
| 37 | /// <summary> |
| 38 | /// Initializes a new instance of the <see cref="NodeAnimationData"/> class. |
| 39 | /// </summary> |
| 40 | NodeAnimationData() |
| 41 | : Position(Float3::Zero) |
| 42 | , Rotation(Quaternion::Identity) |
| 43 | , Scale(Float3::One) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | public: |
| 48 | /// <summary> |
| 49 | /// Evaluates the animation transformation at the specified time (only for the curves with non-empty data). |
| 50 | /// </summary> |
| 51 | /// <param name="time">The time to evaluate the curves at.</param> |
| 52 | /// <param name="result">The interpolated value from the curve at provided time.</param> |
| 53 | /// <param name="loop">If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.</param> |
| 54 | void Evaluate(float time, Transform* result, bool loop = true) const; |
| 55 | |
| 56 | /// <summary> |
| 57 | /// Evaluates the animation transformation at the specified time. |
| 58 | /// </summary> |
| 59 | /// <param name="time">The time to evaluate the curves at.</param> |
| 60 | /// <param name="result">The interpolated value from the curve at provided time.</param> |
| 61 | /// <param name="loop">If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.</param> |
| 62 | void EvaluateAll(float time, Transform* result, bool loop = true) const; |
| 63 | |
| 64 | /// <summary> |
| 65 | /// Gets the total amount of keyframes in the animation curves. |
| 66 | /// </summary> |
| 67 | int32 GetKeyframesCount() const; |
| 68 | |
| 69 | uint64 GetMemoryUsage() const; |
| 70 | }; |