예제 #1
0
        void UpdateIndex(int i)
        {
            Entity entity = manager.entities[i];

            //Blend between previous and current states.
            //Interpolated updates occur after proper updates complete.
            //That means that the internal positions and the front buffer positions are equivalent.
            //However, the backbuffer is uncontested and contains the previous frame's data.
            Vector3Ex.Lerp(ref manager.ReadBuffers.backBuffer[i].Position, ref entity.position, blendAmount, out backBuffer[i].Position);
            QuaternionEx.Slerp(ref manager.ReadBuffers.backBuffer[i].Orientation, ref entity.orientation, blendAmount, out backBuffer[i].Orientation);
        }
예제 #2
0
 /// <summary>
 /// Evaluates the curve section starting at the control point index using
 /// the weight value.
 /// </summary>
 /// <param name="controlPointIndex">Index of the starting control point of the subinterval.</param>
 /// <param name="weight">Location to evaluate on the subinterval from 0 to 1.</param>
 /// <param name="value">Value at the given location.</param>
 public override void Evaluate(int controlPointIndex, float weight, out System.Numerics.Vector3 value)
 {
     value = Vector3Ex.Lerp(ControlPoints[controlPointIndex].Value, ControlPoints[controlPointIndex + 1].Value, weight);
 }