car
{
  name=Toyota 98 LM
  year=1998
  version=062
  credits=Mesh-VirtuaLM Physics and Ini-Kallahim, Update for Racer v0.6.2 by jamesnorman93
  comments=Converted from SCGT, Shader by Dream Factory.
  id=tlemans98
  ; Number of wheels
  wheels=4
  ; The frontal area (in m^2) of the entire car
  front_area=2.1
  ; Skidding
  skid
  {
    sample=skid.wav
  }
  shadow
  {
    ;texture=shadow.tga
    ;width=2.3
    ;length=4.7
  }
  ; Center of gravity of car sprung mass
  cg
  {
    x=0
    y=0
    z=0
  }
}
graphics
{
  ; Car models used
  shadow
  {
    model
    {
      ; Projected shadow model
        ;texture=shadow.tga
        file=body.dof
        use_shaders=0
    }
  }
}
body
{
  ; Weight of the car's body (kg)
  ; This excludes wheels, driver and fuel
  ; Believe it or not, the '67 P4 has a dry weight of 792kg! We'll use the engine weight to make up for a driver and fuel...
  mass=794
  ; Inertia values; X/Y/Z=pitch, yaw (heading), roll
  inertia
  {
    x=2950
    y=2430
    z=1590
  }
  width=2.03
  height=0.9
  length=4.46
  manual_box=1
  ; Stub graphics (will be overruled if a model is present)
  cockpit_start=1
  cockpit_length=1
  model
  {
    file=body.dof
        offset
        {
            x=0
            y=0
            z=0
        }
  }
}
steer
{
  ; Position (stub gfx)
  x=0
  y=.7
  z=.2
  ; Graphical representation
  radius=.0
  ; Rotation towards the driver
  xa=15
  ; Max angle of rotation (angle = -lock/2..lock/2)
  lock=110
}
engine
{
  mass=150
  ; Max rpm generated by the motor
  max_rpm=10000
  ; Idle rpm
  idle_rpm=1000
  autoclutch_rpm=1000
  stall_rpm=400
  start_rpm=950
  starter=1
  starter_torque=120
  ; Engine RPM -> maximum torque curve (normalized 0..1 curve)
  curve_torque=torque.crv
  ; Maximum torque (Nm)(multiplier for the torque curve) - Used to be a little to high...
  ; Nm = lb/ft * 1.356
  max_torque=559
  shifting
  {
    automatic=0
    ; RPMs at which to shift; make sure shift_down_rpm>shift_up_rpm
    shift_up_rpm=8200
    shift_down_rpm=4500
    ; Automatic shifting duration
    time_to_declutch=51
    time_to_clutch=51
  }
  ; Inertia of engine parts
  inertia
  {
    ; Rotational inertia of engine parts (kg*m^2)
    engine=0.07
    final_drive=0.12
  }
  ; Internal engine braking coefficient (0=low, >0=friction)
  braking_coeff=0.7
  ; Rolling friction coefficient; general friction slowing things down
  ; Related to car rolling speed, wheel rotation speed
  rolling_friction_coeff=0.4
  ; Engine friction
  ; NYI
  friction=0
  ; Audio
  ; Currently only 8-bit, 1 channel 22050Hz samples (.wav) are supported
  sample=engine.wav
  sample_rpm=10500
}
gearbox
{
  gears=7
  ; Gear ratios; note that negative gears are reverse gears
  gear0
  {
    ratio=-2.00
    inertia=0.5
  }
  gear1
  {
    ratio=2.75
    inertia=0.13
  }
  gear2
  {
    ratio=1.935
    inertia=0.09
  }
  gear3
  {
    ratio=1.518
    inertia=0.07
  }
  gear4
  {
    ratio=1.232
    inertia=0.05
  }
  gear5
  {
    ratio=1.0
    inertia=0.03
  }
  gear6
  {
    ratio=0.8
    inertia=0.02
  }
}

; The clutch...
clutch
{
    ; Maximum friction the clutch can generate (Nm). Make this bigger than
    ; ENGINE.MAX_TORQUE to avoid clutch slipping.
    max_torque=800
}

