<_templates Include="trucks">
	<Flare>
		<IgnitionSignalWhite
			AspectRatio="1.4"
			Color="g(165; 149; 130) x 0.60"
			Dir="(1;0;0)"
			DirAngle="100"
			Size="0.20"
		/>
		<IgnitionSignalWhite1
			AspectRatio="1.0"
			Color="g(165; 149; 130) x 0.75"
			Dir="(1;0;0)"
			DirAngle="100"
			Size="0.15"
		/>
		<IgnitionSignalRed
			AspectRatio="1.0"
			Color="g(169; 0; 0) x 1.0"
			Dir="(-1;0;0)"
			DirAngle="90"
			Size="0.2"
		/>
		<StopSignal
			AspectRatio="0.6"
			Color="g(255; 0; 0) x 0.5"
			ColorMultAtDay="0.6"
			Dir="(-1.0; 0; 0)"
			DirAngle="90"
			Reflections="true"
			Size="0.4"
		/>
		<ReverseSignal
			AspectRatio="0.5"
			Color="g(141; 133; 117) x 1.5"
			ColorMultAtDay="0.6"
			Dir="(-1.0; 0; 0)"
			DirAngle="90"
			Reflections="true"
			Size="0.5"
		/>
		<MarkerBeacon
			Color="g(117; 94; 72) x 1.25"
			AspectRatio="1.5"
			ColorMultAtDay="0.8"
			Size="0.2"
			SizeMultAtDay="0.8"
			DirAngle="100"
		/>
	</Flare>
	<Wheel>
		<TrailerWheel
			HardpointOffsetY="-0.10"
			SuspensionMin="-0.3"
			SuspensionMax=" 0.3"
			SuspensionStrength="0.036"
			SuspensionDamping="0.24"
			Type="baton"
		/>
	</Wheel>
