Пример #1
0
 internal FlameDescription(string name, IniFileSection fileSection, Matrix graphicMatrix)
 {
     Name      = name;
     Position  = fileSection.GetSlimVector3("POSITION");
     Direction = fileSection.GetSlimVector3("DIRECTION");
     Group     = fileSection.GetInt("GROUP", 0);
 }
Пример #2
0
 internal ColliderDescription(string name, IniFileSection fileSection)
 {
     Name         = name;
     Center       = fileSection.GetSlimVector3("CENTRE");
     Size         = fileSection.GetSlimVector3("SIZE");
     GroundEnable = fileSection.GetBool("GROUND_ENABLE", true);
 }
Пример #3
0
            public DwbSuspension(IniFileSection basic, IniFileSection section, bool front, float xOffset, float wheelRadius) : base(front, wheelRadius)
            {
                var baseY      = section.GetFloat("BASEY", 1f);
                var track      = section.GetFloat("TRACK", 1f);
                var wheelbase  = basic.GetFloat("WHEELBASE", 2f);
                var cgLocation = basic.GetFloat("CG_LOCATION", 0.5f);

                StaticCamber = basic.GetFloat("STATIC_CAMBER", 0f);
                RefPoint     = front ?
                               new Vector3(track * 0.5f * xOffset, baseY, wheelbase * (1f - cgLocation)) :
                               new Vector3(track * 0.5f * xOffset, baseY, -wheelbase * cgLocation);

                Points[0] = section.GetSlimVector3("WBCAR_TOP_FRONT");
                Points[1] = section.GetSlimVector3("WBCAR_TOP_REAR");
                Points[2] = section.GetSlimVector3("WBCAR_BOTTOM_FRONT");
                Points[3] = section.GetSlimVector3("WBCAR_BOTTOM_REAR");
                Points[4] = section.GetSlimVector3("WBTYRE_TOP");
                Points[5] = section.GetSlimVector3("WBTYRE_BOTTOM");
                Points[6] = section.GetSlimVector3("WBCAR_STEER");
                Points[7] = section.GetSlimVector3("WBTYRE_STEER");

                for (var i = Points.Length - 1; i >= 0; i--)
                {
                    Points[i].X *= -xOffset;
                }
            }
Пример #4
0
 public WingDescription(IniFileSection section)
 {
     Name     = section.GetNonEmpty("NAME");
     Chord    = section.GetFloat("CHORD", 1f);
     Span     = section.GetFloat("SPAN", 1f);
     Angle    = section.GetFloat("ANGLE", 0f);
     Position = section.GetSlimVector3("POSITION");
 }
Пример #5
0
            public StrutSuspension(IniFileSection basic, IniFileSection section, bool front, float xOffset, float wheelRadius) : base(front, wheelRadius)
            {
                var baseY      = section.GetFloat("BASEY", 1f);
                var track      = section.GetFloat("TRACK", 1f);
                var wheelbase  = basic.GetFloat("WHEELBASE", 2f);
                var cgLocation = basic.GetFloat("CG_LOCATION", 0.5f);

                StaticCamber = basic.GetFloat("STATIC_CAMBER", 0f);
                RefPoint     = front ?
                               new Vector3(track * 0.5f * xOffset, baseY, wheelbase * (1f - cgLocation)) :
                               new Vector3(track * 0.5f * xOffset, baseY, -wheelbase * cgLocation);

                var vector3 = new Vector3(-xOffset, 1f, 1f);

                Points[0] = Vector3.Modulate(section.GetSlimVector3("STRUT_CAR"), vector3);
                Points[1] = Vector3.Modulate(section.GetSlimVector3("STRUT_TYRE"), vector3);
                Points[2] = Vector3.Modulate(section.GetSlimVector3("WBCAR_BOTTOM_FRONT"), vector3);
                Points[3] = Vector3.Modulate(section.GetSlimVector3("WBCAR_BOTTOM_REAR"), vector3);
                Points[5] = Vector3.Modulate(section.GetSlimVector3("WBTYRE_BOTTOM"), vector3);
                Points[6] = Vector3.Modulate(section.GetSlimVector3("WBCAR_STEER"), vector3);
                Points[7] = Vector3.Modulate(section.GetSlimVector3("WBTYRE_STEER"), vector3);
            }
Пример #6
0
            public AxleSuspension(IniFileSection basic, IniFileSection section, IniFileSection axleSection, bool front, float wheelRadius) : base(front, wheelRadius)
            {
                var baseY      = section.GetFloat("BASEY", 1f);
                var track      = section.GetFloat("TRACK", 1f);
                var wheelbase  = basic.GetFloat("WHEELBASE", 2f);
                var cgLocation = basic.GetFloat("CG_LOCATION", 0.5f);

                StaticCamber = basic.GetFloat("STATIC_CAMBER", 0f);
                RefPoint     = front ?
                               new Vector3(0f, baseY, wheelbase * (1f - cgLocation)) :
                               new Vector3(0f, baseY, -wheelbase * cgLocation);

                AxleWidth = track;
                Links     = Enumerable.Range(0, axleSection.GetInt("LINK_COUNT", 0)).Select(i => new AxleLink(
                                                                                                axleSection.GetSlimVector3($"J{i}_CAR"),
                                                                                                axleSection.GetSlimVector3($"J{i}_AXLE"))).ToArray();
            }
Пример #7
0
 internal ColliderDescription(IniFileSection fileSection, Vector3 offset)
 {
     Center       = fileSection.GetSlimVector3("CENTRE") + offset;
     Size         = fileSection.GetSlimVector3("SIZE");
     GroundEnable = fileSection.GetBool("GROUND_ENABLE", true);
 }