﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="turnOnShovel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../bin/shared/xml/schema/vehicle.xsd">
    <annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>

    <storeData>
        <name>Tornado 252</name>
        <specs>
            <neededPower>90</neededPower>
            <workingWidth>2.5</workingWidth>
        </specs>
        <functions>
            <function>$l10n_function_snowPlow</function>
        </functions>
        <image>$data/vehicles/samasz/tornado251/store_tornado251.png</image>
        <price>9500</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>SAMASZ</brand>
        <category>winterEquipment</category>
        <shopTranslationOffset>0 0 0</shopTranslationOffset>
        <shopRotationOffset>0 0 0</shopRotationOffset>
        <shopHeight>3</shopHeight>
        <vertexBufferMemoryUsage>917248</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>150784</indexBufferMemoryUsage>
        <textureMemoryUsage>1114112</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_snowPlow</typeDesc>
        <filename>$data/vehicles/samasz/tornado251/tornado251.i3d</filename>
        <size width="3" length="2" lengthOffset="-0.3" />
        <speedLimit value="10"/>
        <components>
            <component centerOfMass="0 0.1 0" solverIterationCount="20" mass="720" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" topReferenceNode="topReferenceNode" jointType="implement" isControllable="true" lowerTransLimitScale="0 2.5 0" lowerRotLimitScale="0 0 0" upperRotLimitScale="0 0 0" upperRotationOffset="0" lowerRotationOffset="-3">
                <distanceToGround lower="0.3" upper="0.9" />
            </inputAttacherJoint>
        </inputAttacherJoints>
        <lowerAnimation name="loweringAnimation" speed="1"/>
        <support animationName="moveSupport" />
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="1.1" diameter="0.016" color="0.05 0.05 0.05" straighteningFactor="2.5" adapterNode="hydraulicIn01_connector">
           <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1.1" diameter="0.016" color="0.05 0.05 0.05" straighteningFactor="2.5" adapterNode="hydraulicOut01_connector">
           <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn02"  length="1.1" diameter="0.016" color="0.05 0.05 0.05" straighteningFactor="2.5" adapterNode="hydraulicIn02_connector">
           <objectChange node="hydraulicIn02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut02" length="1.1" diameter="0.016" color="0.05 0.05 0.05" straighteningFactor="2.5" adapterNode="hydraulicOut02_connector">
           <objectChange node="hydraulicOut02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
    </connectionHoses>

    <powerConsumer ptoRpm="470" neededMinPtoPower="45" neededMaxPtoPower="45"/>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="ptoInputNode" aboveAttacher="true" filename="$data/shared/assets/powerTakeOffs/walterscheidW.xml"/>
    </powerTakeOffs>

    <cylindered>
        <movingTools>
            <movingTool node="tower" playSound="true">
                <controls axis="AXIS_CRANE_ARM" invertAxis="false" mouseSpeedFactor="0.3" iconName="PIPE_ROTATE_Y"/>
                <rotation rotSpeed="-25" rotAcceleration="100" rotMax="140" rotMin="-140" rotationAxis="2"/>
            </movingTool>

            <movingTool node="towerPart01" playSound="true">
                <controls axis="AXIS_CRANE_ARM2" invertAxis="false" mouseSpeedFactor="0.3" iconName="PIPE_END_ROTATE"/>
                <rotation rotSpeed="-25" rotAcceleration="80" rotMax="0" rotMin="-44" rotationAxis="1"/>
                <dependentPart node="towerPart01Hydraulic" />
                <dependentPart node="towerPart02" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="towerPart01Hydraulic" referencePoint="towerPart01HydraulicRef" referenceFrame="towerPart01HydraulicRef">
                <translatingPart node="towerPart01HydraulicPunch"/>
            </movingPart>

            <movingPart node="towerPart02" referencePoint="towerPart02HydraulicRef" localReferencePoint="towerPart02Hydraulic" referenceFrame="towerPart02RefFrame" >
                <dependentPart node="towerPart02Hydraulic"/>
            </movingPart>
            <movingPart node="towerPart02Hydraulic" referencePoint="towerPart02HydraulicRef" referenceFrame="towerPart02HydraulicRef" />
        </movingParts>
       <sounds>
            <actionSound template="hydraulicLayerTone"    pitchScale="0.6" volumeScale="0.9" linkNode="tower"       actionNames="TOOL_MOVE_POS TOOL_MOVE_NEG"                     nodes="tower"       fadeIn="0.1" fadeOut="0.1" />
            <actionSound template="hydraulicLayerTone"    pitchScale="1"   volumeScale="0.6" linkNode="towerPart01" actionNames="TOOL_MOVE_POS TOOL_MOVE_NEG"                     nodes="towerPart01" fadeIn="0.1" fadeOut="0.1" />
            <actionSound template="clackVar6"             pitchScale="1.2" volumeScale="0.5" linkNode="towerPart01" actionNames="TOOL_MOVE_END_POS_LIMIT TOOL_MOVE_END_NEG_LIMIT" nodes="towerPart01" />
            <actionSound template="sheetImp02"            pitchScale="1.6" volumeScale="1.1" linkNode="towerPart01" actionNames="TOOL_MOVE_END_POS_LIMIT TOOL_MOVE_END_NEG_LIMIT" nodes="towerPart01" />
            <actionSound template="clackVar6"             pitchScale="0.8" volumeScale="1.1" linkNode="tower"       actionNames="TOOL_MOVE_END_POS_LIMIT TOOL_MOVE_END_NEG_LIMIT" nodes="tower" />
            <actionSound template="cylinderPunch"         pitchScale="2.3" volumeScale="0.3" linkNode="tower"       actionNames="TOOL_MOVE_END_POS_LIMIT TOOL_MOVE_END_NEG_LIMIT" nodes="tower" />
        </sounds>
    </cylindered>

    <animations>
        <animation name="moveSupport">
            <part node="support" startTime="0.0" endTime="0.1" startTrans="0 0.05 0" endTrans="0 0 0" />

            <sound template="clackVar6" startTime="0.09" direction="-1" pitchScale="0.8" volumeScale="0.9" linkNode="attacherJoint"/>
        </animation>
        <animation name="loweringAnimation">
            <part node="shovelNode" startTime="0.0" endTime="0.1" startTrans="0 1 0.158" endTrans="0 -0.5 0.158" />
        </animation>
    </animations>

    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration name="$l10n_configuration_valueDefault">
                <fillUnits>
                    <fillUnit unitTextOverride="$l10n_unit_literShort" fillTypes="SNOW" capacity="5000" updateMass="false" showInShop="false" showOnHud="false" showOnInfoHud="false"/>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <turnOnVehicle turnOffIfNotAllowed="false">
        <animationNodes>
            <animationNode node="rotor"     rotSpeed="1400" rotAxis="1" turnOnFadeTime="3" turnOffFadeTime="4" />
            <animationNode node="propeller" rotSpeed="1500" rotAxis="3" turnOnFadeTime="3" turnOffFadeTime="4" />
        </animationNodes>

        <sounds>
            <start template="STRAWBLOWER_START"/>
            <work  template="STRAWBLOWER_WORK" />
            <stop  template="STRAWBLOWER_STOP" />
        </sounds>
    </turnOnVehicle>

    <shovel useSpeedLimit="true">
        <shovelNode node="shovelNode" fillUnitIndex="1" loadInfoIndex="1" width="2.2" length="0.5" yOffset="-0.2" needsMovement="true" needsActivation="true" resetFillLevel="true" ignoreFillLevel="true" ignoreFarmlandState="true"/>

        <fillEffect>
            <effectNode effectClass="TypedMotionPathEffect" effectType="SNOW_PIECES" linkNode="snowCenterEffect">
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/snowCenterArray.dds" numRows="13" rowLength="27" minFade="0.15" density="0.5"/>
            </effectNode>
            <effectNode effectClass="TypedMotionPathEffect" effectType="SNOW_DUST" linkNode="snowCenterEffect">
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/snowCenterArray.dds" numRows="13" rowLength="27" minFade="0.15" density="0.5"/>
            </effectNode>

            <effectNode effectClass="TypedMotionPathEffect" effectType="STRAW_CHOPPER" materialType="CHOPPER" linkNode="pipeEffect01">
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/pipeEffect01Array.dds" numRows="16" rowLength="18" shapeScale="0.2" maxShapeScale="0.4" speedScale="3"/>
            </effectNode>
            <effectNode effectClass="TypedMotionPathEffect" effectType="STRAW_CHOPPER" materialType="CHOPPER" linkNode="pipeEffect02">
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/pipeEffect02Array.dds" numRows="16" rowLength="18" shapeScale="0.2" maxShapeScale="0.5" speedScale="3" delay="0.20"/>
            </effectNode>
            <effectNode effectClass="TypedMotionPathEffect" effectType="STRAW_CHOPPER" materialType="CHOPPER" linkNode="pipeEffect03" delay="0.2">
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/pipeEffect03Array.dds" numRows="16" rowLength="18" shapeScale="0.2" maxShapeScale="0.5" speedScale="3" delay="0.45" density="0.7"/>
            </effectNode>
            <effectNode effectClass="TypedMotionPathEffect" effectType="STRAW_CHOPPER" materialType="CHOPPER" linkNode="pipeEffect04" >
                <motionPathEffect textureFilename="$data/vehicles/samasz/tornado251/pipeEffect04Array.dds" numRows="20" rowLength="31" maxShapeScale="4" delay="0.55"/>
            </effectNode>
        </fillEffect>
    </shovel>

    <dischargeable requiresTipOcclusionArea="false">
        <dischargeNode node="dischargeNode" emptySpeed="5000" fillUnitIndex="1" unloadInfoIndex="1" canStartDischargeAutomatically="true" canStartGroundDischargeAutomatically="true" needsSetIsTurnedOn="true" canDischargeToGroundAnywhere="true">
            <raycast node="dischargeNode" maxDistance="15"/>
            <info node="dischargeNode" width="1.5" length="1.5" zOffset="0.4" useRaycastHitPosition="true"/>
            <dischargeSound template="dischargeSnowBlower" volumeScale="0.5" linkNode="attacherJoint"/>
        </dischargeNode>
    </dischargeable>

    <tipOccluder>
        <occlusionArea start="tipOccluderAreaStart" width="tipOccluderAreaWidth" height="tipOccluderAreaHeight"/>
    </tipOccluder>

     <ai>
        <agentAttachment width="2.55" height="2.9" length="1.45" lengthOffset="-0.25"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-1.25" maxX="1.25" minZ="-0.6" maxZ="0.5" yOffset="0.1" />
    </foliageBending>

    <baseMaterial>
        <material name="tornado251_mat" baseNode="tornado251_vis">
            <shaderParameter name="colorMat0" value="SAMASZ_ORANGE"/>
        </material>
    </baseMaterial>

    <i3dMappings>
        <i3dMapping id="tornado251_main_component1" node="0>" />
        <i3dMapping id="tornado251_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="ptoInputNode" node="0>0|0|2" />
        <i3dMapping id="groundRefNode" node="0>0|0|3" />
        <i3dMapping id="hydraulicIn01" node="0>0|0|4|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|0|4|0|0" />
        <i3dMapping id="hydraulicIn01_connector" node="0>0|0|4|0|0|0" />
        <i3dMapping id="hydraulicOut01" node="0>0|0|4|1" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|0|4|1|0" />
        <i3dMapping id="hydraulicOut01_connector" node="0>0|0|4|1|0|0" />
        <i3dMapping id="hydraulicIn02" node="0>0|0|4|2" />
        <i3dMapping id="hydraulicIn02_detached" node="0>0|0|4|2|0" />
        <i3dMapping id="hydraulicIn02_connector" node="0>0|0|4|2|0|0" />
        <i3dMapping id="hydraulicOut02" node="0>0|0|4|3" />
        <i3dMapping id="hydraulicOut02_detached" node="0>0|0|4|3|0" />
        <i3dMapping id="hydraulicOut02_connector" node="0>0|0|4|3|0|0" />
        <i3dMapping id="support" node="0>0|0|5" />
        <i3dMapping id="tower" node="0>0|1|0" />
        <i3dMapping id="towerPart01" node="0>0|1|0|0" />
        <i3dMapping id="towerPart02RefFrame" node="0>0|1|0|0|0" />
        <i3dMapping id="towerPart02" node="0>0|1|0|0|0|0" />
        <i3dMapping id="towerPart02Hydraulic" node="0>0|1|0|0|0|0|0" />
        <i3dMapping id="dischargeNode" node="0>0|1|0|0|0|0|2" />
        <i3dMapping id="pipeEffect04" node="0>0|1|0|0|0|0|3" />
        <i3dMapping id="towerPart01HydraulicRef" node="0>0|1|0|0|1" />
        <i3dMapping id="pipeEffect03" node="0>0|1|0|0|4" />
        <i3dMapping id="towerPart01Hydraulic" node="0>0|1|0|1" />
        <i3dMapping id="towerPart01HydraulicPunch" node="0>0|1|0|1|0" />
        <i3dMapping id="towerPart02HydraulicRef" node="0>0|1|0|2" />
        <i3dMapping id="pipeEffect01" node="0>0|1|0|8" />
        <i3dMapping id="pipeEffect02" node="0>0|1|0|9" />
        <i3dMapping id="rotor" node="0>0|1|1" />
        <i3dMapping id="propeller" node="0>0|1|2" />
        <i3dMapping id="shovelNode" node="0>0|2" />
        <i3dMapping id="tipOccluderAreaStart" node="0>0|3|0" />
        <i3dMapping id="tipOccluderAreaWidth" node="0>0|3|1" />
        <i3dMapping id="tipOccluderAreaHeight" node="0>0|3|2" />
        <i3dMapping id="snowCenterEffect" node="0>0|4|0" />
        <i3dMapping id="pipeEffect3" node="0>0|4|1" />
    </i3dMappings>
</vehicle>
