<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="manureSpreader" 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>SV3</name>
        <specs>
            <workingWidth>4.0</workingWidth>
        </specs>
        <functions>
            <function>$l10n_function_sprayer</function>
        </functions>
        <storePacks>
            <storePack>STARTER_GRAPE</storePack>
            <storePack>STARTER_OLIVE</storePack>
        </storePacks>
        <image>textures/store_SV3.dds</image>
        <price>12000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>VILA</brand>
        <category>manureSpreaders</category>
        <shopTranslationOffset>0 -0.013 0</shopTranslationOffset>
        <shopRotationOffset>-0.206 0 0</shopRotationOffset>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_sprayer</typeDesc>
        <filename>Vila_SV3.i3d</filename>
        <size width="2.5" length="5" lengthOffset="0.1" />
        <components maxMass="5000">
            <component centerOfMass="0 0.22 -0.1" solverIterationCount="10" mass="574" />
            <component centerOfMass="0 0 0" solverIterationCount="10" mass="150" />
            <joint component1="1" component2="2" node="drawbarJoint" rotLimit="0 0 0" transLimit="0 0 0"/>
        </components>
        <speedLimit value="15" />
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault" price="0">
                <wheels>
                    <wheel filename="$data/shared/wheels/tires/trelleborg/AW305/300_80R15_3.xml" isLeft="true" hasTireTracks="true" hasParticles="true" >
                        <physics restLoad="0.3" repr="wheelLeft"  forcePointRatio="0.4" initialCompression="7" suspTravel="0.1" spring="100" damper="30" frictionScale="2"/>
                    </wheel>
                    <wheel filename="$data/shared/wheels/tires/trelleborg/AW305/300_80R15_3.xml" isLeft="false" hasTireTracks="true" hasParticles="true" >
                        <physics restLoad="0.3" repr="wheelRight" forcePointRatio="0.4" initialCompression="7" suspTravel="0.1" spring="100" damper="30" frictionScale="2"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>

        <rimColor material="18">SHARED_WHITE1</rimColor>

        <hubs>
            <color0>1 0 0</color0>
            <color1>SHARED_GREY3</color1>
            <hub linkNode="wheelLeft"  filename="$data/shared/wheels/hubs/hub_n6_1.xml" isLeft="true"  scale="0.15 0.2 0.2" />
            <hub linkNode="wheelRight" filename="$data/shared/wheels/hubs/hub_n6_1.xml" isLeft="false" scale="0.15 0.2 0.2" />
        </hubs>
    </wheels>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" rootNode="Vila_SV3_drawbar_component2" jointType="implement" lowerRotLimitScale="0 0 1" upperRotLimitScale="0 0 1" lowerTransLimitScale="0 1 0" allowsLowering="false">
                <distanceToGround lower="0.55" upper="0.55"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport"/>
        <support animationName="lockDrawbarLimit" delayedOnAttach="false" detachAfterAnimation="false"/>
        <brakeForce force="0.15" maxForce="0.7" maxForceMass="4900"/>
    </attachable>

    <lights>
        <sharedLight linkNode="yellowRectangle_01_01"   filename="$data/shared/assets/reflectors/lizard/yellowRectangle_01.xml"/>
        <sharedLight linkNode="yellowRectangle_01_02"   filename="$data/shared/assets/reflectors/lizard/yellowRectangle_01.xml"/>
        <sharedLight linkNode="yellowRectangle_01_03"   filename="$data/shared/assets/reflectors/lizard/yellowRectangle_01.xml"/>
        <sharedLight linkNode="yellowRectangle_01_04"   filename="$data/shared/assets/reflectors/lizard/yellowRectangle_01.xml"/>
        <sharedLight linkNode="whiteRound_01_01"   filename="$data/shared/assets/reflectors/lizard/whiteRound_01.xml"/>
        <sharedLight linkNode="whiteRound_01_02"   filename="$data/shared/assets/reflectors/lizard/whiteRound_01.xml"/>
        <sharedLight linkNode="redTriangle_02_01"   filename="$data/shared/assets/reflectors/lizard/redTriangle_02.xml"/>
        <sharedLight linkNode="redTriangle_02_02"   filename="$data/shared/assets/reflectors/lizard/redTriangle_02.xml"/>
        <sharedLight linkNode="rearLight05_right"   filename="$data/shared/assets/lights/lizard/rearLight05_right.xml"/>
        <sharedLight linkNode="rearLight05_left"   filename="$data/shared/assets/lights/lizard/rearLight05_left.xml"/>

        <realLights>
            <high>
                <light node="backLightsHigh1" lightTypes="0"/>
                <turnLightLeft node="turnLightLeftBack"/>
                <turnLightRight node="turnLightRightBack"/>
                <brakeLight node="backLightsHigh1"/>
            </high>
        </realLights>
    </lights>

    <licensePlates>
        <licensePlate node="licensePlateBack" position="BACK" preferedType="SQUARISH" placementArea="0.08 0.18 0.3 0.18"/>
    </licensePlates>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="electric" node="electrica" length="1.4" diameter="0.005" straighteningFactor="0.5" minDeltaY="-0.12">
            <objectChange node="mangueras" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hidraulica_1" length="1.3" diameter="0.015" straighteningFactor="0.5" minDeltaY="-0.12">
            <objectChange node="mangueras" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hidraulica_2" length="1.3" diameter="0.015" straighteningFactor="0.5" minDeltaY="-0.12">
            <objectChange node="mangueras" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hidraulica_3" length="1.3" diameter="0.015" straighteningFactor="0.5" minDeltaY="-0.12">
            <objectChange node="mangueras" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hidraulica_4" length="1.3" diameter="0.015" straighteningFactor="0.5" minDeltaY="-0.12">
            <objectChange node="mangueras" visibilityActive="false" visibilityInactive="true"/>
        </hose>
    </connectionHoses>

    <workAreas>
        <workArea type="sprayer" functionName="processSprayerArea" disableBackwards="false" requiresGroundContact="false" >
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight" />
            <onlyActiveWhenLowered value="false"/>
        </workArea>
    </workAreas>

    <sprayer fillUnitIndex="1">
        <usageScales workingWidth="4" scale="1" />
        <effects>
            <effectNode effectClass="TypedMotionPathEffect" effectType="MANURE_SPREADER" linkNode="manureEffectNarrowNode">
                <motionPathEffect textureFilename="$data/vehicles/farmtech/variofex750/manureEffectNarrowArray.dds" numRows="28" rowLength="24" speedScale="1.5" shapeScale="0.1" maxShapeScale="2.2"/>
            </effectNode>
            <effectNode effectNode="grainEffect"  delay="0" materialType="unloading" fadeTime="1" materialTypeId="1" />

            <effectNode effectClass="ParticleEffect" effectNode="smokeEmitterNarrow" particleType="smoke" materialType="smokeParticle" worldSpace="false" emitCountScale="0.3" spriteScale="0.5"/>
        </effects>

        <animationNodes>
            <animationNode node="gear01"     rotAxis="1" rotSpeed="-25"/>
            <animationNode node="gear02"     rotAxis="1" rotSpeed="-25"/>
            <animationNode node="floorUvScroll01" rotSpeed="2"  rotAxis="1" shaderComponentScale="0 1 0 0" shaderParameterName="offsetUV" />
            <animationNode node="floorUvScroll02" rotSpeed="2"  rotAxis="1" shaderComponentScale="0 1 0 0" shaderParameterName="offsetUV" />
            <part node="backDoorRot"   startTime="0" endTime="7" startTrans="0 0.3 0" endTrans="0 0 0"/>
            <part node="gear" startTime="0"   endTime="7" startRot="0 0 0" endRot="1080 0 0" />
            <part node="gear" startTime="0"   endTime="7" startTrans="0.285 1.470 -1.645" endTrans="0.285 1.470 -1.645" />

        </animationNodes>

    </sprayer>



    <foldable>
        <foldingConfigurations>
            <foldingConfiguration>
                <foldingParts startAnimTime="1" turnOnFoldDirection="-1" turnOnFoldMinLimit="0" turnOnFoldMaxLimit="0.5">
                    <foldingPart animationName="openBackDoor" speedScale="1" />
                </foldingParts>
            </foldingConfiguration>
        </foldingConfigurations>
    </foldable>


    <cylindered>
        <movingTools>
            <movingTool node="backDoorRot" playSound="true" />
        </movingTools>
        <sounds>
            <hydraulic template="defaultHydraulicSound" linkNode="0>"/>
        </sounds>

    </cylindered>


    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration name="$l10n_configuration_valueDefault" price="0" >
                <fillUnits>
                    <fillUnit shopDisplayUnit="CUBICMETER" fillTypeCategories="MANURESPREADER" capacity="3500">
                        <exactFillRootNode node="exactFillRootNode" />
                    </fillUnit>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <fillVolume>
        <fillVolumeConfigurations>
            <fillVolumeConfiguration name="$l10n_configuration_valueDefault" price="0" >
                <volumes>
                    <volume node="fillVolume" maxDelta="0.5" maxAllowedHeapAngle="20" fillUnitIndex="1"/>
                </volumes>
            </fillVolumeConfiguration>
        </fillVolumeConfigurations>

        <unloadInfos>
            <unloadInfo>
                <node node="unloadNode" width="1.4" length="1.0" />
            </unloadInfo>
        </unloadInfos>
    </fillVolume>

    <turnOnVehicle turnOffIfNotAllowed="true" >
        <sounds>
            <work template="DEFAULT_MANURE_SPREADER_02" linkNode="0>" />
        </sounds>
    </turnOnVehicle>


    <animations>
        <animation name="moveSupport">
            <part node="supportArm"       startTime="0.0" endTime="0.5" startTrans="0 0.53 0" endTrans="0 -0.06 0" />
            <part componentJointIndex="1" startTime="0.0" endTime="0.5" startRotLimit="0 70 45" endRotLimit="0 0 0" />

        </animation>
        <animation name="openBackDoor">
            <part node="backDoorRot"   startTime="0" endTime="7" startTrans="0 0.3 0" endTrans="0 0 0"/>
            <part node="gear" startTime="0"   endTime="7" startRot="0 0 0" endRot="1080 0 0" />
            <part node="gear" startTime="0"   endTime="7" startTrans="0.285 1.470 -1.645" endTrans="0.285 1.470 -1.645" />

            <sound template="clackVar6"     startTime="2.99" direction="1"  volumeScale="0.6" pitchScale="1" />
            <sound template="cylinderPunch" startTime="2.99" direction="1"  volumeScale="0.6" pitchScale="1" />
            <sound template="clackVar6"     startTime="2.99" direction="-1" volumeScale="0.6" pitchScale="0.7" />
            <sound template="cylinderPunch" startTime="0.01" direction="-1" volumeScale="0.5" pitchScale="0.7" />
            <sound template="clackVar6"     startTime="0.01" direction="-1" volumeScale="0.8" pitchScale="0.8" />
            <sound template="cylinderPunch" startTime="0.01" direction="1"  volumeScale="0.3" pitchScale="2" />
        </animation>
		
    </animations>
 
    <ai>
        <needsLowering value="false" />
        <areaMarkers leftNode="aiMarkerLeft" rightNode="aiMarkerRight" backNode="aiMarkerBack" />
        <sizeMarkers leftNode="aiSizeMarkerLeft" rightNode="aiSizeMarkerRight" backNode="aiSizeMarkerBack" />
        <allowTurnBackward value="false" />
        <toolReverserDirectionNode node="aiSizeMarkerBack" />
        <agentAttachment jointNode="attacherJoint" rotCenterWheelIndices="1 2" width="1.8" height="2.7" length="4.7" lengthOffset="0.75"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-1" maxX="1" minZ="-1.2" maxZ="0.2" yOffset="0.5"/>
        <bendingNode minX="-0.7" maxX="0.7" minZ="0.2" maxZ="2.3" yOffset="0.5"/>
        <bendingNode minX="-0.65" maxX="0.65" minZ="-2.3" maxZ="-1.2" yOffset="0.5"/>
    </foliageBending>


    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="4" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="Vila_SV3_main_component1" node="0>" />
        <i3dMapping id="Vila_SV3_vis" node="0>0" />
        <i3dMapping id="supportArm" node="0>0|0|0|0" />
        <i3dMapping id="mangueras" node="0>0|0|1|0" />
        <i3dMapping id="hidraulica_1" node="0>0|0|1|1" />
        <i3dMapping id="hidraulica_2" node="0>0|0|1|2" />
        <i3dMapping id="hidraulica_3" node="0>0|0|1|3" />
        <i3dMapping id="hidraulica_4" node="0>0|0|1|4" />
        <i3dMapping id="electrica" node="0>0|0|1|5" />
        <i3dMapping id="drawbarJoint" node="0>0|1" />
        <i3dMapping id="wheelLeft" node="0>0|2|0" />
        <i3dMapping id="wheelRight" node="0>0|2|1" />
        <i3dMapping id="exactFillRootNode" node="0>0|4|0" />		
        <i3dMapping id="unloadNode" node="0>0|4|1" />		
        <i3dMapping id="fillVolume" node="0>0|4|2" />	
        <i3dMapping id="backDoorRot" node="0>0|5|0|0" />		
        <i3dMapping id="gear" node="0>0|5|0|1" />
        <i3dMapping id="floorUvScroll01" node="0>0|5|1" />
        <i3dMapping id="floorUvScroll02" node="0>0|5|2" />
        <i3dMapping id="gear01" node="0>0|5|3" />
        <i3dMapping id="gear02" node="0>0|5|4" />		
        <i3dMapping id="workAreaStart" node="0>0|6|0" />
        <i3dMapping id="workAreaWidth" node="0>0|6|0|0" />
        <i3dMapping id="workAreaHeight" node="0>0|6|0|1" />
        <i3dMapping id="manureEffectNarrowNode" node="0>0|7|0" />
        <i3dMapping id="smokeEmitterNarrow" node="0>0|7|1" />	
        <i3dMapping id="grainEffect" node="0>0|7|2" />	
        <i3dMapping id="aiMarkerLeft" node="0>0|8|0" />
        <i3dMapping id="aiMarkerRight" node="0>0|8|1" />
        <i3dMapping id="aiMarkerBack" node="0>0|8|2" />
        <i3dMapping id="aiSizeMarkerLeft" node="0>0|8|3" />
        <i3dMapping id="aiSizeMarkerRight" node="0>0|8|4" />
        <i3dMapping id="aiSizeMarkerBack" node="0>0|8|5" />
        <i3dMapping id="yellowRectangle_01_01" node="0>0|9|0|0"/>
        <i3dMapping id="yellowRectangle_01_02" node="0>0|9|0|1"/>
        <i3dMapping id="yellowRectangle_01_03" node="0>0|9|0|2"/>
        <i3dMapping id="yellowRectangle_01_04" node="0>0|9|0|3"/>
        <i3dMapping id="whiteRound_01_01" node="0>0|9|0|4"/>
        <i3dMapping id="whiteRound_01_02" node="0>0|9|0|5"/>
        <i3dMapping id="redTriangle_02_01" node="0>0|9|0|6"/>
        <i3dMapping id="redTriangle_02_02" node="0>0|9|0|7"/>
        <i3dMapping id="rearLight05_right" node="0>0|9|0|8"/>
        <i3dMapping id="rearLight05_left" node="0>0|9|0|9"/>
        <i3dMapping id="backLightsHigh1" node="0>0|9|1|0"/>
        <i3dMapping id="turnLightLeftBack" node="0>0|9|2|0"/>
        <i3dMapping id="turnLightRightBack" node="0>0|9|2|1"/>	
        <i3dMapping id="licensePlateBack" node="0>0|10"/>		
        <i3dMapping id="Vila_SV3_drawbar_component2" node="1>" />
        <i3dMapping id="attacherJoint" node="1>0" />
    </i3dMappings>
</vehicle>
