<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="dynamicMountAttacherShovel">
    <annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>

    <storeData>
        <name>$l10n_shopItem_frontloaderManureGrabFork</name>
        <specs>
            <combination>$l10n_PFN_0_9</combination>
        </specs>
        <image>stores/pfn_09_ToolManureGrabFork.png</image>
        <price>670</price>
        <lifetime>600</lifetime>
		<rotation>0</rotation>
        <brand>ROSTSELMASH</brand>
        <category>frontLoaders</category>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_frontloaderTool</typeDesc>
        <filename>tools/pfn_09_ToolManureGrabFork.i3d</filename>
        <size width="1.7" length="1.7 " lengthOffset="0.7"/>
        <supportsPickUp>false</supportsPickUp>
        <components>
            <component centerOfMass="0 0.15 0.3" solverIterationCount="10" mass="100"/>
            <component solverIterationCount="10" mass="90"/>
            <joint component1="1" component2="2" node="grabJoint" rotLimit="0 0 0" transLimit="0 0 0" rotLimitSpring="300 0 0" rotLimitDamping="30 0 0" rotLimitForceLimit="10 -1 -1"/>
        </components>
        <schemaOverlay attacherJointPosition="0 0">
            <default name="DEFAULT_IMPLEMENT"/>
            <selected name="DEFAULT_IMPLEMENT_SELECTED"/>
        </schemaOverlay>
    </base>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="attacherJoint" jointType="frontloader"/>
        </inputAttacherJoints>
    </attachable>

    <connectionHoses>
		<hose inputAttacherJointIndices="1" type="hydraulicIn"  node="hydraulic_In"  length="1.0" diameter="0.015" straighteningFactor="1.0"/>
		<hose inputAttacherJointIndices="1" type="hydraulicOut" node="hydraulic_Out" length="1.0" diameter="0.015" straighteningFactor="1.0"/>
	</connectionHoses>

    <fillUnit>
        <fillUnitConfigurations>
            <fillUnitConfiguration>
                <fillUnits>
                    <fillUnit unit="$l10n_unit_literShort" fillTypeCategories="fork" capacity="1000">
                        <exactFillRootNode node="exactFillRootNode"/>
                    </fillUnit>
                </fillUnits>
            </fillUnitConfiguration>
        </fillUnitConfigurations>
    </fillUnit>

    <fillVolume>
        <fillVolumeConfigurations>
            <fillVolumeConfiguration>
                <volumes>
                    <volume node="fillVolume" maxAllowedHeapAngle="5" fillUnitIndex="1"/>
                </volumes>
            </fillVolumeConfiguration>
        </fillVolumeConfigurations>

        <loadInfos>
            <loadInfo>
                <node node="fillVolumeLoadNode" width="1.0" length="0.2"/>
            </loadInfo>
        </loadInfos>

        <unloadInfos>
            <unloadInfo>
                <node node="fillVolumeUnloadNode" width="1.0" length="0.1"/>
            </unloadInfo>
        </unloadInfos>
    </fillVolume>

    <cylindered>
        <movingTools>
            <movingTool node="grabJoint" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL2" invertAxis="true" mouseSpeedFactor="0.3" iconName="TOOL_OPEN_CLOSE"/>
                <componentJoint index="1" anchorActor="0"/>
                <rotation rotSpeed="100" rotAcceleration="250" rotMax="0" rotMin="-70"/>
            </movingTool>
        </movingTools>

        <movingParts>
            <movingPart node="grab" referencePoint="grabRef" referenceFrame="grabRef" limitedAxis="1" isActiveDirty="true">
                <dependentPart node="hydraulic"/>
            </movingPart>
            <movingPart node="hydraulic" referencePoint="hydraulicRef" referenceFrame="hydraulicRef">
                <translatingPart node="hydraulicPunch"/>
            </movingPart>
        </movingParts>

        <sounds>
            <hydraulic template="DEFAULT_HYDRAULIC_SOUND" linkNode="pfn_09_ToolManureGrabFork_main_component1"/>
        </sounds>
    </cylindered>

    <dischargeable requiresTipOcclusionArea="false">
        <dischargeNode node="dischargeNode" fillUnitIndex="1" emptySpeed="1000">
            <raycast node="dischargeNode" maxDistance="30" useWorldNegYDirection="true" yOffset="2"/>
            <info width="1.0" length="0.2" zOffset="0.5"/>
            <movingToolActivation node="grabJoint" isInverted="true" openFactor="0.4"/>

            <effects>
                <effectNode effectClass="TipEffect">
                    <effectNode effectNode="emitterShape" effectClass="ParticleEffect" lifespan="0.3"/>
                    <effectNode effectNode="grainEffect" materialType="unloading" materialTypeId="3" fadeTime="0.5" alignXAxisToWorldY="true"/>
                </effectNode>
                <effectNode effectNode="smokeEffect" materialType="smoke" materialTypeId="1" fadeTime="0.5"/>
            </effects>
        </dischargeNode>
    </dischargeable>

    <shovel>
        <shovelNode node="pickUpNode" fillUnitIndex="1" loadInfoIndex="1" width="1.2" length="0.2" needsMovement="true" maxPickupAngle="105">
            <movingToolActivation node="grabJoint" isInverted="true" openFactor="0.4" />
        </shovelNode>
        <dischargeInfo node="dischargeNode" minSpeedAngle="105" maxSpeedAngle="180"/>
    </shovel>

    <dynamicMountAttacher node="pfn_09_ToolManureGrabFork_main_component1">
        <mountCollisionMask node="backColPart" collisionMask="134225920"/>
        <mountCollisionMask node="topColPart"  collisionMask="134225920"/>
        <grab openMountType="TYPE_FORK" closedMountType="TYPE_AUTO_ATTACH_XYZ">
            <movingToolActivation node="grabJoint" isInverted="true" openFactor="0.4"/>
        </grab>
    </dynamicMountAttacher>

    <baseMaterial>
        <material name="pfn_09_tools_mat" baseNode="pfn_09_GrabFork_vis">
            <shaderParameter name="colorMat0" value="0.3 0.02 0.02 1"/>
			<shaderParameter name="colorMat1" value="0.03 0.03 0.03 1"/>
        </material>
    </baseMaterial>

    <baseMaterialConfigurations price="200">
        <baseMaterialConfiguration name="$l10n_Red"    color="0.3 0.02 0.02 1"/>
		<baseMaterialConfiguration name="$l10n_Blue"   color="0.0 0.27 0.70 1"/>
		<baseMaterialConfiguration name="$l10n_Yellow" color="0.8 0.55 0.05 1"/>
        <material name="pfn_09_tools_mat" shaderParameter="colorMat0"/>
    </baseMaterialConfigurations>

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

    <i3dMappings>
	    <i3dMapping id="pfn_09_ToolManureGrabFork_main_component1" node="0>"/>
        <i3dMapping id="attacherJoint"        node="0>0"/>
        <i3dMapping id="pfn_09_GrabFork_vis"  node="0>1"/>
        <i3dMapping id="grabJoint"            node="0>1|0"/>
        <i3dMapping id="grab"                 node="0>1|1"/>
        <i3dMapping id="hydraulicRef"         node="0>1|1|0"/>
        <i3dMapping id="hydraulic"            node="0>1|2"/>
        <i3dMapping id="hydraulicPunch"       node="0>1|2|0"/>
		<i3dMapping id="hydraulic_In"         node="0>1|2|1"/>
	    <i3dMapping id="hydraulic_Out"        node="0>1|2|2"/>
        <i3dMapping id="dischargeNode"        node="0>1|3"/>
        <i3dMapping id="exactFillRootNode"    node="0>1|4"/>
        <i3dMapping id="fillVolume"           node="0>1|5|0"/>
        <i3dMapping id="fillVolumeLoadNode"   node="0>1|5|1"/>
        <i3dMapping id="fillVolumeUnloadNode" node="0>1|5|2"/>
        <i3dMapping id="emitterShape"         node="0>1|6"/>
        <i3dMapping id="grainEffect"          node="0>1|7|0"/>
        <i3dMapping id="smokeEffect"          node="0>1|7|1"/>
        <i3dMapping id="pickUpNode"           node="0>1|8"/>
        <i3dMapping id="backColPart"          node="0>3"/>
        <i3dMapping id="grabRef"              node="1>0"/>
        <i3dMapping id="topColPart"           node="1>2"/>
    </i3dMappings>
</vehicle>