﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="attachableFrontloader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../shared/xml/schema/vehicle.xsd">
    <annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>

    <storeData>
        <name>643R</name>
        <specs>
            <neededPower>280</neededPower>
            <combination xmlFilename="$data/vehicles/johnDeere/series6R/series6R.xml" />
            <combination filterCategory="frontLoaderTools" />
        </specs>
        <functions>
            <function>$l10n_function_frontloader</function>
        </functions>
        <image>$data/vehicles/johnDeere/frontloader643R/store_frontloader643R.png</image>
        <price>15000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>JOHNDEERE</brand>
        <category>frontLoaders</category>
        <shopHeight>2.5</shopHeight>
        <shopTranslationOffset>0 0.267 0</shopTranslationOffset>
        <shopRotationOffset>1.324 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>766720</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>130816</indexBufferMemoryUsage>
        <textureMemoryUsage>1245184</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_frontloader</typeDesc>
        <filename>$data/vehicles/johnDeere/frontloader643R/frontloader643R.i3d</filename>
        <size width="2.5" length="3.2" />
        <components>
            <component centerOfMass="0 0.2 0.5" solverIterationCount="10" mass="1100" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="FRONTLOADER" />
        <mapHotspot type="TOOL" />
    </base>

    <attacherJoints>
        <attacherJoint jointType="frontloader" node="attacherJointTools" nodeVisual="attacherJointToolsVisuals" allowsJointLimitMovement="false" allowsLowering="false" rotLimitSpring="7500 7500 7500" rotLimitDamping="5 5 5" transLimitSpring="7500 7500 7500" transLimitDamping="5 5 5" >
            <schema position="1 0" rotation="0" invertX="false" />
        </attacherJoint>
        <sounds>
            <attach template="ATTACH_01" />
        </sounds>
    </attacherJoints>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" hardAttach="true" jointType="attachableFrontloader" />
        </inputAttacherJoints>
        <support animationName="moveSupport" />
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="0.5" diameter="0.015" straighteningFactor="0.3" dampingFactor="0">
            <objectChange node="detachedHose" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hydraulicIn01_detachedAdapter" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn02"  length="0.5" diameter="0.015" straighteningFactor="0.3" dampingFactor="0">
            <objectChange node="hydraulicIn02_detachedAdapter" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn03"  length="0.5" diameter="0.015" straighteningFactor="0.3" dampingFactor="0">
            <objectChange node="hydraulicIn03_detachedAdapter" visibilityActive="false" visibilityInactive="true"/>
        </hose>
    </connectionHoses>

    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart node="1|0" linkNode="hydraulicIn01_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
        <dynamicallyLoadedPart node="1|0" linkNode="hydraulicIn02_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
        <dynamicallyLoadedPart node="1|0" linkNode="hydraulicIn03_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <animations>
        <animation name="moveSupport">
            <part node="supportCol"  startTime="0" endTime="1" startRot="70 0 0" endRot="0 0 0" />
            <part node="supportArm"  startTime="0" endTime="1" startRot="46 0 0"  endRot="-23.5 0 0" />
            <part node="supportArmMove" startTime="0" endTime="1" startTrans="0 0 -0.377" endTrans="0 0 0.122" />

            <sound template="clackVar5" startTime="0.01" direction="0" volumeScale="0.7" pitchScale="2.8" linkNode="supportArm"/>
            <sound template="clackVar1"  startTime="0.99" direction="0" volumeScale="0.7" pitchScale="2"   linkNode="supportArm"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="mainArmDummy" delayedNode="mainArm">
                <controls axis="AXIS_FRONTLOADER_ARM" invertAxis="true" mouseSpeedFactor="0.8" iconName="FRONTLOADER_ARM_ROTATE" />
                <attacherJoint jointIndices="1" />
                <rotation rotSpeed="20" rotAcceleration="150" rotMax="15" rotMin="-75" startRot="12" detachingRotMinLimit="0" />
                <dependentPart node="attacherRotDummy" />
                <dependentMovingTool node="attacherDummy" minRotLimits="-55 -65" maxRotLimits="100 50" />
            </movingTool>
            <movingTool node="attacherDummy" delayedNode="attacher">
                <controls axis="AXIS_FRONTLOADER_TOOL" invertAxis="true" mouseSpeedFactor="0.6" iconName="FRONTLOADER_ARM_ROTATE_TOOL" />
                <attacherJoint jointIndices="1" />
                <rotation rotSpeed="50" rotAcceleration="300" rotMax="53" rotMin="-65" startRot="-45" syncMaxRotLimits="true" />
            </movingTool>

            <movingTool node="mainArm" playSound="true">
                <dependentPart node="hydraulicMainArm" />
                <dependentPart node="hydraulicMainArm2" />
                <dependentPart node="attacherRot" />
                <dependentPart node="angleDisplayArm" />
            </movingTool>

            <movingTool node="attacher" playSound="true">
                <dependentPart node="wing" />
                <dependentPart node="angleDisplayArm" />
            </movingTool>

            <movingTool node="supportArmMove" >
                <dependentPart node="supportArm2" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="hydraulicMainArm" referencePoint="hydraulicMainArmRef" referenceFrame="mainArm" >
                <translatingPart node="hydraulicMainArmPunch" />
            </movingPart>
            <movingPart node="hydraulicMainArm2" referencePoint="hydraulicMainArm2Ref" referenceFrame="mainArm" >
                <translatingPart node="hydraulicMainArm2Punch" />
            </movingPart>

            <movingPart node="attacherRotDummy" referenceFrame="attacherRootDummy">
                <attacherJoint jointIndices="1" />
            </movingPart>
            <movingPart node="attacherRot" referenceFrame="attacherFrame">
                <attacherJoint jointIndices="1" />
                <dependentPart node="wing" />
            </movingPart>

            <movingPart node="angleDisplayArm" localReferencePoint="angleDisplayArmPart" referencePoint="angleDisplayArmRef" referenceFrame="angleDisplayArmRefFrame" >
                <dependentPart node="angleDisplayArmPart" />
                <dependentPart node="angleDisplay" />
            </movingPart>
            <movingPart node="angleDisplayArmPart" referencePoint="angleDisplayArmRef" referenceFrame="mainArm" />
            <movingPart node="angleDisplay" referencePoint="angleDisplayRef" referenceFrame="angleDisplayRef" useLocalOffset="true">
                <translatingPart node="angleDisplayPunch" />
            </movingPart>

            <movingPart node="wing" localReferencePoint="wingPart" referencePoint="wingRef" referenceFrame="wingRefFrame" >
                <dependentPart node="wingPart" />
                <dependentPart node="angleDisplay" />
                <dependentPart node="hydraulicWing" />
            </movingPart>
            <movingPart node="wingPart" referencePoint="wingRef" referenceFrame="wingRef" />

            <movingPart node="hydraulicWing" referencePoint="hydraulicWingRef" referenceFrame="hydraulicWingRef" >
                <translatingPart node="hydraulicWingPunch" />
            </movingPart>

            <movingPart node="supportArm2" referencePoint="supportArm2Ref" referenceFrame="supportArm2Ref" scaleZ="true" />

        </movingParts>

        <sounds>
            <actionSound template="hydraulicLayerTone2"   pitchScale="1.5" volumeScale="1.2" linkNode="hydraulicMainArm"   actionNames="TRANSLATING_POS TRANSLATING_NEG" nodes="hydraulicMainArm" fadeIn="0.1" fadeOut="0.05"/>
            <actionSound template="hydraulicLayerTone"    pitchScale="0.7" volumeScale="1.2" linkNode="hydraulicMainArm"   actionNames="TRANSLATING_POS" nodes="hydraulicMainArm" fadeIn="0.1" fadeOut="0.05"/>
            <actionSound template="hydraulicLayerTone2"   pitchScale="2.5" volumeScale="0.4" linkNode="hydraulicWing" actionNames="TRANSLATING_POS TRANSLATING_NEG" nodes="hydraulicWing" fadeIn="0.1" fadeOut="0.05"/>
            <actionSound template="defaultHydraulicSound" pitchScale="1.1" volumeScale="0.8" linkNode="hydraulicWing" actionNames="TRANSLATING_POS TRANSLATING_NEG" nodes="hydraulicWing" fadeIn="0.1" fadeOut="0.05"/>
            <actionSound template="metalLowVar2"  pitchScale="1.0" volumeScale="3"   linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_POS_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="cylinderPunch" pitchScale="1.5" volumeScale="0.4" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_POS_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="metalClose"    pitchScale="2.5" volumeScale="0.2" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_POS_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="clackVar6"     pitchScale="1.0" volumeScale="1.0" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_POS_LIMIT" nodes="mainArmDummy"/>

            <actionSound template="metalLowVar2"  pitchScale="1.3" volumeScale="2.0"   linkNode="mainArmDummy" actionNames="TOOL_MOVE_END_NEG_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="cylinderPunch" pitchScale="1.8" volumeScale="0.2" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_NEG_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="metalClose"    pitchScale="2.8" volumeScale="0.1" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_NEG_LIMIT" nodes="mainArmDummy"/>
            <actionSound template="clackVar6"     pitchScale="1.8" volumeScale="0.5" linkNode="mainArmDummy"   actionNames="TOOL_MOVE_END_NEG_LIMIT" nodes="mainArmDummy"/>
        </sounds>
    </cylindered>

    <ai>
        <agentAttachment width="1.3" height="2.2" length="3" lengthOffset="0"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.65" maxX="0.65" minZ="-0.25" maxZ="2.05" yOffset="0.1" node="bendingNode" />
    </foliageBending>

    <baseMaterial>
        <material name="R_mat" baseNode="mainArm">
            <shaderParameter name="colorMat0" value="JOHNDEERE_GREEN1"/>
            <shaderParameter name="colorMat1" value="CARUELLENICOLAS_BLACK1"/>
            <shaderParameter name="colorMat2" value="CASEIH_RED1"/>
            <shaderParameter name="colorMat3" value="CARUELLENICOLAS_GREY1"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="3" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="jdfrontloader643R_main_component1" node="0>" />
        <i3dMapping id="attacherFrame" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0" />
        <i3dMapping id="hydraulicMainArmRef" node="0>0|1" />
        <i3dMapping id="hydraulicMainArm2Ref" node="0>0|2" />
        <i3dMapping id="angleDisplayArmRef" node="0>0|3" />
        <i3dMapping id="mainArm" node="0>1" />
        <i3dMapping id="hydraulicMainArm" node="0>1|0" />
        <i3dMapping id="hydraulicMainArmPunch" node="0>1|0|0" />
        <i3dMapping id="hydraulicMainArm2" node="0>1|1" />
        <i3dMapping id="hydraulicMainArm2Punch" node="0>1|1|0" />
        <i3dMapping id="attacherRot" node="0>1|2" />
        <i3dMapping id="attacher" node="0>1|2|0" />
        <i3dMapping id="attacherJointToolsVisuals" node="0>1|2|0|0" />
        <i3dMapping id="wingRef" node="0>1|2|0|1" />
        <i3dMapping id="wingRefFrame" node="0>1|2|0|2" />
        <i3dMapping id="wing" node="0>1|3" />
        <i3dMapping id="wingPart" node="0>1|3|0" />
        <i3dMapping id="angleDisplay" node="0>1|3|1" />
        <i3dMapping id="angleDisplayPunch" node="0>1|3|1|0" />
        <i3dMapping id="hydraulicWingRef" node="0>1|3|2" />
        <i3dMapping id="hydraulicWing" node="0>1|4" />
        <i3dMapping id="hydraulicWingPunch" node="0>1|4|0" />
        <i3dMapping id="angleDisplayArm" node="0>1|5" />
        <i3dMapping id="angleDisplayArmPart" node="0>1|5|0" />
        <i3dMapping id="angleDisplayArmDecal" node="0>1|5|0|0" />
        <i3dMapping id="angleDisplayRef" node="0>1|5|1" />
        <i3dMapping id="supportArm" node="0>1|6|0" />
        <i3dMapping id="supportArmMove" node="0>1|6|0|0" />
        <i3dMapping id="supportArm2Ref" node="0>1|6|0|0|0" />
        <i3dMapping id="supportArm2" node="0>1|6|1" />
        <i3dMapping id="angleDisplayArmRefFrame" node="0>1|7" />
        <i3dMapping id="bendingNode" node="0>1|9" />
        <i3dMapping id="hydraulicIn01" node="0>1|10|0" />
        <i3dMapping id="hydraulicIn02" node="0>1|10|1" />
        <i3dMapping id="hydraulicIn03" node="0>1|10|2" />
        <i3dMapping id="detachedHoseRotJoint" node="0>1|10|3" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>1|10|3|0" />
        <i3dMapping id="hydraulicIn02_detachedAdapter" node="0>1|10|3|1" />
        <i3dMapping id="hydraulicIn03_detachedAdapter" node="0>1|10|3|2" />
        <i3dMapping id="attacherRootDummy" node="0>2" />
        <i3dMapping id="attacherJointDummy" node="0>2|0" />
        <i3dMapping id="mainArmDummy" node="0>3" />
        <i3dMapping id="attacherRotDummy" node="0>3|0" />
        <i3dMapping id="attacherDummy" node="0>3|0|0" />
        <i3dMapping id="attacherJointTools" node="0>3|0|0|0" />
        <i3dMapping id="supportCol" node="0>3|5" />
        <i3dMapping id="detachedHose" node="0>4|1" />
    </i3dMappings>
</vehicle>