; The differential
differential
{
    ; Number of differentials. As multiple differentials aren't yet
    ; implemented, value of 0 should be used. That way the global
    ; differential (defined below)  will be used.
    count=0

    ; <NYI> The first differential.
    diff0
    {
        ; Diff type; 0=free, 1=viscous, 2=salisbury
        ;type=1

        ; Ratio of input vs. output
        ;ratio=4.7

        ; Inertia of ring gear
        ;inertia=0.05

        ; Differential locking
        ;locking_coeff=75
    }

    ; <NYI> The second differential.
    diff1
    {
        ; Etc.
    }

    ; Global differential parameters, will be obsolete in future versions if
    ; multiple differentials are defined above.
    ;
    ; At the moment Racer supports two types of differentials: free/open (0) and
    ; viscous (1). Salisbury diff (2) will be implemented later. FWD cars mostly
    ; have free differential...
    ; Although a brake assisted traction control does act a bit like a viscous
    ; locking differential. Maybe something like LOCKING_COEFF=25 could be used
    ; with TYPE=1 on an FWD car with a limited slip differential...
    type=1

    ; Ratio of input vs. output (default=1)
    ; This overrides GEARBOX.END_RATIO, which is now obsolete.
    ratio=3.90

    ; Inertia of ring gear
    inertia=0.02

    ; Amount of differential locking. 0 is open and 100 is the maximum in
    ; practise(?). Only used if TYPE=1 or TYPE=2
    locking_coeff=75

    ; The rest of the differential setup is used only if TYPE=2 (Salisbury), which
    ; is not yet implemented. There settings are probably familiar to GPL
    ; drivers...

    ; <NYI> Power ramp angle (degrees).
    power_angle=60

    ; <NYI> Coast ramp angle (degrees).
    coast_angle=60

    ; <NYI> Number of clutches to use (in differential).
    clutches=2

    ; <NYI> Clutch factor to adjust effect of clutches (in differential).
    clutch_factor=1.0
}

aero
{
  body
  {
    center=0 0 0
    cx=0.32
    area=1.5
  }
  wings=2
  wing0
  {
    name=FrontDam
    span=1.4
    cord=0.38
    coeff_drag=0.1
    coeff_down=0.45
    center=0 -0.1 2
    angle=20
    angle_offset=0
  }
  wing1
  {
    name=RearSpolier
    span=1.7
    cord=0.4
    coeff_drag=0.12
    coeff_down=0.9
    center=0 0.8 -2.4
    angle=22
    angle_offset=0
  }
}
;Suspension
antirollbar
{
  count=2
  arb0
  {
    susp_left=0
    susp_right=1
    k=11000
  }
  arb1
  {
    susp_left=2
    susp_right=3
    k=9000
  }
}
susp0
{
  ; Relative location (to body)
  x=.78
  y=.45
  z=1.600000
  ; Size of spring when in rest (used as size of suspension actually)
  restlen=.55
  minlen=.25
  maxlen=.7
  ; Spring coefficient (N/m); determines force when spring is pulled/pushed
  k=29500
  ; Damper bump rate (N/m/s)
  bump_rate=16600
  ; Rebound rate (N/m/s)
  rebound_rate=16800
  ; Roll center (lateral forces are applied here; relative to suspension)
  roll_center
  {
    x=0
    y=-0.25
    z=0
  }
  ; Gfx
  radius=.04
  slices=5
  model
  {
    file=
    scale
    {
      x=1
      y=1
      z=1
    }
  }
}
susp1
{
  ; Relative location (to body)
  x=-.78
  y=.45
  z=1.60000
  ; Size of suspension when in rest
  restlen=.55
  minlen=.25
  maxlen=.7
  radius=.04
  slices=5
  ; Spring rate in N/m
  k=29500
  ; Damper bump rate (N/(m/s))
  bump_rate=6600
  ; Rebound rate (N/m/s)
  rebound_rate=6800
  ; Roll center
  roll_center
  {
    x=0
    y=-0.25
    z=0
  }
}
susp2
{
  x=.78
  y=.48
  z=-1.260000
  ; Size of suspension when in rest
  restlen=.58
  minlen=.3
  maxlen=.85
  radius=.04
  slices=5
  ; Spring rate
  k=33000
  ; Damper bump rate (N/(m/s))
  bump_rate=17100
  ; Rebound rate (N/m/s)
  rebound_rate=17300
  ; Roll center
  roll_center
  {
    x=0
    y=-0.25
    z=0
  }
}
susp3
{
  x=-.78
  y=.48
  z=-1.260000
  ; Size of suspension when in rest
  restlen=.58
  minlen=.3
  maxlen=.85
  radius=.04
  slices=5
  ; Spring rate
  k=33000
  ; Damper bump rate (N/(m/s))
  bump_rate=17100
  ; Rebound rate (N/m/s)
  rebound_rate=17300
  ; Roll center
  roll_center
  {
    x=0
    y=-.25
    z=0
  }
}
;
; Wheels
;
tire_model
{
  ; SAE 950311 low-speed tire implementation
  ; Relaxation length laterally (in m)
  relaxation_length_lat=0.91
  ; Relaxation length longitudinally (in m)
  relaxation_length_long=.091
  ; Damping lat/long speed (in m/s, same for longitudinal and lateral)
  damping_speed=1.45
  ; Strength of damping; too little and the car keeps vibrating (low freq.)
  damping_coefficient_lat=0.7
  damping_coefficient_long=0.7
}
  pacejka
  {
    ; Pacejka constants for all tires
    ; Lateral force
  a0=1.44 ;1.3
  a1=-41
  a2=1700
  a3=2500 ;1632.
  a4=11.
  a5=0.006
  a6=-0.04
  a7=-0.4
  a8=0.003
  a9=-0.002
  a10=0.16
  a111=-11.
  a112=0.045
  a12=0.17
  a13=-23.5
  b0=1.62 ;1.57
  b1=-37
  b2=1630.
  b3=6.8
  b4=380 ;320
  b5=0.1
  b6=-0.01
  b7=-0.008
  b8=0.88
  b9=0.
  b10=0.
  b11=0.
  b12=0.
  c0=2.46
  c1=-2.77
  c2=-2.9
  c3=-0
  c4=-3.6
  c5=-0.1
  c6=0.0004
  c7=0.22
  c8=-2.31
  c9=3.87
  c10=0.0007
  c11=-0.05
  c12=-0.006
  c13=0.33
  c14=-0.04
  c15=-0.4
  c16=0.092
  c17=0.0114
  optimal_slipratio=0.13718
  optimal_slipangle=0.21 ;0.26
  }
