<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="wheelLoader">
    <annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>
    <name>
        <en>Liebherr L538</en>
        <de>Liebherr L538</de>
    </name>
    <filename>data/vehicles/steerable/liebherr/liebherrL538.i3d</filename>

    <size width="3" length="8" />

    <wheels autoRotateBackSpeed="1">
        <wheel rotSpeed="0"  restLoad="3.5" repr="0>0" radius="0.766" width="0.75" initialCompression="70" suspTravel="0.1" spring="50" damper="35" mass="0.315" hasTyreTracks="true" />
        <wheel rotSpeed="0"  restLoad="3.5" repr="0>1" radius="0.766" width="0.75" initialCompression="70" suspTravel="0.1" spring="50" damper="35" mass="0.315" hasTyreTracks="true" />
        <wheel rotSpeed="0"  restLoad="1.9" repr="1>0" radius="0.766" width="0.75" initialCompression="40" suspTravel="0.1" spring="70" damper="35" mass="0.315" hasTyreTracks="true" />
        <wheel rotSpeed="0"  restLoad="1.9" repr="1>1" radius="0.766" width="0.75" initialCompression="40" suspTravel="0.1" spring="70" damper="35" mass="0.315" hasTyreTracks="true" />
    </wheels>

    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart node="3|0" linkNode="0>0"    filename="$data/vehicles/wheels/trelleborg/trelleborgTM2000_620_75R26.i3d" />
        <dynamicallyLoadedPart node="3|1" linkNode="0>1"    filename="$data/vehicles/wheels/trelleborg/trelleborgTM2000_620_75R26.i3d" />
        <dynamicallyLoadedPart node="3|0" linkNode="1>0"    filename="$data/vehicles/wheels/trelleborg/trelleborgTM2000_620_75R26.i3d" />
        <dynamicallyLoadedPart node="3|1" linkNode="1>1"    filename="$data/vehicles/wheels/trelleborg/trelleborgTM2000_620_75R26.i3d" />
        <dynamicallyLoadedPart node="0"   linkNode="1>15|0" filename="$data/vehicles/shared/wheelChock02.i3d" />
        <dynamicallyLoadedPart node="0"   linkNode="1>15|1" filename="$data/vehicles/shared/wheelChock02.i3d" />
    </dynamicallyLoadedParts>

    <differentials>
        <differential torqueRatio="0.5" maxSpeedRatio="1.6" wheelIndex1="0" wheelIndex2="1" /> <!-- front left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.6" wheelIndex1="2" wheelIndex2="3" /> <!-- back left-right -->
        <differential torqueRatio="0.5" maxSpeedRatio="1.6" differentialIndex1="0" differentialIndex2="1" /><!-- front-back -->
    </differentials>

    <motor torqueScale="0.687" minRpm="1000" maxRpm="2200" maxBackwardSpeed="20" brakeForce="10" lowBrakeForceScale="0.22" lowBrakeForceSpeedLimit="1" minForwardGearRatio="19.5" maxForwardGearRatio="130" minBackwardGearRatio="45" maxBackwardGearRatio="130">
        <torque normRpm="0.1" torque="0.35"/>
        <torque normRpm="0.2" torque="0.65"/>
        <torque normRpm="0.3" torque="0.85"/>
        <torque normRpm="0.4" torque="1"/>
        <torque normRpm="0.75" torque="0.75"/>
        <torque normRpm="1" torque="0.65"/>
    </motor>

    <fuelCapacity>205</fuelCapacity>
    <fuelUsage>41</fuelUsage>

    <cameras count="2">
        <camera1 index="0>2|0|0" rotatable="true" rotateNode="0>2|0" limit="true" rotYSteeringRotSpeed="-22.5" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="5" transMax="35" >
            <raycastNode index="0>2|2"/>
            <raycastNode index="0>2|3"/>
            <raycastNode index="0>2|4"/>
            <raycastNode index="1>2"/>
        </camera1>
        <camera2 index="0>2|1" rotatable="true" limit="true" rotMinX="-1.1" rotMaxX="0.4" transMin="0" transMax="0" useMirror="true" isInside="true" />
    </cameras>

    <lights count="2">
        <light realLight="1>3|0|0" decoration="1>3|0|1" lightType="0"/>
        <light                     decoration="0>4|0|0" lightType="0"/>
        <light realLight="0>4|1|0" decoration="0>4|1|1" lightType="1"/>
    </lights>

    <brakeLights>
        <brakeLight index="0>4|3" />
    </brakeLights>

    <beaconLights>
        <beaconLight index="0>4|4" speed="0.015" filename="$data/vehicles/shared/beaconLight02.i3d"/>
    </beaconLights>

    <turnSignals>
        <turnSignalLeft index="0>4|2|0" />
        <turnSignalRight index="0>4|2|1" />
        <turnSignalLeft index="1>3|1|0" />
        <turnSignalRight index="1>3|1|1" />
    </turnSignals>

    <mirrors>
        <mirror index="0>16|0" />
    </mirrors>

    <indoorHud>
        <speed animName="speedDisplay" />
        <fuel animName="fuelDisplay" />
    </indoorHud>

    <enterReferenceNode index="0>" />
    <exitPoint index="0>3" />

    <motorStartDuration>4500</motorStartDuration>
    <attachSound file="$data/vehicles/shared/attach.wav" pitchOffset="1" />
    <motorStartSound file="$data/vehicles/steerable/liebherr/liebherrL538_start.wav" pitchOffset="1" volume="1" />
    <motorSound file="$data/vehicles/steerable/liebherr/liebherrL538_idle.wav" pitchOffset="1" pitchScale="0.0095" pitchMax="1.65" volume="1" radius="50" innerRadius="20" />
    <motorSoundRun file="$data/vehicles/steerable/liebherr/liebherrL538_run.wav" pitchOffset="0.75" pitchScale="0.009851" pitchMax="1.1" volume="1.1" />
    <motorStopSound file="$data/vehicles/steerable/liebherr/liebherrL538_stop.wav" pitchOffset="0.9" volume="1.2" />
    <cylinderedHydraulicSound file="$data/vehicles/steerable/liebherr/liebherrL538_hydraulic.wav" pitchOffset="0.96" volume="0.45" />
    <honkSound file="$data/vehicles/shared/horn.wav" volume="1" radius="70" innerRadius="10" />

    <exhaustEffects>
        <exhaustEffect index="0>7" 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.05" maxRpmScale="0.3" forwardXRotations="50 50 50" forwardZRotations="0 0 0" steerXRotations="0 0 0" steerZRotations="100 0 -100" />
    </exhaustEffects>

    <steering index="0>5|0" indoorRotation="540" outdoorRotation="60" />

    <characterNode index="0>6|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 110" >
        <ikChains>
            <ikChain id="rightFoot" target="0>6|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="90" />
                <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>6|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="90" />
                <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>5|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>5|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="1>8" />

    <attacherJoints>
        <attacherJoint index="0>9"     jointType="trailer" maxRotLimit="20 85 85" minRotRotationOffset="0" allowsJointLimitMovement="false" canTurnOnImplement="false" />
        <attacherJoint index="1>16|0|0" jointType="wheelLoader" allowsJointLimitMovement="false" allowsLowering="false" rootNode="1>" rotLimitSpring="100 100 100" rotLimitDamping="100 100 100" transLimitSpring="100 100 100" transLimitDamping="100 100 100"/>
    </attacherJoints>

    <mouseControls>
        <mouseControl iconFilename="$dataS2/menu/moveControls/frontloader_arm.png" axis="AXIS_FRONTLOADER_ARM" />
        <mouseControl iconFilename="$dataS2/menu/moveControls/frontloader_tool.png" axis="AXIS_FRONTLOADER_TOOL" />
    </mouseControls>

    <movingTools>
        <!-- physics -->
        <movingTool index="1>16" attacherJointIndices="1" anchorActor="0" rotSpeed="30" rotAcceleration="125" rotMax="6" rotMin="-87" axis="AXIS_FRONTLOADER_ARM" invertAxis="true" invertMouseAxis="true" speedFactor="1.2">
            <dependentMovingTool index="1>16|0" rotSpeedScale="-1" minRotLimits="0 85" maxRotLimits="120 180"/>
        </movingTool>
        <movingTool index="1>16|0" attacherJointIndices="1" anchorActor="0" rotSpeed="50" rotAcceleration="125" rotMax="120" rotMin="0" syncMinRotLimits="true" syncMaxRotLimits="true" axis="AXIS_FRONTLOADER_TOOL" invertAxis="false" invertMouseAxis="true" speedFactor="0.35" />

        <!-- delayed mesh -->
        <movingTool index="1>4" isDelayed="true" adjustAttributesToMovingToolIndex="1" rotSpeed="30" rotAcceleration="125" rotMax="6" rotMin="-87" axis="AXIS_FRONTLOADER_ARM" invertAxis="true" invertMouseAxis="true" speedFactor="1.2">
            <dependentPart index="1>5" />
            <dependentPart index="1>4|1" />
            <dependentMovingTool index="1>4|0" rotSpeedScale="-1" minRotLimits="0 85" maxRotLimits="120 180"/>
        </movingTool>
        <movingTool index="1>4|0" isDelayed="true" adjustAttributesToMovingToolIndex="2" rotSpeed="50" rotAcceleration="125" rotMax="120" rotMin="0" syncMinRotLimits="true" syncMaxRotLimits="true" axis="AXIS_FRONTLOADER_TOOL" invertAxis="false" invertMouseAxis="true" speedFactor="0.35" >
            <dependentPart index="1>4|1" />
        </movingTool>
    </movingTools>

    <movingParts>
        <!-- main arm cylinder -->
        <movingPart index="1>5" referencePoint="1>4|2" referenceFrame="1>4|2">
            <translatingPart index="1>5|0" />
        </movingPart>

        <!-- z kinematic -->
        <movingPart index="1>4|1" referencePoint="1>4|0|0" localReferencePoint="1>4|1|0" referenceFrame="1>4|3">
            <dependentPart index="1>4|1|0" />
            <dependentPart index="1>6" />
        </movingPart>
        <movingPart index="1>4|1|0" referencePoint="1>4|0|0" referenceFrame="1>4|1|2" />
        <!-- z cylinder -->
        <movingPart index="1>6" referencePoint="1>4|1|1" referenceFrame="1>4"  >
            <translatingPart index="1>6|0" />
            <dependentPart index="1>7|0|0" />
        </movingPart>
        <movingPart index="1>7|0|0" referenceFrame="1>6" />

        <!-- driving -->
        <movingPart index="0>11" referencePoint="1>10" referenceFrame="1>10" isActiveDirty="true" playSound="false">
            <translatingPart index="0>11|0" />
        </movingPart>
        <movingPart index="0>12" referencePoint="1>11" referenceFrame="1>11" isActiveDirty="true" playSound="false">
            <translatingPart index="0>12|0" />
        </movingPart>
        <movingPart index="0>10" referencePoint="1>9"  referenceFrame="1>9"  scaleZ="true" isActiveDirty="true" playSound="false" />
        <movingPart index="0>13" referencePoint="1>12" referenceFrame="1>12" scaleZ="true" isActiveDirty="true" playSound="false" />
        <movingPart index="0>14" referencePoint="1>13" referenceFrame="1>14" scaleZ="true" isActiveDirty="true" playSound="false" />
    </movingParts>

    <skinnedNodes>
        <skinnedNode index="1>14" />
    </skinnedNodes>

    <animations>
        <animation name="speedDisplay">
            <part node="0>16|1|0|0|0" startTime="0"     endTime="0.010" visibility="true" />
            <part node="0>16|1|0|0|0" startTime="0.011" endTime="0.012" visibility="false" />
            <part node="0>16|1|0|1|0" startTime="0"     endTime="0.010" visibility="false" />
            <part node="0>16|1|0|1|0" startTime="0.001" endTime="0.012" visibility="true" />

            <part node="0>16|1|0|0|1" startTime="0.099" endTime="0.100" visibility="true" />
            <part node="0>16|1|0|0|1" startTime="0.100" endTime="0.101" visibility="false" />
            <part node="0>16|1|0|1|1" startTime="0.099" endTime="0.100" visibility="false" />
            <part node="0>16|1|0|1|1" startTime="0.100" endTime="0.101" visibility="true" />

            <part node="0>16|1|0|0|2" startTime="0.199" endTime="0.200" visibility="true" />
            <part node="0>16|1|0|0|2" startTime="0.200" endTime="0.201" visibility="false" />
            <part node="0>16|1|0|1|2" startTime="0.199" endTime="0.200" visibility="false" />
            <part node="0>16|1|0|1|2" startTime="0.200" endTime="0.201" visibility="true" />

            <part node="0>16|1|0|0|3" startTime="0.299" endTime="0.300" visibility="true" />
            <part node="0>16|1|0|0|3" startTime="0.300" endTime="0.301" visibility="false" />
            <part node="0>16|1|0|1|3" startTime="0.299" endTime="0.300" visibility="false" />
            <part node="0>16|1|0|1|3" startTime="0.300" endTime="0.301" visibility="true" />

            <part node="0>16|1|0|0|4" startTime="0.399" endTime="0.400" visibility="true" />
            <part node="0>16|1|0|0|4" startTime="0.400" endTime="0.401" visibility="false" />
            <part node="0>16|1|0|1|4" startTime="0.399" endTime="0.400" visibility="false" />
            <part node="0>16|1|0|1|4" startTime="0.400" endTime="0.401" visibility="true" />

            <part node="0>16|1|0|0|5" startTime="0.499" endTime="0.500" visibility="true" />
            <part node="0>16|1|0|0|5" startTime="0.500" endTime="0.501" visibility="false" />
            <part node="0>16|1|0|1|5" startTime="0.499" endTime="0.500" visibility="false" />
            <part node="0>16|1|0|1|5" startTime="0.500" endTime="0.501" visibility="true" />

            <part node="0>16|1|0|0|6" startTime="0.599" endTime="0.600" visibility="true" />
            <part node="0>16|1|0|0|6" startTime="0.600" endTime="0.601" visibility="false" />
            <part node="0>16|1|0|1|6" startTime="0.599" endTime="0.600" visibility="false" />
            <part node="0>16|1|0|1|6" startTime="0.600" endTime="0.601" visibility="true" />

            <part node="0>16|1|0|0|7" startTime="0.699" endTime="0.700" visibility="true" />
            <part node="0>16|1|0|0|7" startTime="0.700" endTime="0.701" visibility="false" />
            <part node="0>16|1|0|1|7" startTime="0.699" endTime="0.700" visibility="false" />
            <part node="0>16|1|0|1|7" startTime="0.700" endTime="0.701" visibility="true" />

            <part node="0>16|1|0|0|8" startTime="0.799" endTime="0.800" visibility="true" />
            <part node="0>16|1|0|0|8" startTime="0.800" endTime="0.801" visibility="false" />
            <part node="0>16|1|0|1|8" startTime="0.799" endTime="0.800" visibility="false" />
            <part node="0>16|1|0|1|8" startTime="0.800" endTime="0.801" visibility="true" />

            <part node="0>16|1|0|0|9" startTime="0.899" endTime="0.900" visibility="true" />
            <part node="0>16|1|0|0|9" startTime="0.900" endTime="0.901" visibility="false" />
            <part node="0>16|1|0|1|9" startTime="0.899" endTime="0.900" visibility="false" />
            <part node="0>16|1|0|1|9" startTime="0.900" endTime="0.901" visibility="true" />

            <part node="0>16|1|0|1|9" startTime="0.900" endTime="1.000" visibility="true" />
        </animation>
        <animation name="fuelDisplay">
            <part node="0>16|1|1|0|0" startTime="0"     endTime="0.001" visibility="true" />
            <part node="0>16|1|1|0|0" startTime="0.001" endTime="0.002" visibility="false" />
            <part node="0>16|1|1|1|0" startTime="0"     endTime="0.001" visibility="false" />
            <part node="0>16|1|1|1|0" startTime="0.001" endTime="0.002" visibility="true" />

            <part node="0>16|1|1|0|1" startTime="0.249" endTime="0.250" visibility="true" />
            <part node="0>16|1|1|0|1" startTime="0.250" endTime="0.251" visibility="false" />
            <part node="0>16|1|1|1|1" startTime="0.249" endTime="0.250" visibility="false" />
            <part node="0>16|1|1|1|1" startTime="0.250" endTime="0.251" visibility="true" />

            <part node="0>16|1|1|0|2" startTime="0.499" endTime="0.500" visibility="true" />
            <part node="0>16|1|1|0|2" startTime="0.500" endTime="0.501" visibility="false" />
            <part node="0>16|1|1|1|2" startTime="0.499" endTime="0.500" visibility="false" />
            <part node="0>16|1|1|1|2" startTime="0.500" endTime="0.501" visibility="true" />

            <part node="0>16|1|1|0|3" startTime="0.749" endTime="0.750" visibility="true" />
            <part node="0>16|1|1|0|3" startTime="0.750" endTime="0.751" visibility="true" />
            <part node="0>16|1|1|1|3" startTime="0.749" endTime="0.750" visibility="false" />
            <part node="0>16|1|1|1|3" startTime="0.750" endTime="0.751" visibility="true" />

            <part node="0>16|1|1|1|3" startTime="0.750" endTime="1" visibility="true" />
        </animation>
    </animations>

    <articulatedAxis componentJointIndex="0" anchorActor="0" rotSpeed="55" rotMax="33" rotMin="-33" />

    <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="90" washDuration="1" workMultiplier="4" />

    <components count="2">
        <component1 centerOfMass="0 0.82 -1.1" solverIterationCount="10" />
        <component2 centerOfMass="0 0.82 1.2" solverIterationCount="10" />
        <joint component1="0" component2="1" index="0>8" rotLimit="0 0 0" transLimit="0 0 0" />
    </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.4" rotation="0" invertX="true" />
    </schemaOverlay>

</vehicle>
