Add UpdateSpeed to Animated Model for playback speed scaling
This commit is contained in:
@@ -73,6 +73,7 @@ void AnimationsSystem::Job(int32 index)
|
|||||||
{
|
{
|
||||||
dt = t - lastUpdateTime;
|
dt = t - lastUpdateTime;
|
||||||
}
|
}
|
||||||
|
dt *= animatedModel->UpdateSpeed;
|
||||||
animatedModel->GraphInstance.LastUpdateTime = t;
|
animatedModel->GraphInstance.LastUpdateTime = t;
|
||||||
|
|
||||||
// Evaluate animated nodes pose
|
// Evaluate animated nodes pose
|
||||||
|
|||||||
@@ -665,6 +665,7 @@ void AnimatedModel::Serialize(SerializeStream& stream, const void* otherObj)
|
|||||||
SERIALIZE(PerBoneMotionBlur);
|
SERIALIZE(PerBoneMotionBlur);
|
||||||
SERIALIZE(UseTimeScale);
|
SERIALIZE(UseTimeScale);
|
||||||
SERIALIZE(UpdateWhenOffscreen);
|
SERIALIZE(UpdateWhenOffscreen);
|
||||||
|
SERIALIZE(UpdateSpeed);
|
||||||
SERIALIZE(UpdateMode);
|
SERIALIZE(UpdateMode);
|
||||||
SERIALIZE(BoundsScale);
|
SERIALIZE(BoundsScale);
|
||||||
SERIALIZE(CustomBounds);
|
SERIALIZE(CustomBounds);
|
||||||
@@ -688,6 +689,7 @@ void AnimatedModel::Deserialize(DeserializeStream& stream, ISerializeModifier* m
|
|||||||
DESERIALIZE(PerBoneMotionBlur);
|
DESERIALIZE(PerBoneMotionBlur);
|
||||||
DESERIALIZE(UseTimeScale);
|
DESERIALIZE(UseTimeScale);
|
||||||
DESERIALIZE(UpdateWhenOffscreen);
|
DESERIALIZE(UpdateWhenOffscreen);
|
||||||
|
DESERIALIZE(UpdateSpeed);
|
||||||
DESERIALIZE(UpdateMode);
|
DESERIALIZE(UpdateMode);
|
||||||
DESERIALIZE(BoundsScale);
|
DESERIALIZE(BoundsScale);
|
||||||
DESERIALIZE(CustomBounds);
|
DESERIALIZE(CustomBounds);
|
||||||
|
|||||||
@@ -99,6 +99,12 @@ public:
|
|||||||
API_FIELD(Attributes="EditorOrder(40), DefaultValue(false), EditorDisplay(\"Skinned Model\")")
|
API_FIELD(Attributes="EditorOrder(40), DefaultValue(false), EditorDisplay(\"Skinned Model\")")
|
||||||
bool UpdateWhenOffscreen = false;
|
bool UpdateWhenOffscreen = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The animation update delta time scale. Can be used to speed up animation playback or create slow motion effect.
|
||||||
|
/// </summary>
|
||||||
|
API_FIELD(Attributes="EditorOrder(45), EditorDisplay(\"Skinned Model\")")
|
||||||
|
float UpdateSpeed = 1.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The animation update mode. Can be used to optimize the performance.
|
/// The animation update mode. Can be used to optimize the performance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user