wheel0
{
    x=0
    y=0
    z=0
    steering=1
    powered=0
    lock=38
    ackerman=1.1
    camber=-1
    rolling_coeff=0.016
    mass=18
    inertia=1.8
    radius=0.325
    max_braking=3300
    braking_factor=1
    inboard_brakes=0
    max_handbrake_torque=2300
    tire_rate=220000
  model
  {
    ; Use a 3D model instead of stub graphics
    file=tire_lf.dof
  }
  model_brake
  {
    file=caliper_lf.dof
    offset
    {
      x=0.075
      y=0
      z=0.02
     }
  }
  pacejka~pacejka
  {
  a1=-36
  b1=-31
  }
}
wheel1
{
    x=0
    y=0
    z=0
    steering=1
    powered=0
    lock=38
    ackerman=1.1
    camber=-1
    rolling_coeff=0.016
    mass=18
    inertia=1.8
    radius=0.325
    max_braking=3300
    braking_factor=1
    inboard_brakes=0
    max_handbrake_torque=2300
    tire_rate=220000
  model
  {
    ; Use a 3D model instead of stub graphics
    file=tire_rf.dof
  }
  model_brake
  {
    file=caliper_rf.dof
    offset
    {
      x=-0.075
      y=0
      z=0.02
     }
  }
  pacejka~pacejka
  {
  a1=-36
  b1=-31
  }
}
wheel2
{
  ; Position
  x=0
  y=0
  z=0
  steering=0
  ; Driven by motor?
  powered=1
    lock=38
    ackerman=1.1
    toe=0
    camber=-1.3
    rolling_coeff=0.016
    mass=18
    inertia=1.8
    radius=0.325
    max_braking=1800
    braking_factor=1
    inboard_brakes=0
    max_handbrake_torque=2300
    tire_rate=220000

 model
  {
    ; Use a 3D model instead of stub graphics
    file=tire_lr.dof
  }
  model_brake
  {
    file=caliper_lr.dof
    offset
    {
      x=0.075
      y=0
      z=0.02
     }
  }
  pacejka~pacejka
  {
  a0=1.78
  a2=1680
  b2=1720
  }
}
wheel3
{
  ; Position
  x=0
  y=0
  z=0
  steering=0
  ; Driven by motor?
  powered=1
    lock=38
    ackerman=1.1
    toe=0
    camber=-1.3
    rolling_coeff=0.016
    mass=18
    inertia=1.8
    radius=0.325
    max_braking=1800
    braking_factor=1
    inboard_brakes=0
    max_handbrake_torque=2300
    tire_rate=220000
  model
  {
    ; Use a 3D model instead of stub graphics
    file=tire_rr.dof
  }
  model_brake
  {
    file=caliper_rf.dof
    offset
    {
      x=-0.075
      y=0
      z=0.02
     }
  }
  pacejka~pacejka
  {
  a0=1.78
  a2=1680
  b2=1720
  }
}
}
;	------------------ 5.1 ALPHA AUDIO COMPATABILTY -----------------

