<?xml version="1.0" encoding="utf-8" standalone="no"?>
<vehicle type="jcb4220">
    <annotation>Wortel</annotation>
    <typeDesc>
                Fronthubwerk
                frontlinkage
        </typeDesc>
    <filename>jcbFastrac4000.i3d</filename>
    <size width="3.5" length="7"/>
    <wheels autoRotateBackSpeed="1.5">
        <wheel rotSpeed="1" repr="0>0|0" driveNode="0>0|0|0" radius="0.85" restLoad="2.6" forcePointRatio="0.2" initialCompression="40" suspTravel="0.2" spring="30" damper="50" hasTireTracks="true" fenderNode="0>0|0|1" frictionScale="1.5" mass="0.32" width="0.70" hasParticles="true"/>
        <wheel rotSpeed="1" repr="0>1|0" driveNode="0>1|0|0" radius="0.85" restLoad="2.6" forcePointRatio="0.2" initialCompression="40" suspTravel="0.2" spring="30" damper="50" hasTireTracks="true" fenderNode="0>1|0|1" fenderRotMax="10" frictionScale="1.5" mass="0.32" width="0.70" hasParticles="true"/>
        <wheel rotSpeed="1" repr="0>2" driveNode="0>2|0|0" radius="0.85" restLoad="2.3" forcePointRatio="0.3" initialCompression="40" suspTravel="0.2" spring="35" damper="50" hasTireTracks="true" fenderNode="0>2|0" fenderRotMax="15" frictionScale="1.5" mass="0.32" width="0.70" hasParticles="true"/>
        <wheel rotSpeed="1" repr="0>3" driveNode="0>3|0|0" radius="0.85" restLoad="2.3" forcePointRatio="0.3" initialCompression="40" suspTravel="0.2" spring="35" damper="50" hasTireTracks="true" fenderNode="0>3|0" fenderRotMax="15" frictionScale="1.5" mass="0.32" width="0.70" hasParticles="true"/>
    </wheels>
    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart node="0|1" linkNode="0>0|0|0" filename="trelleborg/trelleborgTM800.i3d"/>
        <dynamicallyLoadedPart node="0|0" linkNode="0>1|0|0" filename="trelleborg/trelleborgTM800.i3d"/>
        <dynamicallyLoadedPart node="1|1" linkNode="0>2|0|0" filename="trelleborg/trelleborgTM800.i3d"/>
        <dynamicallyLoadedPart node="1|0" linkNode="0>3|0|0" filename="trelleborg/trelleborgTM800.i3d"/>
    </dynamicallyLoadedParts>
    <ackermannSteering rotSpeed="55" rotMax="30" rotCenter="0 0 -1.35"/>
    <differentials>
        <differential torqueRatio="0.5" maxSpeedRatio="1.3" wheelIndex1="0" wheelIndex2="1"/>
        <!-- front left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.3" wheelIndex1="2" wheelIndex2="3"/>
        <!-- back left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.1" differentialIndex1="0" differentialIndex2="1"/>
        <!-- front-back -->
    </differentials>
    <crabSteering steeringOffset="14" applySteeringOffsetToFrontWheels="true">
        <frontWheels indices="1 2"/>
        <backWheels indices="3 4"/>
    </crabSteering>
    <motor torqueScale="0.98" minRpm="1000" maxRpm="2200" maxBackwardSpeed="15" brakeForce="10" lowBrakeForceScale="0.22" lowBrakeForceSpeedLimit="1" minForwardGearRatio="11.8" 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>390</fuelCapacity>
    <fuelUsage>81</fuelUsage>
    <cameras count="2">
        <camera1 index="0>4|0|0" rotatable="true" rotateNode="0>4|0" limit="true" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="4" transMax="35">
            <raycastNode index="0>4|2"/>
            <raycastNode index="0>4|3"/>
            <raycastNode index="0>4|4"/>
        </camera1>
        <camera2 index="0>4|1" rotatable="true" limit="true" rotMinX="-1.1" rotMaxX="0.4" transMin="0" transMax="0" useMirror="true" isInside="true"/>
    </cameras>
    <lights>
        <!--to be adjusted manually-->
        <low>
            <light realLight="0>6|0|0" decoration="0>6|0|1" lightTypes="0"/>
            <light realLight="0>6|1|0" decoration="0>6|1|1" lightTypes="1"/>
        </low>
        <!--to be adjusted manually-->
        <high>
            <light realLight="0>6|0|0" decoration="0>6|0|1" lightTypes="0"/>
            <light realLight="0>6|1|0" decoration="0>6|1|1" lightTypes="1"/>
        </high>
        <!--to be adjusted manually-->
        <states>0 1 2</states>
    </lights>
    <brakeLights>
        <brakeLight decoration="0>6|4"/>
    </brakeLights>
    <beaconLights>
        <beaconLight index="0>6|2|0" speed="0.015" filename="$data/shared/beaconLights/beaconLight02.i3d"/>
        <beaconLight index="0>6|2|1" speed="0.016" filename="$data/shared/beaconLights/beaconLight02.i3d"/>
    </beaconLights>
    <turnLights>
        <turnLightLeft decoration="0>6|3|0"/>
        <turnLightRight decoration="0>6|3|1"/>
    </turnLights>
    <reverseLights>
        <reverseLight index="0>6|5"/>
    </reverseLights>
    <mirrors>
        <mirror index="0>22|0"/>
    </mirrors>
    <indoorHud>
        <speed numbers="0>22|1|0" precision="1"/>
        <rpm animName="rpmDisplay" numbers="0>22|1|1" precision="0"/>
        <fuel animName="fuelDisplay"/>
    </indoorHud>
    <enterReferenceNode index="0>"/>
    <exitPoint index="0>5"/>
    <attacherJoints comboDuration="2">
        <attacherJoint index="0>8|0|0" rotationNode="0>8" lowerRotation="5 0 0" upperRotation="24 0 0" rotationNode2="0>8|0" lowerRotation2="-5 0 0" upperRotation2="-17 0 0" lowerRotLimit="0 0 20" lowerTransLimit="0 0.5 0" moveTime="2.5" comboTime="1">
            <bottomArm rotationNode="0>9" translationNode="0>9|0" referenceNode="0>9|0|0" zScale="-1"/>
            <topArm rotationNode="0>9" translationNode="0>9|0" referenceNode="0>9|0|0" zScale="-1"/>
            <schema position="1 0" rotation="0" invertX="false"/>
        </attacherJoint>
        <attacherJoint index="0>12|0|0" rotationNode="0>12" lowerRotation="-10 0 0" upperRotation="-33 0 0" rotationNode2="12|0" lowerRotation2="10 0 0" upperRotation2="20 0 0" lowerRotLimit="0 0 20" lowerTransLimit="0 0.4 0" moveTime="2.5" comboTime="0">
            <bottomArm rotationNode="0>13" translationNode="0>13|0" referenceNode="0>13|0|0" zScale="1"/>
            <topArm rotationNode="0>13" translationNode="0>13|0" referenceNode="0>13|0|0" zScale="1"/>
            <schema position="0 0" rotation="0" invertX="true"/>
        </attacherJoint>
        <attacherJoint index="0>16|0" jointType="trailer" allowsJointLimitMovement="false" upperRotationOffset="0" lowerRotLimit="10 50 50" comboTime="1">
            <schema position="1 0" rotation="0" invertX="false"/>
        </attacherJoint>
        <attacherJoint index="0>16|1" jointType="trailerLow" allowsJointLimitMovement="false" upperRotationOffset="0" lowerRotLimit="10 50 50" comboTime="1">
            <schema position="1 0" rotation="0" invertX="false"/>
        </attacherJoint>
        <attacherJoint index="0>16|2" jointType="trailer" allowsJointLimitMovement="false" upperRotationOffset="0" lowerRotLimit="10 50 50" comboTime="1">
            <schema position="0 0" rotation="0" invertX="true"/>
        </attacherJoint>
        <attacherJoint index="0>16|3" jointType="semitrailer" allowsJointLimitMovement="false" allowsLowering="false" upperRotationOffset="0" lowerRotLimit="20 80 80">
            <schema position="1 0" rotation="0" invertX="false"/>
        </attacherJoint>
        <attacherJoint index="0>16|4" jointType="fastrac" allowsJointLimitMovement="false" allowsLowering="false">
            <schema position="1 0.5" rotation="0" invertX="false"/>
        </attacherJoint>
    </attacherJoints>
    <movingTools>
        <movingTool index="0>9">
            <dependentPart index="0>20|0"/>
            <dependentPart index="0>20|5"/>
        </movingTool>
        <movingTool index="0>13">
            <dependentPart index="0>20|2"/>
        </movingTool>
    </movingTools>
    <movingParts>
        <!-- front -->
        <movingPart index="0>20|2" referencePoint="0>13|0|1" referenceFrame="0>13|0|1">
            <translatingPart index="0>20|2|0"/>
        </movingPart>
        <!-- back -->
        <movingPart index="0>20|0" referencePoint="0>9|0|1" localReferencePoint="0>20|0|0" referenceFrame="0>">
            <dependentPart index="0>20|0|0"/>
        </movingPart>
        <!-- attacher joint back bottom cylinder 2b -->
        <movingPart index="0>20|0|0" referencePoint="0>9|0|1" referenceFrame="0>9|0|1" scaleZ="true">
            <dependentPart index="0>20|1"/>
        </movingPart>
        <!-- hydraulic -->
        <movingPart index="0>20|1" referencePoint="0>20|0|1" referenceFrame="0>20|0|1">
            <translatingPart index="0>20|1|0"/>
        </movingPart>
        <movingPart index="0>20|5" referencePoint="0>9|0|2" referenceFrame="0>9|0|2" scaleZ="true"/>
        <!-- steering front -->
        <movingPart index="0>20|3|0" referencePoint="0>1|0|2" referenceFrame="0>1|0|2" isActiveDirty="true" playSound="false" scaleZ="false"/>
        <movingPart index="0>20|3|1" referencePoint="0>0|0|2" referenceFrame="0>0|0|2" isActiveDirty="true" playSound="false" scaleZ="false"/>
        <!-- steering back -->
        <movingPart index="0>20|4|0" referencePoint="0>3|0|1" referenceFrame="0>3|0|1" isActiveDirty="true" playSound="false" scaleZ="false"/>
        <movingPart index="0>20|4|1" referencePoint="0>2|0|1" referenceFrame="0>2|0|1" isActiveDirty="true" playSound="false" scaleZ="false"/>
        <!-- powershafts -->
        <movingPart index="0>21|0|0" referencePoint="0>21|3" referenceFrame="0>21|0" isActiveDirty="true" playSound="false"/>
        <movingPart index="0>21|2|0" referencePoint="0>21|4" referenceFrame="0>21|2" isActiveDirty="true" playSound="false"/>
    </movingParts>
    <foldingParts startMoveDirection="1" turnOnFoldDirection="-1">
        <foldingPart animationName="foldFrontlinkage" speedScale="1"/>
    </foldingParts>
    <animations>
        <animation name="foldFrontlinkage">
            <part node="0>13|0|2" startTime="0" endTime="1" startRot="0 -20 0" endRot="-48 -20 0"/>
            <part node="0>13|0|3" startTime="0" endTime="1" startRot="0 20 0" endRot="-48 20 0"/>
        </animation>
        <animation name="fuelDisplay">
            <part node="0>22|1|2" startTime="0" endTime="1" startRot="0 90 0" endRot="0 -90 0"/>
        </animation>
        <animation name="rpmDisplay">
            <part node="0>22|1|3" startTime="0" endTime="1" startRot="0 90 0" endRot="0 -55 0"/>
        </animation>
    </animations>
    <steering index="0>7|0" indoorRotation="540" outdoorRotation="50"/>
    <characterNode index="0>17|0" cameraMinDistance="1.5" filename="$dataS2/character/player/player.xml" spineRotation="180 0 108">
        <target ikChain="rightFoot" targetNode="0>17|1" setDirty="true"/>
        <target ikChain="leftFoot" targetNode="0>17|2" setDirty="true"/>
        <target ikChain="rightArm" targetNode="0>17|3" setDirty="true"/>
        <target ikChain="leftArm" targetNode="0>7|0|0" setDirty="true"/>
    </characterNode>
    <ai>
        <trafficCollisionTrigger index="0>18"/>
    </ai>
    <exhaustEffects>
        <!--TODO: adjust xzRotationOffset, xzRotationsForward, xzRotationsBackward, xzRotationsLeft, xzRotationsRight-->
        <exhaustEffect filename="$data/particleSystems/shared/exhaust.i3d" index="0>19" minRpmColor="0.9 0.9 0.9 0.05" maxRpmColor="0.9 0.9 0.9 0.2" minRpmScale="0.05" maxRpmScale="0.4" xzRotationOffset="0 0" xzRotationsForward="0 0" xzRotationsBackward="0 0" xzRotationsLeft="0 0" xzRotationsRight="0 0"/>
    </exhaustEffects>
    <motorStartDuration>2900</motorStartDuration>
    <attachSound file="$data/sounds/attach.wav" pitchOffset="1"/>
    <motorStartSound file="sounds/jcbFastrac3000_start.wav" pitchOffset="1" volume="1"/>
    <motorSound file="sounds/jcbFastrac3000_idle.wav" pitchOffset="1" pitchScale="0.016" pitchMax="1.65" volume="1" radius="50" innerRadius="20"/>
    <motorSoundRun file="sounds/jcbFastrac3000_run.wav" pitchOffset="0.89" pitchScale="0.0092" pitchMax="1.5" volume="0.95"/>
    <motorSoundRun2 file="sounds/jcbFastrac3000_transmission.wav" pitchOffset="1" volume="0.4" pitchMax="1.585" volumeMax="1.2"/>
    <motorStopSound file="sounds/jcb435s_stop.wav" pitchOffset="0.9" volume="1.2"/>
    <compressedAirSound file="$data/sounds/technicalAccessories/brakeBig.wav" pitchOffset="1" volume="1.25"/>
    <compressionSound file="sounds/jcbFastracBrakesystem.wav" pitchOffset="1" volume="1.25"/>
    <hydraulicSound file="$data/sounds/hydraulicUp.wav" pitchOffset="0.55" volume="0.8"/>
    <honkSound file="$data/sounds/hornBig.wav" volume="1" innerRadius="10" radius="70"/>
    <speedRotatingParts>
        <speedRotatingPart index="0>21|0" wheelIndex="2" wheelScale="2"/>
        <speedRotatingPart index="0>21|1" wheelIndex="2" wheelScale="2"/>
        <speedRotatingPart index="0>21|2" wheelIndex="2" wheelScale="2"/>
    </speedRotatingParts>
    <objectChanges>
        <objectChange node="0>22|2" visibilityActive="true"/>
        <objectChange node="0>26" visibilityActive="true"/>
        <objectChange node="0>27" visibilityActive="false"/>
        <objectChange node="0>34" visibilityActive="false"/>
    </objectChanges>
    <washable dirtDuration="50" washDuration="1" workMultiplier="4"/>
    <components count="1">
        <component1 centerOfMass="0 0.82 0" 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"/>
    <storeData>
        <name>
            <de>JCB Fastrac 4220</de>
            <en>JCB Fastrac 4220</en>
        </name>
        <functions>
            <function>$l10n_function_tractor</function>
        </functions>
        <specs>
            <power>235</power>
        </specs>
        <image>store_jcbFastrac4220.png</image>
        <price>165000</price>
        <dailyUpkeep>170</dailyUpkeep>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>JCB</brand>
        <category>tractors</category>
    </storeData>
</vehicle>
