﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="attachableCombineExtended" 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>LH II</name>
        <specs>
            <combination xmlFilename="$data/vehicles/kemper/plus345/plus345.xml"/>
            <combination filterCategory="weights" filterSpec="weight" filterSpecMin="2300" filterSpecMax="2500"/>
        </specs>
        <functions>
            <function>$l10n_function_combine</function>
        </functions>
        <storePacks>
            <storePack>STARTER_CHAFF</storePack>
        </storePacks>
        <rotation>0</rotation>
        <image>$data/vehicles/lacotec/lhII/store_lhII.png</image>
        <price>85000</price>
        <lifetime>600</lifetime>
        <brand>LACOTEC</brand>
        <category>forageHarvesterCutters</category>
        <shopHeight>5</shopHeight>
        <vertexBufferMemoryUsage>2016000</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>356864</indexBufferMemoryUsage>
        <textureMemoryUsage>2293760</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_harvester</typeDesc>
        <filename>$data/vehicles/lacotec/lhII/lhII.i3d</filename>
        <size width="3.5" length="6.4" height="6" lengthOffset="2.3" />
        <components>
            <component centerOfMass="0 0.2 0.2" solverIterationCount="10" mass="2900" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferenceNode" lowerRotLimitScale="0 0 0">
                <distanceToGround lower="0.6" upper="1"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport" />
    </attachable>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn01"  length="0.8" diameter="0.015">
            <objectChange node="hydraulicIn01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulicOut01" length="0.8" diameter="0.015">
            <objectChange node="hydraulicOut01_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulicIn02"  length="0.8" diameter="0.015">
            <objectChange node="hydraulicIn02_detached" visibilityActive="false" visibilityInactive="true"/>
        </hose>
        <hose inputAttacherJointIndices="1" type="electric" node="electric" adapterNode="electric_detached" length="0.8" diameter="0.008">
            <objectChange node="electric_detached" visibilityActive="false" visibilityInactive="true" />
        </hose>
    </connectionHoses>

    <attacherJoints>
        <attacherJoint jointType="cutterHarvester" node="attacherJointFront" jointPositionOffset="0 0 -0.713" lowerTransLimit="0 0 0" lowerRotLimit="5 0 10" lockDownRotLimit="true" moveTime="3" comboTime="0">
            <distanceToGround lower="1.19" upper="1.27" />
            <rotationNode node="attacherJointFrontRot" lowerRotation="0 0 0" upperRotation="-13 0 0" />
            <bottomArm rotationNode="feederHouse" referenceNode="attacherJointFront" />
            <schema position="1 0" rotation="0" invertX="false" />
        </attacherJoint>

        <sounds>
            <attach template="ATTACH_01" />
            <hydraulic template="defaultHydraulicSound" />
        </sounds>
    </attacherJoints>

    <powerTakeOffs>
        <input inputNode="pto" inputAttacherJointIndices="1" aboveAttacher="true"/>
    </powerTakeOffs>

    <powerConsumer ptoRpm="540" neededMaxPtoPower="0"/>

    <animations>
        <animation name="moveSupport">
            <part node="supportArm" startTime="0" endTime="0.2" startTrans="0 0.241 0" endTrans="0 0 0" />

            <sound template="metalClose"            startTime="0.01" direction="-1" volumeScale="0.7" pitchScale="2.8"/>
            <sound template="metalClose"            startTime="0.18" direction="1" volumeScale="0.7" pitchScale="2.8"/>
            <sound template="clackVar1"             startTime="0.1" direction="1"  volumeScale="1.3" pitchScale="1.8"/>
            <sound template="clackVar1"             startTime="0.18" direction="-1"  volumeScale="1.3" pitchScale="1.8"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
            <movingTool node="feederHouse">
                <dependentPart node="feederHydraulic" />
            </movingTool>
            <movingTool node="arm" playSound="true">
                <dependentPart node="armHydraulic" />
                <dependentPart node="pipeEnd02Arm" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="feederHydraulic" referencePoint="feederHydraulicRef" referenceFrame="feederHydraulicRef">
                <translatingPart node="feederHydraulicPunch" />
            </movingPart>
            <movingPart node="armHydraulic" referencePoint="armHydraulicRef" referenceFrame="armHydraulicRef">
              <translatingPart node="armHydraulicPunch" />
            </movingPart>
            <movingPart node="pipeEnd02Arm" referencePoint="pipeEnd02ArmRef" referenceFrame="pipeEnd02ArmRef" scaleZ="true"/>

            <movingPart node="pipeEnd01Hydraulic" referencePoint="pipeEnd01HydraulicRef" referenceFrame="pipeEnd01HydraulicRef" isActiveDirty="true" maxUpdateDistance="200">
              <translatingPart node="pipeEnd01HydraulicPunch" />
            </movingPart>
        </movingParts>

        <sounds>
            <hydraulic template="defaultHydraulicSound" pitchScale="0.5" volumeScale="1.7" fadeIn="0.1"/>
            <actionSound template="cylinderPunch" pitchScale="1.4" volumeScale="0.3" linkNode="armHydraulic" actionNames="TRANSLATING_END_NEG" nodes="armHydraulicPunch"/>
            <actionSound template="cylinderPunch" pitchScale="1.0" volumeScale="0.1" linkNode="armHydraulic" actionNames="TRANSLATING_END_POS" nodes="armHydraulicPunch"/>
            <actionSound template="clackVar1" pitchScale="1.4" volumeScale="1.0" linkNode="armHydraulic" actionNames="TRANSLATING_END_NEG" nodes="armHydraulicPunch"/>
            <actionSound template="clackVar4" pitchScale="0.3" volumeScale="1.1" linkNode="armHydraulic" actionNames="TRANSLATING_START_POS" nodes="armHydraulicPunch"/>
        </sounds>
    </cylindered>

    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration>
                <fillUnits>
                    <fillUnit unitTextOverride="$l10n_unit_literShort" showOnHud="false" showOnInfoHud="false" fillTypeCategories="forageHarvester"/>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <dischargeable requiresTipOcclusionArea="false" >
        <dischargeNode node="dischargeNode" emptySpeed="1000" fillUnitIndex="1" maxDistance="20" stopDischargeOnEmpty="false" effectTurnOffThreshold="0.5">
            <info width="0.4" length="0.4" useRaycastHitPosition="true"/>

            <effects>
                <effectNode                          effectNode="pipeEffect1"  delay="0"    materialType="unloading" fadeScale="0"/>
                <effectNode                          effectNode="pipeEffect2"  delay="0.1"  materialType="unloading" fadeScale="0"/>
                <effectNode effectClass="PipeEffect" effectNode="pipeEffect3"  delay="0.12" materialType="pipe"      maxBending="0.15" extraDistance="0.2" shapeScaleSpread="1.03 0.96 1 0"/>
            </effects>
            <dischargeSound template="dischargeForageHarvester" volumeScale="1.4" linkNode="attacherJointFront"/>
        </dischargeNode>
    </dischargeable>

    <pipe toggleableDischargeToGround="true">
        <unloadingTriggers>
            <unloadingTrigger node="trailerTrigger" />
        </unloadingTriggers>

        <pipeNodes>
            <pipeNode node="armRotBase" rotationSpeeds="0 35 0" autoAimYRotation="true" autoAimInvertZ="false" foldPriority="1">
                <state rotation="0 0 0" />
                <state rotation="0 0 0"/>
            </pipeNode>
            <pipeNode node="arm" rotationSpeeds="30 0 0">
                <state rotation="30 0 0"/>
                <state rotation="0 0 0"/>
            </pipeNode>
            <pipeNode node="pipeEnd01" rotationSpeeds="40 0 0" autoAimXRotation="true" subPipeNode="pipeEnd02" minRotationLimits="-49 - -" maxRotationLimits="0 - -" bendingRegulation="0.15" subPipeNodeRatio="0.5">
                <state rotation="-49 0 0"/>
                <state rotation="-35 0 0"/>
            </pipeNode>
            <pipeNode node="pipeEnd02" rotationSpeeds="80 0 0" autoAimXRotation="true" minRotationLimits="-49 - -" maxRotationLimits="-1 - -" bendingRegulation="0.15">
                <state rotation="-49 0 0"/>
                <state rotation="-35 0 0"/>
                <bendingRegulationNode node="dischargeNode" axis="1" direction="1"/>
            </pipeNode>
        </pipeNodes>
        <states num="2" unloading="2" autoAiming="2" turnOnAllowed="2"/>
    </pipe>

    <combine allowThreshingDuringRain="true">
        <buffer loadingDelay="0.75" unloadingDelay="2.5"/>

        <animationNodes>
            <animationNode node="roll01"  rotSpeed="700"   rotAxis="1" turnOnFadeTime="2" turnOffFadeTime="3"/>
            <animationNode node="roll02"  rotSpeed="-700"  rotAxis="1" turnOnFadeTime="2" turnOffFadeTime="3"/>
            <animationNode node="roll03"  rotSpeed="700"   rotAxis="1" turnOnFadeTime="2" turnOffFadeTime="3"/>
        </animationNodes>

        <sounds>
            <start template="MEX5_FORAGE_START" />
            <work template="MEX5_FORAGE_WORK" />
            <stop template="MEX5_FORAGE_STOP" />
        </sounds>
    </combine>

    <turnOnVehicle turnOffIfNotAllowed="true"/>

     <ai>
        <needsLowering value="true" lowerIfAnyIsLowered="true"/>
        <agentAttachment width="2.6" height="1.8" length="1.2" lengthOffset="-0.05"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-1.35" maxX="1.25" minZ="-0.55" maxZ="0.55" yOffset="0.3" />
    </foliageBending>

    <baseMaterial>
        <material name="lhII_mat" baseNode="lhII_vis">
            <shaderParameter name="colorMat0" value="LACOTEC_GREEN1"/>
        </material>
    </baseMaterial>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="2" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="lhII_main_component1" node="0>" />
        <i3dMapping id="lhII_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="pto" node="0>0|0|2" />
        <i3dMapping id="supportArm" node="0>0|0|3" />
        <i3dMapping id="hydraulicIn02_detached" node="0>0|0|4|0" />
        <i3dMapping id="hydraulicIn01_detached" node="0>0|0|4|1" />
        <i3dMapping id="hydraulicOut01_detached" node="0>0|0|4|2" />
        <i3dMapping id="hydraulicIn02" node="0>0|0|4|3" />
        <i3dMapping id="hydraulicIn01" node="0>0|0|4|4" />
        <i3dMapping id="hydraulicOut01" node="0>0|0|4|5" />
        <i3dMapping id="electric_detached" node="0>0|0|4|6" />
        <i3dMapping id="electric" node="0>0|0|4|7" />
        <i3dMapping id="attacherJointFrontRot" node="0>0|1|0|0|0" />
        <i3dMapping id="attacherJointFront" node="0>0|1|0|0|0|0" />
        <i3dMapping id="feederHouse" node="0>0|1|0|1|0" />
        <i3dMapping id="feederHydraulicRef" node="0>0|1|0|1|0|0" />
        <i3dMapping id="roll01" node="0>0|1|0|1|0|2" />
        <i3dMapping id="roll02" node="0>0|1|0|1|0|3" />
        <i3dMapping id="roll03" node="0>0|1|0|1|0|4" />
        <i3dMapping id="feederHydraulic" node="0>0|2|0" />
        <i3dMapping id="feederHydraulicPunch" node="0>0|2|0|0" />
        <i3dMapping id="armRotBase" node="0>0|2|1" />
        <i3dMapping id="arm" node="0>0|2|1|0" />
        <i3dMapping id="armHydraulic" node="0>0|2|1|0|0" />
        <i3dMapping id="armHydraulicPunch" node="0>0|2|1|0|0|0" />
        <i3dMapping id="pipeEnd01" node="0>0|2|1|0|1|0" />
        <i3dMapping id="pipeEnd02" node="0>0|2|1|0|1|0|0" />
        <i3dMapping id="dischargeNode" node="0>0|2|1|0|1|0|0|0" />
        <i3dMapping id="pipeEnd02ArmRef" node="0>0|2|1|0|1|0|0|1" />
        <i3dMapping id="pipeEffect3" node="0>0|2|1|0|1|0|0|2" />
        <i3dMapping id="pipeEnd01HydraulicRef" node="0>0|2|1|0|1|0|1" />
        <i3dMapping id="pipeEffect2" node="0>0|2|1|0|1|0|2" />
        <i3dMapping id="pipeEnd01Hydraulic" node="0>0|2|1|0|2" />
        <i3dMapping id="pipeEnd01HydraulicPunch" node="0>0|2|1|0|2|0" />
        <i3dMapping id="pipeEnd02Arm" node="0>0|2|1|0|3" />
        <i3dMapping id="pipeEffect1" node="0>0|2|1|0|7" />
        <i3dMapping id="armHydraulicRef" node="0>0|2|1|1" />
        <i3dMapping id="trailerTrigger" node="0>0|3|0" />
    </i3dMappings>
</vehicle>
