﻿<?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>TMS2-300D</name>
        <specs>
            <neededPower>150</neededPower>
            <workingWidth>3</workingWidth>
            <combination filterCategory="weights" filterSpec="weight" filterSpecMin="650" filterSpecMax="750"/>
        </specs>
        <functions>
            <function>$l10n_function_mulcher</function>
        </functions>
        <image>$data/vehicles/tmcCancela/tms2_300d/store_tms2_300d.png</image>
        <price>9500</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>TMCCANCELA</brand>
        <category>mulchers</category>
        <shopTranslationOffset>0 -0.025 0</shopTranslationOffset>
        <shopRotationOffset>0 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>1160448</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>185088</indexBufferMemoryUsage>
        <textureMemoryUsage>2359296</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_mulcher</typeDesc>
        <filename>$data/vehicles/tmcCancela/tms2_300d/tms2_300d.i3d</filename>
        <size width="4.2" length="2" lengthOffset="-0.2"/>
        <speedLimit value="12"/>
        <components>
            <component centerOfMass="0 0.2 0" solverIterationCount="15" mass="1910"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <speedRotatingParts>
        <speedRotatingPart node="roll01" radius="0.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.45" upper="0.9"/>
                <objectChange node="gearbox" rotationActive="0 0 0"/>
            </inputAttacherJoint>
            <inputAttacherJoint node="attacherJoint2" jointType="implement" topReferenceNode="topReferenceNode2" lowerRotationOffset="0" upperRotationOffset="15" lowerRotLimitScale="0 0 0" upperRotLimitScale="0 0 0" lowerTransLimitScale="0 1 0" allowsLowering="true">
                <distanceToGround lower="0.45" upper="0.9"/>
                <objectChange node="gearbox" rotationActive="180 0 0"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport"/>
    </attachable>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="pto01" aboveAttacher="true"/>
        <input inputAttacherJointIndices="2" inputNode="pto02" aboveAttacher="true"/>
    </powerTakeOffs>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="1.2" diameter="0.01">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hosesFront" visibilityActive="true"/>
            <objectChange node="hosesBack" visibilityActive="false"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1.2" diameter="0.01">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hosesFront" visibilityActive="true"/>
            <objectChange node="hosesBack" visibilityActive="false"/>
        </hose>
        <hose inputAttacherJointIndices="2" type="hydraulicIn"  node="hydraulicIn02"  length="1.2" diameter="0.01">
            <objectChange node="hydraulicIn02_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hosesBack" visibilityActive="true"/>
            <objectChange node="hosesFront" visibilityActive="false"/>
        </hose>
        <hose inputAttacherJointIndices="2" type="hydraulicOut" node="hydraulicOut02" length="1.2" diameter="0.01">
            <objectChange node="hydraulicOut02_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hosesBack" visibilityActive="true"/>
            <objectChange node="hosesFront" visibilityActive="false"/>
        </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="tms2_300d_main_component1" ptoRpm="540" neededMaxPtoPower="35"/>

    <groundReferenceNodes>
        <groundReferenceNode node="groundReferenceNode" forceFactor="1" threshold="0.1"/>
    </groundReferenceNodes>

    <workAreas>
        <workArea type="mulcher" functionName="processMulcherArea" disableBackwards="false">
            <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/tms2_300d/mulcherEffectArray.dds" numRows="30" rowLength="18" minFade="0.15" shapeScale="0.2" maxShapeScale="2"/>
                </effectNode>
                <effectNode effectNode="smokeEmitter" effectClass="ParticleEffect" particleType="smoke" materialType="smokeParticle" worldSpace="false" emitCountScale="0.3"/>
            </effect>
        </effects>
        <sounds>
            <work template="crushingStubbles" linkNode="tms2_300d_main_component1" />
        </sounds>
    </mulcher>

    <animations>
        <animation name="moveSupport">
            <part node="supportArm01" startTime="0" endTime="0.2" startRot="0 0 0" endRot="0 0 -90"/>
            <part node="supportArm02" startTime="0" endTime="0.2" startRot="0 0 0" endRot="0 0 90"/>
            <part node="supportCol"   startTime="0" endTime="0.2" startTrans="0 0.2 0" endTrans="0 0 0"/>

            <sound template="clackVar6" startTime="0.01" direction="-1" volumeScale="1" pitchScale="1.2" linkNode="attacherJoint"/>
            <sound template="clackVar6" startTime="0.19" direction="1" volumeScale="1" pitchScale="1.4" linkNode="attacherJoint"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="mulcher">
                <controls axis="AXIS_FRONTLOADER_TOOL" invertAxis="false" mouseSpeedFactor="0.5" iconName="IMPLEMENT_TRANS_X" />
                <translation transAcceleration="10" transSpeed="0.4" transMin="-0.35" transMax="0.35" translationAxis="1" startTrans="0"/>
                <powerTakeOffs indices="1" />
                <dependentPart node="hydraulic" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="hydraulic" referencePoint="hydraulicRef" referenceFrame="hydraulicRef">
                <translatingPart node="hydraulicPunch" />
            </movingPart>
        </movingParts>

        <sounds>
            <actionSound template="hydraulicLayerTone" pitchScale="0.5" volumeScale="0.9" linkNode="hydraulic" actionNames="TRANSLATING_POS TRANSLATING_NEG" nodes="hydraulic"/>
            <actionSound template="clackVar6"          pitchScale="0.8" volumeScale="1.1" linkNode="mulcher"   actionNames="TOOL_MOVE_END_NEG_LIMIT"         nodes="mulcher"/>
            <actionSound template="sheetImp02"         pitchScale="0.8" volumeScale="2"   linkNode="mulcher"   actionNames="TOOL_MOVE_END_NEG_LIMIT"         nodes="mulcher"/>
            <actionSound template="clackVar6"          pitchScale="1"   volumeScale="1.1" linkNode="mulcher"   actionNames="TOOL_MOVE_END_POS_LIMIT"         nodes="mulcher"/>
            <actionSound template="clackVar4"          pitchScale="1"   volumeScale="0.6" linkNode="mulcher"   actionNames="TOOL_MOVE_END_POS_LIMIT"         nodes="mulcher"/>
        </sounds>
    </cylindered>

    <turnOnVehicle turnOffIfNotAllowed="true">
        <animationNodes>
            <animationNode node="roll02" rotSpeed="-2500" rotAxis="1" 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="3.5" height="1.4"/>
        <agentAttachment width="3.5" height="1.5" length="1.5" lengthOffset="-0.25"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-1.75" maxX="1.75" minZ="-0.9" maxZ="0.4" yOffset="0.25" node="mulcher"/>
    </foliageBending>

    <baseMaterial>
        <material name="tms2_300d_mat" baseNode="tms2_300d_vis">
            <shaderParameter name="colorMat1" value="TMCCANCELA_ORANGE"/>
        </material>
        <material name="tms2_300dAlpha_mat" baseNode="tms2_300dAlpha">
            <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="tms2_300d_main_component1" node="0>" />
        <i3dMapping id="tms2_300d_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="attacherJoint2" node="0>0|0|2" />
        <i3dMapping id="topReferenceNode2" node="0>0|0|3" />
        <i3dMapping id="supportArm02" node="0>0|0|4" />
        <i3dMapping id="supportArm01" node="0>0|0|5" />
        <i3dMapping id="hosesFront" node="0>0|0|6|0" />
        <i3dMapping id="hydraulicOut01" node="0>0|0|6|0|0" />
        <i3dMapping id="hydraulicIn01" node="0>0|0|6|0|1" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|0|6|0|2" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>0|0|6|0|2|0" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|0|6|0|3" />
        <i3dMapping id="hydraulicOut01_detachedAdapter" node="0>0|0|6|0|3|0" />
        <i3dMapping id="hoseFront" node="0>0|0|6|0|4" />
        <i3dMapping id="hosesBack" node="0>0|0|6|1" />
        <i3dMapping id="hydraulicOut02" node="0>0|0|6|1|0" />
        <i3dMapping id="hydraulicIn02" node="0>0|0|6|1|1" />
        <i3dMapping id="hydraulicIn02_detached" node="0>0|0|6|1|2" />
        <i3dMapping id="hydraulicIn02_detachedAdapter" node="0>0|0|6|1|2|0" />
        <i3dMapping id="hydraulicOut02_detached" node="0>0|0|6|1|3" />
        <i3dMapping id="hydraulicOut02_detachedAdapter" node="0>0|0|6|1|3|0" />
        <i3dMapping id="hoseBack" node="0>0|0|6|1|4" />
        <i3dMapping id="pto01" node="0>0|0|7" />
        <i3dMapping id="pto02" node="0>0|0|8" />
        <i3dMapping id="mulcher" node="0>0|1|0" />
        <i3dMapping id="roll01" node="0>0|1|0|0" />
        <i3dMapping id="roll02" node="0>0|1|0|1" />
        <i3dMapping id="hydraulicRef" node="0>0|1|0|2" />
        <i3dMapping id="gearbox" node="0>0|1|0|3" />
        <i3dMapping id="groundReferenceNode" node="0>0|1|0|4" />
        <i3dMapping id="workArea01Start" node="0>0|1|0|5|0" />
        <i3dMapping id="workArea01Width" node="0>0|1|0|5|1" />
        <i3dMapping id="workArea01Height" node="0>0|1|0|5|2" />
        <i3dMapping id="smokeEmitter" node="0>0|1|0|6|0" />
        <i3dMapping id="mulcherEffectNode" node="0>0|1|0|6|1" />
        <i3dMapping id="aiMarkerLeft" node="0>0|1|0|7|0" />
        <i3dMapping id="aiMarkerRight" node="0>0|1|0|7|1" />
        <i3dMapping id="aiMarkerBack" node="0>0|1|0|7|2" />
        <i3dMapping id="aiCollisionNode" node="0>0|1|0|7|3" />
        <i3dMapping id="tms2_300dAlpha" node="0>0|1|0|8|4" />
        <i3dMapping id="supportCol" node="0>0|1|0|10" />
        <i3dMapping id="hydraulic" node="0>0|1|1" />
        <i3dMapping id="hydraulicPunch" node="0>0|1|1|0" />
    </i3dMappings>
</vehicle>
