﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="baleGrab" 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>$l10n_shopItem_telehandlerBaleGrab</name>
        <specs>
            <combination filterCategory="teleLoaderVehicles" />
        </specs>
        <functions>
            <function>$l10n_function_frontloaderBaleFork</function>
        </functions>
        <image>$data/vehicles/magsi/telehandlerBaleGrab/store_magsiTelehandlerBaleGrab.png</image>
        <price>1500</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>MAGSI</brand>
        <category>teleLoaderTools</category>
        <shopRotationOffset>0.006 0 0</shopRotationOffset>
        <vertexBufferMemoryUsage>116224</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>22016</indexBufferMemoryUsage>
        <textureMemoryUsage>720896</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_telehandlerTool</typeDesc>
        <filename>$data/vehicles/magsi/telehandlerBaleGrab/telehandlerBaleGrab.i3d</filename>
        <size width="2.5" length="2"/>
        <supportsPickUp>false</supportsPickUp>
        <components>
            <component centerOfMass="0 0.1 0" solverIterationCount="20" mass="200" />
            <component solverIterationCount="15" mass="50" />
            <component solverIterationCount="15" mass="50" />
            <joint component1="1" component2="2" node="leftGrabJoint" rotLimit="0 0 0" transLimit="0 0 0" rotLimitSpring="0 180 0" rotLimitDamping="0 10 0" rotLimitForceLimit="-1 10 -1" />
            <joint component1="1" component2="3" node="rightGrabJoint" rotLimit="0 0 0" transLimit="0 0 0" rotLimitSpring="0 180 0" rotLimitDamping="0 10 0" rotLimitForceLimit="-1 10 -1" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="telehandler" />
        </inputAttacherJoints>
    </attachable>

    <baleGrab triggerNode="dynamicMountTrigger" rootNode="0>" jointNode="dynamicMountTrigger" jointType="TYPE_AUTO_ATTACH_XYZ" forceAcceleration="90" grabRefComponentJointIndex1="0" grabRefComponentJointIndex2="1" rotDiffThreshold1="4" rotDiffThreshold2="-4" />

    <cylindered>
        <movingTools>
            <movingTool node="rightGrabJoint" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL2" invertAxis="true" mouseSpeedFactor="0.3" iconName="GRABBER_OPEN_CLOSE" />
                <rotation rotationAxis="2" rotSpeed="35" rotAcceleration="250" rotMax="0" rotMin="-45" />
                <componentJoint index="2" anchorActor="0" />
                <dependentMovingTool node="leftGrabJoint" speedScale="-1" />
            </movingTool>
            <movingTool node="leftGrabJoint" playSound="true">
                <rotation rotationAxis="2" rotSpeed="35" rotAcceleration="250" rotMax="45" rotMin="0" />
                <componentJoint index="1" anchorActor="0" />
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="leftGrabArm" referencePoint="leftGrabArmRef" referenceFrame="leftGrabArmRef" limitedAxis="2" isActiveDirty="true" maxUpdateDistance="50">
                <dependentPart node="hydraulicGrab" />
            </movingPart>
            <movingPart node="rightGrabArm" referencePoint="rightGrabArmRef" referenceFrame="rightGrabArmRef" limitedAxis="2" isActiveDirty="true" maxUpdateDistance="50">
                <dependentPart node="hydraulicGrab" />
            </movingPart>
            <movingPart node="hydraulicGrab" referencePoint="hydraulicGrabRef" referenceFrame="hydraulicGrabRef" >
                <translatingPart node="hydraulicGrabPunch" />
            </movingPart>
        </movingParts>

        <sounds>
            <actionSound template="defaultHydraulicSound" pitchScale="0.6" volumeScale="2"   linkNode="leftGrabJoint"  actionNames="TOOL_MOVE_POS TOOL_MOVE_NEG"     nodes="leftGrabJoint"/>
            <actionSound template="clackVar6"             pitchScale="0.9" volumeScale="1.4" linkNode="rightGrabJoint" actionNames="TOOL_MOVE_END_POS_LIMIT"         nodes="rightGrabJoint"/>
            <actionSound template="cylinderPunch"         pitchScale="2"   volumeScale="0.5" linkNode="rightGrabJoint" actionNames="TOOL_MOVE_END_POS_LIMIT"         nodes="rightGrabJoint"/>
            <actionSound template="clackVar6"             pitchScale="0.6" volumeScale="1.7" linkNode="rightGrabJoint" actionNames="TOOL_MOVE_END_NEG_LIMIT"         nodes="rightGrabJoint"/>
            <actionSound template="sheetImp02"            pitchScale="0.8" volumeScale="2"   linkNode="rightGrabJoint" actionNames="TOOL_MOVE_END_NEG_LIMIT"         nodes="rightGrabJoint"/>
        </sounds>
    </cylindered>

    <ai>
        <agentAttachment width="1.0" height="1.5" length="1.8" lengthOffset="0"/>
    </ai>

    <baseMaterial>
        <material name="telehandlerBaleGrab_mat" baseNode="telehandlerBaleGrab_vis">
            <shaderParameter name="colorMat0" value="MAGSI_BLACK1"/>
        </material>
    </baseMaterial>

    <foliageBending>
        <bendingNode minX="-0.45" maxX="0.45" minZ="-0.6" maxZ="-0.15" yOffset="0.02" />
    </foliageBending>

    <wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
    <washable dirtDuration="90" washDuration="1" workMultiplier="2" fieldMultiplier="2"/>

    <i3dMappings>
        <i3dMapping id="telehandlerBaleGrab_vis" node="0>0" />
        <i3dMapping id="attacherJoint" node="0>0|0" />
        <i3dMapping id="leftGrabArm" node="0>0|1" />
        <i3dMapping id="hydraulicGrab" node="0>0|1|0" />
        <i3dMapping id="hydraulicGrabPunch" node="0>0|1|0|0" />
        <i3dMapping id="rightGrabArm" node="0>0|2" />
        <i3dMapping id="hydraulicGrabRef" node="0>0|2|0" />
        <i3dMapping id="leftGrabJoint" node="0>0|3" />
        <i3dMapping id="rightGrabJoint" node="0>0|4" />
        <i3dMapping id="dynamicMountTrigger" node="0>0|5" />
        <i3dMapping id="leftGrabArmRef" node="1>0" />
        <i3dMapping id="rightGrabArmRef" node="2>0" />
    </i3dMappings>
</vehicle>