audio
{
  skid
  {
    sample=skid.wav
  }
  acc_all
  {
    attack=100
    decay=100
  }
  dec_all
  {
    attack=0
    decay=100
  }
  accelerate_out
  {
    ; Master volume for this set (0..1)
    volume=0.9
    smp0~audio.acc_all
    {
      sample=engine.wav
      min=0
      max=1001
      ; Sample's actual natural frequency
      natural=11000
      minvol=0.75
      maxvol=1
    }
    smp1~audio.acc_all
    {
      sample=engine.wav
      min=1100
      max=12500
      natural=10500
      minvol=1.5
      maxvol=2
      volume_scale=0.95
    }
  }
}
camera0
{
  offset
  {
    x=-0.004687
    y=-0.385417
    z=-3.385002
  }
  angle
  {
    x=15.138849
    y=180.173615
    z=0.000000
  }
  name=Behind
  follow
  {
    pitch=0
    yaw=1
    roll=0
  }
  fov=75
}
camera1
{
  offset
  {
    x=0.517187
    y=0.606250
    z=-2.890002
  }
  angle
  {
    x=24.027788
    y=-25.520817
    z=0.000000
  }
  name=Side view
  follow
  {
    pitch=0
    yaw=1
    roll=0
  }
  fov=70
}
camera2
{
  offset
  {
    x=-0.589064
    y=-1.162499
    z=-1.080001
  }
  angle
  {
    x=1.527779
    y=-207.291458
    z=12.934029
  }
  follow
  {
    pitch=0
    yaw=1
    roll=1
  }
}
camera3
{
  follow
  {
    pitch=
    yaw=1
    roll=
  }
  offset
  {
    x=0.342190
    y=-0.170833
    z=-2.409997
  }
  angle
  {
    x=-0.694461
    y=36.632000
    z=-2.083333
  }
  name=Wheels
}
camera4
{
  offset
  {
    x=-0.493750
    y=-2.308333
    z=-8.135000
  }
  angle
  {
    x=2.361111
    y=-110.763885
    z=0.000000
  }
}
camera6
{
  follow
  {
    pitch=1
    yaw=1
    roll=0
  }
  offset
  {
    x=-0.018750
    y=-0.225001
    z=-3.545002
  }
  angle
  {
    x=-6.666670
    y=-359.201965
    z=-0.434030
  }
}
camera7
{
  offset
  {
    x=-0.029688
    y=-1.083335
    z=-2.739993
  }
  angle
  {
    x=-29.166676
    y=-180.034927
    z=0.000000
  }
  follow
  {
    pitch=0
    yaw=1
    roll=1
  }
}
camera9
{
  follow
  {
    pitch=1
    yaw=1
    roll=1
  }
  offset
  {
    x=0.017188
    y=-0.777077
    z=0.560004
  }
  angle
  {
    x=0.000000
    y=-180.000000
    z=0.000000
  }
  fov=70
}
camera8
{
  offset
  {
    x=-0.520318
    y=-0.314583
    z=-4.494998
  }
  angle
  {
    x=7.361122
    y=66.145706
    z=0.000000
  }
  follow
  {
    pitch=0
    yaw=1
    roll=1
  }
}
camera5
{
  follow
  {
    pitch=0
    yaw=1
    roll=0
  }
  offset
  {
    x=0.000000
    y=-1.000000
    z=-6.019992
  }
  angle
  {
    x=21.666662
    y=-105.555519
    z=2.430554
  }
  name=High
}
