/// <summary> /// Starts a new straight track at the given position and rotation /// </summary> /// <param name="position">Track start position</param> /// <param name="rotation">Track start rotation</param> /// <param name="length">Length of track</param> /// <param name="inverted">If the track piece should be inverted</param> /// <returns></returns> public TrackSection StartTrack(Vector3 position, Quaternion rotation, float length, bool inverted = false) { if (CurrentSection != null) { PushState(); } CurrentSection = new TrackSection() { Length = length, Position = position, Rotation = rotation, }; if (inverted) { CurrentSection.Flip(); } Inverted = inverted; return(CurrentSection); }