﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="tractor">
    <annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>
    <name>
        <en>Case IH Puma 160</en>
        <de>Case IH Puma 160</de>
    </name>
    <filename>data/vehicles/steerable/caseIH/caseIHPuma160.i3d</filename>

    <size width="3.6" length="6.5"/>

    <wheels autoRotateBackSpeed="1.5">
        <wheel rotSpeed="1" restLoad="2.3" repr="0>2|0" driveNode="0>2|0|0|0" radius="0.71" initialCompression="50" suspTravel="0.2" spring="25" damper="60" mass="0.21" fenderNode="0>2|0|3" fenderRotMin="-26" hasTyreTracks="true" />
        <wheel rotSpeed="1" restLoad="2.3" repr="0>3|0" driveNode="0>3|0|0|0" radius="0.71" initialCompression="50" suspTravel="0.2" spring="25" damper="60" mass="0.21" fenderNode="0>3|0|3" fenderRotMax="26"  hasTyreTracks="true" />
        <wheel rotSpeed="0" restLoad="2.1" repr="0>0"                         radius="0.89" initialCompression="50"  suspTravel="0.2" spring="25" damper="60" mass="0.39" hasTyreTracks="true" />
        <wheel rotSpeed="0" restLoad="2.1" repr="0>1"                         radius="0.89" initialCompression="50"  suspTravel="0.2" spring="25" damper="60" mass="0.39" hasTyreTracks="true" />
    </wheels>

    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart node="1|1" linkNode="0>2|0|0|0" filename="$data/vehicles/wheels/trelleborg/trelleborgTM800_540_65R28.i3d" />
        <dynamicallyLoadedPart node="1|0" linkNode="0>3|0|0|0" filename="$data/vehicles/wheels/trelleborg/trelleborgTM800_540_65R28.i3d" />
        <dynamicallyLoadedPart node="1|0" linkNode="0>0"       filename="$data/vehicles/wheels/trelleborg/trelleborgTM800_650_65R38.i3d" />
        <dynamicallyLoadedPart node="1|1" linkNode="0>1"       filename="$data/vehicles/wheels/trelleborg/trelleborgTM800_650_65R38.i3d" />
    </dynamicallyLoadedParts>

    <ackermannSteering rotSpeed="60" rotMax="31.5" rotCenterWheel1="2" rotCenterWheel2="3" />

    <differentials>
        <differential torqueRatio="0.5" maxSpeedRatio="1.3" wheelIndex1="0" wheelIndex2="1" /> <!-- front left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.4" wheelIndex1="2" wheelIndex2="3" /> <!-- back left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.1" differentialIndex1="0" differentialIndex2="1" /> <!-- front-back -->
    </differentials>

    <motor torqueScale="0.899" minRpm="1000" maxRpm="2200" maxBackwardSpeed="15" brakeForce="5" lowBrakeForceScale="0.22" lowBrakeForceSpeedLimit="1" minForwardGearRatio="16" maxForwardGearRatio="130" minBackwardGearRatio="50" maxBackwardGearRatio="130">
        <torque normRpm="0.45" torque="0.9"/>
        <torque normRpm="0.5" torque="0.97"/>
        <torque normRpm="0.59" torque="1"/>
        <torque normRpm="0.72" torque="1"/>
        <torque normRpm="0.86" torque="0.88"/>
        <torque normRpm="1" torque="0.72"/>
    </motor>

    <fuelCapacity>330</fuelCapacity>
    <fuelUsage>66</fuelUsage>

    <cameras count="2">
        <camera1 index="4|0" rotatable="true" rotateNode="4" limit="true" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="4" transMax="35" >
            <raycastNode index="0>6"/>
            <raycastNode index="0>7"/>
        </camera1>
        <camera2 index="5" rotatable="true" limit="true" rotMinX="-1.1" rotMaxX="0.4" transMin="0" transMax="0" useMirror="true" isInside="true" />
    </cameras>

    <indoorHud>
        <speed numbers="0>39|0" precision="1" />
        <rpm numbers="0>39|1" precision="0" />
        <operatingTime numbers="0>39|2" precision="1" />
        <fuel animName="fuelDisplay" />
    </indoorHud>

    <lights>
        <light realLight="0>9" decoration="0>28" lightType="0"/>
        <light realLight="0>10" decoration="0>29" lightType="1"/>
    </lights>

    <brakeLights>
        <brakeLight index="0>34" />
    </brakeLights>

    <beaconLights>
        <beaconLight index="0>30|0" speed="0.015" filename="$data/vehicles/shared/beaconLight02.i3d" />
        <beaconLight index="0>30|1" speed="0.015" filename="$data/vehicles/shared/beaconLight02.i3d" />
    </beaconLights>

    <turnSignals>
        <turnSignalLeft index="0>43|0" />
        <turnSignalRight index="0>43|1" />
    </turnSignals>

    <mirrors>
        <mirror index="0>44|0" />
        <mirror index="0>44|1" />
        <mirror index="0>44|2" />
    </mirrors>

    <steering index="0>23|0" indoorRotation="540" outdoorRotation="60" />
    <enterReferenceNode index="0>"/>
    <exitPoint index="0>8"/>

    <attacherJoints>
        <!-- back -->
        <attacherJoint index="0>11|0|0" rotationNode="0>11" minRot="32 0 0" minRot2="-25 0 0" maxRot="8 0 0" rotationNode2="0>11|0" maxRot2="-8 0 0" maxTransLimit="0 0.5 0" maxRotLimit="0 0 20" moveTime="2.5" ptoOutputNode="0>20" ptoFilename="$data/vehicles/shared/powerTakeoff.i3d">
            <bottomArm rotationNode="0>12" translationNode="0>12|0" referenceNode="0>12|0|0" zScale="-1" />
            <topArm baseNode="0>13" filename="$data/vehicles/shared/upperLink.i3d" zScale="-1" />
        </attacherJoint>
        <!-- front -->
        <attacherJoint index="0>16|0|0" rotationNode="0>16" minRot="-33 0 0" minRot2="20 0 0" maxRot="-10 0 0" rotationNode2="16|0" maxRot2="10 0 0" maxTransLimit="0 0.4 0" maxRotLimit="0 0 20" moveTime="2.5" ptoOutputNode="0>22" ptoFilename="$data/vehicles/shared/powerTakeoff.i3d">
            <bottomArm rotationNode="0>17" translationNode="17|0" referenceNode="17|0|0" zScale="1" />
            <topArm baseNode="0>18" filename="$data/vehicles/shared/upperLink.i3d" zScale="1" toggleVisibility="true" />
        </attacherJoint>
        <!-- trailer attacher -->
        <attacherJoint index="0>19" jointType="trailer"    maxRotLimit="10 50 50" minRotRotationOffset="0" allowsJointLimitMovement="false" ptoOutputNode="0>20" ptoFilename="$data/vehicles/shared/powerTakeoff.i3d"/>
        <attacherJoint index="0>21" jointType="trailerLow" maxRotLimit="10 50 50" minRotRotationOffset="0" allowsJointLimitMovement="false" ptoOutputNode="0>20" ptoFilename="$data/vehicles/shared/powerTakeoff.i3d"/>
        <attacherJoint index="0>42" jointType="trailer"    maxRotLimit="10 80 80" minRotRotationOffset="0" allowsJointLimitMovement="false" ptoOutputNode="0>22" ptoFilename="$data/vehicles/shared/powerTakeoff.i3d"/>
    </attacherJoints>

    <attacherJointLowerCombo duration="2">
        <attacherJoint index="2" time="0" />
        <attacherJoint index="1" time="1" />
        <attacherJoint index="3" time="1" />
        <attacherJoint index="4" time="1" />
        <attacherJoint index="5" time="0" />
    </attacherJointLowerCombo>

    <animations>
        <animation name="fuelDisplay">
            <part node="0>39|3|0" startTime="0" endTime="1" startRot="0 0 0" endRot="0 -126 0" />
        </animation>
    </animations>

    <movingTools>
        <!-- attacher joint back bottom-->
        <movingTool index="0>12">
            <!-- cylinder 1 -->
            <dependentPart index="0>14" />
            <!-- cylinder 2 -->
            <dependentPart index="0>15" />
            <!-- side arms -->
            <dependentPart index="0>35" />
            <dependentPart index="0>36" />
        </movingTool>

        <!-- attacher joint front bottom-->
        <movingTool index="0>17">
            <!-- cylinder -->
            <dependentPart index="0>31" />
        </movingTool>
    </movingTools>

    <movingParts>
        <!-- attacher joint back bottom cylinder 1 -->
        <movingPart index="0>14" referencePoint="0>15|1" referenceFrame="0>41">
            <translatingPart index="0>14|0" />
        </movingPart>

        <!-- attacher joint back bottom cylinder 2 -->
        <movingPart index="0>15" referencePoint="0>12|0|1" localReferencePoint="0>15|0" referenceFrame="0>40">
            <dependentPart index="0>15|0" />
        </movingPart>
        <!-- attacher joint back bottom cylinder 2b -->
        <movingPart index="0>15|0" referencePoint="0>12|0|1" referenceFrame="0>12|0|1|0">
            <dependentPart index="0>15|0|0" />
            <dependentPart index="0>15|0|1" />
        </movingPart>
        <movingPart index="0>15|0|0" referencePoint="0>12|0|1|0" referenceFrame="0>12|0|1|0">
            <translatingPart index="0>15|0|0|0" />
        </movingPart>
        <movingPart index="0>15|0|1" referencePoint="0>12|0|1|1" referenceFrame="0>12|0|1|0">
            <translatingPart index="0>15|0|1|0" />
        </movingPart>
        <!-- side arms -->
        <movingPart index="0>35" referencePoint="0>12|0|2" referenceFrame="0>">
            <translatingPart index="0>35|0" />
        </movingPart>
        <movingPart index="0>36" referencePoint="0>12|0|3" referenceFrame="0>">
            <translatingPart index="0>36|0" />
        </movingPart>

        <!-- attacher joint front bottom cylinder -->
        <movingPart index="0>31" referencePoint="0>17|0|1" referenceFrame="0>17|0|1">
            <translatingPart index="0>31|0" />
        </movingPart>

        <!-- steering -->
        <movingPart index="0>32" referencePoint="0>2|0|2" referenceFrame="0>" isActiveDirty="true" playSound="false">
            <translatingPart index="0>32|0" />
        </movingPart>
        <movingPart index="0>33" referencePoint="0>3|0|2" referenceFrame="0>" isActiveDirty="true" playSound="false">
            <translatingPart index="0>33|0" />
        </movingPart>
        <movingPart index="0>2|0|1" referencePoint="0>3|0|1" referenceFrame="0>" isActiveDirty="true" playSound="false" scaleZ="true" />
    </movingParts>

    <characterNode index="0>24|0" cameraMinDistance="1.5" filename="$dataS2/character/player/player.i3d" characterMesh="1" characterGloves="2" characterSkin="0" spineNode="0|0" leftArmIKChainId="leftArm" rightArmIKChainId="rightArm" spineRotation="180 0 105" >
        <ikChains>
            <ikChain id="rightFoot" target="0>24|1" targetOffset="0 0.1 0" alignToTarget="true" isDirtyOnLoad="true" >
                <node index="0|1" />
                <node index="0|1|0"     minRx="0" maxRx="0" minRy="-30" maxRy="30" minRz="0"   maxRz="120" />
                <node index="0|1|0|0"   minRx="0" maxRx="0" minRy="0"   maxRy="0"  minRz="-100" maxRz="-7" />
                <node index="0|1|0|0|0" />
            </ikChain>
            <ikChain id="leftFoot" target="0>24|2" targetOffset="0 0.1 0" alignToTarget="true" isDirtyOnLoad="true">
                <node index="0|2"     />
                <node index="0|2|0"     minRx="0" maxRx="0" minRy="-30" maxRy="30" minRz="0"   maxRz="120" />
                <node index="0|2|0|0"   minRx="0" maxRx="0" minRy="0"   maxRy="0"  minRz="-100" maxRz="-7" />
                <node index="0|2|0|0|0" />
            </ikChain>
            <ikChain id="rightArm" target="0>23|0|0" targetOffset="0.025 0.066 0" alignToTarget="true" isDirtyOnLoad="true">
                <node index="0|0|0|1" />
                <node index="0|0|0|1|0" minRx="-20" maxRx="20" minRy="-20" maxRy="20" minRz="-80" maxRz="80" />
                <node index="0|0|0|1|0|0" minRx="-10" maxRx="10" minRy="0" maxRy="0" minRz="7"   maxRz="130" />
                <node index="0|0|0|1|0|0|0" />
                <rotationNode index="0|0|0|1|0|0|0|0" rotation="0 0 -60" />
                <rotationNode index="0|0|0|1|0|0|0|0|0" rotation="0 0 -60" />
                <rotationNode index="0|0|0|1|0|0|0|1" rotation="-90 20 -40" />
                <rotationNode index="0|0|0|1|0|0|0|1|0" rotation="0 0 -40" />
            </ikChain>
            <ikChain id="leftArm" target="0>23|0|1" targetOffset="-0.025 0.066 0" alignToTarget="true" isDirtyOnLoad="true">
                <node index="0|0|0|2" />
                <node index="0|0|0|2|0" minRx="-20" maxRx="20" minRy="-20" maxRy="20" minRz="-80" maxRz="80" />
                <node index="0|0|0|2|0|0" minRx="-10" maxRx="10" minRy="0" maxRy="0" minRz="7"   maxRz="130" />
                <node index="0|0|0|2|0|0|0" />
                <rotationNode index="0|0|0|2|0|0|0|0" rotation="0 0 -60" />
                <rotationNode index="0|0|0|2|0|0|0|0|0" rotation="0 0 -60" />
                <rotationNode index="0|0|0|2|0|0|0|1" rotation="-90 20 -40" />
                <rotationNode index="0|0|0|2|0|0|0|1|0" rotation="0 0 -40" />
            </ikChain>
        </ikChains>
    </characterNode>
    <aiTrafficCollisionTrigger index="0>25" />

    <exhaustEffects>
        <exhaustEffect index="0>26" filename="$data/vehicles/particleAnimations/shared/exhaust.i3d" minRpmColor="0.9 0.9 0.9 0.05" maxRpmColor="0.9 0.9 0.9 0.2" minRpmScale="0.15" maxRpmScale="0.45" forwardXRotations="-250 0 120" forwardZRotations="0 0 0" steerXRotations="180 0 -120" steerZRotations="0 0 0" />
    </exhaustEffects>

    <motorStartDuration>2500</motorStartDuration>
    <attachSound file="$data/vehicles/shared/attach.wav" pitchOffset="1" />
    <motorStartSound file="$data/vehicles/steerable/caseIH/caseIHPuma160_start.wav" pitchOffset="0.9" volume="0.75" />
    <motorSound file="$data/vehicles/steerable/caseIH/caseIHPuma160_idle.wav" pitchOffset="0.9" pitchScale="0.015" pitchMax="1.5" volume="0.75" radius="50" innerRadius="20" />
    <motorSoundRun file="$data/vehicles/steerable/caseIH/caseIHPuma160_run.wav" pitchOffset="0.55" pitchScale="0.0195" pitchMax="1.35" volume="0.97" />
	<motorSoundRun2 file="$data/vehicles/shared/transmissionSmall.wav" pitchOffset="0.75" volume="0.35" pitchMax="1.55" volumeMax="0.85"/>
    <motorStopSound file="$data/vehicles/steerable/caseIH/caseIHPuma160_stop.wav" pitchOffset="1" volume="0.7" />
    <compressedAirSound file="$data/vehicles/shared/compressedAir.wav" pitchOffset="1" volume="1.0"/>
    <compressionSound file="$data/vehicles/shared/compressorWork.wav" pitchOffset="1" volume="1.5"/>
    <hydraulicSound file="$data/vehicles/shared/hydraulicUp.wav" pitchOffset="0.55" volume="0.8" />
    <honkSound file="$data/vehicles/shared/horn.wav" volume="1" radius="70" innerRadius="10" />

    <driveGroundParticleSystems>
        <driveGroundParticleSystem file="$data/vehicles/particleAnimations/shared/drivingParticleSystem.i3d" wheel="1" />
        <driveGroundParticleSystem file="$data/vehicles/particleAnimations/shared/drivingParticleSystem.i3d" wheel="2" />
        <driveGroundParticleSystem file="$data/vehicles/particleAnimations/shared/drivingParticleSystem.i3d" wheel="3" />
        <driveGroundParticleSystem file="$data/vehicles/particleAnimations/shared/drivingParticleSystem.i3d" wheel="4" />
    </driveGroundParticleSystems>

    <washable dirtDuration="50" washDuration="1" workMultiplier="4" />

    <components count="1">
        <component1 centerOfMass="0 0.95 0.1" solverIterationCount="10" />
    </components>

    <schemaOverlay file="$dataS2/menu/schemas/vehicleSchema.png" fileSelected="$dataS2/menu/schemas/vehicleSchemaSelected.png" width="0.5" height="0.5" attacherJointPosition="0.5 0">
        <attacherJoint position="1 0" rotation="0" invertX="false" />
        <attacherJoint position="0 0" rotation="0" invertX="true" />
        <attacherJoint position="1 0" rotation="0" invertX="false" />
        <attacherJoint position="1 0" rotation="0" invertX="false" />
        <attacherJoint position="0 0" rotation="0" invertX="true" />
    </schemaOverlay>

</vehicle>
