Exemple #1
0
        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);
        }
Exemple #2
0
 internal WallDike(int type, Direction direction, ObjectDictionary LeftObjects, ObjectDictionary RightObjects, bool exists = true)
 {
     Exists       = exists;
     Type         = type;
     Direction    = direction;
     leftObjects  = LeftObjects;
     rightObjects = RightObjects;
 }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
        internal void Create(Vector3 wpos, Transformation RailTransformation, double StartingDistance, double EndingDistance, double Brightness, ObjectDictionary Beacon)
        {
            UnifiedObject obj = null;

            if (BeaconStructureIndex == -2)
            {
                switch (Type)
                {
                case 0: obj = CompatibilityObjects.TransponderS; break;

                case 1: obj = CompatibilityObjects.TransponderSN; break;

                case 2: obj = CompatibilityObjects.TransponderFalseStart; break;

                case 3: obj = CompatibilityObjects.TransponderPOrigin; break;

                case 4: obj = CompatibilityObjects.TransponderPStop; break;
                }
            }
            else
            {
                int b = BeaconStructureIndex;
                if (b >= 0 & Beacon.ContainsKey(b))
                {
                    obj = Beacon[b];
                }
            }
            if (obj != null)
            {
                double dx = Position.X;
                double dy = Position.Y;
                double dz = TrackPosition - StartingDistance;
                wpos += dx * RailTransformation.X + dy * RailTransformation.Y + dz * RailTransformation.Z;
                double tpos = TrackPosition;
                if (BeaconStructureIndex == -2)
                {
                    obj.CreateObject(wpos, RailTransformation, new Transformation(Yaw, Pitch, Roll), -1, StartingDistance, EndingDistance, tpos, Brightness);
                }
                else
                {
                    obj.CreateObject(wpos, RailTransformation, new Transformation(Yaw, Pitch, Roll), StartingDistance, EndingDistance, tpos);
                }
            }
        }
Exemple #6
0
        internal void Create(Vector3 wpos, Transformation RailTransformation, double StartingDistance, double EndingDistance, ObjectDictionary Beacon)
        {
            UnifiedObject obj = null;

            if (Beacon.ContainsKey(BeaconStructureIndex))
            {
                obj = Beacon[BeaconStructureIndex];
            }
            if (obj != null)
            {
                double dx = Position.X;
                double dy = Position.Y;
                double dz = TrackPosition - StartingDistance;
                wpos += dx * RailTransformation.X + dy * RailTransformation.Y + dz * RailTransformation.Z;
                double tpos = TrackPosition;
                obj.CreateObject(wpos, RailTransformation, new Transformation(Yaw, Pitch, Roll), StartingDistance, EndingDistance, tpos);
            }
        }