|
@@ -5,6 +5,8 @@
|
|
#pragma once
|
|
#pragma once
|
|
|
|
|
|
#include <Jolt/Core/Reference.h>
|
|
#include <Jolt/Core/Reference.h>
|
|
|
|
+#include <Jolt/Core/Result.h>
|
|
|
|
+#include <Jolt/Core/StreamUtils.h>
|
|
#include <Jolt/ObjectStream/SerializableObject.h>
|
|
#include <Jolt/ObjectStream/SerializableObject.h>
|
|
|
|
|
|
JPH_NAMESPACE_BEGIN
|
|
JPH_NAMESPACE_BEGIN
|
|
@@ -62,6 +64,10 @@ public:
|
|
/// Scale the size of all joints by inScale
|
|
/// Scale the size of all joints by inScale
|
|
void ScaleJoints(float inScale);
|
|
void ScaleJoints(float inScale);
|
|
|
|
|
|
|
|
+ /// If the animation is looping or not. If an animation is looping, the animation will continue playing after completion
|
|
|
|
+ void SetIsLooping(bool inIsLooping) { mIsLooping = inIsLooping; }
|
|
|
|
+ bool IsLooping() const { return mIsLooping; }
|
|
|
|
+
|
|
/// Get the (interpolated) joint transforms at time inTime
|
|
/// Get the (interpolated) joint transforms at time inTime
|
|
void Sample(float inTime, SkeletonPose &ioPose) const;
|
|
void Sample(float inTime, SkeletonPose &ioPose) const;
|
|
|
|
|
|
@@ -69,6 +75,14 @@ public:
|
|
const AnimatedJointVector & GetAnimatedJoints() const { return mAnimatedJoints; }
|
|
const AnimatedJointVector & GetAnimatedJoints() const { return mAnimatedJoints; }
|
|
AnimatedJointVector & GetAnimatedJoints() { return mAnimatedJoints; }
|
|
AnimatedJointVector & GetAnimatedJoints() { return mAnimatedJoints; }
|
|
|
|
|
|
|
|
+ /// Saves the state of this animation in binary form to inStream.
|
|
|
|
+ void SaveBinaryState(StreamOut &inStream) const;
|
|
|
|
+
|
|
|
|
+ using AnimationResult = Result<Ref<SkeletalAnimation>>;
|
|
|
|
+
|
|
|
|
+ /// Restore a saved ragdoll from inStream
|
|
|
|
+ static AnimationResult sRestoreFromBinaryState(StreamIn &inStream);
|
|
|
|
+
|
|
private:
|
|
private:
|
|
AnimatedJointVector mAnimatedJoints; ///< List of joints and keyframes
|
|
AnimatedJointVector mAnimatedJoints; ///< List of joints and keyframes
|
|
bool mIsLooping = true; ///< If this animation loops back to start
|
|
bool mIsLooping = true; ///< If this animation loops back to start
|