<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="tedder" 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>KH4S</name>
        <specs>
            <workingWidth>3.7</workingWidth>
            <neededPower>31</neededPower>
        </specs>
        <functions>
            <function>$l10n_function_tedder</function>
        </functions>
        <storePacks>
            <storePack>STARTER_HAY</storePack>
        </storePacks>
        <image>store_fahrKH4S.png</image>
        <price>2500</price>
        <lifetime>600</lifetime>
        <rotation>0</rotation>
        <brand>FAHR</brand>
        <category>tedders</category>
        <vertexBufferMemoryUsage>1848832</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>332544</indexBufferMemoryUsage>
        <textureMemoryUsage>1769472</textureMemoryUsage>
        <audioMemoryUsage>0</audioMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
    </storeData>

    <base>
        <typeDesc>$l10n_typeDesc_tedder</typeDesc>
        <filename>fahrKH4S.i3d</filename>
        <size width="3.2" length="2.2" lengthOffset="-0.05" />
        <speedLimit value="15" />
        <components>
            <component centerOfMass="0 0.6 -0.395" solverIterationCount="15" mass="260" />
        </components>
        <schemaOverlay attacherJointPosition="0 0" name="IMPLEMENT" />
        <mapHotspot type="TOOL" />
    </base>
	
	<wheels>
        <wheelConfigurations>
            <wheelConfiguration name="$l10n_configuration_valueDefault" price="0">
                <wheels>
                    <wheel  isLeft="false" hasTireTracks="true" hasParticles="true">
                        <physics rotMin="0" rotMax="0" tipOcclusionAreaGroupId="2" restLoad="0.1" repr="0>0|3|0" driveNode="0>0|3|0|0" forcePointRatio="0" initialCompression="20" suspTravel="0.03" spring="99" damper="99" frictionScale="0.2" rotationDamping="90" brakeFactor="0" versatileYRot="true" yOffset="0.01" radius="0.16" width="0.03"/>
                        <tire maxDeformation="0.01"/>
                    </wheel>
                    <wheel isLeft="true" hasTireTracks="true" hasParticles="true">
                        <physics rotMin="0" rotMax="0" tipOcclusionAreaGroupId="2" restLoad="0.1" repr="0>0|3|1" driveNode="0>0|3|1|0" forcePointRatio="0" initialCompression="20" suspTravel="0.03" spring="99" damper="99" frictionScale="0.2" rotationDamping="90" brakeFactor="0" versatileYRot="true" yOffset="0.01" radius="0.16" width="0.03"/>
                        <tire maxDeformation="0.01"/>
                    </wheel>
					<wheel isLeft="true" hasTireTracks="true" hasParticles="true">
                        <physics rotMin="0" rotMax="0" tipOcclusionAreaGroupId="2" restLoad="0.1" repr="0>0|4|3" driveNode="0>0|4|3|0" forcePointRatio="0" initialCompression="20" suspTravel="0.03" spring="99" damper="99" frictionScale="0.2" rotationDamping="90" brakeFactor="0" versatileYRot="true" yOffset="0.01" radius="0.16" width="0.03"/>
                        <tire maxDeformation="0.01"/>
                    </wheel>
					<wheel isLeft="true" hasTireTracks="true" hasParticles="true">
                        <physics rotMin="0" rotMax="0" tipOcclusionAreaGroupId="2" restLoad="0.1" repr="0>0|5|3" driveNode="0>0|5|3|0" forcePointRatio="0" initialCompression="20" suspTravel="0.03" spring="99" damper="99" frictionScale="0.2" rotationDamping="90" brakeFactor="0" versatileYRot="true" yOffset="0.01" radius="0.16" width="0.03"/>
                        <tire maxDeformation="0.01"/>
                    </wheel>
                </wheels>
            </wheelConfiguration>
        </wheelConfigurations>
    </wheels>

    <attachable>
        <inputAttacherJoints>
            <inputAttacherJoint node="0>0|0" jointType="implement" upperRotationOffset="20" lowerRotationOffset="0" lowerRotLimitScale="0 0 0" lowerTransLimitScale="0 1 0" topReferenceNode="0>0|2">
                <distanceToGround lower="0.3" upper="0.8"/>
            </inputAttacherJoint>
        </inputAttacherJoints>
        <support animationName="moveSupport" delayedOnLoad="true"/>
    </attachable>
	
	<speedRotatingParts>
        <speedRotatingPart node="0>0|3|0|0" radius="0.16" groundReferenceNodeIndex="1"/>
		<speedRotatingPart node="0>0|3|1|0" radius="0.16" groundReferenceNodeIndex="1"/>
		<speedRotatingPart node="0>0|4|3|0" radius="0.16" groundReferenceNodeIndex="1"/>
		<speedRotatingPart node="0>0|5|3|0" radius="0.16" groundReferenceNodeIndex="1"/>
    </speedRotatingParts>

    <powerTakeOffs>
        <input inputAttacherJointIndices="1" inputNode="0>0|13" aboveAttacher="true" detachNode="0>0|17"/>
    </powerTakeOffs>

    <powerConsumer ptoRpm="400" neededMinPtoPower="5" neededMaxPtoPower="10"/>

    <groundReferenceNodes>
        <groundReferenceNode node="0>0|12" threshold="0.2" />
    </groundReferenceNodes>

    <workAreas>
        <workArea type="tedder" functionName="processTedderArea" preprocessFunctionName="preprocessTedderArea" disableBackwards="true" >
            <area startNode="0>0|14|0" widthNode="0>0|14|1" heightNode="0>0|14|2" />
            <groundReferenceNode index="1" />
            <folding minLimit="0" maxLimit="0.1" />
            <tedder dropWindrowWorkAreaIndex="2"/>
            <onlyActiveWhenLowered value="true"/>
        </workArea>

        <workArea type="auxiliary" >
            <area startNode="0>0|14|3" widthNode="0>0|14|4" heightNode="0>0|14|5" />
        </workArea>
    </workAreas>

    <foldable>
        <foldingConfigurations>
            <foldingConfiguration>
                <foldingParts startMoveDirection="1" turnOnFoldMaxLimit="0.1" turnOnFoldMinLimit="0" detachingMaxLimit="1" detachingMinLimit="0.9">
                    <foldingPart animationName="folding" speedScale="0.8" />
                </foldingParts>
            </foldingConfiguration>
        </foldingConfigurations>
    </foldable>
	
	<cylindered>
        <movingTools>
            <movingTool node="0>0|4" wheelIndices="3"/>
            <movingTool node="0>0|5" wheelIndices="4"/>
        </movingTools>
    </cylindered>

    <animations>
        <animation name="folding">
            <part node="0>0|4"     startTime="0.00" endTime="1.5" startRot="0 0 0" endRot="0 86 0" />
			<part node="0>0|5"     startTime="1.5" endTime="3" startRot="0 0 0" endRot="0 -86 0" />
			<part node="0>0|10"       startTime="0.0" endTime="0.0" visibility="true" />
			<part node="0>0|10"       startTime="0.0001" endTime="3.0" visibility="false" />

            <sound template="clackVar4"             startTime="0.01"  direction="-1" volumeScale="2.1" pitchScale="0.6" />
            <sound template="sheetImp02"            startTime="0.01"  direction="-1" volumeScale="1.8" pitchScale="0.6" />
			<sound template="clackVar4"             startTime="3"  direction="1" volumeScale="2.1" pitchScale="0.6" />
            <sound template="sheetImp02"            startTime="3"  direction="1" volumeScale="1.8" pitchScale="0.6" />
			<sound template="clackVar4"             startTime="1.5"  direction="-1" volumeScale="2.1" pitchScale="0.6" />
            <sound template="sheetImp02"            startTime="1.5"  direction="-1" volumeScale="1.8" pitchScale="0.6" />
			<sound template="clackVar4"             startTime="1.5"  direction="1" volumeScale="2.1" pitchScale="0.6" />
            <sound template="sheetImp02"            startTime="1.5"  direction="1" volumeScale="1.8" pitchScale="0.6" />
            <sound template="metalClose"            startTime="0.2"  direction="-1" volumeScale="1.4" pitchScale="0.6" />
			<sound template="metalClose"            startTime="1.5"  direction="-1" volumeScale="1.4" pitchScale="0.6" />
            <sound template="clackVar6"             startTime="0.01" direction="-1" volumeScale="1"   pitchScale="0.8" />
            <sound template="sheetImp02"            startTime="0.01" direction="-1" volumeScale="1"   pitchScale="1.2" />
			<sound template="clackVar6"             startTime="0.01" direction="1" volumeScale="1"   pitchScale="0.8" />
            <sound template="sheetImp02"            startTime="0.01" direction="1" volumeScale="1"   pitchScale="1.2" />
            <sound template="sheetImp02"            startTime="0.01" direction="-1"  volumeScale="3"   pitchScale="0.7" />
            <sound template="clackVar4"             startTime="0.2"  direction="1"  volumeScale="1.4" pitchScale="0.6" />
            <sound template="clackVar6"             startTime="3"    direction="1"  volumeScale="1.3" pitchScale="0.8" />
            <sound template="sheetImp01"            startTime="3"    direction="1"  volumeScale="0.8" pitchScale="0.8" />
            <sound template="clackVar4"             startTime="2.8"  direction="1"  volumeScale="2.3" pitchScale="0.7" />
			<sound template="clackVar4"             startTime="0.1"  direction="-1"  volumeScale="2.3" pitchScale="0.7" />
        </animation>
    </animations>

    <tedder fillTypeConverter="TEDDER">
        <animationNodes>
            <animationNode node="0>0|4|0" rotAxis="2" rotSpeed="-900" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|6" rotAxis="2" rotSpeed="900" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|7" rotAxis="2" rotSpeed="-900" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|5|0" rotAxis="2" rotSpeed="900" turnOnFadeTime="1" turnOffFadeTime="3"/>
			
			<animationNode node="0>0|4|1" rotAxis="1" rotSpeed="1800" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|5|1" rotAxis="1" rotSpeed="1800" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|8" rotAxis="1" rotSpeed="1800" turnOnFadeTime="1" turnOffFadeTime="3"/>
            <animationNode node="0>0|9" rotAxis="1" rotSpeed="1800" turnOnFadeTime="1" turnOffFadeTime="3"/>
        </animationNodes>

        <effects>
            <effect workAreaIndex="1">
                <effectNode effectClass="TypedMotionPathEffect" effectType="TEDDER" linkNode="0>0|15|2">
                    <motionPathEffect textureFilename="$data/effects/tedder/arrays/sharedTedderArrayLeft.dds" numRows="4" rowLength="28" minFade="0.03"/>
                </effectNode>
                <effectNode effectClass="TypedMotionPathEffect" effectType="TEDDER" linkNode="0>0|15|1">
                    <motionPathEffect textureFilename="$data/effects/tedder/arrays/sharedTedderArrayRight.dds" numRows="4" rowLength="28" minFade="0.03"/>
                </effectNode>
                <effectNode effectClass="TypedMotionPathEffect" effectType="TEDDER" linkNode="0>0|15|4">
                    <motionPathEffect textureFilename="$data/effects/tedder/arrays/sharedTedderArrayLeft.dds" numRows="4" rowLength="28" minFade="0.03"/>
                </effectNode>
                <effectNode effectClass="TypedMotionPathEffect" effectType="TEDDER" linkNode="0>0|15|3">
                    <motionPathEffect textureFilename="$data/effects/tedder/arrays/sharedTedderArrayRight.dds" numRows="4" rowLength="28" minFade="0.03"/>
                </effectNode>
            </effect>
        </effects>
    </tedder>

    <turnOnVehicle turnOffIfNotAllowed="true">
        <sounds>
            <work template="DEFAULT_TEDDER"   linkNode="0>" fadeIn="0.1" fadeOut="2.5"/>
        </sounds>
    </turnOnVehicle>
	
	<designConfigurations>
        <designConfiguration name="$l10n_ui_no" price="0">
            <objectChange node="0>0|4|2" visibilityActive="false" visibilityInactive="true"/>		
			<objectChange node="0>0|5|2" visibilityActive="false" visibilityInactive="true"/>	
        </designConfiguration>
        <designConfiguration name="$l10n_ui_yes" price="100">
            <objectChange node="0>0|4|2" visibilityActive="true" visibilityInactive="false"/>
			<objectChange node="0>0|5|2" visibilityActive="true" visibilityInactive="false"/>
        </designConfiguration>	
    </designConfigurations>
	
	<baseMaterial>
		<material name="fahrKH4S_mat" baseNode="0>0|4">
            <shaderParameter name="colorMat4" value="0.035 0.033 0.031"/>
        </material>
    </baseMaterial>
	
	<designMaterialConfigurations price="0" useDefaultColors="false" defaultColorIndex="0">
		<designMaterialConfiguration name="$l10n_czerwony" material="6" price="0" color="0.42 0.05 0.02"/>
		<designMaterialConfiguration name="$l10n_bialy" material="6" price="50" color="0.5 0.45 0.4"/>
		<designMaterialConfiguration name="$l10n_czarny" material="6" price="50" color="0.04 0.04 0.04"/>
		<designMaterialConfiguration name="$l10n_galvanized" material="4" price="50" color="0.55 0.55 0.55"/>
		
		<material name="fahrKH4S_mat" shaderParameter="colorMat4" />
    </designMaterialConfigurations>

    <ai>
        <needsLowering value="true" />
        <areaMarkers leftNode="0>0|14|6" rightNode="0>0|14|7" backNode="0>0|14|8" />
        <collisionTrigger node="0>0|16" width="4.5" height="1.8"/>
        <agentAttachment width="2.5" height="2.0" length="1.8" lengthOffset="0"/>
    </ai>

    <foliageBending>
        <bendingNode minX="-0.8" maxX="0.8" minZ="-0.2" maxZ="0.2" yOffset="0.2" />
        <bendingNode minX="-1" maxX="-0.35" minZ="-0.2" maxZ="0.2" yOffset="-0.5" node="0>0|5" />
        <bendingNode minX="0.35" maxX="1" minZ="-0.2" maxZ="0.2" yOffset="-0.5" node="0>0|4" />
    </foliageBending>

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