﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="frontloader">
	<annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>
    <name>
        <en>Deutz Agrofarm</en>
        <de>Deutz Agrofarm</de>
    </name>
    <filename>data/vehicles/steerable/deutz/deutzAgrofarmFrontloader.i3d</filename>

	<size width="3.5" length="6.5"/>

    <wheels autoRotateBackSpeed="2">
        <wheel rotSpeed="70" rotMax="32" rotMin="-32" driveMode="2" repr="0" driveNode="0|0" radius="0.68" deltaY="0.1" suspTravel="0.2" spring="50" damper="40" mass="0.105" longitudalStiffness="0.9" lateralStiffness="2" />
        <wheel rotSpeed="70" rotMax="32" rotMin="-32" driveMode="2" repr="1" driveNode="1|0" radius="0.68" deltaY="0.1" suspTravel="0.2" spring="50" damper="40" mass="0.105" longitudalStiffness="0.9" lateralStiffness="2" />
        <wheel rotSpeed="0" driveMode="1" repr="2" radius="0.86" deltaY="0.05" suspTravel="0.1" spring="80" damper="40" mass="0.2" longitudalStiffness="0.9" lateralStiffness="2" />
        <wheel rotSpeed="0" driveMode="1" repr="3" radius="0.86" deltaY="0.05" suspTravel="0.1" spring="80" damper="40" mass="0.2" longitudalStiffness="0.9" lateralStiffness="2" />
    </wheels>
    <motor minRpm="100" maxRpm="670 1080 2300 495" maxTorques="-1 -1 -1 -1" brakeForce="3.5" lowBrakeForceScale="0.5" lowBrakeForceSpeedLimit="1" compensateWheelRadius="true" accelerations="1 1 1 1" forwardGearRatio="15.5" backwardGearRatio="17" differentialRatio="1" rpmFadeOutRange="50">
		<torque rpm="500" torque="0.5"/>
		<torque rpm="2300" torque="0.7"/>
		<backwardTorque rpm="100" torque="0.7"/>
		<backwardTorque rpm="600" torque="0.3"/>
		<backwardTorque rpm="720" torque="0"/>
    </motor>
	<accelerationSpeed maxAcceleration="0.25" deceleration="0.6" backwardDeceleration="0.7" />
    <fuelCapacity>160</fuelCapacity>
    <fuelUsage>0.0016</fuelUsage>
    <downForce>8</downForce>
	<bunkerSiloCompacter compactingScale="2"/>

	<components count="2">
        <component1 centerOfMass="0 0 -0.3" solverIterationCount="20" />
        <component2 centerOfMass="0 -2.5 -1.2" solverIterationCount="20" />
        <joint component1="0" component2="1" index="0>18|3" rotLimit="0 0 0" transLimit="0 0 0" />
    </components>

    <cameras count="2">
        <camera1 index="0>4|0" rotatable="true" rotateNode="4" limit="true" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="4" transMax="18" >
			<raycastNode index="0>23"/>
			<raycastNode index="0>24"/>
		</camera1>
        <camera2 index="0>5" rotatable="true" limit="true" rotMinX="-1.1" rotMaxX="0.4" transMin="0" transMax="0" />
    </cameras>

    <lights>
        <light realLight="0>26" fakeLight="0>20" decoration="0>21" lightType="0"/>
        <light realLight="0>27" decoration="0>28" lightType="1"/>
    </lights>

	<brakeLights>
		<brakeLight index="0>29" />
	</brakeLights>

	<beaconLights>
		<beaconLight index="0>22|0" speed="0.015" />
		<beaconLight index="0>22|1" speed="0.016" />
	</beaconLights>

    <characterNode index="0>30" cameraMinDistance="1.5" />
    <aiTrafficCollisionTrigger index="0>31" />
	<steering index="0>16|0" rotationSpeed="6"/>
    <enterReferenceNode index="0>" />
    <exitPoint index="0>25" />

    <exhaustParticleSystems count="1">
        <exhaustParticleSystem1 node="17" file="data/vehicles/particleSystems/exhaustParticleSystem.i3d" />
    </exhaustParticleSystems>

    <mouseControls>
        <mouseControl iconFilename="dataS2/menu/mouseControlsHelp/dafs_arm1.png" mouseButton="LEFT" mouseAxis="Y" axis="AXIS_FRONTLOADER_ARM" />
        <mouseControl iconFilename="dataS2/menu/mouseControlsHelp/dafs_tool.png" mouseButton="LEFT" mouseAxis="X" axis="AXIS_FRONTLOADER_TOOL" />
    </mouseControls>

    <movingTools>
        <movingTool index="18" attacherJointIndices="2" componentJointIndex="0" anchorActor="0" rotSpeed="45" rotAcceleration="280" rotMax="5" rotMin="-80" axis="AXIS_FRONTLOADER_ARM" invertAxis="true" invertMouseAxis="true" speedFactor="0.3">
            <dependentPart index="0>18|1" />
            <dependentMovingTool index="18|0|1" rotSpeedScale="-1"/>
        </movingTool>
        <movingTool index="18|0|1" attacherJointIndices="2" anchorActor="0" rotSpeed="70" rotAcceleration="300" rotMax="145" rotMin="5" axis="AXIS_FRONTLOADER_TOOL" invertAxis="false" invertMouseAxis="false" speedFactor="0.3" rotSpeed2="-45" rotAcceleration2="280" axis2="AXIS_FRONTLOADER_ARM" invertAxis2="true" invertMouseAxis2="true" speedFactor2="0.3">
            <dependentPart index="0>18|0|0" />
        </movingTool>
    </movingTools>

    <movingParts>
        <!-- arm cylinder -->
        <movingPart index="0>18|1" referencePoint="0>19|0" referenceFrame="0>19|0">
            <translatingPart index="0>18|1|0" />
        </movingPart>

        <!-- main hinge -->
        <movingPart index="0>18|0|0" referencePoint="0>18|0|1|1" localReferencePoint="0>18|0|0|0" referenceFrame="0>18|0|1|1">
            <dependentPart index="0>18|0|0|0" />
            <dependentPart index="0>18|2" />
        </movingPart>
        <!-- front top hinge -->
        <movingPart index="0>18|0|0|0" referencePoint="0>18|0|1|1" referenceFrame="0>18|0|1">
        </movingPart>

        <!-- tool cylinder -->
        <movingPart index="0>18|2" referencePoint="0>18|0|0|1" referenceFrame="0>18|0">
            <translatingPart index="0>18|2|0" />
        </movingPart>
    </movingParts>

    <trailerAttacherJoints>
        <trailerAttacherJoint index="0>6" maxRotLimit="10 80 80" ptoOutputNode="0>7" ptoFilename="data/vehicles/steerable/powerTakeoff.i3d"/>
        <trailerAttacherJoint index="0>8" low="true" ptoOutputNode="0>7" ptoFilename="data/vehicles/steerable/powerTakeoff.i3d"/>
    </trailerAttacherJoints>

    <attacherJoints>
        <attacherJoint index="10|0|0" rotationNode="10" minRot="4 0 0" minRot2="5 0 0" maxRot="-12 0 0" rotationNode2="10|0" maxRot2="13 0 0" maxTransLimit="0 0.5 0" maxRotLimit="0 0 20" moveTime="2" ptoOutputNode="0>7" ptoFilename="data/vehicles/steerable/powerTakeoff.i3d">
            <bottomArm rotationNode="11" translationNode="11|0" referenceNode="11|0|0" zScale="-1" />
            <topArm baseNode="0>12" filename="data/vehicles/steerable/upperLinkMedium.i3d" zScale="-1" />
        </attacherJoint>
        <attacherJoint index="13|0|0" rotationNode="13" minRot="-10 0 0" minRot2="0 0 0" maxRot="10 0 0" rotationNode2="13|0" maxRot2="-7 0 0" maxTransLimit="0 0.5 0" maxRotLimit="0 0 20" moveTime="2" ptoOutputNode="0>9" ptoFilename="data/vehicles/steerable/powerTakeoff.i3d">
            <bottomArm rotationNode="14" translationNode="14|0" referenceNode="14|0|0" zScale="1" />
            <topArm baseNode="0>15" filename="data/vehicles/steerable/upperLinkMedium.i3d" zScale="1" />
        </attacherJoint>

        <!-- frontloader -->
        <attacherJoint jointType="frontloader" index="18|0|1|0" allowsJointLimitMovement="false" allowsLowering="false" />
    </attacherJoints>

    <motorStartDuration>2500</motorStartDuration>
    <attachSound file="data/vehicles/steerable/deutz/attach.wav" pitchOffset="1" />
    <motorStartSound file="data/vehicles/steerable/deutz/agrotron_xl_start.wav" pitchOffset="1" volume="2" />
    <motorSound file="data/vehicles/steerable/deutz/agrotron_xl_idle.wav" pitchOffset="1" pitchScale="0.02" pitchMax="1.65" volume="2" radius="35" innerRadius="15" />
    <motorSoundRun file="data/vehicles/steerable/deutz/agrofarm_run.wav" pitchOffset="0.5" pitchScale="0.025" pitchMax="1.05" volume="0.65" />
    <motorStopSound file="data/vehicles/steerable/deutz/agrotron_xl_out.wav" pitchOffset="1" />
    <compressedAirSound file="data/vehicles/steerable/deutz/compressedAir.wav" pitchOffset="1" volume="1.0"/>
    <compressionSound file="data/vehicles/steerable/deutz/compressorWork.wav" pitchOffset="1" volume="1.5"/>
	<cylinderedHydraulicSound file="data/vehicles/steerable/deutz/hydraulicUp.wav" pitchOffset="0.8" volume="0.4" />

	<honkSound file="dataS2/sounds/horn.wav" volume="1" radius="80" innerRadius="35" />

	<schemaOverlay file="data/vehicles/schemas/vehicleSchema.png" fileSelected="data/vehicles/schemas/vehicleSchemaSelected.png" width="0.5" height="0.5" attacherJointPosition="0.5 0">
        <attacherJoint position="1 0" rotation="0" invertX="false" />
        <attacherJoint position="0 0" rotation="0" invertX="true" />
        <attacherJoint position="0 0.5" rotation="0" invertX="false" />
        <attacherJoint position="1 0" rotation="0" invertX="false" />
        <attacherJoint position="1 0" rotation="0" invertX="false" />
    </schemaOverlay>

</vehicle>
