<_templates Include="trucks" />
<TruckAddon>
	<TruckData FuelCapacity="200" RepairsCapacity="1200">
		<LimitedFluid
			AxisX="(0; 1; 0)"
			Center="(-1.706; 2.32; 1.158)"
			LengthX="0.984"
			RadiusY="0.294"
			RadiusZ="0.294"
			Type="Cylinder"
		/>
	</TruckData>
    <PhysicsModel Mesh="trucks/Nami_Repair_Crane">
		<Body ImpactType="Truck" Collisions="All" ForceBodyParams="true" Mass="2000">
			<Constraint Type="Fixed" />
 		<Body ImpactType="Truck" Collisions="All" Mass="1000" ModelFrame="BoneStrela1_cdt">
				<Constraint
					AxisLocal="(0; 0; 1)"
					MinLimit="-18"
					MaxLimit="0"
					Name="Foot1"
					Type="Hinge"
				>
					<Motor Force="500000" Tau="0.04" Type="Position" />
				</Constraint>
							<Body Collisions="All" Mass="500" ModelFrame="BoneKruk_cdt">
								<Constraint
									AxisLocal="(0;0;1)"
									MinLimit="-20"
									MaxLimit="65"
									Type="Hinge"
								>
									<Motor Damping="500" Spring="0" Type="Spring" />
								</Constraint>
		</Body>
		</Body>
		<Body ImpactType="Truck" Collisions="All" Mass="500" ForceBodyParams="true" Friction="1.5" ModelFrame="BoneOporaLap_cdt">
				<Constraint
					Name="Foot2"
					AxisLocal="(0; 1; 0)"
					MinLimit="-1.0"
					MaxLimit="0"
					Type="Prismatic"
				>
					<Motor Force="400000" Tau="0.1" Type="Position"  />
				</Constraint>
		</Body>
							<Body Collisions="All" Mass="100" ModelFrame="BoneZapaska_cdt">
								<Constraint
									AxisLocal="(0;0;1)"
									MinLimit="-40"
									MaxLimit="40"
									Type="Hinge"
								>
									<Motor Damping="50" Spring="0" Type="Spring" />
								</Constraint>
		</Body>
		</Body>
    </PhysicsModel>

	<ModelAttachments>
		<StopSignals>
			<Light _template="StopSignal" Pos="(-4.774; 1.696; 0)" />
			<Flare _template="StopSignal" Pos="(-4.774; 1.696; 1.261)" />
			<Flare _template="StopSignal" Pos="(-4.774; 1.696; -1.261)" />
		</StopSignals>
		<ReverseSignals>
			<Light _template="ReverseSignal" Pos="(-2.643; 3.156; 1.124)"  />
			<Flare _template="ReverseSignal" Pos="(-2.643; 3.156; 1.124)"  />
		</ReverseSignals>
		<Ignition>
			<Light _template="IgnitionSignalRed" Pos="(-4.774; 1.696; 0)" />
			<Flare _template="IgnitionSignalRed" Pos="(-4.774; 1.696; 1.261)" />
			<Flare _template="IgnitionSignalRed" Pos="(-4.774; 1.696; -1.261)" />
		</Ignition>
	</ModelAttachments>

	<PoweredConstraints>
		<Group Id="Rear_Support">
			<Constraint Name="Foot2" Position="-1.0" TerminalFix="true" SpeedMult="0.3" />
		</Group>
	</PoweredConstraints>
	<ControlledConstraints>
		<Constraint Id="Crane"  Name="Foot1" />
	</ControlledConstraints>
	<AutomaticIK>
		<IKBone ModelFrame="Cylinder1" ParentFrame="BoneChassis_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0.0; 0.0; 0)"
				AttachToFrame="BoneStrela1_cdt"
				ModelFrame="Cylinder2"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
    <GameData>
		<WinchSocket Pos="(-6.131; 2.084; 0.0)" ParentFrame="BoneKruk_cdt" />
                <InstallSocket Type="Nami_Repair_Crane" />

    </GameData>
</TruckAddon>