public Vector3 InterpolateTripPosition(int now, float max_speed) { foreach (TripSegment t in _Trip) { if (t.IsWithinThisSegment(now)) { AGT_LinearMotion motion_calculator = new AGT_LinearMotion(t.StartPosition.X, t.StartPosition.Y, t.StartPosition.Z); motion_calculator.MoveTo(t.EndPosition.X, t.EndPosition.Y, t.EndPosition.Z, (t.Throttle * max_speed)); return motion_calculator.InterpolatePosition(t.CalculateSegmentOffset(now)); } } //return Vector3.Empty; return _Trip[0].StartPosition; }
private void SetCurrentPosition(string unit_name, AGT_LinearMotion mc, int time) { SetCurrentPosition(unit_name, mc.InterpolatePosition(time)); }