﻿<?xml version="1.0" encoding="utf-8" standalone="no"?>
<vehicle type="mulcher" 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>TDE-220</name>
        <specs>
            <neededPower>130</neededPower>
            <workingWidth>2.2</workingWidth>
            <combination filterCategory="weights" filterSpec="weight" filterSpecMin="600" filterSpecMax="700"/>
        </specs>
        <functions>
            <function>$l10n_function_mulcher</function>
        </functions>
        <image>$data/vehicles/tmcCancela/tde220/store_tde220.png</image>
        <price>7000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>TMCCANCELA</brand>
        <category>mulchers</category>
        <shopTranslationOffset>0 -0.005 0</shopTranslationOffset>
        <shopRotationOffset>-0.415 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>992000</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>160000</indexBufferMemoryUsage>
        <textureMemoryUsage>2228224</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_mulcher</typeDesc>
        <filename>$data/vehicles/tmcCancela/tde220/tde220.i3d</filename>
        <size width="4" length="3"/>
        <speedLimit value="12"/>
        <components>
            <component centerOfMass="0 0.6 0" solverIterationCount="15" mass="745"/>
            <component centerOfMass="0 0 0.7" solverIterationCount="15" mass="250"/>
            <joint component1="1" component2="2" node="componentJoint" rotLimit="0 0 0" transLimit="0 0 0"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault">
                <wheels>
                    <wheel>
                        <physics restLoad="0.4" repr="wheel01" radius="0.12" width="0.2" forcePointRatio="0.35" initialCompression="20" suspTravel="0.05" spring="50" damper="80" frictionScale="0.1" yOffset="0.01"/>
                    </wheel>
                    <wheel>
                        <physics restLoad="0.2" repr="wheel02" radius="0.12" width="0.2" forcePointRatio="0.35" initialCompression="20" suspTravel="0.05" spring="50" damper="80" frictionScale="0.1" yOffset="0.01"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>
    </wheels>

    <speedRotatingParts>
        <speedRotatingPart node="roll01" wheelIndex="1" groundReferenceNodeIndex="1" onlyActiveWhenLowered="true" />
    </speedRotatingParts>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferenceNode" lowerRotationOffset="0" upperRotationOffset="15" lowerRotLimitScale="0 0 0" upperRotLimitScale="0 0 0" lowerTransLimitScale="0 1 0" allowsLowering="true">
                <distanceToGround lower="0.4" upper="0.78"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport"/>
        <lowerAnimation name="loweringAnimation" speed="1"/>
    </attachable>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="pto" detachNode="ptoDetach" aboveAttacher="true" filename="$data/shared/assets/powerTakeOffs/walterscheidWWZ.xml">
            <objectChange node="ptoHolder" translationActive="0 0 0" translationInactive="-0.006 0.02 0" rotationActive="0 0 0" rotationInactive="0 0 85"/>
        </input>
    </powerTakeOffs>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="1" diameter="0.015">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1" diameter="0.015">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn02"  length="1" diameter="0.015">
            <objectChange node="hydraulicIn02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut02" length="1" diameter="0.015">
            <objectChange node="hydraulicOut02_detached" 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="hydraulicOut01_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="hydraulicOut02_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <powerConsumer forceNode="tde220_main_component1" ptoRpm="540" neededMaxPtoPower="30"/>

    <groundReferenceNodes>
        <groundReferenceNode node="groundReferenceNode" forceFactor="1" threshold="0.25" />
    </groundReferenceNodes>

    <workAreas>
        <workArea type="mulcher" functionName="processMulcherArea" >
            <area startNode="workArea01Start" widthNode="workArea01Width" heightNode="workArea01Height"/>
            <groundReferenceNode index="1"/>
            <onlyActiveWhenLowered value="true"/>
        </workArea>
    </workAreas>

    <mulcher>
        <effects>
            <effect workAreaIndex="1">
                <effectNode effectClass="TypedMotionPathEffect" effectType="MULCHER" linkNode="mulcherEffectNode">
                    <motionPathEffect textureFilename="$data/vehicles/tmcCancela/tde220/mulcherEffectArray.dds" numRows="21" rowLength="18" minFade="0.15" shapeScale="0.2" maxShapeScale="2" speedScale="1.5"/>
                </effectNode>
                <effectNode effectNode="smokeEmitter" effectClass="ParticleEffect" particleType="smoke" materialType="smokeParticle" worldSpace="false" emitCountScale="0.3"/>
            </effect>
        </effects>
        <sounds>
            <work template="crushingStubbles" linkNode="tde220_main_component1" />
        </sounds>
    </mulcher>

    <animations>
        <animation name="folding">
            <part node="arm01_phys" startTime="0" endTime="2"  startRot="0 -20 0" endRot="0 65 0" />
            <part node="arm01Part01_phys" startTime="0" endTime="2"  startRot="20 0 0" endRot="-65 0 0" />
            <part node="ptoDetach" startTime="0" endTime="2"  startTrans="-0.3 0.615 1.3" endTrans="0.155 0.615 1.4" />

            <sound template="hydraulicLayerTone" startTime="0.01" endTime="1.99" volumeScale="1.4" pitchScale="0.8"/>
            <sound template="clackVar6"          startTime="0.01" direction="-1" pitchScale="0.8" volumeScale="1.1" />
            <sound template="sheetImp02"         startTime="0.01" direction="-1" pitchScale="0.8" volumeScale="2"   />
            <sound template="clackVar6"          startTime="1.99" direction="1"  pitchScale="1" volumeScale="1.1"/>
            <sound template="clackVar4"          startTime="1.99" direction="1"  pitchScale="1" volumeScale="0.6"/>
        </animation>
        <animation name="loweringAnimation">
            <part componentJointIndex="1" startTime="1" endTime="2.5"  startRotLimit="0 0 0" endRotLimit="35 0 0" />

            <sound template="foldStopMed01"  startTime="1.2"  direction="1"  volumeScale="1.1" pitchScale="0.8" />
            <sound template="clackVar6"      startTime="0.01" direction="1"  volumeScale="0.8" pitchScale="0.8" />
            <sound template="foldStartMed02" startTime="1.4"  direction="-1" volumeScale="1.6"   pitchScale="0.8" />
            <sound template="clackVar6"      startTime="1.7"  direction="-1" volumeScale="1.1" pitchScale="0.8" />
            <sound template="clackVar4"      startTime="1.4"  direction="-1" volumeScale="1.1" pitchScale="0.8" />
            <sound template="sheetImp02"     startTime="0.9"  direction="1"  volumeScale="2.5" pitchScale="0.8" />
        </animation>
        <animation name="moveSupport">
            <part node="supportArm" startTime="0" endTime="0.2" startTrans="0 0.483 0" endTrans="0 0 0"/>

            <sound template="latchSmall" startTime="0.19" volumeScale="0.2" pitchScale="1.6" linkNode="attacherJoint"/>
            <sound template="clackVar6"  startTime="0.19" volumeScale="1.2" pitchScale="0.9" linkNode="attacherJoint"/>
            <sound template="clackVar1"  startTime="0.1"  volumeScale="1.2" pitchScale="1.3" linkNode="attacherJoint"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="arm01_phys" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL" invertAxis="true" mouseSpeedFactor="0.5" iconName="IMPLEMENT_TRANS_X" />
                <animation animSpeed="0.5" animAcceleration="3" animName="folding" />
                <componentJoint index="1"/>
            </movingTool>
            <movingTool node="arm01Part01_phys">
                <componentJoint index="1"/>
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="arm01" referencePoint="arm01Ref" referenceFrame="arm01RefFrame" isActiveDirty="true" limitedAxis="2" maxUpdateDistance="300">
                <dependentPart node="arm01Part01" />
            </movingPart>
            <movingPart node="arm01Part01" localReferencePoint="arm01Part02" referencePoint="arm01Part02Ref" referenceFrame="arm01Part01RefFrame" limitedAxis="1">
                <dependentPart node="arm01Part02" />
                <dependentPart node="arm01Hydraulic" />
                <dependentPart node="arm02" />
            </movingPart>
            <movingPart node="arm01Part02" referencePoint="arm01Part02Ref" referenceFrame="arm01Part02Ref" limitedAxis="1"/>
            <movingPart node="arm01Hydraulic" referencePoint="arm01HydraulicRef" referenceFrame="arm01HydraulicRef">
                <translatingPart node="arm01HydraulicPunch" />
            </movingPart>
            <movingPart node="arm02" referencePoint="arm02Ref" referenceFrame="arm02RefFrame" limitedAxis="1">
                <dependentPart node="arm02Hydraulic" />
                <powerTakeOffs indices="1" />
            </movingPart>
            <movingPart node="arm02Hydraulic" referencePoint="arm02HydraulicRef" referenceFrame="arm02HydraulicRefFrame" >
                <translatingPart node="arm02HydraulicPunch" />
            </movingPart>
        </movingParts>

        <sounds>
            <actionSound template="clackVar6"          pitchScale="0.8" volumeScale="1.1" linkNode="arm01" actionNames="TOOL_MOVE_END_NEG_LIMIT"     nodes="arm01"/>
            <actionSound template="sheetImp02"         pitchScale="0.8" volumeScale="2"   linkNode="arm01" actionNames="TOOL_MOVE_END_NEG_LIMIT"     nodes="arm01"/>
            <actionSound template="clackVar6"          pitchScale="1"   volumeScale="1.1" linkNode="arm01" actionNames="TOOL_MOVE_END_POS_LIMIT"     nodes="arm01"/>
            <actionSound template="clackVar4"          pitchScale="1"   volumeScale="0.6" linkNode="arm01" actionNames="TOOL_MOVE_END_POS_LIMIT"     nodes="arm01"/>
        </sounds>
    </cylindered>

    <turnOnVehicle turnOffIfNotAllowed="true">
        <animationNodes>
            <animationNode node="roll02" rotSpeed="2500" rotAxis="3" turnOnFadeTime="2" turnOffFadeTime="8" />
        </animationNodes>
        <sounds>
            <start template="mulcherStart" />
            <work template="mulcherLoop" />
            <stop template="mulcherStop" />
        </sounds>
    </turnOnVehicle>

    <ai>
        <needsLowering value="true"/>
        <areaMarkers leftNode="aiMarkerLeft" rightNode="aiMarkerRight" backNode="aiMarkerBack"/>
        <collisionTrigger node="aiCollisionNode" width="2.3" height="2.2"/>
        <agentAttachment width="3.2" height="1.5" length="2.2" lengthOffset="0"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.9" maxX="0.7" minZ="0.8" maxZ="1" yOffset="0.4" />
        <bendingNode minX="-0.2" maxX="0.2" minZ="-0.6" maxZ="1" yOffset="-0.18" node="arm01HydraulicRef"/>
        <bendingNode minX="-0.65" maxX="0.5" minZ="-0.5" maxZ="2.05" yOffset="-0.5" node="arm02"/>
    </foliageBending>

    <baseMaterial>
        <material name="tde220_mat" baseNode="tde220_vis">
            <shaderParameter name="colorMat1" value="TMCCANCELA_ORANGE"/>
        </material>
        <material name="tde220Alpha_mat" baseNode="tde220Alpha">
            <shaderParameter name="colorMat0" value="TMCCANCELA_ORANGE"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="6" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="tde220_main_component1" node="0>" />
        <i3dMapping id="tde220_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="ptoHolderRot" node="0>0|0|2" />
        <i3dMapping id="ptoHolder" node="0>0|0|2|0" />
        <i3dMapping id="supportArm" node="0>0|0|3" />
        <i3dMapping id="ptoDetach" node="0>0|0|4" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|0|5|0" />
        <i3dMapping id="hydraulicOut01_detachedAdapter" node="0>0|0|5|0|0" />
        <i3dMapping id="hydraulicIn02_detached" node="0>0|0|5|1" />
        <i3dMapping id="hydraulicIn02_detachedAdapter" node="0>0|0|5|1|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|0|5|2" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>0|0|5|2|0" />
        <i3dMapping id="hydraulicOut02_detached" node="0>0|0|5|3" />
        <i3dMapping id="hydraulicOut02_detachedAdapter" node="0>0|0|5|3|0" />
        <i3dMapping id="hydraulicOut02" node="0>0|0|5|4" />
        <i3dMapping id="hydraulicIn02" node="0>0|0|5|5" />
        <i3dMapping id="hydraulicOut01" node="0>0|0|5|6" />
        <i3dMapping id="hydraulicIn01" node="0>0|0|5|7" />
        <i3dMapping id="arm01_phys" node="0>0|1|0" />
        <i3dMapping id="arm01Part01_phys" node="0>0|1|0|0|0" />
        <i3dMapping id="componentJoint" node="0>0|1|0|0|0|0" />
        <i3dMapping id="arm01RefFrame" node="0>0|1|1" />
        <i3dMapping id="arm01" node="0>0|1|1|0" />
        <i3dMapping id="arm01Part01" node="0>0|1|1|0|0|0" />
        <i3dMapping id="arm01Part02" node="0>0|1|1|0|0|0|0|0" />
        <i3dMapping id="arm02RefFrame" node="0>0|1|1|0|0|0|1" />
        <i3dMapping id="arm02" node="0>0|1|1|0|0|0|1|0" />
        <i3dMapping id="pto" node="0>0|1|1|0|0|0|1|0|0" />
        <i3dMapping id="roll01" node="0>0|1|1|0|0|0|1|0|1|0" />
        <i3dMapping id="roll02" node="0>0|1|1|0|0|0|1|0|2" />
        <i3dMapping id="arm02Hydraulic" node="0>0|1|1|0|0|0|1|0|3" />
        <i3dMapping id="arm02HydraulicPunch" node="0>0|1|1|0|0|0|1|0|3|0" />
        <i3dMapping id="arm02HydraulicRefFrame" node="0>0|1|1|0|0|0|1|0|5" />
        <i3dMapping id="smokeEmitter" node="0>0|1|1|0|0|0|1|0|6|0" />
        <i3dMapping id="mulcherEffectNode" node="0>0|1|1|0|0|0|1|0|6|1" />
        <i3dMapping id="arm01Hydraulic" node="0>0|1|1|0|0|0|2" />
        <i3dMapping id="arm01HydraulicPunch" node="0>0|1|1|0|0|0|2|0" />
        <i3dMapping id="arm02HydraulicRef" node="0>0|1|1|0|0|0|4" />
        <i3dMapping id="arm01Part01RefFrame" node="0>0|1|1|0|2" />
        <i3dMapping id="arm01HydraulicRef" node="0>0|1|1|0|3" />
        <i3dMapping id="arm01Part02Ref" node="0>0|1|2" />
        <i3dMapping id="tde220Alpha" node="0>0|2|1" />
        <i3dMapping id="arm02Ref" node="1>0" />
        <i3dMapping id="wheel01" node="1>1" />
        <i3dMapping id="wheel02" node="1>2" />
        <i3dMapping id="arm01Ref" node="1>3" />
        <i3dMapping id="arm01Part01Ref" node="1>4" />
        <i3dMapping id="groundReferenceNode" node="1>5" />
        <i3dMapping id="workArea01Start" node="1>6|0" />
        <i3dMapping id="workArea01Width" node="1>6|1" />
        <i3dMapping id="workArea01Height" node="1>6|2" />
        <i3dMapping id="aiMarkerLeft" node="1>7|0" />
        <i3dMapping id="aiMarkerRight" node="1>7|1" />
        <i3dMapping id="aiMarkerBack" node="1>7|2" />
        <i3dMapping id="aiCollisionNode" node="1>7|3" />
    </i3dMappings>
</vehicle>
