<_templates Include="trucks" />
<TruckAddon>
	<PhysicsModel Mesh="trucks/addons/crane_cat_th357">
		<NetSync Legacy="true" />
		<Body CenterOfMassOffset="(0; 0; 0)" Mass="10">
			<Constraint Type="Rigid" />
			<Body
				CenterOfMassOffset="(1; -0.4; 0)"
				Mass="800"
				ModelFrame="BoneShaft1_cdt"
			>
				<Constraint
					AxisLocal="(0; 0; 1)"
					Name="Crane"
					Type="Hinge"
					MinLimit="-9"
					MaxLimit="61"
				>
					<Motor Force="1000000" Tau="0.1" Type="Position" />
				</Constraint>
				<Body
					CenterOfMassOffset="(0; 0; 0)"
					Mass="700"
					ModelFrame="BoneShaft2_cdt"
				>
					<Constraint
						AxisLocal="(1; 0; 0)"
						Name="Shaft"
						Type="Prismatic"
						MinLimit="0"
						MaxLimit="3"
					>
						<Motor Force="800000" Tau="0.2" Type="Position" />
					</Constraint>
					<Body
						CenterOfMassOffset="(0; 0; 0)"
						ForceBodyParams="true"
						Mass="500"
						ModelFrame="BoneFork_cdt"
					>
						<Constraint
							AxisLocal="(0; 0; 1)"
							Name="Fork"
							Type="Hinge"
							MinLimit="-65"
							MaxLimit="15"
						>
							<Motor Force="600000" Tau="0.1" Type="Position" />
						</Constraint>
					</Body>
				</Body>
			</Body>
		</Body>
	</PhysicsModel>
	<GameData
		CameraPreset="hoods"
		Price="7900"
		UnlockByExploration="false"
		Category="frame_addons"
		UnlockByRank="1"
		SoundForEachConstraint="true"
	>
		<UiDesc
			UiDesc="UI_ADDON_CRANE_CAT_TH357_DESC"
			UiIcon30x30=""
			UiIcon40x40=""
			UiName="UI_ADDON_CRANE_CAT_TH357_NAME"
		/>
		<ConstraintSounds>
			<SoundIKStop Name="trucks/cat_th357/cat_th357_crane_move_stop" Range="20" Volume="1" ConstraintName="Crane"/>
			<SoundIKStart Name="trucks/cat_th357/cat_th357_crane_move_start" Range="20" Volume="1" ConstraintName="Crane"/>
			<SoundIKLoop Name="trucks/cat_th357/cat_th357_crane_move_loop" Range="20" Volume="1" ConstraintName="Crane"/>
			
			<SoundIKStop Name="trucks/cat_th357/cat_th357_fork_move_stop" Range="20" Volume="1" ConstraintName="Fork"/>
			<SoundIKStart Name="" Range="20" Volume="1" ConstraintName="Fork"/>
			<SoundIKLoop Name="trucks/cat_th357/cat_th357_fork_move_loop" Range="20" Volume="1" ConstraintName="Fork"/>
			
			<SoundIKStop Name="trucks/cat_th357/cat_th357_shaft_move_stop" Range="20" Volume="1" ConstraintName="Shaft"/>
			<SoundIKStart Name="trucks/cat_th357/cat_th357_shaft_move_start" Range="20" Volume="1" ConstraintName="Shaft"/>
			<SoundIKLoop Name="trucks/cat_th357/cat_th357_shaft_move_loop" Range="20" Volume="1" ConstraintName="Shaft"/>
		</ConstraintSounds>
		<InstallSocket Type="CraneCatTh357" />
		<AddonType Name="Fork" />
	</GameData>
	<ActionCategories>
		<ActionCategory Action="1" Id="crane_control" LocaleUid="UI_FORK_CONTROL" AvailableForFastMode="true" RemoveChildActionsFromCustomPanelShowCounter = "true"/>
	</ActionCategories>
	
	<ControlledConstraints>
		<Constraint Action="9"  Id="crane" LocaleUid="UI_FORK_CRANE" Name="Crane" SpeedMult=".5" BelongToCategorie="crane_control"/>
		<Constraint Action="10" Id="crane_shaft" LocaleUid="UI_FORK_Shaft" Name="Shaft" BelongToCategorie="crane_control"/>
		<Constraint Action="11" Id="crane_grappler" LocaleUid="UI_FORK_GRAPPLER" Name="Fork" BelongToCategorie="crane_control"/>
	</ControlledConstraints>
	<AutomaticIK>
		<IKBone ModelFrame="BonePistonBase1" ParentFrame="BoneRoot_cdt">
			<IKJoint AxisLocal="(0; 0; 1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0; 0)"
				AttachToFrame="BoneShaft1_cdt"
				ModelFrame="BonePiston1"
			>
				<IKJoint AxisLocal="(1; 0; 0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BonePistonBase2" ParentFrame="BoneRoot_cdt">
			<IKJoint AxisLocal="(0; 0; 1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0; 0)"
				AttachToFrame="BoneShaft1_cdt"
				ModelFrame="BonePiston2"
			>
				<IKJoint AxisLocal="(1; 0; 0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BoneJack1" ParentFrame="BoneShaft2_cdt">
			<IKJoint AxisLocal="(0; 0; 1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0.129; -0.231; 0)"
				AttachToFrame="BoneFork_cdt"
				ModelFrame="BoneJack2"
			>
				<IKJoint AxisLocal="(0; 0; 1)" Type="Hinge" />
			</IKBone>
		</IKBone>
		<IKBone ModelFrame="BoneForkPistonBase" ParentFrame="BoneShaft2_cdt">
			<IKJoint AxisLocal="(0; 0; 1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0; 0; 0)"
				AttachToFrame="BoneJack1"
				ModelFrame="BoneForkPiston"
			>
				<IKJoint AxisLocal="(1; 0; 0)" Type="Slider" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
	<AddonCamera FirstPersonDir="(1; 0; 0)" FirstPersonPos="(-0.138; 2; 0.702)" />
</TruckAddon>
