﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="plow" 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>SERVO 25</name>
        <specs>
            <neededPower>85</neededPower>
            <workingWidth>1.2</workingWidth>
        </specs>
        <functions>
            <function>$l10n_function_plow</function>
        </functions>
        <image>$data/vehicles/poettinger/servo25/store_servo25.png</image>
        <price>14000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>POETTINGER</brand>
        <category>plows</category>
        <shopTranslationOffset>0 -0.05 0</shopTranslationOffset>
        <shopRotationOffset>-0.05 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>1175808</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>208128</indexBufferMemoryUsage>
        <textureMemoryUsage>1507328</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_plow</typeDesc>
        <filename>$data/vehicles/poettinger/servo25/servo25.i3d</filename>
        <size width="2.5" length="3.5" widthOffset="0.15" lengthOffset="-0.2"/>
        <speedLimit value="12.4" />
        <components>
            <component centerOfMass="0 0.3 0.4" solverIterationCount="10" mass="645" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault" price="0">
                <wheels hasSurfaceSounds="false">
                    <wheel>
                        <physics restLoad="0.35" repr="wheel01_phys" radius="0.25" width="0.2" forcePointRatio="0.2" initialCompression="15" suspTravel="0.05" spring="30" damper="28" rotationDamping="0.005" supportsWheelSink="false"/>
                    </wheel>
                    <wheel>
                        <physics restLoad="0.35" repr="wheel02_phys" radius="0.25" width="0.2" forcePointRatio="0.2" initialCompression="15" suspTravel="0.05" spring="30" damper="28" rotationDamping="0.005" supportsWheelSink="false"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>
   </wheels>

   <speedRotatingParts>
       <speedRotatingPart node="wheel01" wheelIndex="1"/>
       <speedRotatingPart node="wheel02" wheelIndex="2"/>
       <speedRotatingPart node="wheel03" wheelIndex="2"/>
       <speedRotatingPart node="wheel04" wheelIndex="1"/>
   </speedRotatingParts>

   <lights>
        <sharedLight linkNode="yellowRound_02_01" filename="$data/shared/assets/reflectors/lizard/yellowRound_02.xml" />
        <sharedLight linkNode="yellowRound_02_02" filename="$data/shared/assets/reflectors/lizard/yellowRound_02.xml" />
    </lights>

   <powerConsumer forceNode="servo25_main_component1" maxForce="8" />

    <groundReferenceNodes>
        <groundReferenceNode node="groundReferneceNode01" threshold="0.1" forceFactor="1" />
        <groundReferenceNode node="groundReferenceNode02" threshold="0.075" forceFactor="0" depthNode="depthNode02"/>
        <groundReferenceNode node="groundReferenceNode03" threshold="0.075" forceFactor="0" depthNode="depthNode03"/>
    </groundReferenceNodes>

    <workAreas>
        <workArea type="plow" functionName="processPlowArea" >
            <area startNode="start" widthNode="width" heightNode="height" />
            <groundReferenceNode index="1" />
            <onlyActiveWhenLowered value="true"/>
        </workArea>
    </workAreas>

    <workParticles>
        <particle>
            <node node="smokeEmitterBottom" refNodeIndex="2" particleType="SOIL_SMOKE" emitCountScale="2" speedThreshold="2"/>
            <node node="smokeEmitterTop"    refNodeIndex="3" particleType="SOIL_SMOKE" emitCountScale="2" speedThreshold="2"/>
        </particle>
        <effect groundReferenceNodeIndex="2" speedThreshold="0">
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectBottom01">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25BottomShareArray.dds" numRows="9" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectBottom02">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25BottomShareArray.dds" numRows="9" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectBottom03">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25BottomShareArray.dds" numRows="9" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
        </effect>
        <effect groundReferenceNodeIndex="3" speedThreshold="0">
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectTop01">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25TopShareArray.dds" numRows="6" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectTop02">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25TopShareArray.dds" numRows="6" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
            <effectNode effectClass="PlowMotionPathEffect" effectType="PLOW" linkNode="plowEffectTop03">
                <motionPathEffect textureFilename="$data/vehicles/poettinger/servo25/servo25TopShareArray.dds" numRows="6" rowLength="23" minFade="0.08" speedScale="0.75"/>
            </effectNode>
        </effect>
    </workParticles>

    <attachable allowFoldingWhileLowered="false">
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferenceNode" lowerRotLimitScale="0 0 0.6" rotLimitThreshold="0.95" transLimitThreshold="0.95" lowerTransLimitScale="0 1 0" upperRotationOffset="15" lowerRotationOffset="0"  >
                <distanceToGround lower="0.35" upper="0.8" />
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport" />
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="0.5" diameter="0.015" straighteningFactor="1.0" isTwoPointHose="true">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hydraulicIn01_detachedAdapter" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="0.5" diameter="0.015" straighteningFactor="1.0" isTwoPointHose="true">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
            <objectChange node="hydraulicOut01_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="hydraulicOut01_detachedAdapter" filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <animations>
        <animation name="rotatePlow">
            <part node="rotPart" startTime="0.0" endTime="4.0" startRot="0 0 0" endRot="0 0 -179.9" />

            <sound template="hydraulicLayerTone" startTime="0.01" endTime="3.99" volumeScale="1.1" pitchScale="0.8" />
            <sound template="clackVar6"          startTime="0.01" direction="1"  volumeScale="1.1" pitchScale="0.8" />
            <sound template="clackVar6"          startTime="3.9"  direction="1"  volumeScale="0.8" pitchScale="0.7" />
            <sound template="sheetImp02"         startTime="3.9"  direction="1"  volumeScale="2"   pitchScale="0.7" />
            <sound template="clackVar6"          startTime="3.99" direction="-1" volumeScale="0.7" pitchScale="0.8" />
            <sound template="foldStartMed02"     startTime="0.1"  direction="-1" volumeScale="1.7" pitchScale="0.7" />
        </animation>

        <animation name="moveSupport">
            <part node="leftSlidingCollision"  startTime="0" endTime="0.2" startTrans="0 0.4 0" endTrans="0 0 0" />
            <part node="rightSlidingCollision" startTime="0" endTime="0.2" startTrans="0 -0.4 0" endTrans="0 0 0" />

            <part node="support"    startTime="0" endTime="0.2" requiredAnimation="rotatePlow" requiredAnimationRange="0.0 0.5"  startRot="0 0 0" endRot="-90 0 0" />
            <part node="support"    startTime="0" endTime="0.2" requiredAnimation="rotatePlow" requiredAnimationRange="0.5 1.0"  startRot="0 0 0" endRot="90 0 0" />

            <sound template="clackVar6" startTime="0.19" volumeScale="1.1" pitchScale="0.8" linkNode="attacherJoint"/>
            <sound template="clackVar4" startTime="0.1"  volumeScale="1.6" pitchScale="2.6" linkNode="attacherJoint"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="rotPart" wheelIndices="1 2" playSound="false">
                <dependentPart node="rotPartHydraulic" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="rotPartHydraulic" referencePoint="rotPartHydraulicRef" referenceFrame="rotPartHydraulicRefFrame">
              <translatingPart node="rotPartHydraulicPunch" />
            </movingPart>
        </movingParts>
    </cylindered>

    <plow>
        <rotationPart turnAnimationName="rotatePlow" rotationAllowedIfLowered="false" limitFoldRotationMax="true" foldRotationMinLimit="0" foldRotationMaxLimit="1" rotationFoldMinLimit="0" rotationFoldMaxLimit="1" foldMinLimit="0" foldMaxLimit="1"/>
        <rotateLeftToMax value="true"/>

        <sounds>
            <turn template="DEFAULT_PLOW_TURN" linkNode="servo25_main_component1" />
            <work template="DEFAULT_PLOW_WORK" linkNode="servo25_main_component1" />
        </sounds>
    </plow>

    <ai>
        <needsLowering value="true" />
        <collisionTrigger node="aiCollisionNode" width="2.2" height="1.7"/>
        <areaMarkers leftNode="areaMarkerLeft" rightNode="areaMarkerRight" backNode="areaMarkerBack" />
        <sizeMarkers leftNode="sizeMarkerLeft" rightNode="sizeMarkerRight" backNode="sizeMarkerBack" />
        <hasNoFullCoverageArea value="true" />
        <agentAttachment width="2.5" height="3.8" length="3" lengthOffset="-0.2"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.85" maxX="0.75"  minZ="-1.8" maxZ="1.0" yOffset="0.5" />
    </foliageBending>

    <baseMaterial>
        <material name="servo25_mat" baseNode="servo25_vis">
            <shaderParameter name="colorMat0" value="POETTINGER_RED1"/>
            <shaderParameter name="colorMat1" value="POETTINGER_YELLOW"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="45" washDuration="1" workMultiplier="3" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="servo25_main_component1" node="0>" />
        <i3dMapping id="servo25_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>0|0|2" />
        <i3dMapping id="hydraulicOut01_detachedAdapter" node="0>0|0|3" />
        <i3dMapping id="yellowRound_02_01" node="0>0|1|0|0" />
        <i3dMapping id="yellowRound_02_02" node="0>0|1|0|1" />
        <i3dMapping id="rotPart" node="0>0|2|0" />
        <i3dMapping id="mainFrame" node="0>0|2|0|0" />
        <i3dMapping id="leftSlidingCollision" node="0>0|2|0|0|1|0" />
        <i3dMapping id="rightSlidingCollision" node="0>0|2|0|0|1|1" />
        <i3dMapping id="rightSlidingCollisionMiddle" node="0>0|2|0|0|1|1|0" />
        <i3dMapping id="rightSlidingCollisionBack" node="0>0|2|0|0|1|1|1" />
        <i3dMapping id="wheel01" node="0>0|2|0|0|3" />
        <i3dMapping id="wheel02" node="0>0|2|0|0|4" />
        <i3dMapping id="wheel03" node="0>0|2|0|0|5" />
        <i3dMapping id="wheel04" node="0>0|2|0|0|6" />
        <i3dMapping id="wheel01_phys" node="0>0|2|0|0|7" />
        <i3dMapping id="wheel02_phys" node="0>0|2|0|0|8" />
        <i3dMapping id="plowEffectBottom01" node="0>0|2|0|0|9|0" />
        <i3dMapping id="plowEffectBottom02" node="0>0|2|0|0|9|1" />
        <i3dMapping id="plowEffectBottom03" node="0>0|2|0|0|9|2" />
        <i3dMapping id="plowEffectTop01" node="0>0|2|0|0|9|3" />
        <i3dMapping id="plowEffectTop02" node="0>0|2|0|0|9|4" />
        <i3dMapping id="plowEffectTop03" node="0>0|2|0|0|9|5" />
        <i3dMapping id="smokeEmitterBottom" node="0>0|2|0|0|9|6" />
        <i3dMapping id="smokeEmitterTop" node="0>0|2|0|0|9|7" />
        <i3dMapping id="start" node="0>0|2|0|0|10|0" />
        <i3dMapping id="width" node="0>0|2|0|0|10|1" />
        <i3dMapping id="height" node="0>0|2|0|0|10|2" />
        <i3dMapping id="groundReferenceNode02" node="0>0|2|0|0|10|3" />
        <i3dMapping id="depthNode02" node="0>0|2|0|0|10|4" />
        <i3dMapping id="groundReferenceNode03" node="0>0|2|0|0|10|5" />
        <i3dMapping id="depthNode03" node="0>0|2|0|0|10|6" />
        <i3dMapping id="areaMarkerLeft" node="0>0|2|0|0|11|0|0" />
        <i3dMapping id="areaMarkerRight" node="0>0|2|0|0|11|0|1" />
        <i3dMapping id="areaMarkerBack" node="0>0|2|0|0|11|0|2" />
        <i3dMapping id="sizeMarkerLeft" node="0>0|2|0|0|11|1|0" />
        <i3dMapping id="sizeMarkerRight" node="0>0|2|0|0|11|1|1" />
        <i3dMapping id="sizeMarkerBack" node="0>0|2|0|0|11|1|2" />
        <i3dMapping id="aiCollisionNode" node="0>0|2|0|0|11|2" />
        <i3dMapping id="support" node="0>0|2|0|0|12|0" />
        <i3dMapping id="rotPartHydraulicRef" node="0>0|2|0|1" />
        <i3dMapping id="rotPartHydraulicRefFrame" node="0>0|2|1" />
        <i3dMapping id="rotPartHydraulic" node="0>0|2|2" />
        <i3dMapping id="rotPartHydraulicPunch" node="0>0|2|2|0" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|2|2|1|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|2|2|1|1" />
        <i3dMapping id="hydraulicIn01" node="0>0|2|2|1|2" />
        <i3dMapping id="hydraulicOut01" node="0>0|2|2|1|3" />
        <i3dMapping id="groundReferneceNode01" node="0>0|3" />
    </i3dMappings>
</vehicle>
