// Lexus IS-F Suspension Geometry
//////////////////////////////////////////////////////////////////////////
//
// Conventions:
//
// +x = left
// +z = rear
// +y = up
// +pitch = nose up
// +yaw = nose right
// +roll = right
//
// [BODY]  - a rigid mass with mass and inertial properties
// [JOINT] - a ball joint constraining an offset of one body to an
//           offset of another body (eliminates 3 DOF)
// [HINGE] - a constraint restricting the relative rotations of two
//           bodies to be around a single axis (eliminates 2 DOF).
// [BAR]   - a constraint holding an offset of one body from an offset of
//           another body at a fixed distance (eliminates 1 DOF).
// [JOINT&HINGE] - both the joint and hinge constraints, forming the
//           conventional definition of a hinge (eliminates 5 DOF).
//
// FRONT-
// Kingpin inclination: 11.1833333 degrees
// Camber: 0.9666667 deg
// Caster: 8.7 deg
// Toe: 0.18mm toe-in
// Track: 1.560m (offset rims) Tire centers probably about 1.5198m
//
// Kingpin inclination: ?.? degrees
// Camber: 0.78333 deg
// Caster: ?0.0? deg
// Toe: 3.00mm toe-in
// Track: 1.516m (offset rims) Tire centers probably about 1.4740m
//
//////////////////////////////////////////////////////////////////////////

// Body including all rigidly attached parts (wings, barge boards, etc.)
[BODY]
name=body mass=(0) inertia=(0,0,0)
pos=(0,0,0) ori=(0,0,0)

// Front spindles
[BODY]
name=fl_spindle mass=(16.5) inertia=(0.0400,0.0385,0.0370) // upright + 0.5*susparms + motionratio*dampershaftmass + 0.5*motionratio*springmass. ~16.5kg?
pos=( 0.7260019,-0.0007011,-1.3499637) ori=(0.0,0.0,0.0)

[BODY]
name=fr_spindle mass=(16.5) inertia=(0.0400,0.0385,0.0370)
pos=(-0.7260019,-0.0007011,-1.3499637) ori=(0.0,0.0,0.0)

// Front wheels
[BODY]
name=fl_wheel mass=(32.0) inertia=(1.680,1.090,1.090) // Mass = Rim ~9.5 + Tire ~10? + Disc ~9? + BrakeHub+Axle ~3.5?
pos=(0.75990,0.0,-1.3500) ori=(0.0,0.0,0.0)

// Inertia = Tire sidewall ~surface area 2*((pi*.331^2)-(pi*.2413^2))=0.3225492655. Sidewall thickness ~0.5x carcus thickness (thus mass)
// Tire carcus surface area = 2*pi*.326*.225 = 0.460871642282 (tire radius minus 0.5 total thickness ~0.005m)
// totally, 0.460871642282+0.3225492655. Sidewall ~0.004m thick, mass density ~0.5x tread. 0.5*0.3225492655+1*0.460871642282
// equivalence 10/0.5*0.3225492655+1*0.460871642282=10/0.622146275032
// sidewall mass ~2.5922301kg, carcus 7.40776985kg
// .5*7.4*(.319^2+.331^2)=0.7818914 carcus pitch inertia
// .5*2.6*(.2413^2+.326^2)=0.213852197 sidewall pitch inertia
// Rim, very approximate calculation .5*9.5*(.10^2+.241^2)=0.32338475 pitch inertia
// Disc, .5*9*(.08^2+.18^2)=0.1746
// Hub+Axle part, .5*3.5*(.12^2)=0.0252
// Total (minus disc) 1.344328347, with disc 1.518928347

[BODY]
name=fr_wheel mass=(32.0) inertia=(1.680,1.090,1.090)
pos=(-0.75990,0.0,-1.3500) ori=(0.0,0.0,0.0)

// Rear spindles
[BODY]
name=rl_spindle mass=(17.5) inertia=(0.0450,0.0435,0.0420) // upright + 0.5*susparms + motionratio*dampershaftmass + 0.5*motionratio*springmass. ~17.5kg?
pos=( 0.65250,-0.0007,1.3810) ori=(0.0,0.0,0.0)

[BODY]
name=rr_spindle mass=(17.5) inertia=(0.0450,0.0435,0.0420)
pos=(-0.65250,-0.0007,1.3810) ori=(0.0,0.0,0.0)

// Rear wheels
[BODY]
name=rl_wheel mass=(33.3) inertia=(1.740,1.130,1.130) // Rim ~9.8, Tire ~11.5?, Disc ~7?, BrakeHub+Axle+0.5xShaft ~5.0?
pos=( 0.73700,0.0,1.38050) ori=(0.0,0.0,0.0)

[BODY]
name=rr_wheel mass=(33.3) inertia=(1.740,1.130,1.130)
pos=(-0.73700,0.0,1.38050) ori=(0.0,0.0,0.0)

// Fuel in tank is not rigidly attached - it is attached with springs and
// dampers to simulate movement.  Properties are defined in the HDV file.

[BODY]
name=fuel_tank mass=(1.5) inertia=(1.0,1.0,1.0)
pos=(0.0,0.0,0.0) ori=(0.0,0.0,0.0)

// Driver's head is not rigidly attached, and it does NOT affect the vehicle
// physics.  Position is from the eyepoint defined in the VEH file, while
// other properties are defined in the head physics file.

