From 50a5abb2d8123aaef1627f997732bb3c6e55e916 Mon Sep 17 00:00:00 2001 From: dexy Date: Fri, 6 Mar 2020 22:25:41 +1100 Subject: [PATCH] Face animation improvements --- CodeWalker/Rendering/Renderable.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CodeWalker/Rendering/Renderable.cs b/CodeWalker/Rendering/Renderable.cs index fc36b70..267449d 100644 --- a/CodeWalker/Rendering/Renderable.cs +++ b/CodeWalker/Rendering/Renderable.cs @@ -584,13 +584,14 @@ namespace CodeWalker.Rendering break; case 24://face stuff v = anim.EvaluateVector4(frame, i, interpolate); //single float - //bone.AnimTranslation = v.XYZ(); - //bone.AnimRotation = Quaternion.RotationYawPitchRoll(v.X, 0.0f, 0.0f); + var fv = new Vector3(0, v.X * 0.005f, 0);//not sure about this + bone.AnimTranslation = bone.Translation + bone.AnimRotation.Multiply(fv);//not sure about this break; case 25://face stuff v = anim.EvaluateVector4(frame, i, interpolate); //vector3 roll/pitch/yaw var mult = -0.314159265f; - bone.AnimRotation = Quaternion.RotationYawPitchRoll(v.Z * mult, v.Y * mult, v.X * mult); + q = Quaternion.RotationYawPitchRoll(v.Z * mult, v.Y * mult, v.X * mult); + bone.AnimRotation = bone.Rotation * q; break; case 26://face stuff q = anim.EvaluateQuaternion(frame, i, interpolate);