<?xml version="1.0"?>
<_templates Include="trucks">
	<Constraint>
		<AnchorExt
			Name="AnchorExt"
			Type="Prismatic"
			MinLimit="0"
			MaxLimit="0.5"
		>
			<Motor Type="Position" Force="32000" />
		</AnchorExt>
		<AnchorFoot
			Type="Hinge"
			Axis="(0;0;1)"
			MinLimit="0"
			MaxLimit="30"
		>
			<Motor
				Type="Spring"
				Spring="2400"
				Damping="600"
			/>
		</AnchorFoot>
	</Constraint>
</_templates>
<TruckAddon IsChassisFullOcclusion="true">
	<GameData RepairsCapacity="400">
		<InstallSocket Type="Maz2Utility" />
		<WinchSocket ParentFrame="BoneHook_cdt" Offset="(-5.085; 2.075; 0)" />
	</GameData>
	<PhysicsModel Mesh="maz2_utility.xml">
		<Body Mass="4000">
			<Constraint Type="Fixed" />
			<Body
				ModelFrame="BoneCrane_cdt"
				Mass="2000"
				Collisions="None"
			>
				<Constraint
					Name="Crane"
					Type="Hinge"
					Axis="(0;0;1)"
					MinLimit="-10"
					MaxLimit="0"
				>
					<Motor Type="Position" Force="320000" />
				</Constraint>
				<Body
					ModelFrame="BoneHook_cdt"
					Mass="1000"
					AngularDamping="2"
					Collisions="None"
				>
					<Constraint
						Type="Ragdoll"
						TwistAxis="(0;1;0)"
						ConeMin="-60"
						ConeMax="60"
						TwistMin="0"
						TwistMax="0"
					/>
				</Body>
			</Body>
			<Body
				ModelFrame="BoneAnchorRight_cdt"
				Mass="400"
				Collisions="None"
			>
				<Constraint
					_template="AnchorExt"
					MinLimit="0"
					MaxLimit="0.6"
					Axis="(0;1;0)"
				/>
				<Body
					ModelFrame="BoneFootRight_cdt"
					Mass="200"
					NoFoliageCollisions="true"
				>
					<Constraint _template="AnchorFoot" />
				</Body>
			</Body>
			<Body
				ModelFrame="BoneAnchorLeft_cdt"
				Mass="400"
				Collisions="None"
			>
				<Constraint
					_template="AnchorExt"
					MinLimit="0"
					MaxLimit="0.6"
					Axis="(0;1;0)"
				/>
				<Body
					ModelFrame="BoneFootLeft_cdt"
					Mass="200"
					NoFoliageCollisions="true"
				>
					<Constraint _template="AnchorFoot" />
				</Body>
			</Body>
		</Body>
	</PhysicsModel>
	<ModelAttachments>
		<Ignition>
			<Flare _template="RedSignal" Offset="(-4.558; 1.667; -1.34)" />
			<Flare _template="RedSignal" Offset="(-4.558; 1.667; 1.34)" />
		</Ignition>
		<ReverseSignals>
			<Flare _template="ReverseSignal" Offset="(-4.558; 1.667; 1.34)" />
			<Flare _template="ReverseSignal" Offset="(-4.558; 1.667; -1.34)" />
			<Light _template="ReverseSignal" Offset="(-4.358; 1.667; 0)" />
		</ReverseSignals>
		<StopSignals>
			<Flare _template="StopSignal" Offset="(-4.558; 1.667; 1.34)" />
			<Flare _template="StopSignal" Offset="(-4.558; 1.667; -1.34)" />
			<Light _template="StopSignal" Offset="(-4.358; 1.667; 0)" />
		</StopSignals>
	</ModelAttachments>
	<PoweredConstraints>
		<anchors_extend>
			<Constraint
				Name="AnchorExt"
				Position="0.5"
				InitialFix="true"
				TerminalFix="true"
			/>
			<Constraint
				Name="AnchorExt"
				Position="0.5"
				InitialFix="true"
				TerminalFix="true"
			/>
		</anchors_extend>
	</PoweredConstraints>
	<ControlledConstrains>
		<crane Name="Crane" />
	</ControlledConstrains>
	<AutomaticIK>
		<IKBone ModelFrame="BonePistonsBase" ParentFrame="BoneBase_cdt">
			<IKJoint Type="Hinge" Axis="(0;0;1)" />
			<IKBone
				ModelFrame="BonePistons"
				AttachToFrame="BoneCrane_cdt"
				AttachOffset="(0; 0.949; 0)"
			>
				<IKJoint Type="Slider" Axis="(0;1;0)" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
</TruckAddon>
