Exemplo n.º 1
0
 public BlurredObject(IniFileSection section)
 {
     WheelIndex = section.GetInt("WHEEL_INDEX", -1);
     Name       = section.GetNonEmpty("NAME");
     MinSpeed   = section.GetFloat("MIN_SPEED", 0f);
     MaxSpeed   = section.GetFloat("MAX_SPEED", 30f);
 }
Exemplo n.º 2
0
 public WingAnimation(IniFileSection section) : base(section.GetNonEmpty("FILE"), section.GetFloat("TIME", 1f))
 {
     Id         = section.GetInt("WING", 0);
     Next       = section.GetIntNullable("NEXT");
     StartAngle = section.GetFloat("MIN", 0f);
     AngleRange = section.GetFloat("MAX", 60f) - StartAngle;
 }
Exemplo n.º 3
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);

                Points[0] = section.GetSlimVector3("STRUT_CAR");
                Points[1] = section.GetSlimVector3("STRUT_TYRE");
                Points[2] = section.GetSlimVector3("WBCAR_BOTTOM_FRONT");
                Points[3] = section.GetSlimVector3("WBCAR_BOTTOM_REAR");
                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;
                }
            }
Exemplo n.º 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");
 }
Exemplo n.º 5
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();
            }
Exemplo n.º 6
0
            internal WheelDescription(string name, IniFileSection wheelsPairSection, IniFileSection axleSection, IniFileSection graphicOffsetSection,
                                      float wheelbase, float cgLocation, bool left, bool front, [CanBeNull] CarSuspensionModifiers modifiers)
            {
                Name         = name;
                BaseY        = axleSection.GetFloat("BASEY", 0f) + ((front ? modifiers?.BaseYFrontAdd : modifiers?.BaseYRearAdd) ?? 0f);
                StaticCamber = axleSection.GetFloat("STATIC_CAMBER", 0f) + ((front ? modifiers?.CamberFrontAdd : modifiers?.CamberRearAdd) ?? 0f);
                StaticToe    = (front ? modifiers?.ToeFrontAdd : modifiers?.ToeRearAdd) ?? 0f;

                var baseCenter = new Vector3(
                    (left ? 0.5f : -0.5f) * (
                        axleSection.GetFloat("TRACK", 1.4f) +
                        ((front ? modifiers?.TrackWidthFrontAdd : modifiers?.TrackWidthRearAdd) ?? 0f)),
                    BaseY,
                    (front ? 1f - cgLocation : -cgLocation) * wheelbase + ((front ? modifiers?.ZOffsetFrontAdd : modifiers?.ZOffsetRearAdd) ?? 0f));

                CenterWheel = baseCenter + new Vector3(graphicOffsetSection.GetFloat("WHEEL_" + name, 0f), 0f, 0f);
                CenterSusp  = baseCenter + new Vector3(graphicOffsetSection.GetFloat("SUSP_" + name, 0f), 0f, 0f);
                Radius      = wheelsPairSection.GetFloat("RADIUS", 0.3f);
                RimRadius   = wheelsPairSection.GetFloat("RIM_RADIUS", 0.23f) - 0.0254f;
                Width       = wheelsPairSection.GetFloat("WIDTH", 0.2f);
            }
Exemplo n.º 7
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);

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

                Points[0] = Vector3.Modulate(section.GetSlimVector3("WBCAR_TOP_FRONT"), vector3);
                Points[1] = Vector3.Modulate(section.GetSlimVector3("WBCAR_TOP_REAR"), vector3);
                Points[2] = Vector3.Modulate(section.GetSlimVector3("WBCAR_BOTTOM_FRONT"), vector3);
                Points[3] = Vector3.Modulate(section.GetSlimVector3("WBCAR_BOTTOM_REAR"), vector3);
                Points[4] = Vector3.Modulate(section.GetSlimVector3("WBTYRE_TOP"), 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);
            }
Exemplo n.º 8
0
 internal LodDescription(IniFileSection fileSection)
 {
     FileName = fileSection.GetNonEmpty("FILE");
     In       = fileSection.GetFloat("IN", 0f);
     Out      = fileSection.GetFloat("OUT", 0f);
 }