<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="turnOnCultivator" 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>HR 4040</name>
        <specs>
            <neededPower>160</neededPower>
            <workingWidth>4</workingWidth>
            <combination xmlFilename="$data/vehicles/kuhn/venta4030/venta4030.xml"/>
            <combination filterCategory="weights" filterSpec="weight" filterSpecMin="600" filterSpecMax="650"/>
        </specs>
        <functions>
            <function>$l10n_function_cultivator</function>
        </functions>
        <image>$data/vehicles/kuhn/hr4040/store_hr4040.png</image>
        <price>25000</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>KUHN</brand>
        <category>powerHarrows</category>
        <shopFoldingState>1</shopFoldingState>
        <shopTranslationOffset>0 0 0</shopTranslationOffset>
        <shopRotationOffset>0 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>1828608</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>298752</indexBufferMemoryUsage>
        <textureMemoryUsage>1048576</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_powerHarrow</typeDesc>
        <filename>$data/vehicles/kuhn/hr4040/hr4040.i3d</filename>
        <size width="4.5" length="2.2" lengthOffset="-0.2"/>
        <speedLimit value="12" />
        <components>
            <component centerOfMass="0 0.3 0" solverIterationCount="15" mass="1050" />
            <component solverIterationCount="15" mass="500" />

            <joint node="componentJoint" component1="1" component2="2" rotLimit="0 0 0" transMinLimit="0 -0.03 0" transLimit="0 0.12 0"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration>
                <wheels>
                    <wheel>
                        <physics rotSpeed="0" restLoad="0.3" repr="wheel01" radius="0.28" width="0.5" forcePointRatio="0.35" initialCompression="10" suspTravel="0.1" spring="16" damper="30"/>
                    </wheel>
                    <wheel>
                        <physics rotSpeed="0" restLoad="0.3" repr="wheel02" radius="0.28" width="0.5" forcePointRatio="0.35" initialCompression="10" suspTravel="0.1" spring="16" damper="30"/>
                    </wheel>
                    <wheel>
                        <physics rotSpeed="0" restLoad="0.3" repr="wheel03" radius="0.28" width="0.5" forcePointRatio="0.35" initialCompression="10" suspTravel="0.1" spring="16" damper="30"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>
    </wheels>

    <speedRotatingParts>
        <speedRotatingPart node="roll" radius="0.277" wheelIndex="1"/>
    </speedRotatingParts>

    <attachable allowFoldingWhileLowered="false">
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferenceNode" lowerTransLimitScale="0 1 0" lowerRotationOffset="-2" upperRotationOffset="12" lowerRotLimitScale="0 0 0.3" forcedAttachingDirection="-1">
                <distanceToGround lower="0.45" upper="1" />
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport" />
    </attachable>

    <attacherJoints>
        <attacherJoint node="backAttacherJoint" rootNode="hr4040_roller_component2" jointType="implement" upperRotationOffset="0" lowerRotationOffset="0" upperRotLimit="0 0 0" lowerRotLimit="0 0 0" lowerTransLimit="0 0 0" lockDownTransLimit="false" moveTime="2.5" comboTime="0">
            <distanceToGround lower="0.41" upper="1.48" />
            <topArm baseNode="attacherJointBackArmTop" filename="$data/shared/assets/upperLinks/walterscheid02.i3d" zScale="-1" color="SHARED_BLACK1" toggleVisibility="true"/>
            <schema position="1 0" rotation="0" invertX="false" />
            <subType name="venta4030"/>
            <objectChange node="rollArmPart" movingPartUpdateActive="true" movingPartUpdateInactive="false"/>
            <objectChange node="rollArm" movingPartUpdateActive="true" movingPartUpdateInactive="false"/>
            <objectChange node="rollArmAlign2" movingPartUpdateActive="false" movingPartUpdateInactive="true"/>
            <objectChange node="rollArmPartLockBolt" visibilityActive="false" visibilityInactive="true"/>
        </attacherJoint>

        <sounds>
            <attach template="clackVar6" volumeScale="1" pitchScale="0.8"/>
        </sounds>
    </attacherJoints>

    <lights>
        <sharedLight linkNode="rearLight03_01"    filename="$data/shared/assets/lights/lizard/rearLight03_left.xml" />
        <sharedLight linkNode="rearLight03_02"    filename="$data/shared/assets/lights/lizard/rearLight05_right.xml" />
        <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" />
        <sharedLight linkNode="redRound_02_01"    filename="$data/shared/assets/reflectors/lizard/redRound_02.xml" />
        <sharedLight linkNode="redRound_02_02"    filename="$data/shared/assets/reflectors/lizard/redRound_02.xml" />
        <sharedLight linkNode="reflectorWhiteRound_02_01" filename="$data/shared/assets/reflectors/lizard/whiteRound_02.xml" />
        <sharedLight linkNode="reflectorWhiteRound_02_03" filename="$data/shared/assets/reflectors/lizard/whiteRound_02.xml" />
        <sharedLight linkNode="whiteRectangle_01_01" filename="$data/shared/assets/reflectors/lizard/whiteRectangle_01.xml" />
        <sharedLight linkNode="whiteRectangle_01_02" filename="$data/shared/assets/reflectors/lizard/whiteRectangle_01.xml" />

        <realLights>
            <high>
                <light node="backLightsHigh1" lightTypes="0"/>
                <turnLightLeft node="turnLightLeftBack"/>
                <turnLightRight node="turnLightRightBack"/>
                <brakeLight node="backLightsHigh1"/>
            </high>
        </realLights>
    </lights>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="1.2" diameter="0.02" straighteningFactor="1">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1.2" diameter="0.02" straighteningFactor="1">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn02"  length="1.2" diameter="0.02" straighteningFactor="1">
            <objectChange node="hydraulicIn02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut02" length="1.2" diameter="0.02" straighteningFactor="1">
            <objectChange node="hydraulicOut02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="electric" node="electric" length="1.5" diameter="0.01" straighteningFactor="2.5" minCenterPointOffset="-1 0 0" maxCenterPointOffset="1 0 0">
            <objectChange node="electric_detached" 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" />
        <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" />
        <dynamicallyLoadedPart node="1|1" linkNode="electric_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="ptoInputNode" detachNode="ptoDetachNode" aboveAttacher="true" color="SHARED_BLACK1" decalColor="WALTERSCHEID_YELLOW1">
            <objectChange node="ptoMounting" rotationActive="0 0 0" rotationInactive="0 0 -45"/>
        </input>
    </powerTakeOffs>

    <powerConsumer ptoRpm="470" neededMaxPtoPower="55" forceNode="hr4040_main_component1" maxForce="8" />

    <groundReferenceNodes>
        <groundReferenceNode node="groundReferenceNode" forceFactor="1" threshold="0.2" depthNode="depthNode"/>
    </groundReferenceNodes>

    <workAreas>
        <workArea type="cultivator" functionName="processCultivatorArea">
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight"/>
            <groundReferenceNode index="1"/>
            <onlyActiveWhenLowered value="true"/>
        </workArea>
    </workAreas>

    <cultivator useDeepMode="false" isPowerHarrow="true">
        <sounds>
            <work template="DEFAULT_CULTIVATOR_WORK" linkNode="0>" />
        </sounds>
        <directionNode node="0>" />
        <onlyActiveWhenLowered value="true"/>
    </cultivator>

    <animations>
        <animation name="moveSupport">
            <part node="supportCol" startTime="0" endTime="0.4" startTrans="0 0.45 0" endTrans="0 0 0" />

            <sound template="clackVar5" startTime="0.39" direction="-1" volumeScale="1.1" pitchScale="1"   linkNode="attacherJoint"/>
            <sound template="clackVar1" startTime="0.39" direction="-1" volumeScale="1.8" pitchScale="1.5" linkNode="attacherJoint"/>
        </animation>
    </animations>

    <cylindered>
        <movingParts>
            <movingPart node="rollArmAlign2" referencePoint="rollArmAlign2Ref" referenceFrame="rollArmRefFrame" isActiveDirty="true" maxUpdateDistance="200" limitedAxis="1" smoothedDirectionScale="true" smoothedDirectionTime="0.1">
                <dependentPart node="rollArmHydraulic" />
            </movingPart>

            <movingPart node="rollArm" referencePoint="rollArmRef" referenceFrame="rollArmRefFrame" isActiveDirty="true" maxUpdateDistance="200" limitedAxis="1" smoothedDirectionScale="true" smoothedDirectionTime="0.1">
                <dependentPart node="rollArmPart" />
                <dependentPart node="rollArmHydraulic" />
            </movingPart>
            <movingPart node="rollArmPart" localReferencePoint="rollArmPartLocalRef" referencePoint="rollArmPartRef" referenceFrame="rollArmPartRefFrame" smoothedDirectionScale="true" smoothedDirectionTime="0.1"/>

            <movingPart node="rollArmHydraulic" referencePoint="rollArmHydraulicRef" referenceFrame="rollArmHydraulicRef">
                <translatingPart node="rollArmHydraulicPunch" />
            </movingPart>
        </movingParts>

        <sounds>
            <hydraulic template="defaultHydraulicSound" linkNode="0>"/>
        </sounds>
    </cylindered>

    <workParticles>
        <effect workAreaIndex="1">
            <effectNode effectClass="CultivatorMotionPathEffect" effectType="CULTIVATOR" linkNode="rollerEffect01LinkNode">
                <motionPathEffect textureFilename="$data/vehicles/kuhn/hr4040/rollerEffect01Array.dds" numRows="30" rowLength="18" minFade="0.07" densityScale="0.35"/>
            </effectNode>
        </effect>

        <effect workAreaIndex="1" activeDirection="0" needsSetIsTurnedOn="true">
            <effectNode effectClass="CultivatorMotionPathEffect" effectType="CULTIVATOR" linkNode="rotationEffect01LinkNode">
                <motionPathEffect textureFilename="$data/vehicles/kuhn/hr4040/rotationEffect01Array.dds" numRows="20" rowLength="18" minFade="0.07" speedScale="1"/>
            </effectNode>
        </effect>

        <particle>
            <node node="smokeEmitter" refNodeIndex="1" particleType="SOIL_SMOKE" emitCountScale="2.5"/>
            <node node="smokeEmitterFront" refNodeIndex="1" particleType="SOIL_SMOKE" emitCountScale="2.5" worldSpace="false"/>
        </particle>
    </workParticles>

    <turnOnVehicle>
        <sounds>
            <start template="STRAWBLOWER_START" />
            <work template="STRAWBLOWER_WORK" />
            <stop template="STRAWBLOWER_STOP" />
        </sounds>

        <animationNodes>
            <animationNode node="rotatingPart01" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart02" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart03" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart04" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart05" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart06" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart07" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart08" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart09" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart10" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart11" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart12" rotSpeed="2500"  rotAxis="2" />
            <animationNode node="rotatingPart13" rotSpeed="-2500" rotAxis="2" />
            <animationNode node="rotatingPart14" rotSpeed="2500"  rotAxis="2" />
        </animationNodes>
    </turnOnVehicle>

    <ai>
        <areaMarkers leftNode="aiMarkerLeft" rightNode="aiMarkerRight" backNode="aiMarkerBack" />
        <sizeMarkers leftNode="sizeMarkerLeft" rightNode="sizeMarkerRight" backNode="sizeMarkerBack"/>
        <collisionTrigger node="aiCollisionNode" width="4.2" height="1.4"/>
        <needsLowering value="true"/>
        <agentAttachment width="4.1" height="1.4" length="1.65" lengthOffset="-0.2"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-2.05" maxX="2.05" minZ="-1.05" maxZ="0.45" yOffset="0.35" />
    </foliageBending>

    <baseMaterial>
        <material name="hr4040_mat" baseNode="hr4040_vis">
            <shaderParameter name="colorMat0" value="KUHN_RED1"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="6" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="hr4040_main_component1" node="0>" />
        <i3dMapping id="hr4040_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="supportCol" node="0>0|0|2" />
        <i3dMapping id="ptoInputNode" node="0>0|0|3" />
        <i3dMapping id="ptoDetachNode" node="0>0|0|3|0" />
        <i3dMapping id="ptoMounting" node="0>0|0|4" />
        <i3dMapping id="hydraulicIn01" node="0>0|0|5|0" />
        <i3dMapping id="hydraulicOut01" node="0>0|0|5|1" />
        <i3dMapping id="hydraulicIn02" node="0>0|0|5|2" />
        <i3dMapping id="hydraulicOut02" node="0>0|0|5|3" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|0|5|4" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>0|0|5|4|0" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|0|5|5" />
        <i3dMapping id="hydraulicOut01_detachedAdapter" node="0>0|0|5|5|0" />
        <i3dMapping id="hydraulicIn02_detached" node="0>0|0|5|6" />
        <i3dMapping id="hydraulicIn02_detachedAdapter" node="0>0|0|5|6|0" />
        <i3dMapping id="hydraulicOut02_detached" node="0>0|0|5|7" />
        <i3dMapping id="hydraulicOut02_detachedAdapter" node="0>0|0|5|7|0" />
        <i3dMapping id="electric" node="0>0|0|5|8" />
        <i3dMapping id="electric_detached" node="0>0|0|5|9" />
        <i3dMapping id="electric_detachedAdapter" node="0>0|0|5|9|0" />
        <i3dMapping id="attacherJointBackArmTop" node="0>0|0|6" />
        <i3dMapping id="rearLight03_02" node="0>0|1|0|0" />
        <i3dMapping id="rearLight03_01" node="0>0|1|0|1" />
        <i3dMapping id="whiteRectangle_01_02" node="0>0|1|0|2" />
        <i3dMapping id="whiteRectangle_01_01" node="0>0|1|0|3" />
        <i3dMapping id="redRound_02_02" node="0>0|1|0|4" />
        <i3dMapping id="redRound_02_01" node="0>0|1|0|5" />
        <i3dMapping id="reflectorWhiteRound_02_03" node="0>0|1|0|6" />
        <i3dMapping id="reflectorWhiteRound_02_01" node="0>0|1|0|7" />
        <i3dMapping id="yellowRound_02_02" node="0>0|1|0|8" />
        <i3dMapping id="yellowRound_02_01" node="0>0|1|0|9" />
        <i3dMapping id="backLightsHigh1" node="0>0|1|1|0" />
        <i3dMapping id="turnLightLeftBack" node="0>0|1|2|0" />
        <i3dMapping id="turnLightRightBack" node="0>0|1|2|1" />
        <i3dMapping id="componentJoint" node="0>0|2|0" />
        <i3dMapping id="rollArmRefFrame" node="0>0|2|1" />
        <i3dMapping id="rollArmAlign2" node="0>0|2|1|0" />
        <i3dMapping id="rollArm" node="0>0|2|1|0|0" />
        <i3dMapping id="rollArmPartRefFrame" node="0>0|2|1|0|0|0" />
        <i3dMapping id="rollArmPart" node="0>0|2|1|0|0|0|0" />
        <i3dMapping id="rollArmPartLocalRef" node="0>0|2|1|0|0|0|0|0" />
        <i3dMapping id="rollArmPartLockBolt" node="0>0|2|1|0|0|0|0|1" />
        <i3dMapping id="roll" node="0>0|2|1|0|0|0|0|2|0" />
        <i3dMapping id="rollArmHydraulicRef" node="0>0|2|1|0|0|1" />
        <i3dMapping id="rollArmPartRef" node="0>0|2|1|1" />
        <i3dMapping id="rollArmHydraulic" node="0>0|2|2" />
        <i3dMapping id="rollArmHydraulicPunch" node="0>0|2|2|0" />
        <i3dMapping id="rotatingPart01" node="0>0|2|3" />
        <i3dMapping id="rotatingPart02" node="0>0|2|4" />
        <i3dMapping id="rotatingPart03" node="0>0|2|5" />
        <i3dMapping id="rotatingPart04" node="0>0|2|6" />
        <i3dMapping id="rotatingPart05" node="0>0|2|7" />
        <i3dMapping id="rotatingPart06" node="0>0|2|8" />
        <i3dMapping id="rotatingPart07" node="0>0|2|9" />
        <i3dMapping id="rotatingPart08" node="0>0|2|10" />
        <i3dMapping id="rotatingPart09" node="0>0|2|11" />
        <i3dMapping id="rotatingPart10" node="0>0|2|12" />
        <i3dMapping id="rotatingPart11" node="0>0|2|13" />
        <i3dMapping id="rotatingPart12" node="0>0|2|14" />
        <i3dMapping id="rotatingPart13" node="0>0|2|15" />
        <i3dMapping id="rotatingPart14" node="0>0|2|16" />
        <i3dMapping id="workAreaStart" node="0>0|3|0" />
        <i3dMapping id="workAreaWidth" node="0>0|3|1" />
        <i3dMapping id="workAreaHeight" node="0>0|3|2" />
        <i3dMapping id="groundReferenceNode" node="0>0|3|3" />
        <i3dMapping id="depthNode" node="0>0|3|4" />
        <i3dMapping id="aiMarkerLeft" node="0>0|4|0" />
        <i3dMapping id="aiMarkerRight" node="0>0|4|1" />
        <i3dMapping id="aiMarkerBack" node="0>0|4|2" />
        <i3dMapping id="sizeMarkerLeft" node="0>0|4|3" />
        <i3dMapping id="sizeMarkerRight" node="0>0|4|4" />
        <i3dMapping id="sizeMarkerBack" node="0>0|4|5" />
        <i3dMapping id="aiCollisionNode" node="0>0|4|6" />
        <i3dMapping id="rotationEffect01LinkNode" node="0>0|5|0" />
        <i3dMapping id="rollerEffect01LinkNode" node="0>0|5|1" />
        <i3dMapping id="smokeEmitterFront" node="0>0|5|2" />
        <i3dMapping id="smokeEmitter" node="0>0|5|3" />
        <i3dMapping id="hr4040_roller_component2" node="1>" />
        <i3dMapping id="wheel01" node="1>0|0" />
        <i3dMapping id="wheel02" node="1>0|1" />
        <i3dMapping id="wheel03" node="1>0|2" />
        <i3dMapping id="rollArmRef" node="1>1" />
        <i3dMapping id="rollArmAlign2Ref" node="1>2" />
        <i3dMapping id="backAttacherJoint" node="1>3" />
    </i3dMappings>
</vehicle>
