; BMw 318tds (E36) compact
; by Fabikan75, MudBear, Bartłomiej Kawecki
;
car
{
  name=BMW E36 318 Tds
  year=1995
  credits=by Fabikan75; Body Graphics by MudBear
  comments=Poj:1665 ccm3,Mmo:190 Nm przy 2000 obr./min.,Moc:90 KM( 66 kW )przy 4400 obr./min.
  
  id=BMW3_E36CPT
  version=050b6
  wheels=4

  skid
  {
    sample=skid.wav
  }
  shadow
  {
    texture=shadow.tga
    width=1.7
    length=4.1
    offset_z=0
  }
  cg
  {
    x=0
    y=-0.10
    z=0.02
  }
}
graphics 
{
  shadow 
  {
    texture=shadow.tga
    model
    {
      ; Projected shadow model
      file=shadow.dof
    }
  }
}
audio
{
skid
  	{
    		sample=skid.wav
  	}
  	acc_all
  	{
    		attack=600
    		decay=600
  	}
  	accelerate_out
  	{
    		smp0~audio.acc_all
    		{
      			volume=0.5
			sample=idle.wav
      			min=0
      			max=1200
      			natural=750
    		}
		smp1~audio.acc_all
    		{
      			volume=0.5
     			sample=low.wav
      			min=1200
      			max=2500
      			natural=2000
		}
		smp2~audio.acc_all
    		{
      			volume=0.5
     			sample=mid.wav
      			min=2500
      			max=3500
      			natural=3000
		}
		smp3~audio.acc_all
    		{
      			volume=0.5
     			sample=hi.wav
      			min=4000
      			max=6000
      			natural=4500
		}
		smp4~audio.acc_all
    		{
      			volume=0.5
     			sample=turbotds.wav
      			min=2200
      			max=5200
      			natural=3000
		
    		}
        }
  	decelerate_out
  	{
   		smp0~audio.acc_all
    		{
      			volume=0.5
			sample=idle.wav
      			min=0
      			max=1200
      			natural=750
    		}
		smp1~audio.acc_all
    		{
      			volume=0.5
     			sample=low.wav
      			min=1200
      			max=2500
      			natural=2000
		}
		smp2~audio.acc_all
    		{
      			volume=0.5
     			sample=mid.wav
      			min=2500
      			max=3500
      			natural=3000
		}
		smp3~audio.acc_all
    		{
      			volume=0.5
     			sample=hi.wav
      			min=4000
      			max=6000
      			natural=4500
		}
		smp4~audio.acc_all
    		{
      			volume=0.5
     			sample=turbotds.wav
      			min=2200
      			max=5200
      			natural=3000
		
    		}
  	}
}
gearwhine
{
  volume=0.5
  pitch_scale=0.001
  pitch_offset=0
  smp0~audio.acc_all
  {
    sample=gearwhine.wav
    min=0
    max=10000
    natural=7000
  }
}
wind
{
  volume=3
  volume_scale=0.1
  volume_offset=0
  pitch_scale=0
  pitch_offset=0
  smp0
  {
    sample=wind_ext.wav
    ; Speeds in m/s
    min=0
    max=9999
    natural=4000
  }
}
;----------------------------------------------------------------------
;Body:}
body
{
  mass=1215
  restitution_coeff=0.25
  inertia
  {
    x=1393
    y=1698
    z=421
  }
  model
  {
    file=body.dof
  }
  model_braking_l
  {
    ;file=brake.dof
  }
  model_light_l
  {
    ;file=glow.dof
  }
  width=1.393
  height=1.393
  length=4.210
  manual_box=1
}
;----------------------------------------------------------------------
;Steer:

steer
{
  x=0.400
  y=.095
  z=0.55
  radius=45
  xa=35
  lock=280
  linearity=1.233		;3 turns lock to lock. 16.0:1 steering ratio. 10.65m turning circle
  model
  {
    file=s_wheel.dof
  }
}
;----------------------------------------------------------------------
;Engine:

engine
{
  mass=0
  idle_rpm=700
  max_rpm=5500
  max_torque=190
  
  sample=acc5k.wav
  sample_rpm=7500

  curve_torque=torque.crv
  autoclutch_rpm=1200
  starter=1
  starter_torque=65
  start_stalled=0
  stall_rpm=400
  start_rpm=850
  reaction=0
  shifting
  {
    automatic=0
    shift_up_rpm=5750
    shift_down_rpm=2750
    time_to_declutch=325
    time_to_clutch=135
  }
  inertia
  {
    engine=0.29
    final_drive=0.2
  }
  braking_coeff=2.5
  rolling_friction_coeff=0.4
}
;----------------------------------------------------------------------
;Traction Constol:

traction_control
{
   enable=0
   max_velocity_ratio=1.18
   min_velocity_ratio=1
}
;----------------------------------------------------------------------
;ABS:

abs
{
	max_velocity_ratio=1.15
	min_velocity_ratio=1.05
	enable=1
}
;----------------------------------------------------------------------
;Gearbox:

