<TruckAddon IsChassisFullOcclusion="true">
    <TruckData
		  RepairsCapacity="1000"
	/>

   	<PhysicsModel Mesh="trucks/bat_m">
		<Body
			CenterOfMassOffset="(-5.577; 0.727; 0.0)"
			Collisions="All"
			Mass="5000"
			ModelFrame="BoneBazaCran_cdt"
			ParentFrame="BoneChassis_cdt"
		>
			<Constraint Type="Fixed" />
			
			<Body
			
			    ModelFrame="BoneArm1_cdt"
				Collisions="None"
				Mass="1000"
			>
				<Constraint
					Name="otval"
					Type="Hinge"
					AxisLocal="(0;0;-1)"
					MinLimit="0"
					MaxLimit="160"
				>
					<Motor
						Type="Position"
						Force="9000000"
						Tau="0.1"
					/>
				</Constraint>
				
				<Body
			
			        ModelFrame="BoneKriloLBase_cdt"
				    Collisions="Internal"
				    Mass="2500"
			    >
				    <Constraint
					    Name="kriloL"
					    Type="Hinge"
					    AxisLocal="(0.05;1;0)"
					    MinLimit="-0"
					    MaxLimit="61"
				    >
					    <Motor
						   Type="Position"
						   Force="9000000"
						   Tau="0.1"
						/>
				    </Constraint>
				
			    </Body>
				
				<Body
			
			        ModelFrame="BoneKriloRBase_cdt"
				    Collisions="Internal"
				    Mass="2500"
			    >
				    <Constraint
					    Name="kriloR"
					    Type="Hinge"
					    AxisLocal="(-0.05;-1;0)"
					    MinLimit="-0"
					    MaxLimit="61"
				    >
					    <Motor
						   Type="Position"
						   Force="9000000"
						   Tau="0.1"
						/>
				    </Constraint>
				
			    </Body>
				
			</Body>
			
			<Body 
			
			    ModelFrame="BoneArm2_cdt"
				Collisions="All"
				Mass="500"
			>
				<Constraint
					Name="otval"
					Type="Hinge"
					AxisLocal="(0;0;-1)"
					MinLimit="-0"
					MaxLimit="20"
				>
					<Motor
						Type="Position"
						Force="5000000"
						Tau="0.1"
					/>
				</Constraint>
				
			</Body>
			
			<Body 
			
			    ModelFrame="BoneRotationBase_cdt"
				Collisions="All"
				Mass="2000"
			>
				<Constraint
					Name="povorot"
					Type="Hinge"
					AxisLocal="(0;1;0)"
					MinLimit="-180"
					MaxLimit="180"
				>
					<Motor
						Type="Position"
						Force="1000000"
						Tau="0.1"
					/>
				</Constraint>
				
				    <Body 
			
			            ModelFrame="BoneArm_cdt"
						Collisions="Internal"
				        Mass="1000"
			        >
				        <Constraint
					        Name="strela"
					        Type="Hinge"
					        AxisLocal="(0;0;-1)"
					        MinLimit="-45"
					        MaxLimit="15"
				        >
					        <Motor
						       Type="Position"
						       Force="1000000"
						       Tau="0.1"
					        />
				        </Constraint>
						
						    <Body
				                 ModelFrame="BoneBlok_cdt"
				                 AngularDamping="10"
				                 Collisions="None"
				                 Mass="500"
			                >	  
				                     <Constraint
					                    AxisLocal="(0.0; 0.0; 1.0)"
					                    MinLimit="-60"
					                    MaxLimit="60"
					                    Type="Hinge"
				                     />
								<Body
									Collisions="Internal"
									ForceBodyParams="true"
								    Mass="500"
								    ModelFrame="BoneKruk_cdt"
								>
									    <Constraint
										   AxisLocal="(0;-1;0)"
										   MinLimit="-0"
										   MaxLimit="4.5"
										   Name="kruk"
										   Type="Prismatic"
									    >
										     <Motor 
											    Force="1000000"
												Type="Position"
												Damping="*"
												Tau="0.1"
											 />	
									    </Constraint>
								</Body>	 
							</Body>
					</Body>
			</Body>
			
		</Body>
	</PhysicsModel>
	<TruckData>
		<OcclusionMap HalfSizeZ="2.05" MinX="-5.95" MaxX="5.95" />
		
		<Camera Center="(-6.0; 0; 0)" />
	</TruckData>
	<GameData>
		<InstallSocket Type="BAT_M" />
		<WinchSocket Pos="(4.785; 2.254; 0)" ParentFrame="BoneArm1_cdt" />
		<WinchSocket Pos="(2.084; 2.775; 0)" ParentFrame="BoneKruk_cdt" />
	</GameData>
	
	<ControlledIK>
		<Chain
			ModelFrames="BoneBazaCran_cdt,BoneRotationBase_cdt, BoneArm_cdt"
			AffectedFrames="BoneArm_cdt,BoneBlok_cdt,BoneKruk_cdt"
			CenterXZ="(1.0; 0)"
			EndOffset="(-3.441; 3.513; 0)"
			Id="crane"
		/>
	</ControlledIK>	
	
	<ControlledConstraints>
	    <Constraint Id="Otval" Name="otval" />
		<Constraint Id="KriloL" Name="kriloL" />
		<Constraint Id="KriloR" Name="kriloR" />
		<Constraint Id="Kruk" Name="kruk" />
	</ControlledConstraints>
	<AutomaticIK>
	    <IKBone
			ModelFrame="BazeHtok3"
			ParentFrame="BoneRotationBase_cdt"
		>
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0.0; 0.0; 0.0)"
				AttachToFrame="BoneArm_cdt"
				ModelFrame="Htok3"
				ParentFrame="BoneArm_cdt"
			>
				<IKJoint AxisLocal="(1;0;0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone
			ModelFrame="BazeHtok2"
			ParentFrame="BoneBazaCran_cdt"
		>
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0.0; 0.0; 0.0)"
				AttachToFrame="BoneArm2_cdt"
				ModelFrame="Htok2"
				ParentFrame="BoneArm2_cdt"
			>
				<IKJoint AxisLocal="(1;0;0)" Type="Slider" />
			</IKBone>
		</IKBone>
		<IKBone
			ModelFrame="BazeHtok"
			ParentFrame="BoneArm2_cdt"
		>
			<IKJoint AxisLocal="(0;0;1)" Type="Hinge" />
			<IKBone
				AttachOffset="(0.0; 0.0; 0.0)"
				AttachToFrame="BoneArm1_cdt"
				ModelFrame="Htok"
				ParentFrame="BoneArm1_cdt"
			>
				<IKJoint AxisLocal="(1;0;0)" Type="Slider" />
			</IKBone>
		</IKBone>
	</AutomaticIK>
</TruckAddon>
