internal bool CreateRailAligned(ObjectDictionary FreeObjects, Vector3 WorldPosition, Transformation RailTransformation, double StartingDistance, double EndingDistance) { if (Types.Length == 0) { return(false); } if (LastType > Types.Length - 1) { LastType = 0; } LastPlacement += Interval; double dz = LastPlacement - StartingDistance; WorldPosition += Position.X * RailTransformation.X + Position.Y * RailTransformation.Y + dz * RailTransformation.Z; UnifiedObject obj; FreeObjects.TryGetValue(Types[LastType], out obj); if (obj != null) { obj.CreateObject(WorldPosition, RailTransformation, new Transformation(), StartingDistance, EndingDistance, LastPlacement); } if (Types.Length > 1) { LastType++; } return(true); }
internal void CreateGroundAligned(ObjectDictionary FreeObjects, Vector3 WorldPosition, Transformation GroundTransformation, Vector2 Direction, double Height, double StartingDistance, double EndingDistance) { double d = TrackPosition - StartingDistance; Vector3 wpos = WorldPosition + new Vector3(Direction.X * d + Direction.Y * Position.X, Position.Y - Height, Direction.Y * d - Direction.X * Position.X); UnifiedObject obj; FreeObjects.TryGetValue(Type, out obj); if (obj != null) { obj.CreateObject(wpos, GroundTransformation, new Transformation(Yaw, Pitch, Roll), StartingDistance, EndingDistance, TrackPosition); } }
internal void CreateRailAligned(ObjectDictionary FreeObjects, Vector3 WorldPosition, Transformation RailTransformation, double StartingDistance, double EndingDistance) { double dz = TrackPosition - StartingDistance; WorldPosition += Position.X * RailTransformation.X + Position.Y * RailTransformation.Y + dz * RailTransformation.Z; UnifiedObject obj; FreeObjects.TryGetValue(Type, out obj); if (obj != null) { obj.CreateObject(WorldPosition, RailTransformation, new Transformation(Yaw, Pitch, Roll), StartingDistance, EndingDistance, TrackPosition); } }