<_templates Include="trucks" >
	<Wheel>
		<RearWheel 
			ParentFrame="BoneRear_cdt"			 
			SuspensionMin="-0.25"
			HardpointOffsetY="-0.1"
			SuspensionStrength="0.075"
			SuspensionDamping="0.5"			
			Type="us_platform_double"
		/>
	</Wheel>
	<Body>
		<Runners
			Friction="2.0"
			Mass="1000"
			NoFoliageCollisions="true"
		>
			<Constraint Type="Hinge"> 
				<Motor
					Damping="1.0"
					Force="60000"
					Tau="0.04"
					Type="Position"
				/>
			</Constraint>
		</Runners>
		<Chassis  ImpactType="Truck" Mass="5500" >
			<Constraint
				AxisLocal="(1;0;0)"
				MinLimit="-5"
				MaxLimit="5"
				Type="Hinge"
			>
				<Motor Damping="100000" Spring="1000000" Type="Spring" />
			</Constraint>
		</Chassis>
		<Board ImpactType="Truck" Mass = "10">
			<Constraint
				AxisLocal="(0;0;1)"
				MinLimit="-7"
				MaxLimit="7"
				Type="Hinge"
			>
				<Motor Damping="150" Spring="300" Type="Spring" />
			</Constraint>	
		</Board>
	</Body>	
</_templates>
<Truck >
	<Wheels
		HardpointDefaultY="0.62"
		HardpointDefaultZ="1.548"
	>
		<Wheel _template="RearWheel" HardpointX="-10.198" />
		<Wheel _template="RearWheel" HardpointX="-10.198" RightSide="true" />	
		<Wheel _template="RearWheel" HardpointX="-11.172" />
		<Wheel _template="RearWheel" HardpointX="-11.172" RightSide="true" />
		<Wheel _template="RearWheel" HardpointX="-12.148" />
		<Wheel _template="RearWheel" HardpointX="-12.148" RightSide="true" />
		<Wheel _template="RearWheel" HardpointX="-13.124" />
		<Wheel _template="RearWheel" HardpointX="-13.124" RightSide="true" />
	</Wheels>
	<TruckData> 
		<OcclusionMap
			HalfSizeZ="2"
			MinX="-15.444"
			MaxX="-2"
			ParentFrame="BoneRear_cdt"
		/>
		<Constraint _template="TrailerRagdoll">
		</Constraint>
		<Camera Center="(-12.26; 0; 0)" ParentFrame="BoneRear_cdt" />
		<Axles>
			<Axle Frame="BoneAxle0" />		
			<Axle Frame="BoneAxle1" />
			<Axle Frame="BoneAxle2" />
			<Axle Frame="BoneAxle3" />
		</Axles>
	
	</TruckData>
	<PoweredConstraints>
		<Group Id="lower_ramp" >
			<Constraint InitialFix="true" Name="Runner" Position="110" SpeedMult="0.5" />
		</Group>
		<Group Id="_trailer_foot">
			<Constraint InitialFix="true" Name="Leg" Position="0.43" />
		</Group>
	</PoweredConstraints>	
	<PhysicsModel Mesh="trucks/us_truck_platform_01">
		<Body ImpactType="Truck" CenterOfMassOffset="(0; 0; 0)" Mass="1000" ModelFrame="BoneHandle_cdt">
			<Body _template="Chassis" ModelFrame="BoneRear_cdt">
				<Body _template="Runners" ModelFrame="BoneRunners_cdt">
					<Constraint AxisLocal="(0;0;1)" MinLimit="0" MaxLimit="110" Name="Runner" />
				</Body>	
			</Body>
			<Body Mass="500" ModelFrame="BoneLeg_cdt" NoFoliageCollisions="true" >
				<Constraint
					AxisLocal="(0; 1; 0)"
					MinLimit="0"
					MaxLimit="1.0"
					Name="Leg"
					Type="Prismatic"
				>
					<Motor Force="900000" Type="Position" />
				</Constraint>
			</Body>
		</Body>
	
	</PhysicsModel>
	<ModelAttachments>
		<StopSignals>
			<Light _template="StopSignal" Pos="(-15.025; 0.708; 0)" ParentFrame="BoneRunners_cdt"/>
			<Flare _template="StopSignal" Pos="(-14.815; 1.449; 1.684)"  ParentFrame="BoneRunners_cdt"/>
			<Flare _template="StopSignal" Pos="(-14.815; 1.449; -1.684)"  ParentFrame="BoneRunners_cdt" />
		</StopSignals>
		<Ignition>
			<Light _template="IgnitionSignalRed" Pos="(-15.025; 0.708; 0)" ParentFrame="BoneRunners_cdt"/>
			<Flare _template="IgnitionSignalRed" Pos="(-14.815; 1.449; 1.684)" ParentFrame="BoneRunners_cdt"/>
			<Flare _template="IgnitionSignalRed" Pos="(-14.815; 1.449; -1.684)" ParentFrame="BoneRunners_cdt"/>
			
			<Flare _template="MarkerBeacon" Pos="(-14.74; 1.977; 1.889)" ParentFrame="BoneRunners_cdt"/>
			<Flare _template="MarkerBeacon" Pos="(-14.74; 1.977; -1.889)" ParentFrame="BoneRunners_cdt"/>

		</Ignition>	
	</ModelAttachments>
	<GameData>
		<WinchSocket Pos="(-7.166; 1.129; 1.83)" ParentFrame="BoneRear_cdt" />
		<WinchSocket Pos="(-7.166; 1.129; -1.831)" ParentFrame="BoneRear_cdt" />
		<WinchSocket Pos="(-14.555; 0.855; 1.562)" ParentFrame="BoneRear_cdt" />
		<WinchSocket Pos="(-14.555; 0.855; -1.562)" ParentFrame="BoneRear_cdt" />
		<WinchSocket Pos="(0.3; 1.8; 0)" ParentFrame="BoneHandle_cdt" />
		<RequiredAddon Types="saddle" />
		<InstallSocket Offset="(-0.29; 1.6; 0)" Type="TruckPlatform" ParentFrame="BoneHandle_cdt" />
	</GameData>	
	<AutomaticIK>
		<IKBone ModelFrame="BonePistonsBase" ParentFrame="BoneRear_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0; 0)"
				AttachToFrame="BoneRunners_cdt"
				ModelFrame="BonePistons"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BoneSuspension0" AttachOffset="(0; 0; 0.356)" AttachToFrame="BoneAxle0" ParentFrame="BoneRear_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
		</IKBone>		
		<IKBone ModelFrame="BoneSuspension1" AttachOffset="(0; 0; 0.356)" AttachToFrame="BoneAxle1" ParentFrame="BoneRear_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
		</IKBone>
		<IKBone ModelFrame="BoneSuspension2" AttachOffset="(0; 0; 0.356)" AttachToFrame="BoneAxle2" ParentFrame="BoneRear_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
		</IKBone>
		<IKBone ModelFrame="BoneSuspension3" AttachOffset="(0; 0; 0.356)" AttachToFrame="BoneAxle3" ParentFrame="BoneRear_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
		</IKBone>
	</AutomaticIK>		
</Truck>