gearbox
{
  gears=6
  gear0
  {
    ratio=-3.00
    inertia=0.2
  }
  gear1
  {
    ratio=4,00
    inertia=0.1
  }
  gear2
  {
    ratio=2.35
    inertia=0.08
  }
  gear3
  {
    ratio=1.45
    inertia=0.06
  }
  gear4
  {
    ratio=1.17
    inertia=0.04
  }
  gear5
  {
    ratio=0.75
    inertia=0.02
  }
  end_ratio=3.20
}
;----------------------------------------------------------------------
;Clutch:

clutch
{
  max_torque=1200
}
;----------------------------------------------------------------------
;Handbrakes:

handbrakes
{
  wheels=23
}
;----------------------------------------------------------------------
;Differential:

differential
{
	type=1
	ratio=3.15
	inertia=0.05

	;CST Modes
		;Snow
		;locking_coeff=15

		;Rain
		;locking_coeff=25

		;Sport
		;locking_coeff=35

		;Race
		locking_coeff=80

		;Off
		;locking_coeff=45

	output0=2
	output1=3
}
;----------------------------------------------------------------------
;Aero:

aero
{
  body
  {
    center=0 0 0
    cx=0.32		;sourced
    area=2		;measured
  }
  wings=2
  wing0
  {
    name=Overall aerodynamic effect F
    span=1
    cord=0.1
    coeff_drag=0
    coeff_down=17.18	;2746N (1275f 1471r) @ 300km/h
    center=0 -0.3 -1.31
    angle=0
    angle_offset=10
  }
  wing1
  {
    name=Overall aerodynamic effect R
    span=1
    cord=0.1
    coeff_drag=0
    coeff_down=19.82	;2746N (1275f 1471r) @ 300km/h
    center=0 -0.3 -1.39
    angle=0
    angle_offset=10
  }
}
;----------------------------------------------------------------------
;Antirollbar:

antirollbar
{
  count=2
  arb0
  {
    susp_left=1
    susp_right=0
    k=46600
  }
  arb1
  {
    susp_left=3
    susp_right=2
    k=32800
  }
}
;----------------------------------------------------------------------
;Suspension front:

susp_front
{
  y=-0.11
  z=1.34
  restlen=0.332		;245mm,288.2kg/2826N, 12.5cm ground clearance
  minlen=0.17
  maxlen=0.34
  k=42946		;k=m(nf/0.159)sq NF ~ 1.7 ~ 36936N/m
  bump_rate=1300	;1283*1.0
  rebound_rate=4950	;6163*0.8
  bump_function=0
  bump_max=1300
  rebound_function=0
  anti_pitch=0.09
  camber_change_per_m=0
  roll_center
  {
    x=0
    y=-0.40
    z=0
  }
}
susp0~susp_front
{
  x=0.72
  camber_change_steering=0.147
  caster_offset=-0.0235
  toe_change_per_m=0
}
susp1~susp_front
{
  x=-0.72
  camber_change_steering=-0.147
  caster_offset=-0.0235
  toe_change_per_m=0
}
;----------------------------------------------------------------------
;Suspension rear:

susp_rear
{
  y=-0.11
  z=-1.32
  restlen=0.331		;255mm, 366.8kg/3597N
  minlen=0.125
  maxlen=0.34
  k=57009		;k=m(nf/0.159)sq NF ~ 1.8 ~ 58036N/m
  bump_rate=1800	;1814*1.0
  rebound_rate=6650	;8305*0.8
  bump_function=0
  bump_max=1800
  rebound_function=0
  anti_pitch=0.14
  camber_change_per_m=0.45	;2.3 degree per 0.1m deflection!
  roll_center
  {
    x=0
    y=-0.50
    z=0
  }
}
susp2~susp_rear
{
  x=0.73
}
susp3~susp_rear
{
  x=-0.73
}
;----------------------------------------------------------------------
;Tire model:

tire_model_front
{
   damping_predict_lat=0
   damping_predict_long=0
}
tire_model_rear
{
   damping_predict_lat=0
   damping_predict_long=0
}
;----------------------------------------------------------------------
;Pacejka:

pacejka
{
  ; Pacejka constants for all tires
  ; Lateral force
  a0=1.3
  a1=-49
  a2=1216
  a3=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
  ; Longitudinal force
  b0=1.57
  b1=-48
  b2=2000
  b3=6.8
  b4=444
  b5=0
  b6=0.0034
  b7=-0.008
  b8=0.66
  b9=0
  b10=0
  b11=0
  b12=0
  ; Aligning moment
  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
}
;----------------------------------------------------------------------
;Wheel front:

