コード例 #1
0
        //Draw interpolation (Before each Drawing)
        public void Interpolation(double interpolationHd, float interpolationLd, float elapsedTime)
        {
            Quaternion.Slerp(ref LookAtDirection.ValuePrev, ref LookAtDirection.Value, interpolationLd, out LookAtDirection.ValueInterp);
            Quaternion.Slerp(ref MoveDirection.ValuePrev, ref MoveDirection.Value, interpolationLd, out MoveDirection.ValueInterp);
            Vector3D.Lerp(ref WorldPosition.ValuePrev, ref WorldPosition.Value, interpolationHd, out WorldPosition.ValueInterp);

            if (ModelInstance != null)
            {
                ModelInstance.HeadRotation = Quaternion.Invert(LookAtDirection.ValueInterp);
                ModelInstance.Rotation     = Quaternion.Invert(MoveDirection.ValueInterp);
                ModelInstance.Interpolation(elapsedTime);
            }
        }