﻿<?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>KRG 250</name>
        <specs>
            <neededPower>190</neededPower>
            <workingWidth>2.5</workingWidth>
            <combination filterCategory="weights" filterSpec="weight" filterSpecMin="600" filterSpecMax="700"/>
        </specs>
        <functions>
            <function>$l10n_function_spader</function>
        </functions>
        <image>$data/vehicles/farmax/krg/store_krg.png</image>
        <price>35500</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>FARMAX</brand>
        <category>spaders</category>
        <shopTranslationOffset>0 0.122 0</shopTranslationOffset>
        <shopRotationOffset>5.652 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>1463808</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>226560</indexBufferMemoryUsage>
        <textureMemoryUsage>1703936</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_spader</typeDesc>
        <filename>$data/vehicles/farmax/krg/krg.i3d</filename>
        <size width="4" length="6" lengthOffset="-0.4"/>
        <speedLimit value="8" />
        <components>
            <component centerOfMass="0 0.5 -0.5" solverIterationCount="15" mass="4650" />
            <component centerOfMass="0 0 0" solverIterationCount="15" mass="250" />
            <joint component1="1" component2="2" node="attacherBarJoint" rotLimit="0 0 0" transLimit="0 0 0"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL_TRAILED" />
    </base>

    <wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault" price="0">
                <wheels hasSurfaceSounds="false">
                    <wheel>
                        <physics restLoad="1.5" repr="wheel01" radius="0.712" width="0.5" forcePointRatio="0.3" initialCompression="15" suspTravel="0.1" spring="88" damper="80" mass="0.1"/>
                        <tire isCareWheel="false"/>
                    </wheel>
                    <wheel>
                        <physics restLoad="1.5" repr="wheel02" radius="0.712" width="0.5" forcePointRatio="0.3" initialCompression="15" suspTravel="0.1" spring="88" damper="80" mass="0.1"/>
                        <tire isCareWheel="false"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>

        <dynamicallyLoadedWheels>
            <dynamicallyLoadedWheel linkNode="wheel_vis01"  filename="$data/shared/wheels/tires/nokian/groundKing/540_65R30.xml" isLeft="true"/>
            <dynamicallyLoadedWheel linkNode="wheel_vis02"  filename="$data/shared/wheels/tires/nokian/groundKing/540_65R30.xml" isLeft="true"/>
            <dynamicallyLoadedWheel linkNode="wheel_vis03"  filename="$data/shared/wheels/tires/nokian/groundKing/540_65R30.xml" isLeft="true"/>
            <dynamicallyLoadedWheel linkNode="wheel_vis04"  filename="$data/shared/wheels/tires/nokian/groundKing/540_65R30.xml" isLeft="true"/>
        </dynamicallyLoadedWheels>

        <rimColor material="18">SHARED_WHITE1</rimColor>
    </wheels>

    <speedRotatingParts>
        <speedRotatingPart node="axisRotation" radius="0.712" wheelIndex="1" hasTireTracks="false"/>
        <speedRotatingPart node="wheel_vis01" radius="0.712" wheelIndex="1" hasTireTracks="true"/>
        <speedRotatingPart node="wheel_vis02" radius="0.712" wheelIndex="1" hasTireTracks="true"/>
        <speedRotatingPart node="wheel_vis03" radius="0.712" wheelIndex="2" hasTireTracks="true"/>
        <speedRotatingPart node="wheel_vis04" radius="0.712" wheelIndex="2" hasTireTracks="true"/>
    </speedRotatingParts>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" rootNode="krg_attacher_component2" jointType="implement" lowerRotLimitScale="0 0 30" upperRotLimitScale="0 0 30" lowerTransLimitScale="0 1 0" allowsLowering="true">
                <distanceToGround lower="0.7" upper="0.7"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport"/>
        <support animationName="lockDrawbarLimit" delayedOnAttach="false" detachAfterAnimation="false"/>
        <brakeForce force="0.9"/>
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="1.4" diameter="0.015" straighteningFactor="1">
           <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="1.4" diameter="0.015" straighteningFactor="1">
           <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="electric"  node="electricIn"  length="1.6" diameter="0.008" straighteningFactor="1">
            <objectChange node="electricIn01_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|1" linkNode="electric_detachedAdapter"  filename="$data/shared/connectionHoses/connectors.i3d" />
    </dynamicallyLoadedParts>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="ptoInputNode" aboveAttacher="true" />
    </powerTakeOffs>

    <powerConsumer ptoRpm="470" neededMinPtoPower="50" neededMaxPtoPower="50" forceNode="krg_main_component1" maxForce="12" />

    <lights>
        <sharedLight linkNode="rearLight29_left"   filename="$data/shared/assets/lights/lizard/rearLight11_left.xml" />
        <sharedLight linkNode="rearLight29_right"  filename="$data/shared/assets/lights/lizard/rearLight11_right.xml" />

        <realLights>
            <high>
                <light node="backLightsHigh1" lightTypes="0" />
                <brakeLight node="backLightsHigh1" />
                <turnLightLeft node="turnLightLeftBack" />
                <turnLightRight node="turnLightRightBack" />
            </high>
        </realLights>

        <defaultLights>
            <defaultLight shaderNode="backlightsStatic" lightTypes="0"/>
        </defaultLights>
    </lights>

    <groundReferenceNodes>
        <groundReferenceNode node="groundReferenceNode"  threshold="0.18" depthNode="depthNode" />
    </groundReferenceNodes>

    <workAreas>
        <workArea type="cultivator" functionName="processCultivatorArea">
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight" />
            <groundReferenceNode index="1" />
            <onlyActiveWhenLowered value="true"/>
        </workArea>
    </workAreas>

    <workParticles>
        <effect workAreaIndex="1" activeDirection="0" needsSetIsTurnedOn="true">
            <effectNode effectClass="CultivatorMotionPathEffect" effectType="CULTIVATOR" linkNode="tineEffect01LinkNode">
                <motionPathEffect textureFilename="$data/vehicles/farmax/krg/tineEffect01Array.dds" numRows="20" rowLength="18" density="1" shapeScale="1.5" maxShapeScale="1.5"/>
            </effectNode>
        </effect>

        <particle>
            <node node="dustEmitterShape" refNodeIndex="1" particleType="SOIL_SMOKE" emitCountScale="1.0" />
        </particle>
    </workParticles>

    <foldable>
        <foldingConfigurations>
            <foldingConfiguration>
                <foldingParts startMoveDirection="1" foldMiddleAnimTime="1"  detachingMinLimit="1" detachingMaxLimit="1" unfoldWarning="$l10n_warning_liftImplementFirst">
                    <foldingPart animationName="folding" speedScale="1" />
                </foldingParts>
            </foldingConfiguration>
         </foldingConfigurations>
    </foldable>

    <animations>
        <animation name="moveSupport">
            <part node="supportArm" startTime="0" endTime="0.6" startTrans="0 0 0" endTrans="0 -1.096 0"/>
            <part node="drawbar" startTime="0" endTime="0.6" startRot="-40 0 0" endRot="-30 0 0"/>

            <sound template="defaultHydraulicSound" startTime="0.01" endTime="0.55" volumeScale="1.7" pitchScale="1.1" linkNode="attacherJoint"/>
            <sound template="clackVar1" startTime="0.1" direction="-1"  volumeScale="2" pitchScale="1.5" linkNode="attacherJoint"/>
            <sound template="latchSmall" startTime="0.55"   volumeScale="0.5" pitchScale="2" linkNode="attacherJoint"/>
            <sound template="clackVar3" startTime="0.55"   volumeScale="2" pitchScale="2" linkNode="attacherJoint"/>
            <sound template="clackVar5" startTime="0.5" volumeScale="2" pitchScale="1" linkNode="attacherJoint"/>
        </animation>
        <animation name="lockDrawbarLimit">
            <part componentJointIndex="1" startTime="0.0" endTime="0.1" startRotLimit="0 90 20" endRotLimit="0 0 0" />
        </animation>
        <animation name="folding">
            <part node="drawbar" startTime="0" endTime="2" startRot="-40 0 0" endRot="-40 0 0" />
            <part node="axis" startTime="0" endTime="2" startRot="22 0 0" endRot="0 0 0" />
            <part node="axisRotationRot" startTime="0" endTime="2" startRot="-60 0 0" endRot="0 0 0" />

            <sound template="hydraulicLayerTone" startTime="0.01" endTime="1.99" volumeScale="1.7" pitchScale="1.1" fadeIn="0.1" fadeOut="0.1"/>
            <sound template="clackVar1" startTime="1.99" direction="-1" volumeScale="2" pitchScale="1.1"/>
            <sound template="clackVar5" startTime="0.01" direction="-1" volumeScale="2.3" pitchScale="0.7"/>
            <sound template="clackVar2" startTime="0.1" direction="-1" volumeScale="2.5" pitchScale="0.6"/>
            <sound template="clackVar5" startTime="0.01" direction="1" volumeScale="2" pitchScale="0.9"/>
            <sound template="clackVar1" startTime="1.99" direction="1" volumeScale="2.7" pitchScale="1.1"/>
            <sound template="clackVar3" startTime="1.99" direction="1" volumeScale="2.2" pitchScale="0.7"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="axis" wheelIndices="1 2" playSound="true">
              <dependentPart node="axisHydraulic" />
            </movingTool>
            <movingTool node="drawbar" playSound="true">
                <inputAttacherJoint value="true" />
                <dependentPart node="drawbarHydraulic" />
                <componentJoint index="1"/>
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="attacherBar" referencePoint="attacherBarRef" referenceFrame="attacherBarRef" isActiveDirty="true" maxUpdateDistance="100" limitedAxis="2"/>
            <movingPart node="drawbarHydraulic" referencePoint="drawbarHydraulicRef" referenceFrame="drawbarHydraulicRef">
              <translatingPart node="drawbarHydraulicPunch" />
            </movingPart>
            <movingPart node="axisHydraulic" referencePoint="axisHydraulicRef" referenceFrame="axisHydraulicRef">
                <translatingPart node="axisHydraulicPunch" />
            </movingPart>
        </movingParts>
    </cylindered>

    <cultivator isSubsoiler="true" useDeepMode="true">
        <sounds>
            <work template="DEFAULT_PLOW_WORK" volumeScale="1.4" linkNode="0>" />
        </sounds>
        <directionNode node="0>" />
        <onlyActiveWhenLowered value="true"/>
    </cultivator>

    <turnOnVehicle>
        <sounds>
            <start template="STRAWBLOWER_START" />
            <work template="STRAWBLOWER_WORK" />
            <stop template="STRAWBLOWER_STOP" />
        </sounds>
        <animationNodes>
            <animationNode node="tine01" rotSpeed="350" rotAxis="1" turnOnFadeTime="2" turnOffFadeTime="5" />
        </animationNodes>
    </turnOnVehicle>

    <ai>
        <areaMarkers leftNode="aiMarkerLeft" rightNode="aiMarkerRight" backNode="aiMarkerBack" />
        <collisionTrigger node="aiCollisionNode" width="3.0" height="2.4"/>
        <needsLowering value="true"/>
        <allowTurnBackward value="false"/>
        <turningRadiusLimitation rotationJointNode="attacherBarJoint" wheelIndices="1 2"/>
        <agentAttachment jointNode="attacherJoint" rotCenterWheelIndices="1 2" width="3.0" height="2.7" length="4.3" lengthOffset="1.4"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-1.4" maxX="1.4" minZ="-3.3" maxZ="0.6" yOffset="0.65" />
        <bendingNode minX="-0.25" maxX="0.25" minZ="0" maxZ="2.3" yOffset="0.9" />
    </foliageBending>

    <baseMaterial>
        <material name="krg_mat" baseNode="krg_vis">
            <shaderParameter name="colorMat0" value="FARMAX_RED1"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="6" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="krg_main_component1" node="0>" />
        <i3dMapping id="krg_vis" node="0>0" />
        <i3dMapping id="ptoInputNode" node="0>0|0|0" />
        <i3dMapping id="supportArm" node="0>0|0|1" />
        <i3dMapping id="drawbar" node="0>0|1|0" />
        <i3dMapping id="drawbarHydraulicRef" node="0>0|1|0|0" />
        <i3dMapping id="attacherBarJoint" node="0>0|1|0|2|0" />
        <i3dMapping id="attacherBar" node="0>0|1|0|3|0" />
        <i3dMapping id="drawbarHydraulic" node="0>0|1|1" />
        <i3dMapping id="drawbarHydraulicPunch" node="0>0|1|1|0" />
        <i3dMapping id="electricIn" node="0>0|1|1|1|0" />
        <i3dMapping id="hydraulicOut01" node="0>0|1|1|1|1" />
        <i3dMapping id="hydraulicIn01" node="0>0|1|1|1|2" />
        <i3dMapping id="electricIn01_detached" node="0>0|1|1|1|3" />
        <i3dMapping id="electric_detachedAdapter" node="0>0|1|1|1|3|0" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|1|1|1|4" />
        <i3dMapping id="hydraulicOut01_detachedAdapter" node="0>0|1|1|1|4|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|1|1|1|5" />
        <i3dMapping id="hydraulicIn01_detachedAdapter" node="0>0|1|1|1|5|0" />
        <i3dMapping id="axis" node="0>0|1|2" />
        <i3dMapping id="axisRotationRot" node="0>0|1|2|0" />
        <i3dMapping id="axisRotation" node="0>0|1|2|0|0" />
        <i3dMapping id="wheel_vis01" node="0>0|1|2|0|1" />
        <i3dMapping id="wheel_vis02" node="0>0|1|2|0|2" />
        <i3dMapping id="wheel_vis03" node="0>0|1|2|0|3" />
        <i3dMapping id="wheel_vis04" node="0>0|1|2|0|4" />
        <i3dMapping id="wheel01" node="0>0|1|2|1" />
        <i3dMapping id="wheel02" node="0>0|1|2|2" />
        <i3dMapping id="axisHydraulicRef" node="0>0|1|2|3" />
        <i3dMapping id="rearLight29_right" node="0>0|1|2|4|0|0" />
        <i3dMapping id="rearLight29_left" node="0>0|1|2|4|0|1" />
        <i3dMapping id="backlightsStatic" node="0>0|1|2|4|1|1" />
        <i3dMapping id="backLightsHigh1" node="0>0|1|2|4|2|0" />
        <i3dMapping id="turnLightLeftBack" node="0>0|1|2|4|3|0" />
        <i3dMapping id="turnLightRightBack" node="0>0|1|2|4|3|1" />
        <i3dMapping id="axisHydraulic" node="0>0|1|3" />
        <i3dMapping id="axisHydraulicPunch" node="0>0|1|3|0" />
        <i3dMapping id="tine01" node="0>0|1|4" />
        <i3dMapping id="workAreaStart" node="0>0|2|0" />
        <i3dMapping id="workAreaWidth" node="0>0|2|1" />
        <i3dMapping id="workAreaHeight" node="0>0|2|2" />
        <i3dMapping id="groundReferenceNode" node="0>0|2|3" />
        <i3dMapping id="depthNode" node="0>0|2|4" />
        <i3dMapping id="aiMarkerLeft" node="0>0|3|0" />
        <i3dMapping id="aiMarkerRight" node="0>0|3|1" />
        <i3dMapping id="aiMarkerBack" node="0>0|3|2" />
        <i3dMapping id="aiCollisionNode" node="0>0|3|3" />
        <i3dMapping id="tineEffect01LinkNode" node="0>0|4|0" />
        <i3dMapping id="dustEmitterShape" node="0>0|4|1" />
        <i3dMapping id="krg_attacher_component2" node="1>" />
        <i3dMapping id="attacherJoint" node="1>0" />
        <i3dMapping id="attacherBarRef" node="1>1" />
    </i3dMappings>
</vehicle>