[BODY]
name=driver_head mass=(6.20) inertia=(0.035,0.025,0.030)
pos=(0.0,0.0,0.0) ori=(0.0,0.0,0.0)

//////////////////////////////////////////////////////////////////////////
//
// Constraints
//
//////////////////////////////////////////////////////////////////////////

// Front wheel and spindle connections
[JOINT&HINGE]
posbody=fl_wheel negbody=fl_spindle pos=fl_wheel axis=( 0.75990,0.0,0.0)

[JOINT&HINGE]
posbody=fr_wheel negbody=fr_spindle pos=fr_wheel axis=(-0.75990,0.0,0.0)


// Front left suspension (2 A-arms + 1 steering arm = 5 links)
[BAR] // forward lower arm
posbody=body negbody=fl_spindle pos=(0.3156653,-0.0947631,-1.3773282) neg=(0.7068877,-0.0782750,-1.3532304)

[BAR] // rearward lower arm
name=fl_fore_lower posbody=body negbody=fl_spindle pos=(0.2860542,-0.0782366,-1.0427874) neg=(0.7068877,-0.0782750,-1.3532304)

[BAR] // forward upper arm
name=fl_fore_upper posbody=body negbody=fl_spindle pos=(0.4060197,0.3417360,-1.3970385) neg=(0.6158113,0.3824444,-1.2824053)

[BAR] // rearward upper arm
posbody=body negbody=fl_spindle pos=(0.4054943,0.3108626,-1.1880205) neg=(0.6158113,0.3824444,-1.2824053)

[BAR] // steering arm (must be named for identification)
name=fl_steering posbody=body negbody=fl_spindle pos=(0.3046306,-0.0838713,-1.4706661) neg=(0.7260661,-0.0656043,-1.4688177)


// Front right suspension (2 A-arms + 1 steering arm = 5 links)
[BAR] // forward lower arm
name=fr_fore_lower posbody=body negbody=fr_spindle pos=(-0.3156653,-0.0947631,-1.3773282) neg=(-0.7068877,-0.0782750,-1.3532304)

[BAR] // rearward lower arm
posbody=body negbody=fr_spindle pos=(-0.2860542,-0.0782366,-1.0427874) neg=(-0.7068877,-0.0782750,-1.3532304)

[BAR] // forward upper arm (used in steering lock calculation)
name=fr_fore_upper posbody=body negbody=fr_spindle pos=(-0.4060197,0.3417360,-1.3970385) neg=(-0.6158113,0.3824444,-1.2824053)

[BAR] // rearward upper arm
posbody=body negbody=fr_spindle pos=(-0.4054943,0.3108626,-1.1880205) neg=(-0.6158113,0.3824444,-1.2824053)

[BAR] // steering arm (must be named for identification)
name=fr_steering posbody=body negbody=fr_spindle pos=(-0.3046306,-0.0838713,-1.4706661) neg=(-0.7260661,-0.0656043,-1.4688177)


// Rear left suspension (2 A-arms + 1 straight link = 5 links)
[BAR] // forward lower arm
posbody=body negbody=rl_spindle pos=(0.1914663,-0.0401679,1.1409805) neg=(0.6636131,-0.1317047,1.3801439)

[BAR] // rearward lower arm
posbody=body negbody=rl_spindle pos=(0.1950764,-0.1002390,1.5145448) neg=(0.6636131,-0.1317047,1.3801439)

[BAR] // forward upper arm
posbody=body negbody=rl_spindle pos=(0.3226537,0.1610445,1.2249030) neg=(0.5938609,0.1678497,1.3846591)

[BAR] // rearward upper arm
posbody=body negbody=rl_spindle pos=(0.3066985,0.1661484,1.3846588) neg=(0.5938609,0.1678497,1.3846591)

[BAR] // straight link
posbody=body negbody=rl_spindle pos=(0.3037763,-0.0250977,1.2121434) neg=(0.6440486,-0.0578884,1.2129936)


// Rear right suspension (2 A-arms + 1 straight link = 5 links)
[BAR] // forward lower arm
posbody=body negbody=rr_spindle pos=(-0.1914663,-0.0401679,1.1409805) neg=(-0.6636131,-0.1317047,1.3801439)

[BAR] // rearward lower arm
posbody=body negbody=rr_spindle pos=(-0.1950764,-0.1002390,1.5145448) neg=(-0.6636131,-0.1317047,1.3801439)

[BAR] // forward upper arm
posbody=body negbody=rr_spindle pos=(-0.3226537,0.1610445,1.2249030) neg=(-0.5938609,0.1678497,1.3846591)

[BAR] // rearward upper arm
posbody=body negbody=rr_spindle pos=(-0.3066985,0.1661484,1.3846588) neg=(-0.5938609,0.1678497,1.3846591)

[BAR] // straight link
posbody=body negbody=rr_spindle pos=(-0.3037763,-0.0250977,1.2121434) neg=(-0.6440486,-0.0578884,1.2129936)

// Rear spindle and wheel connections
[JOINT&HINGE]
posbody=rl_wheel negbody=rl_spindle pos=rl_wheel axis=( 0.7500,0.0,0.0)

[JOINT&HINGE]
posbody=rr_wheel negbody=rr_spindle pos=rr_wheel axis=(-0.7500,0.0,0.0)

