<_templates Include="trucks">
	<Wheel>
		<RearWheel
			ConnectedToHandbrake="true"
			Type="MTZ-1221_wheel"
			SuspensionMin="-0.6"
			SuspensionMax="0.1"
			SuspensionStrength="0.5"
			Torque="default"
		/>
		<FrontWheel
			Type="MTZ-1221_wheel1"
			SuspensionMin="-0.1"
			SuspensionMax="0.1"
			SuspensionStrength="1.0"
			Torque="full"
		/>
		<FrontWheelLR _template="FrontWheel" ParentFrame="BoneAxleFront_cdt" SteeringAngle="36" SteeringJointOffset="0.23" />
		<FrontWheelL  _template="FrontWheel" ParentFrame="BoneRotatorL_cdt" SteeringAngle="1" />
		<FrontWheelR  _template="FrontWheel" ParentFrame="BoneRotatorR_cdt" SteeringAngle="1" />
		
	</Wheel>

	<Flare>
		<Sublight Color="(122; 61; 0) x 0.6" Size="0.4" />
	</Flare>

</_templates>
<Truck>
	<Wheels
		HardpointDefaultY="0.88"
		HardpointDefaultZ="0.82"
	>
		<Wheel _template="FrontWheelL"	HardpointX="1.71" HardpointY="0.58" HardpointZ="0.82" />
		<Wheel _template="FrontWheelR"	HardpointX="1.71" HardpointY="0.58" HardpointZ="0.82" RightSide="true"/>
		<Wheel _template="RearWheel"	HardpointX="-1.03" />
		<Wheel _template="RearWheel"	HardpointX="-1.03" RightSide="true" />
	</Wheels>
	<TruckData
		BackSteerSpeed="0.006"
		EngineStartDelay="1.5"
		EngineIconMesh="env/engine_default"
		EngineIconScale="1.0"
		FuelCapacity="370"
		Responsiveness="0.07"
		SteerSpeed="0.02"
	>
		<Steam Origin="(1.2; 0.5; 0)" Scale="0.75" />
		<Sounds
		   	AirHissInterval="14.0"
			Origin="(0.8; 1.3; 0)"
			ParentFrame="BoneCabin_cdt"
		>
			<EngineTrans Sound="truck/trans" />
			<EngineStop Sound="JD7R_stop" />
			<EngineStart Sound="1221_start" />
			<EngineRev Sound="kraz_rev" />
			<EngineLow Sound="1221_low" />
			<EngineIdle Sound="1221_idle" />
			<EngineHigh Sound="1221_high" />
			<BrakePull Sound="brake_pull" />
		</Sounds>
		<Shafts>
			<Shaft SocketPointA="Shaft1a" SocketPointB="Shaft1b" />
			<Shaft SocketPointA="Shaft2a" SocketPointB="Shaft2b" />
		</Shafts>
		<OcclusionVolume
			HalfSizeZ="0.88"
			HeightFront="1.0"
			HeightRear="0.8"
			MinX="-1.7"
			MaxX="1.939"
		>
			<FullOcclusion HeightRear="1.2" />
		</OcclusionVolume>
		<OcclusionMap HalfSizeZ="1.90" MinX="-1.579" MaxX="1.88" />
		<Motor MaxDeltaAngVel="0.02" Torque="150000">
			<ReverseGear AngVel="0.4" />
			<HighGear AngVel="4.5" />
			<Gear AngVel="0.3" />
			<Gear AngVel="2.9" />
			<Gear AngVel="3.5" />
			<Gear AngVel="5.0" />
			<Gear AngVel="6.5" />
		</Motor>
			<LimitedFluid
			Center="(-1.1; 1.25; 0.35)"
			SizeX="0.3"
			SizeY="0.1"
			SizeZ="0.35"
			Type="Box"
		/>
		<LimitedFluid
			Center="(-1.1; 1.25; -0.38)"
			SizeX="0.3"
			SizeY="0.1"
			SizeZ="0.35"
			Type="Box"
		/>
		<Exhaust Dir="(0.75; 0.4; 0.0)" Origin="(1.339; 3.02; -0.439)" Speed="3.00" IsLight="true" ParentFrame="BoneChassis_cdt" />
		<Driver Pos="(-0.68; 1.75; -0.06)" SteeringWheelPos="(-0.3; 2.16; -0.07)" ParentFrame="BoneCabin_cdt"  />
		<Damage
			Capacity="700"
			SensationMin="(0.252; 3.035; 0.602)"
			SensationMax="(0.246; 3.088; 0.574)"
		/>
	   <Camera CabinPos="(-1.63; 2.32; 0.4)" RadiusMultiplier="1.0" >
			<Cockpit
				_template="Default"
				ControlsDiffuse="g(59; 58; 55)"
				ViewPos="(-0.75; 2.6; -0.1)"
				WindshieldDiffuseTexture="trucks/ural4320_glass__d_a.tga"
			/>
		</Camera>
		<Axles>
		</Axles>
	</TruckData>
	<PhysicsModel Mesh="trucks/MTZ_1221">
		<Body
			CenterOfMassOffset="(0; -0.75; 0)"
			ImpactType="Truck"
			Mass="6000"
			ModelFrame="BoneChassis_cdt"
	>
			<Body
				ImpactType="Truck"
				Mass="1500"
				ModelFrame="BoneAxleFront_cdt"
				>
					<Constraint
						AxisLocal="(1;0;0)"
						MinLimit="-12"
						MaxLimit="12"
						Type="Hinge"
					>
						<Motor Type="Spring" Spring="0" Damping="0" />
					</Constraint>

			<Body
				Collisions="None" 
				Mass="750"
				ModelFrame="BoneRotatorL_cdt"
				>
					<Constraint
						AxisLocal="(0;1;0)"
						MinLimit="-36"
						MaxLimit="36"
						Name="RotatorL"
						Type="Hinge"
					>
						<Motor Force="345000" Type="Position" />
					</Constraint>
			</Body>
			<Body
				Collisions="None" 
				Mass="750"
				ModelFrame="BoneRotatorR_cdt"
				>
					<Constraint
						AxisLocal="(0;1;0)"
						MinLimit="-36"
						MaxLimit="36"
						Name="RotatorR"
						Type="Hinge"
					>
						<Motor Force="345000" Type="Position" />
					</Constraint>
				</Body>
			</Body>
			<Body
				Mass="10"
				Collisions="None" 
				ModelFrame="BoneSteer_cdt"
				>
					<Constraint
						AxisLocal="(0;1;0)"
						MinLimit="-360"
						MaxLimit="360"
						Name="steer"
						Type="Hinge"
					>
						<Motor Damping="1.0" Force="100" Tau="0.04" Type="Position" />
					</Constraint>
			</Body>
			<Body Collisions="None" Mass="1000" ModelFrame="BoneFixator_cdt" >
					<Constraint
						AxisLocal="(0;0;-1)"
						MinLimit="-30"
						MaxLimit="30"
						Name="Naveska"
						Type="Hinge"
					>
						<Motor Force="666000" Type="Position" />
					</Constraint>
				<Body Collisions="Internal" Mass="1000" ModelFrame="BoneAttacher_cdt" >
					<Constraint
						AxisLocal="(0;0;1)"
						MinLimit="-28"
						MaxLimit="35"
						Name="Naveska"
						Type="Hinge"
					>
						<Motor Force="666000" Type="Position" />
					</Constraint>
				</Body>
			</Body>
			<Body CenterOfMassOffset="(-0.003; 0; 0)" Mass="10" ModelFrame="BoneDoor_cdt" >
					<Constraint
						AxisLocal="(0;-1;0)"
						MinLimit="0"
						MaxLimit="184"
						Name="Door"
						Type="Hinge"
					>
						<Motor Force="750" Tau="0.01" Type="Position" />
					</Constraint>
			</Body>
			<Body Collisions="None" CenterOfMassOffset="(0.08; 0; 0)" Mass="10" ModelFrame="BoneMudguard_cdt" >
					<Constraint 
						AxisLocal="(0;0;1)"
						MinLimit="-10"
						MaxLimit="30"
						Type="Hinge"
					>
						<Motor Spring="10" Damping="7" Type="Spring"/>
					</Constraint>
			</Body>
		</Body>
	</PhysicsModel>
	<ModelAttachments>
	    <StopSignals>
			<Light _template="StopSignal" Pos="(-1.52; 1.85; 0)" />
			<Flare _template="StopSignal" Pos="(-1.52; 1.85; -0.8)" />
			<Flare _template="StopSignal" Pos="(-1.52; 1.85; 0.8)" />
		</StopSignals>
	    <ReverseSignals>
			<Light _template="ReverseSignal" Pos="(-1.4; 2.64; 0)" />
			<Flare _template="ReverseSignal" Pos="(-1.4; 2.64; -0.73)" />
			<Flare _template="ReverseSignal" Pos="(-1.4; 2.64; 0.73)" />
		</ReverseSignals>
	  	<HeadLight>
		    <Model _template="HeadLightRay" Org="(0.05; 2.9; 0.272)" ParentFrame="BoneCabin_cdt" />
			<Model _template="HeadLightRay" Org="(0.05; 2.9; -0.313)" ParentFrame="BoneCabin_cdt" />
			
		    <Flare _template="HeadLight" Pos="(0.05; 2.9; -0.313)" ParentFrame="BoneCabin_cdt" />
			<Flare _template="HeadLight" Pos="(0.05; 2.9; 0.272)" ParentFrame="BoneCabin_cdt" />
			
			<Model _template="HeadLightRay" Org="(1.76; 1.16; -0.1)" ParentFrame="BoneCabin_cdt" />
			<Model _template="HeadLightRay" Org="(1.76; 1.16; 0.1)" ParentFrame="BoneCabin_cdt" />
			
		    <Flare _template="HeadLight" Pos="(1.76; 1.16; -0.1)" ParentFrame="BoneCabin_cdt" />
			<Flare _template="HeadLight" Pos="(1.76; 1.16; 0.1)" ParentFrame="BoneCabin_cdt" />
		</HeadLight>		
	</ModelAttachments>
	<HeadLight _template="Default" Pos="(2.8; 2.0; 0.0)" ParentFrame="BoneCabin_cdt" />
	<GameData BalancePoints="1">
		<WinchSocket Pos="(2.0; 0.89; 0.296)"  />
		<WinchSocket Pos="(2.0; 0.89; -0.33)"  />
		<WinchSocket Pos="(-2.25; 0.74; -0)" ParentFrame="BoneAttacher_cdt" />
		<AddonSockets>
			<Socket Names="KamazTrailerCart" Offset="(-2.3; 0.75; -0.00)" ParentFrame="BoneAttacher_cdt" />
			<Socket Names="Pricep_Bort" Offset="(-2.31; 0.76; -0.00)" ParentFrame="BoneAttacher_cdt" />
			<Socket Names="Pricep_cisterna" Offset="(-2.29; 0.76; -0.00)" ParentFrame="BoneAttacher_cdt" />
			<Socket Names="Pricep_pts" Offset="(-2.29; 0.76; -0.00)" ParentFrame="BoneAttacher_cdt" />
			<Socket Names="Pricep_pts_garaj" Offset="(-2.29; 0.76; -0.00)" ParentFrame="BoneAttacher_cdt" />
		</AddonSockets>
		<AddonSockets>
		    <Socket Names="Ahik" Offset="(0.0; 0.0; -0.0)"  />
		</AddonSockets>
		<AddonSockets>
		    <Socket Names="Pogruzchik" Offset="(-0.08; 0.0; -0.0)"  />
		</AddonSockets>
		<AddonSockets>
			<Socket Names="Otval" Offset="(0.0; 0.0; 0.0)" ParentFrame="BoneAttacher_cdt" />
		</AddonSockets>
		<AddonSockets>
		   <Socket Names="Protivoves" Offset="(0.0; 0.0; 0.0)"  />
		</AddonSockets>
	</GameData>
	<ControlledConstraints>
		<Constraint Id="SteeringWheel" IsLinkedSteering="true" Name="RotatorL" />
		<Constraint Id="SteeringWheel" IsLinkedSteering="true" Name="RotatorR" />
		<Constraint Id="SteeringWheel" IsLinkedSteering="true" Name="steer" />	
		<Constraint Id="grab_rise" Name="Naveska" TerminalFix="true" />
	</ControlledConstraints>
	<AutomaticIK>
		<IKBone ModelFrame="mtz80_lifter" ParentFrame="BoneChassis_cdt">
			<IKJoint Type="Hinge" AxisLocal="(0;0;1)" />
			<IKBone
				ModelFrame="mtz80_connector"
				AttachToFrame="BoneFixator_cdt"
				AttachOffset="(0; 0.48; 0)"
			>
				<IKJoint Type="Hinge" AxisLocal="(0;0;1)" />
			</IKBone>
		</IKBone>

		<IKBone ModelFrame="mtz80_piston" ParentFrame="BoneChassis_cdt">
			<IKJoint Type="Hinge" AxisLocal="(0;0;1)" />
			<IKBone
				ModelFrame="mtz80_pixton"
				AttachToFrame="BoneAttacher_cdt"
				AttachOffset="(-0.1; 0; 0)"
			>
				<IKJoint Type="Slider" AxisLocal="(1;0;0)" />
			</IKBone>
		</IKBone>
		
		<IKBone ModelFrame="mtz80_st_conector_r" ParentFrame="BoneRotatorR_cdt">
			<IKJoint Type="Hinge" AxisLocal="(0;1;0)" />
			<IKBone
				ModelFrame="mtz80_st_conector_l"
				AttachToFrame="BoneRotatorL_cdt"
				AttachOffset="(0; 0; 0)"
			>
				<IKJoint Type="Hinge" AxisLocal="(0;1;0)" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
</Truck>