﻿<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="DLCBaleloader">
	<annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>
    <name>
        <en>Bale Loader</en>
		<de>Ballensammler</de>
    </name>
	<typeDesc>$l10n_TypeDesc_BaleLoader</typeDesc>
    <filename>data/vehicles/trailers/baleloader.i3d</filename>

    <size width="4.5" length="10" lengthOffset="1" />

    <wheels autoRotateBackSpeed="2.0">
        <wheel driveMode="0" repr="0" radius="0.38" deltaY="0.06" suspTravel="0.1" spring="75" damper="25" mass="0.3" lateralStiffness="6" />
        <wheel driveMode="0" repr="1" radius="0.38" deltaY="0.06" suspTravel="0.1" spring="75" damper="25" mass="0.3" lateralStiffness="6" />
    </wheels>
    <brakeForce>1</brakeForce>
    <capacity>50</capacity>

    <movingTools>
        <movingTool index="0>4" inputAttacherJoint="true" componentJointIndex="0" anchorActor="0" />

        <!-- support -->
        <movingTool index="0>2" componentJointIndex="1" anchorActor="0"/>

		<movingTool index="0>3|1" componentJointIndex="2" anchorActor="0"/>
		<movingTool index="0>3|0" componentJointIndex="3" anchorActor="0"/>
    </movingTools>

    <animations>
        <!-- move from transform to work position -->
        <animation name="baleGrabberTransportToWork">
            <part node="0>4" 	 startTime="0" endTime="2.5" startRot="0 -19 0" endRot="0 20 0"/>
			<part node="0>4|0" 	 startTime="0" endTime="2.5" startRot="0 109 0" endRot="0 70 0"/>
            <part node="0>3|2|0" startTime="2.5" endTime="3.5" startTrans="0 0 -0.602" endTrans="0 0 -0.189"/>
        </animation>

        <animation name="baleGrabberMoveToSlider">
			<part node="3|2|0|0" startTime="0.01" endTime="1"  startTrans="0.006 -0.034 1.838" endTrans="0.006 -0.102 1.543" startRot="90 140 90" endRot="90 90 90"/>
        </animation>

		<animation name="baleGrabberMoveToTop0">
			<part node="0>3|2|0|1|0" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|0" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|0" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		<animation name="baleGrabberMoveToTop1">
			<part node="0>3|2|0|1|1" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|1" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|1" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		<animation name="baleGrabberMoveToTop2">
			<part node="0>3|2|0|1|2" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|2" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|2" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		<animation name="baleGrabberMoveToTop3">
			<part node="0>3|2|0|1|3" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|3" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|3" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		<animation name="baleGrabberMoveToTop4">
			<part node="0>3|2|0|1|4" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|4" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|4" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		<animation name="baleGrabberMoveToTop5">
			<part node="0>3|2|0|1|5" startTime="0" endTime="3" startTrans="0.006 -0.102 1.543" endTrans="0.006 -0.11983 -1.516" />
			<part node="0>3|2|0|1|5" startTime="3" endTime="3.4" startRot="90 90 90" endRot="90 148 90" />
			<part node="0>3|2|0|1|5" startTime="3" endTime="3.4" startTrans="0.006 -0.11983 -1.516" endTrans="0.006 -0.44 -2.041" />
        </animation>
		
		<animation name="unloading">
            <part node="0>3|1" startTime="0" endTime="5" startRot="0 0 0" endRot="0 -130 0" />
			<part node="0>3|0" startTime="0.5" endTime="5.5" startRot="0 0 0" endRot="0 130 0" />
        </animation>
 
        <!-- move support wheel down/up -->
        <animation name="moveSupport">
            <part node="0>2" startTime="0" duration="0.6" startTrans="-0.93805 0.58998 3.46486" endTrans="-0.93805 0.32153 3.46486" />
			<part node="0>6" startTime="0" duration="0.6" startRot="0 720 0" endRot="0 0 0" />
        </animation>
    </animations>

    <baleGrabber grabNode="3|2|0|0" speedLimit="18" />
	<baleTrigger index="0>5" baleLock="0>" />

	<baleGrabSound file="data/vehicles/trailers/baleloader_grab.wav" pitchOffset="1" volume="1"/>
	<baleGrabParticleSystem disableDuration="1" node="0>3|2|0" position="0.007 0.08995 2.42171" rotation="0 0 0" file="data/vehicles/particleSystems/grabBaleParticleSystem.i3d" />
	<baleSlider sound="data/vehicles/trailers/baleloader_slider.wav" volume="1.5">
		<slider node="0>3|2|0|1|0" animation="baleGrabberMoveToTop0" />
		<slider node="0>3|2|0|1|1" animation="baleGrabberMoveToTop1" />
		<slider node="0>3|2|0|1|2" animation="baleGrabberMoveToTop2" />
		<slider node="0>3|2|0|1|3" animation="baleGrabberMoveToTop3" />
		<slider node="0>3|2|0|1|4" animation="baleGrabberMoveToTop4" />
		<slider node="0>3|2|0|1|5" animation="baleGrabberMoveToTop5" />
	</baleSlider>
    <balePlaces startBalePlace="0>3|2|0|1" >
    </balePlaces>
	<baleTypes>
        <baleType filename="data/vehicles/balers/haybaleBalerSmall.i3d" />
		<baleType filename="data/vehicles/balers/strawbaleBalerSmall.i3d" />
	</baleTypes>

    <support animationName="moveSupport" />

	<allowFillFromAir value="false" />
    <allowTipDischarge value="false" />

    <attacherJoint index="0>4|0" jointType="trailer" />

	<powerTakeoffInput index="0>3|4"/>

    <components count="5">
        <component1 centerOfMass="0 0.05 0.3" solverIterationCount="20" />
        <component2 centerOfMass="-0.628 -1.45 -4.01" solverIterationCount="20" />
		<component3 centerOfMass="1.1 0 0" solverIterationCount="20" />
		<component4 centerOfMass="-0.725 -1.97 2.687" solverIterationCount="20" />
		<component5 centerOfMass="0.69 -1.97 2.687" solverIterationCount="20" />
        <joint component1="0" component2="1" index="0>4|1" rotLimit="0 0 0" transLimit="0 0 0" />
		<joint component1="0" component2="2" index="0>2|0" rotLimit="0 0 0" transLimit="0 0 0" />
		<joint component1="0" component2="3" index="0>3|1" rotLimit="0 0 0" transLimit="0 0 0" />
		<joint component1="0" component2="4" index="0>3|0" rotLimit="0 0 0" transLimit="0 0 0" />
	</components>

	<schemaOverlay file="data/vehicles/schemas/implementSchema.png" fileSelected="data/vehicles/schemas/implementSchemaSelected.png" width="0.5" height="0.5" attacherJointPosition="0 0"/>
</vehicle>
