public virtual void SetODEState(double time, ODEState state) { double[] s = state.State; Debug.Assert(s.Length == PointMassStateLength); Position = new Vector2D(s[0], s[1]); Velocity = new Vector2D(s[2], s[3]); Time = time; }
public virtual void SetODEState(double time, ODEState state) { int i = 0; foreach (IODEEquationPart p in parts) { int length = p.StateLength; double[] partState = new double[length]; Array.Copy(state.State, i, partState, 0, length); i += length; p.SetODEState(time, new ODEState(partState)); } }