<_templates Include="trucks" />
<TruckAddon>
	<PoweredConstraints>
		<Group Id="loader_grab" IsGamepadHotkey="true">
			<Constraint Name="Hook" Position="110" />
		</Group>
	</PoweredConstraints>
	<PhysicsModel Mesh="trucks/kirovets_loader">
		<Body ImpactType="Truck" Mass="800" ModelFrame="BoneRoot_cdt">
			<Constraint Type="Fixed" />
			<Body Mass="600" ModelFrame="BoneArm_cdt">
				<Constraint
					AxisLocal="(0;0;-1)"
					MinLimit="-10"
					MaxLimit="120"
					Name="Arm"
					Type="Hinge"
				>
					<Motor Force="80000" Tau="0.02" Type="Position" />
				</Constraint>
				<Body Mass="200" ModelFrame="BoneGrappler_cdt">
					<Constraint
						AxisLocal="(0;0;-1)"
						MinLimit="-140"
						MaxLimit="0"
						Name="Grappler"
						Type="Hinge"
					>
						<Motor Force="60000" Tau="0.02" Type="Position" />
					</Constraint>
					<Body Mass="100" ModelFrame="BoneHook_cdt">
						<Constraint
							AxisLocal="(0;0;1)"
							MinLimit="0"
							MaxLimit="110"
							Name="Hook"
							Type="Hinge"
						>
							<Motor Force="100000" Tau="0.2" Type="Position" />
						</Constraint>
					</Body>
				</Body>
			</Body>
			<Body Collisions="None" Mass="200" ModelFrame="BoneChassisCables_cdt">
				<Constraint ExplicitParentFrame="0" Type="Fixed" />
			</Body>
			<Body Collisions="Internal" Mass="200" ModelFrame="BoneCage_cdt">
				<Constraint Type="Fixed" />
			</Body>
		</Body>
	</PhysicsModel>
	<ModelAttachments>
		<HeadLight>
			<Model
				_template="HeadLightRay"
				Dir="(-0.988; -0.152; 0)"
				Org="(-0.923; 2.221; 0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
			<Model
				_template="HeadLightRay"
				Dir="(-0.988; -0.152; 0)"
				Org="(-0.923; 2.221; -0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
			<Flare
				_template="HeadLight"
				Dir="(-0.988; -0.152; 0)"
				Pos="(-0.923; 2.221; 0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
			<Flare
				_template="HeadLight"
				Dir="(-0.988; -0.152; 0)"
				Pos="(-0.923; 2.221; -0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
			<Flare
				_template="BlueStreak"
				Dir="(-0.988; -0.152; 0)"
				Pos="(-0.923; 2.221; 0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
			<Flare
				_template="BlueStreak"
				Dir="(-0.988; -0.152; 0)"
				Pos="(-0.923; 2.221; -0.651)"
				ParentFrame="BoneArm1_cdt"
			/>
		</HeadLight>
	</ModelAttachments>
	<HeadLight
		_template="Default"
		AttenEnd="32"
		Dir="(-0.988; -0.6; 0)"
		Pos="(-1.2; 2.221; 0)"
	/>
	<GameData>
		<InstallSocket Type="KirovetsLoader" />
	</GameData>
	<ControlledConstraints>
		<Constraint
			ActionId="loader_lift"
			Id="loader"
			InterestFrame="BoneRoot_cdt"
			InterestOffset="(1.5;3;0)"
			Name="Arm"
		/>
		<Constraint
			Id="crane_grappler"
			LinkToControlledConstraint="loader"
			Name="Grappler"
		/>
	</ControlledConstraints>
	<AutomaticIK>
		<IKBone ModelFrame="BonePistonArmBase" ParentFrame="BoneRoot_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0.745; 0)"
				AttachToFrame="BoneArm_cdt"
				ModelFrame="BonePistonArm"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BonePistonGrapplerBase" ParentFrame="BoneArm_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0.901; 0)"
				AttachToFrame="BoneGrappler_cdt"
				ModelFrame="BonePistonGrappler"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BonePistonHookBase" ParentFrame="BoneGrappler_cdt">
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0.431; 0)"
				AttachToFrame="BoneHook_cdt"
				ModelFrame="BonePistonHook"
			>
				<IKJoint AxisLocal="(0;1;0)" Type="Slider" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
	<AddonCamera FirstPersonDir="(0; -0.5; -1.0)" FirstPersonPos="(-2.0; 2.0; 3.2)" />
</TruckAddon>
