<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="implement_attacherJointControl" 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>EGV 65 AHK SG</name>
        <specs>
            <neededPower>60</neededPower>
        </specs>
        <functions>
            <function>$l10n_function_winch</function>
        </functions>
        <rotation>0</rotation>
        <image>$data/vehicles/tajfun/egv65AHK_SG/store_egv65AHK_SG.png</image>
        <price>8500</price>
        <lifetime>600</lifetime>
        <brand>TAJFUN</brand>
        <category>forestryWinches</category>
        <shopHeight>2.5</shopHeight>
        <shopTranslationOffset>0 0.026 0</shopTranslationOffset>
        <shopRotationOffset>-1.5 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>370432</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>99840</indexBufferMemoryUsage>
        <textureMemoryUsage>720896</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_winch</typeDesc>
        <filename>$data/vehicles/tajfun/egv65AHK_SG/egv65AHK_SG.i3d</filename>
        <size width="1.7" length="0.8" height="2.35"/>
        <components>
            <component centerOfMass="0 0.2 0.1" solverIterationCount="30" mass="540"/>
            <component centerOfMass="0 0 0" solverIterationCount="30" mass="100"/>
            <joint component1="1" component2="2" node="componentJointRotPart" rotLimit="0 0 0" transLimit="0 0 0"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT"/>
    </base>

    <powerConsumer ptoRpm="350" neededMinPtoPower="5" neededMaxPtoPower="40"/>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="implement" topReferenceNode="topReferenceNode" isControllable="true" lowerRotLimitScale="0 0 0" upperRotationOffset="15" lowerRotationOffset="-8" needsLowering="false">
                <distanceToGround lower="0.43" upper="0.8"/>
                <bottomArm widths="0.9 1.08" ballType="1"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport"/>
    </attachable>

    <attacherJointControl>
        <control controlFunction="controlAttacherJointHeight" controlAxis="AXIS_HYDRAULICATTACHER1" invertControlAxis="true" mouseSpeedFactor="0.2" iconName="IMPLEMENT_ATTACHER_TRANS"/>

        <sounds>
            <hydraulic template="hydraulicOpen02" linkNode="0>" volumeScale="2" fadeIn="0.1"/>
        </sounds>
    </attacherJointControl>

    <connectionHoses>
        <hose inputAttacherJointIndices="1" type="electric" node="electricOut" length="1.25" diameter="0.008" straighteningFactor="0.5" outgoingAdapter="DEFAULT" socket="electric"/>
    </connectionHoses>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="pto" detachNode="ptoDetachNode" aboveAttacher="true">
            <objectChange node="ptoHolder" rotationActive="0 0 0" rotationInactive="0 -160 0"/>
        </input>
    </powerTakeOffs>

    <winch>
        <rope node="ropeNode" triggerNode="ropeTrigger" maxTreeMass="12" maxNumTrees="8" minLength="0.25" maxLength="100" maxSubLength="6">
            <mainRope diameter="0.01" uvScale="4" />
            <setupRope diameter="0.01" uvScale="4" emissiveColor="0 2 0 1" />
            <componentJoint jointIndex="1" limitActive="0 60 0" limitInactive="0 0 0"/>
            <attach node="ropeNode">
                <marker filename="$data/shared/forestry/targetTreeMarker.i3d" width="0.1" offset="0.005" color="0 2 0"/>
            </attach>
            <treeHook filename="$data/shared/forestry/treeHook03.xml"/>
            <objectChange node="rope_attached" visibilityActive="true" visibilityInactive="false" />
            <objectChange node="rope_detached" visibilityActive="false" visibilityInactive="true" />

            <animationNodes>
                <animationNode class="ScrollingAnimation" node="rope_attached" shaderParameterName="offsetUV" shaderParameterComponent="2" scrollLength="1" scrollSpeed="2.5" turnOnFadeTime="0.1" turnOffFadeTime="0.1" speedFunc="getWinchRopeSpeedFactor" speedFuncParam="1"/>
                <animationNode node="pullRoll01" rotSpeed="-75" rotAxis="1" turnOnFadeTime="0.1" turnOffFadeTime="0.1" speedFunc="getWinchRopeSpeedFactor" speedFuncParam="1"/>
                <animationNode node="pullRoll02" rotSpeed="-75" rotAxis="1" turnOnFadeTime="0.1" turnOffFadeTime="0.1" speedFunc="getWinchRopeSpeedFactor" speedFuncParam="1"/>
            </animationNodes>

            <sounds>
                <releaseRope template="winchOut" fadeIn="0.1" fadeOut="0.1" supportsReverb="false">
                    <volume indoor="0.5" outdoor="0.8"/>
                    <lowpassGain indoor="0.6" outdoor="1"/>
                </releaseRope>
                <pullRope    template="winchIn"  fadeIn="0.1" fadeOut="0.1" supportsReverb="false">
                    <volume indoor="0.5" outdoor="0.8"/>
                    <lowpassGain indoor="0.6" outdoor="1"/>
                </pullRope>
                <attachTree template="treeAttach" supportsReverb="false">
                    <volume indoor="0.7" outdoor="1.4"/>
                </attachTree>
                <detachTree template="yarderRemove" supportsReverb="false">
                    <volume indoor="0.7" outdoor="1.4"/>
                </detachTree>
            </sounds>
        </rope>
    </winch>

    <animations>
        <animation name="moveSupport">
            <part node="supportArm" startTime="0" endTime="0.2" startTrans="0 -0.22 0" endTrans="0 0 0" />

            <sound template="metalClose" startTime="0.01" volumeScale="2" pitchScale="2" direction="-1"/>
            <sound template="slideOpen"  startTime="0.01" endTime="0.19" volumeScale="2" pitchScale="2" direction="1"/>
        </animation>
    </animations>

    <cylindered>
        <movingTools>
        </movingTools>

        <movingParts>
            <movingPart node="roll" referencePoint="rollRef" referenceFrame="rollRefFrame" limitedAxis="2" isActiveDirty="true" maxUpdateDistance="50"/>
        </movingParts>
    </cylindered>

    <handToolHolders>
        <handToolHolderConfigurations>
            <handToolHolderConfiguration>
                <handToolHolder>
                    <holder type="CHAINSAW" node="chainsawHolderNode" dummyFilename="$data/shared/visualization/dummyChainsaw.i3d" />
                    <trigger node="playerTrigger" />
                </handToolHolder>
            </handToolHolderConfiguration>
        </handToolHolderConfigurations>
    </handToolHolders>

    <ai>
        <agentAttachment useSize="true"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.83" maxX="0.88" minZ="-0.4" maxZ="0.3" yOffset="0.02"/>
    </foliageBending>

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

    <i3dMappings>
        <i3dMapping id="EGV65AHKSG_main_component1" node="0>" />
        <i3dMapping id="egv65AHK_SG_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0|0" />
        <i3dMapping id="topReferenceNode" node="0>0|0|1" />
        <i3dMapping id="supportArm" node="0>0|0|2|0|0" />
        <i3dMapping id="ptoHolder" node="0>0|0|3" />
        <i3dMapping id="pto" node="0>0|0|4" />
        <i3dMapping id="ptoDetachNode" node="0>0|0|5" />
        <i3dMapping id="electricOut" node="0>0|0|6" />
        <i3dMapping id="componentJointRotPart" node="0>0|1|0" />
        <i3dMapping id="rollRefFrame" node="0>0|1|1" />
        <i3dMapping id="roll" node="0>0|1|1|0" />
        <i3dMapping id="pullRoll02" node="0>0|1|1|0|1" />
        <i3dMapping id="ropeTrigger" node="0>0|1|2" />
        <i3dMapping id="rope_detached" node="0>0|1|3" />
        <i3dMapping id="rope_attached" node="0>0|1|4" />
        <i3dMapping id="pullRoll01" node="0>0|1|5" />
        <i3dMapping id="playerTrigger" node="0>0|3" />
        <i3dMapping id="chainsawHolderNode" node="0>0|4" />
        <i3dMapping id="rollRef" node="1>0" />
        <i3dMapping id="ropeNode" node="1>1" />
    </i3dMappings>
</vehicle>
