public Matrix GetAbsoluteTransformAtTime(float time) { Matrix parentTransform = Matrix.Identity; if (Parent != null) { parentTransform = Parent.GetAbsoluteTransformAtTime(time); } Matrix transform = Transform; if (Keyframes.Any()) { var framesBefore = Keyframes.Where(x => x.Time < time); var framesAfter = Keyframes.Where(x => x.Time > time); var frame1 = framesBefore.Any() ? framesBefore.Last() : Keyframes.First(); var frame2 = framesAfter.Any() ? framesAfter.First() : Keyframes.Last(); transform = Matrix.Lerp(frame1.Transform, frame2.Transform, Math.Min((time - frame1.Time) / (float)(frame2.Time - frame1.Time), 1f)) * Transform; } return(transform * parentTransform); }