﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="saltSpreader" 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>SG2000</name>
        <specs>
            <workingWidth>10.0</workingWidth>
        </specs>
        <functions>
            <function>$l10n_function_saltSpreader</function>
        </functions>
        <storePacks>
            <storePack>STARTER_SNOW</storePack>
        </storePacks>
        <image>$data/vehicles/bredal/sg/store_sg.png</image>
        <price>8000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>BREDAL</brand>
        <category>winterEquipment</category>
        <vertexBufferMemoryUsage>807936</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>140800</indexBufferMemoryUsage>
        <textureMemoryUsage>1966080</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_saltSpreader</typeDesc>
        <filename>$data/vehicles/bredal/sg/sg.i3d</filename>
        <size width="3" length="2.5"/>
        <speedLimit value="20" />
        <components>
            <component centerOfMass="0 0.3 0" solverIterationCount="10" mass="545"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <lights>
        <sharedLight linkNode="rearLight10_01" filename="$data/shared/assets/lights/lizard/rearLight10_left.xml" />
        <sharedLight linkNode="rearLight10_02" filename="$data/shared/assets/lights/lizard/rearLight10_right.xml" />
        <sharedLight linkNode="sideMarker01_left" filename="$data/shared/assets/lights/lizard/sideMarker01_left.xml" />
        <sharedLight linkNode="sideMarker01_right" filename="$data/shared/assets/lights/lizard/sideMarker01_right.xml" />
        <sharedLight linkNode="bigTriangle" filename="$data/shared/assets/reflectors/lizard/bigTriangle.xml" />

        <realLights>
            <high>
                <light          node="backLightsHigh" lightTypes="0"/>
                <brakeLight     node="backLightsHigh"/>
                <turnLightLeft  node="turnLightLeft"/>
                <turnLightRight node="turnLightRight"/>
            </high>
        </realLights>
    </lights>

    <powerConsumer ptoRpm="400" neededMaxPtoPower="5" />

    <workAreas>
        <workArea type="saltspreader" functionName="processSaltSpreaderArea" disableBackwards="false" requiresGroundContact="false">
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight" />
            <onlyActiveWhenLowered value="false"/>
        </workArea>
    </workAreas>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferencePoint" lowerRotLimitScale="0 0 0" lowerTransLimitScale="0 0 0" upperRotationOffset="3" needsLowering="false" >
                <distanceToGround lower="0.3" upper="0.65" />
            </inputAttacherJoint>
        </inputAttacherJoints>
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn" node="hydraulicIn01" length="1.2" diameter="0.02" straighteningFactor="2">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1.2" diameter="0.02" straighteningFactor="2">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
    </connectionHoses>

    <dynamicallyLoadedParts>
        <dynamicallyLoadedPart node="1|0" linkNode="hydraulicIn01_connector"  filename="$data/shared/connectionHoses/connectors.i3d" />
        <dynamicallyLoadedPart node="1|0" linkNode="hydraulicOut01_connector" filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <animations>
        <animation name="toggleCover">
            <part node="coverClosed" startTime="0.00" endTime="0.02" visibility="true" />
            <part node="coverClosed" startTime="0.02" endTime="0.04" visibility="false" />
            <part node="coverOpen"   startTime="0.00" endTime="0.02" visibility="false" />
            <part node="coverOpen"   startTime="0.02" endTime="0.04" visibility="true" />

            <sound template="fabricCover2" startTime="0.01" direction="1"  volumeScale="1.4" pitchScale="1.5"/>
            <sound template="fabricCover1" startTime="0.03" direction="-1" volumeScale="1.4" pitchScale="1.8"/>
        </animation>
    </animations>

    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration>
                <fillUnits>
                    <unloading width="11" offset="0 0 0" />
                    <fillUnit unitTextOverride="$l10n_unit_literShort" fillTypes="roadsalt" capacity="2000">
                        <exactFillRootNode node="exactFillRootNode" />
                    </fillUnit>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <fillVolume>
        <fillVolumeConfigurations>
            <fillVolumeConfiguration>
                <volumes>
                    <volume node="fillVolume" maxDelta="2" fillUnitIndex="1" maxAllowedHeapAngle="7" />
                </volumes>
            </fillVolumeConfiguration>
        </fillVolumeConfigurations>
    </fillVolume>

    <saltSpreader fillUnitIndex="1" usage="0.6" usageWorkArea="1">
        <effects>
            <effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectLeft">
                <motionPathEffect textureFilename="$data/vehicles/bredal/sg/fertilizerEffectLeftArray.dds" numRows="10" rowLength="24" minFade="0.03" isLeft="true"/>
            </effectNode>
            <effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectRight">
                <motionPathEffect textureFilename="$data/vehicles/bredal/sg/fertilizerEffectRightArray.dds" numRows="10" rowLength="24" minFade="0.03" isLeft="false"/>
            </effectNode>
            <effectNode effectNode="unloadMesh" delay="0" materialType="unloading" fadeTime="1"/>
        </effects>
    </saltSpreader>

    <variableWorkWidth defaultStateLeft="2" defaultStateRight="2">
        <sections>
            <section isLeft="true" maxWidthNode="section01"/>
            <section isLeft="true" maxWidthNode="section02"/>
            <section isLeft="true" maxWidthNode="section03"/>
            <section isLeft="true" maxWidthNode="section04"/>
            <section isLeft="true" maxWidthNode="section05"/>

            <section isLeft="false" maxWidthNode="section06"/>
            <section isLeft="false" maxWidthNode="section07"/>
            <section isLeft="false" maxWidthNode="section08"/>
            <section isLeft="false" maxWidthNode="section09"/>
            <section isLeft="false" maxWidthNode="section10"/>
        </sections>

        <sectionNodes>
            <sectionNode node="workAreaHeight" isLeft="true"  minTrans="1 0 -3"  maxTrans="5 0 -1.5"/>
            <sectionNode node="workAreaWidth"  isLeft="false" minTrans="-1 0 -3" maxTrans="-5 0 -1.5"/>
        </sectionNodes>
    </variableWorkWidth>

    <turnOnVehicle>
        <animationNodes>
            <animationNode node="spreaderLeft"  rotSpeed="-800" turnOnFadeTime="1" turnOffFadeTime="1.5" />
            <animationNode node="spreaderRight" rotSpeed="800"  turnOnFadeTime="1" turnOffFadeTime="1.5" />
            <animationNode node="roll01"        rotSpeed="-700"  turnOnFadeTime="1" turnOffFadeTime="1.5" rotAxis="1"/>
            <animationNode node="roll02"        rotSpeed="-700"  turnOnFadeTime="1" turnOffFadeTime="1.5" rotAxis="1"/>
        </animationNodes>

        <sounds>
            <work template="DEFAULT_SPREADER" linkNode="sg_main_component1" />
        </sounds>
    </turnOnVehicle>

    <cover>
        <coverConfigurations>
            <coverConfiguration>
                <cover openAnimation="toggleCover" fillUnitIndices="1" />
            </coverConfiguration>
        </coverConfigurations>
    </cover>

    <ai>
        <needsLowering value="false" />
        <collisionTrigger node="aiCollisionNode" width="2.1" height="1.6"/>
        <areaMarkers leftNode="aiMarkerLeft" rightNode="aiMarkerRight" backNode="aiMarkerBack" />
        <sizeMarkers leftNode="sizeMarkerLeft" rightNode="sizeMarkerRight" backNode="sizeMarkerBack" />
        <agentAttachment width="2.0" height="1.6" length="2.2" lengthOffset="0"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.95" maxX="0.95" minZ="-1.1" maxZ="0.9" yOffset="0.05" />
    </foliageBending>

    <baseMaterial>
        <material name="body_mat" baseNode="sg_vis">
            <shaderParameter name="colorMat0" value="BREDAL_RED1"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="4" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="sg_main_component1" node="0>" />
        <i3dMapping id="sg_vis" node="0>0" />
        <i3dMapping id="rearLight10_01" node="0>0|0|0|0" />
        <i3dMapping id="rearLight10_02" node="0>0|0|0|1" />
        <i3dMapping id="sideMarker01_right" node="0>0|0|0|2" />
        <i3dMapping id="sideMarker01_left" node="0>0|0|0|3" />
        <i3dMapping id="bigTriangle" node="0>0|0|0|4" />
        <i3dMapping id="backLightsHigh" node="0>0|0|1|0" />
        <i3dMapping id="turnLightLeft" node="0>0|0|2|0" />
        <i3dMapping id="turnLightRight" node="0>0|0|2|1" />
        <i3dMapping id="topReferencePoint" node="0>0|1|0" />
        <i3dMapping id="attacherJoint" node="0>0|1|1" />
        <i3dMapping id="hydraulicIn01" node="0>0|1|2|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|1|2|0|0" />
        <i3dMapping id="hydraulicIn01_connector" node="0>0|1|2|0|0|0" />
        <i3dMapping id="hydraulicOut01" node="0>0|1|2|1" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|1|2|1|0" />
        <i3dMapping id="hydraulicOut01_connector" node="0>0|1|2|1|0|0" />
        <i3dMapping id="belt" node="0>0|2|0" />
        <i3dMapping id="roll01" node="0>0|2|1" />
        <i3dMapping id="roll02" node="0>0|2|2" />
        <i3dMapping id="spreaderLeft" node="0>0|2|3" />
        <i3dMapping id="spreaderRight" node="0>0|2|4" />
        <i3dMapping id="coverOpen" node="0>0|3|0" />
        <i3dMapping id="coverClosed" node="0>0|3|1" />
        <i3dMapping id="fillVolume" node="0>0|4|0" />
        <i3dMapping id="exactFillRootNode" node="0>0|4|1" />
        <i3dMapping id="workAreaStart" node="0>0|5|0" />
        <i3dMapping id="workAreaWidth" node="0>0|5|1" />
        <i3dMapping id="workAreaHeight" node="0>0|5|2" />
        <i3dMapping id="section01" node="0>0|5|3|0" />
        <i3dMapping id="section02" node="0>0|5|3|1" />
        <i3dMapping id="section03" node="0>0|5|3|2" />
        <i3dMapping id="section04" node="0>0|5|3|3" />
        <i3dMapping id="section05" node="0>0|5|3|4" />
        <i3dMapping id="section06" node="0>0|5|3|5" />
        <i3dMapping id="section07" node="0>0|5|3|6" />
        <i3dMapping id="section08" node="0>0|5|3|7" />
        <i3dMapping id="section09" node="0>0|5|3|8" />
        <i3dMapping id="section10" node="0>0|5|3|9" />
        <i3dMapping id="fertilizerEffectLeft" node="0>0|6|0" />
        <i3dMapping id="fertilizerEffectRight" node="0>0|6|1" />
        <i3dMapping id="unloadMesh" node="0>0|6|2" />
        <i3dMapping id="aiMarkerLeft" node="0>0|7|0|0" />
        <i3dMapping id="aiMarkerRight" node="0>0|7|0|1" />
        <i3dMapping id="aiMarkerBack" node="0>0|7|0|2" />
        <i3dMapping id="sizeMarkerLeft" node="0>0|7|1|0" />
        <i3dMapping id="sizeMarkerRight" node="0>0|7|1|1" />
        <i3dMapping id="sizeMarkerBack" node="0>0|7|1|2" />
        <i3dMapping id="aiCollisionNode" node="0>0|7|2" />
    </i3dMappings>
</vehicle>