</_templates>
<Truck>
	<Wheels
		HardpointDefaultY="0.658"
		HardpointDefaultZ="1.02"
	>
		<Wheel _template="TrailerWheel" HardpointX="-4.292" />
		<Wheel _template="TrailerWheel" HardpointX="-4.292" RightSide="true" />
		<Wheel _template="TrailerWheel" HardpointX="-6.096" />
		<Wheel _template="TrailerWheel" HardpointX="-6.096" RightSide="true" />
	</Wheels>
	<TruckData>
		<OcclusionMap
			HalfSizeZ="1.55"
			MinX="-7.60"
			MaxX=" 0.4"
			Texture="trucks/occlusion/chassis_trailer__s_d_a.tga"
		/>
		<Constraint
			ConeAxisLocal="(1; 0; 0)"
			ConeLimit="-5"
			ConeLimit="5"
			PlaneAxisLocal="(0; 0; 1)"
			PlaneMin="-15"
			PlaneMax="15"
			TwistAxisLocal="(0; 1; 0)"
			TwistMin="-120"
			TwistMax="120"
			Type="Ragdoll"
		>
			<ConeMotor Damping="400000" Spring="2000000" Type="Spring" />
		</Constraint>
		<Camera Center="(-2.096; 0.5; 0)" RadiusMultiplier="1.25"  />
		<Axles>
			<Axle Frame="BoneAxle1" />
			<Axle Frame="BoneAxle2" />
		</Axles>
	</TruckData>
	<ControlledConstraints>
		<Constraint Id="Samosval" Name="kuzov" />
	</ControlledConstraints>
	<PoweredConstraints>
		<Group Id="_trailer_foot">
			<Constraint Name="Foot" Position="0.55" TerminalFix="true" />
		</Group>
		<Group Id="Bort">
			<Constraint InitialFix="true" Name="bort" Position="0" />
		</Group>
	</PoweredConstraints>
	<PhysicsModel Mesh="trucks/trailer_dumper_tonar">
		<Body CenterOfMassOffset="(-0.6; -0.3; 0)" ImpactType="Truck" Mass="3000" ModelFrame="BoneChassis_cdt">
			<Body ForceBodyParams="true" Mass="500" ModelFrame="BoneFoot_cdt" NoFoliageCollisions="true">
				<Constraint AxisLocal="(0;1;0)" MinLimit="0" MaxLimit="0.55" Name="Foot" Type="Prismatic">
					<Motor Force="500000" Type="Position" Tau="0.25" />
				</Constraint>
			</Body>
			<Body AngularDamping="7.5" Collisions="None" Mass="5" ModelFrame="BoneMGL1_cdt">
				<Constraint AxisLocal="(0;0;1)" MinLimit="-25" MaxLimit="5" Type="Hinge" />
			</Body>
			<Body AngularDamping="7.5" Collisions="None" Mass="5" ModelFrame="BoneMGL2_cdt">
				<Constraint AxisLocal="(0;0;1)" MinLimit="-25" MaxLimit="5" Type="Hinge" />
			</Body>
			<Body AngularDamping="7.5" Collisions="None" Mass="5" ModelFrame="BoneMGR1_cdt">
				<Constraint AxisLocal="(0;0;1)" MinLimit="-25" MaxLimit="5" Type="Hinge" />
			</Body>
			<Body AngularDamping="7.5" Collisions="None" Mass="5" ModelFrame="BoneMGR2_cdt">
				<Constraint AxisLocal="(0;0;1)" MinLimit="-25" MaxLimit="5" Type="Hinge" />
			</Body>
			<Body CenterOfMassOffset="(-0.6; -0.3; 0)" Mass="1500" ModelFrame="BoneKuzov_cdt">
				<Constraint
					AxisLocal="(0;0;1)"
					MinLimit="0"
					MaxLimit="52"
					Name="kuzov"
					Type="Hinge"
				>
					<Motor Force="1500000" Type="Position" Tau="0.10" />
				</Constraint>
				<Body CenterOfMassOffset="(0.1; -0.1; 0)" Mass="250" ModelFrame="BoneBort_cdt">
					<Constraint AxisLocal="(0;0;-1)" MinLimit="0" MaxLimit="135" Name="bort" Type="Hinge">
						<Motor Damping="50" Spring="100" Type="Spring" />
					</Constraint>
				</Body>
			</Body>
		</Body>
	</PhysicsModel>
	<ModelAttachments>
		<Ignition>
			<Flare _template="IgnitionSignalWhite"  Pos="( 0.444; 1.601;  1.170)" />
			<Flare _template="IgnitionSignalWhite"  Pos="( 0.444; 1.601; -1.170)" />
			<Flare _template="IgnitionSignalWhite1" Pos="(-6.613; 1.334;  1.332)" />
			<Flare _template="IgnitionSignalWhite1" Pos="(-6.613; 1.334; -1.332)" />
			<Light _template="IgnitionSignalRed"	Pos="(-7.677; 0.920;  0.000)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.677; 1.420;  0.968)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.677; 1.420;  1.070)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.677; 1.420; -0.968)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.677; 1.420; -1.070)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.655; 1.334;  1.332)" />
			<Flare _template="IgnitionSignalRed"	Pos="(-6.655; 1.334; -1.332)" />
			<Flare _template="MarkerBeacon"			Pos="( 0.378; 1.598;  1.258)" Dir="(0;0; 1)" />
			<Flare _template="MarkerBeacon"			Pos="(-1.006; 1.580;  0.560)" Dir="(0;0; 1)" />
			<Flare _template="MarkerBeacon"			Pos="(-4.128; 1.580;  0.761)" Dir="(0;0; 1)" />
			<Flare _template="MarkerBeacon"			Pos="( 0.378; 1.598; -1.258)" Dir="(0;0;-1)" />
			<Flare _template="MarkerBeacon"			Pos="(-1.006; 1.580; -0.560)" Dir="(0;0;-1)" />
			<Flare _template="MarkerBeacon"			Pos="(-4.128; 1.580; -0.761)" Dir="(0;0;-1)" />
		</Ignition>
		<StopSignals>
			<Light _template="StopSignal" Pos="(-7.677; 0.885;  0.0)" />
			<Flare _template="StopSignal" Pos="(-6.677; 1.385;  0.9)" />
			<Flare _template="StopSignal" Pos="(-6.677; 1.385; -0.9)" />
		</StopSignals>
		<ReverseSignals>
			<Light _template="ReverseSignal" Pos="(-7.677; 0.885;  0.000)" />
			<Flare _template="ReverseSignal" Pos="(-6.677; 1.385;  0.838)" />
			<Flare _template="ReverseSignal" Pos="(-6.677; 1.385; -0.838)" />
		</ReverseSignals>
	</ModelAttachments>
	<GameData>
		<RequiredAddon Types="kraz_tractor" />
		<InstallSocket Offset="(0.0; 1.337; 0.0)" Type="KamazTrailer" />
	</GameData>
	<AutomaticIK>
		<IKBone ModelFrame="Cyl0" ParentFrame="BoneChassis_cdt">
			<IKJoint AxisLocal="(0;0;-1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0;0;0)"
				AttachToFrame="Cyl2"
				ModelFrame="Cyl1"
				ParentFrame="Cyl0"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
				<IKBone
					AttachOffset="(0; 0.0; 0)"
					AttachToFrame="Cyl3"
					ModelFrame="Cyl2"
					ParentFrame="Cyl1"
				>
					<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
					<IKBone
						AttachOffset="(0; 0.0; 0)"
						AttachToFrame="Cyl4"
						ModelFrame="Cyl3"
						ParentFrame="Cyl2"
					>
						<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
						<IKBone
							AttachOffset="(0; 0.0; 0)"
							AttachToFrame="Cyl5"
							ModelFrame="Cyl4"
							ParentFrame="Cyl3"
						>
							<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
							<IKBone
								AttachOffset="(0; 0.0; 0)"
								AttachToFrame="Cyl6"
								ModelFrame="Cyl5"
								ParentFrame="Cyl4"
							>
								<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
								<IKBone
									AttachOffset="(0; 0.0; 0)"
									AttachToFrame="BoneKuzov_cdt"
									ModelFrame="Cyl6"
									ParentFrame="Cyl5"
								>
									<IKJoint AxisLocal="(0;0;-1)" Type="Hinge" />
								</IKBone>
							</IKBone>
						</IKBone>
					</IKBone>
				</IKBone>
			</IKBone>
		</IKBone>
	</AutomaticIK>
</Truck>