wheel_front
{
  y=0
  z=0
  camber=-4.0
  steering=1
  powered=0
  lock=64
  ackerman=1.2
  mass=15
  inertia=1.12
  radius=0.30
  width=0.35
  rolling_coeff=0.015
  friction_road=1.7
  max_braking=2450
  braking_factor=0.9
  tire_rate=170000
  pacejka~pacejka
  { 
  }
}
wheel0~wheel_front
{
  x=0
  toe=0
  model
  {
    file=wheelM_l.dof
  }
  model_brake
  {
    file=
  }

}
wheel1~wheel_front
{
  x=0
  toe=0
  model
  {
    file=wheelM_r.dof
  }
  model_brake
  {
    file=
  }
}
;----------------------------------------------------------------------
;Wheel rear:

wheel_rear
{
  y=0
  z=0
  camber=-2.0
  steering=0
  powered=1
  mass=15
  inertia=1.26
  radius=0.30
  width=0.45
  rolling_coeff=0.015
  friction_road=1.7 
  max_braking=1150
  braking_factor=0.6
  max_handbrake_torque=2750
  tire_rate=170000
  pacejka~pacejka
  {
  }
}
wheel2~wheel_rear
{
  x=0
  toe=0
  model
  {
    file=wheelM_l.dof
  }
  model_brake
  {
    file=
  }
}
wheel3~wheel_rear
{
  x=0
  toe=0
  model
  {
    file=wheelM_r.dof
  }
  model_brake
  {
    file=
  }
}
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
;Camera

camera0
{
  offset
  {
    x=0.0
    y=1.5
    z=-7.0
  }
  angle
  {
    x=0.000000
    y=180.000000
    z=0.000000
  }
  name=Chase Close
  follow
  {
    pitch=0
    yaw=0
    roll=0
  }
  fov=55
  model=0
  wheels=0
  view=0
  src
  {
    mass=6
    k=300
    damping=90
    maxdist=2
  }
  dst
  {
    mass=1
    k=200
    damping=70
    maxdist=1
  }
}
camera1
{
  offset
  {
    x=0
    y=-0.15
    z=-4.600000
  }
  angle
  {
    x=12.000000
    y=-180.000000
    z=0.000000
  }
  name=Chase High
  follow
  {
    pitch=0
    yaw=1
    roll=0
  }
  fov=72
  model=0
  wheels=0
  view=0
}
camera2
{
  offset
  {
    x=0
    y=0.15
    z=2.100000
  }
  angle
  {
    x=0.000000
    y=180.000000
    z=0.000000
  }
  name=Bumper
  follow
  {
    pitch=1
    yaw=1
    roll=1
  }
  fov=80
  model=2
  wheels=0
  view=2
}
camera3
{
  follow
  {
    pitch=0
    yaw=0
    roll=0
  }
  offset
  {
    x=-0.3
    y=-0.0
    z=-45
  }
  angle
  {
    x=12
    y=17
    z=4
  }
  name=LowFrontAngle
  fov=5
}
camera4
{
  offset
  {
    x=1.150625
    y=0.2
    z=0.350000
  }
  angle
  {
    x=-2.00
    y=-175.472336
    z=-7.017359
  }
  follow
  {
    pitch=1
    yaw=1
    roll=1
  }
  fov=72
  model=0
  wheels=0
  view=0
  name=Left Front Wheel
}
camera5
{
  follow
  {
    pitch=0
    yaw=0
    roll=0
  }
  offset
  {
    x=0.0
    y=-0.25
    z=-5.5
  }
  angle
  {
    x=6.0
    y=30.853992
    z=0.0
  }
  name=Side High
  fov=60
  model=0
  wheels=1
  view=1
}
camera6
{
  follow
  {
    pitch=1
    yaw=-5
    roll=0
  }
  offset
  {
    x=-0.273437
    y=0.739583
    z=-6.650010
  }
  angle
  {
    x=15.194437
    y=-327.986633
    z=11.357632
  }
  name=Side High
  fov=30
}
camera7
{
  follow
  {
    pitch=0
    yaw=0
    roll=0
  }
  offset
  {
    x=0
    y=0
    z=-9
  }
  angle
  {
    x=10
    y=150
    z=0
  }
  fov=35
  model=0
  wheels=1
  view=0
  name=Front High
}
camera8
{
  follow
  {
    pitch=1
    yaw=1
    roll=1
  }
  offset
  {
    x=0.4
    y=-0.265
    z=-0.5
  }
  angle
  {
    x=7.000000
    y=-180
    z=0.000000
  }
  fov=70
  ; Type of model to use; 0=outside, 1=inside, 2=none
  model=1
  wheels=0
  view=1
  name=Inside Driver (fixed)
}
camera9
{
  follow
  {
    pitch=0
    yaw=0
    roll=0
  }
  offset
  {
    x=0.39
    y=0.32
    z=-0.45
  }
  offset_to
  {
    x=0.39
    y=0.29
    z=0.0
  }
  angle
  {
    x=7.000000
    y=-180
    z=0.000000
  }
  src
  {
    mass=3
    k=150
    damping=15
    maxdist=.01
  }
  dst
  {
    mass=1
    k=100
    damping=70
    maxdist=.01
  }
  fov=70
  ; Type of model to use; 0=outside, 1=inside, 2=none
  model=1
  wheels=0
  view=1
  name=Inside Driver
}