package java.game.vehicles.BMW_635csi;

import java.game.*;
import java.game.parts.*;
import java.util.*;
import java.util.resource.*;

public class BMW_635csi_chassis extends Chassis
{
	public static Vector tuni;
	public Vector getTuningStageItems(){ return tuni; }

	static	Vector	decals;

	public Vector getDecals()
	{
		return decals;
	}

	public BMW_635csi_chassis ( int id )
	{
		super( id );

		if( !tuni )
		{
			tuni = new Vector();
			// body //
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 999,   vehicles.BMW_635csi:0x00000030r, vehicles.BMW_635csi:0x00000030r, vehicles.BMW_635csi:0x00000030r, vehicles.BMW_635csi:0x00000030r ) ); // "Steering wheel"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 1000,  vehicles.BMW_635csi:0x00000011r, vehicles.BMW_635csi:0x0000009Dr, vehicles.BMW_635csi:0x0000009Dr, vehicles.BMW_635csi:0x0000009Dr ) ); // "Front bumper"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 601,   vehicles.BMW_635csi:0x00000015r, vehicles.BMW_635csi:0x00000015r, vehicles.BMW_635csi:0x00000015r, vehicles.BMW_635csi:0x0000009Fr ) ); // "Hood"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 1002,  vehicles.BMW_635csi:0x0000000Dr, vehicles.BMW_635csi:0x0000000Dr, vehicles.BMW_635csi:0x0000000Dr, vehicles.BMW_635csi:0x0000000Dr ) ); // "Front left door"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 1003,  vehicles.BMW_635csi:0x0000001Br, vehicles.BMW_635csi:0x0000001Br, vehicles.BMW_635csi:0x0000001Br, vehicles.BMW_635csi:0x0000001Br ) ); // "Front right door"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 1001,  vehicles.BMW_635csi:0x00000018r, vehicles.BMW_635csi:0x0000009Er, vehicles.BMW_635csi:0x0000009Er, vehicles.BMW_635csi:0x0000009Er ) ); // "Rear bumper"
			tuni.addElement( new TuningStageItem( Tuning.TT_BODY, 1004,  0,                             0,                             vehicles.BMW_635csi:0x000000A0r, vehicles.BMW_635csi:0x000000A0r ) ); // "Rear wing"
			// tyres //
			tuni.addElement( new TuningStageItem( Tuning.TT_TYRE, 101,   vehicles.BMW_635csi:0x00000053r, /*   tarmac */
			                                                             vehicles.BMW_635csi:0x00000062r, /* off-road */
			                                                             vehicles.BMW_635csi:0x0000006Cr, /*     sand */
			                                                             vehicles.BMW_635csi:0x00000076r, /*   rubble */
			                                                             vehicles.BMW_635csi:0x00000080r  /*   winter */ ) );
			tuni.addElement( new TuningStageItem( Tuning.TT_TYRE, 102,   vehicles.BMW_635csi:0x00000053r, /*   tarmac */
			                                                             vehicles.BMW_635csi:0x00000062r, /* off-road */
			                                                             vehicles.BMW_635csi:0x0000006Cr, /*     sand */
			                                                             vehicles.BMW_635csi:0x00000076r, /*   rubble */
			                                                             vehicles.BMW_635csi:0x00000080r  /*   winter */ ) );
			tuni.addElement( new TuningStageItem( Tuning.TT_TYRE, 103,   vehicles.BMW_635csi:0x00000059r, /*   tarmac */
			                                                             vehicles.BMW_635csi:0x00000063r, /* off-road */
			                                                             vehicles.BMW_635csi:0x0000006Dr, /*     sand */
			                                                             vehicles.BMW_635csi:0x00000077r, /*   rubble */
			                                                             vehicles.BMW_635csi:0x00000081r  /*   winter */ ) );
			tuni.addElement( new TuningStageItem( Tuning.TT_TYRE, 104,   vehicles.BMW_635csi:0x00000059r, /*   tarmac */
			                                                             vehicles.BMW_635csi:0x00000063r, /* off-road */
			                                                             vehicles.BMW_635csi:0x0000006Dr, /*     sand */
			                                                             vehicles.BMW_635csi:0x00000077r, /*   rubble */
			                                                             vehicles.BMW_635csi:0x00000081r  /*   winter */ ) );
		}
		carCategory = PACKAGE;

// steering wheel //
		setSteerWheel(329.0*MM2METER/2.0 - 30.0*MM2METER, 10.0*MM2METER);
// end of steering wheel //

		if ( !decals )
		{
			decals = new Vector();
// decals //
			decals.addElement ( new PartDecal ( 10, PartDecal.DT_2DIGIT_B	, -0.05274,  0.74551,  0.02500,  0.00000,  0.00000,  0.05000 ) );
			decals.addElement ( new PartDecal ( 10, PartDecal.DT_2DIGIT_B	, -0.14747,  0.84141, -0.02500,  0.00000,  0.00000, -0.05000 ) );
			decals.addElement ( new PartDecal (  9, PartDecal.DT_2DIGIT_A	, -0.07774,  0.74551,  0.02500,  0.00000,  0.00000,  0.05000 ) );
			decals.addElement ( new PartDecal (  9, PartDecal.DT_2DIGIT_A	, -0.12247,  0.84141, -0.02500,  0.00000,  0.00000, -0.05000 ) );
			decals.addElement ( new PartDecal (  8, PartDecal.DT_1DIGIT	, -0.06524,  0.74551,  0.02500,  0.00000,  0.00000,  0.05000 ) );
			decals.addElement ( new PartDecal (  8, PartDecal.DT_1DIGIT	, -0.13497,  0.84141, -0.02500,  0.00000,  0.00000, -0.05000 ) );
			decals.addElement ( new PartDecal (  7, PartDecal.DT_DIGIT_PLATE, -0.10274,  0.72051,  0.10000,  0.00000,  0.00000,  0.10000 ) );
			decals.addElement ( new PartDecal (  7, PartDecal.DT_DIGIT_PLATE, -0.09747,  0.86641, -0.10000,  0.00000,  0.00000, -0.10000 ) );
// end of decals //
		}
	}

	int[] SPdReb = { 0, 0, 0, 0 };

	public void updateSuspension_UpdateSpringsAndWheels(float Custom0, float Custom1)
	{
		super.updateSuspension_UpdateSpringsAndWheels(Custom0, Custom1);

		WheelRef whl;

		float SPdamp_F = SPdamp[ WH_FRONT+TS_MIN ] + (SPdamp[ WH_FRONT+TS_MAX ]-SPdamp[ WH_FRONT+TS_MIN ])*Custom1;
		float SPdReb_F = SPdReb[ WH_FRONT+TS_MIN ] + (SPdReb[ WH_FRONT+TS_MAX ]-SPdReb[ WH_FRONT+TS_MIN ])*Custom1;
		float SPdamp_R = SPdamp[  WH_REAR+TS_MIN ] + (SPdamp[  WH_REAR+TS_MAX ]-SPdamp[  WH_REAR+TS_MIN ])*Custom1;
		float SPdReb_R = SPdReb[  WH_REAR+TS_MIN ] + (SPdReb[  WH_REAR+TS_MAX ]-SPdReb[  WH_REAR+TS_MIN ])*Custom1;

		whl = getWheel(0);	if (whl)	whl.setDamping( SPdamp_F, SPdReb_F );
		whl = getWheel(1);	if (whl)	whl.setDamping( SPdamp_F, SPdReb_F );
		whl = getWheel(2);	if (whl)	whl.setDamping( SPdamp_R, SPdReb_R );
		whl = getWheel(3);	if (whl)	whl.setDamping( SPdamp_R, SPdReb_R );
	}

// updateSuspension //
	public void updateSuspension(int Stage, float Custom0, float Custom1)
	{
		updateSuspension_RemoveAntiRollBars();

		switch (Stage)
		{
			case 3:  // 5 presets (0.00 0.25 0.50 0.75 1.00) adjustable //
				// --- front stuffs min->max --- //
				SPforc[ WH_FRONT+TS_MIN ] = 16220;	SPforc[ WH_FRONT+TS_MAX ] = SPforc[ WH_FRONT+TS_MIN ];
				SPdamp[ WH_FRONT+TS_MIN ] = 8786;	SPdamp[ WH_FRONT+TS_MAX ] = SPdamp[ WH_FRONT+TS_MIN ];
				SPdReb[ WH_FRONT+TS_MIN ] = 6758;	SPdReb[ WH_FRONT+TS_MAX ] = SPdReb[ WH_FRONT+TS_MIN ];
				SPrest[ WH_FRONT+TS_MIN ] = 35.0;	SPrest[ WH_FRONT+TS_MAX ] = SPrest[ WH_FRONT+TS_MIN ];
				SPminl[ WH_FRONT+TS_MIN ] = 24.5;	SPminl[ WH_FRONT+TS_MAX ] = SPminl[ WH_FRONT+TS_MIN ];
				SPmaxl[ WH_FRONT+TS_MIN ] = 33.5;	SPmaxl[ WH_FRONT+TS_MAX ] = SPmaxl[ WH_FRONT+TS_MIN ];

				RBforc[ WH_FRONT+TS_MIN ] = 2703;	RBforc[ WH_FRONT+TS_MAX ] = RBforc[ WH_FRONT+TS_MIN ];
				RBdamp[ WH_FRONT+TS_MIN ] = 54;	RBdamp[ WH_FRONT+TS_MAX ] = RBdamp[ WH_FRONT+TS_MIN ];

				WHcamb[ WH_FRONT+TS_MIN ] = 0.5;	WHcamb[ WH_FRONT+TS_MAX ] = WHcamb[ WH_FRONT+TS_MIN ];
				WHtoea[ WH_FRONT+TS_MIN ] = 0.2;	WHtoea[ WH_FRONT+TS_MAX ] = WHtoea[ WH_FRONT+TS_MIN ];
				WHtrak[ WH_FRONT+TS_MIN ] = 0.0;	WHtrak[ WH_FRONT+TS_MAX ] = WHtrak[ WH_FRONT+TS_MIN ];

				// --- rear stuffs min->max --- //
				SPforc[  WH_REAR+TS_MIN ] = 15772;	SPforc[  WH_REAR+TS_MAX ] = SPforc[  WH_REAR+TS_MIN ];
				SPdamp[  WH_REAR+TS_MIN ] = 8543;	SPdamp[  WH_REAR+TS_MAX ] = SPdamp[  WH_REAR+TS_MIN ];
				SPdReb[  WH_REAR+TS_MIN ] = 6572;	SPdReb[  WH_REAR+TS_MAX ] = SPdReb[  WH_REAR+TS_MIN ];
				SPrest[  WH_REAR+TS_MIN ] = 35.0;	SPrest[  WH_REAR+TS_MAX ] = SPrest[  WH_REAR+TS_MIN ];
				SPminl[  WH_REAR+TS_MIN ] = 24.5;	SPminl[  WH_REAR+TS_MAX ] = SPminl[  WH_REAR+TS_MIN ];
				SPmaxl[  WH_REAR+TS_MIN ] = 33.5;	SPmaxl[  WH_REAR+TS_MAX ] = SPmaxl[  WH_REAR+TS_MIN ];

				RBforc[  WH_REAR+TS_MIN ] = 2629;	RBforc[  WH_REAR+TS_MAX ] = RBforc[  WH_REAR+TS_MIN ];
				RBdamp[  WH_REAR+TS_MIN ] = 53;	RBdamp[  WH_REAR+TS_MAX ] = RBdamp[  WH_REAR+TS_MIN ];

				WHcamb[  WH_REAR+TS_MIN ] = 0.5;	WHcamb[  WH_REAR+TS_MAX ] = WHcamb[  WH_REAR+TS_MIN ];
				WHtoea[  WH_REAR+TS_MIN ] = 0.2;	WHtoea[  WH_REAR+TS_MAX ] = WHtoea[  WH_REAR+TS_MIN ];
				WHtrak[  WH_REAR+TS_MIN ] = 0.0;	WHtrak[  WH_REAR+TS_MAX ] = WHtrak[  WH_REAR+TS_MIN ];
				break;
			case 2:  // 5 presets (0.00 0.25 0.50 0.75 1.00) unadjustable //
				// --- front stuffs min->max --- //
				SPforc[ WH_FRONT+TS_MIN ] = 16220;	SPforc[ WH_FRONT+TS_MAX ] = SPforc[ WH_FRONT+TS_MIN ];
				SPdamp[ WH_FRONT+TS_MIN ] = 8786;	SPdamp[ WH_FRONT+TS_MAX ] = SPdamp[ WH_FRONT+TS_MIN ];
				SPdReb[ WH_FRONT+TS_MIN ] = 6758;	SPdReb[ WH_FRONT+TS_MAX ] = SPdReb[ WH_FRONT+TS_MIN ];
				SPrest[ WH_FRONT+TS_MIN ] = 33.0;	SPrest[ WH_FRONT+TS_MAX ] = SPrest[ WH_FRONT+TS_MIN ];
				SPminl[ WH_FRONT+TS_MIN ] = 24.5;	SPminl[ WH_FRONT+TS_MAX ] = SPminl[ WH_FRONT+TS_MIN ];
				SPmaxl[ WH_FRONT+TS_MIN ] = 31.5;	SPmaxl[ WH_FRONT+TS_MAX ] = SPmaxl[ WH_FRONT+TS_MIN ];

				RBforc[ WH_FRONT+TS_MIN ] = 2703;	RBforc[ WH_FRONT+TS_MAX ] = RBforc[ WH_FRONT+TS_MIN ];
				RBdamp[ WH_FRONT+TS_MIN ] = 54;	RBdamp[ WH_FRONT+TS_MAX ] = RBdamp[ WH_FRONT+TS_MIN ];

				WHcamb[ WH_FRONT+TS_MIN ] = 0.2;	WHcamb[ WH_FRONT+TS_MAX ] = WHcamb[ WH_FRONT+TS_MIN ];
				WHtoea[ WH_FRONT+TS_MIN ] = 0.4;	WHtoea[ WH_FRONT+TS_MAX ] = WHtoea[ WH_FRONT+TS_MIN ];
				WHtrak[ WH_FRONT+TS_MIN ] = 0.0;	WHtrak[ WH_FRONT+TS_MAX ] = WHtrak[ WH_FRONT+TS_MIN ];

				// --- rear stuffs min->max --- //
				SPforc[  WH_REAR+TS_MIN ] = 15772;	SPforc[  WH_REAR+TS_MAX ] = SPforc[  WH_REAR+TS_MIN ];
				SPdamp[  WH_REAR+TS_MIN ] = 8543;	SPdamp[  WH_REAR+TS_MAX ] = SPdamp[  WH_REAR+TS_MIN ];
				SPdReb[  WH_REAR+TS_MIN ] = 6572;	SPdReb[  WH_REAR+TS_MAX ] = SPdReb[  WH_REAR+TS_MIN ];
				SPrest[  WH_REAR+TS_MIN ] = 33.0;	SPrest[  WH_REAR+TS_MAX ] = SPrest[  WH_REAR+TS_MIN ];
				SPminl[  WH_REAR+TS_MIN ] = 24.5;	SPminl[  WH_REAR+TS_MAX ] = SPminl[  WH_REAR+TS_MIN ];
				SPmaxl[  WH_REAR+TS_MIN ] = 31.5;	SPmaxl[  WH_REAR+TS_MAX ] = SPmaxl[  WH_REAR+TS_MIN ];

				RBforc[  WH_REAR+TS_MIN ] = 2629;	RBforc[  WH_REAR+TS_MAX ] = RBforc[  WH_REAR+TS_MIN ];
				RBdamp[  WH_REAR+TS_MIN ] = 53;	RBdamp[  WH_REAR+TS_MAX ] = RBdamp[  WH_REAR+TS_MIN ];

				WHcamb[  WH_REAR+TS_MIN ] = 0.2;	WHcamb[  WH_REAR+TS_MAX ] = WHcamb[  WH_REAR+TS_MIN ];
				WHtoea[  WH_REAR+TS_MIN ] = 0.4;	WHtoea[  WH_REAR+TS_MAX ] = WHtoea[  WH_REAR+TS_MIN ];
				WHtrak[  WH_REAR+TS_MIN ] = 0.0;	WHtrak[  WH_REAR+TS_MAX ] = WHtrak[  WH_REAR+TS_MIN ];
				break;
			case 1:  // 3 presets (0.00      0.50      1.00) unadjustable //
				// --- front stuffs min->max --- //
				SPforc[ WH_FRONT+TS_MIN ] = 16220;	SPforc[ WH_FRONT+TS_MAX ] = SPforc[ WH_FRONT+TS_MIN ];
				SPdamp[ WH_FRONT+TS_MIN ] = 9462;	SPdamp[ WH_FRONT+TS_MAX ] = SPdamp[ WH_FRONT+TS_MIN ];
				SPdReb[ WH_FRONT+TS_MIN ] = 6758;	SPdReb[ WH_FRONT+TS_MAX ] = SPdReb[ WH_FRONT+TS_MIN ];
				SPrest[ WH_FRONT+TS_MIN ] = 31.5;	SPrest[ WH_FRONT+TS_MAX ] = SPrest[ WH_FRONT+TS_MIN ];
				SPminl[ WH_FRONT+TS_MIN ] = 23.5;	SPminl[ WH_FRONT+TS_MAX ] = SPminl[ WH_FRONT+TS_MIN ];
				SPmaxl[ WH_FRONT+TS_MIN ] = 29.5;	SPmaxl[ WH_FRONT+TS_MAX ] = SPmaxl[ WH_FRONT+TS_MIN ];

				RBforc[ WH_FRONT+TS_MIN ] = 2703;	RBforc[ WH_FRONT+TS_MAX ] = RBforc[ WH_FRONT+TS_MIN ];
				RBdamp[ WH_FRONT+TS_MIN ] = 54;	RBdamp[ WH_FRONT+TS_MAX ] = RBdamp[ WH_FRONT+TS_MIN ];

				WHcamb[ WH_FRONT+TS_MIN ] = 0.0;	WHcamb[ WH_FRONT+TS_MAX ] = WHcamb[ WH_FRONT+TS_MIN ];
				WHtoea[ WH_FRONT+TS_MIN ] = 0.0;	WHtoea[ WH_FRONT+TS_MAX ] = WHtoea[ WH_FRONT+TS_MIN ];
				WHtrak[ WH_FRONT+TS_MIN ] = 0.0;	WHtrak[ WH_FRONT+TS_MAX ] = WHtrak[ WH_FRONT+TS_MIN ];

				// --- rear stuffs min->max --- //
				SPforc[  WH_REAR+TS_MIN ] = 15772;	SPforc[  WH_REAR+TS_MAX ] = SPforc[  WH_REAR+TS_MIN ];
				SPdamp[  WH_REAR+TS_MIN ] = 9200;	SPdamp[  WH_REAR+TS_MAX ] = SPdamp[  WH_REAR+TS_MIN ];
				SPdReb[  WH_REAR+TS_MIN ] = 6572;	SPdReb[  WH_REAR+TS_MAX ] = SPdReb[  WH_REAR+TS_MIN ];
				SPrest[  WH_REAR+TS_MIN ] = 31.5;	SPrest[  WH_REAR+TS_MAX ] = SPrest[  WH_REAR+TS_MIN ];
				SPminl[  WH_REAR+TS_MIN ] = 23.5;	SPminl[  WH_REAR+TS_MAX ] = SPminl[  WH_REAR+TS_MIN ];
				SPmaxl[  WH_REAR+TS_MIN ] = 29.5;	SPmaxl[  WH_REAR+TS_MAX ] = SPmaxl[  WH_REAR+TS_MIN ];

				RBforc[  WH_REAR+TS_MIN ] = 2629;	RBforc[  WH_REAR+TS_MAX ] = RBforc[  WH_REAR+TS_MIN ];
				RBdamp[  WH_REAR+TS_MIN ] = 53;	RBdamp[  WH_REAR+TS_MAX ] = RBdamp[  WH_REAR+TS_MIN ];

				WHcamb[  WH_REAR+TS_MIN ] = 0.0;	WHcamb[  WH_REAR+TS_MAX ] = WHcamb[  WH_REAR+TS_MIN ];
				WHtoea[  WH_REAR+TS_MIN ] = 0.0;	WHtoea[  WH_REAR+TS_MAX ] = WHtoea[  WH_REAR+TS_MIN ];
				WHtrak[  WH_REAR+TS_MIN ] = 0.0;	WHtrak[  WH_REAR+TS_MAX ] = WHtrak[  WH_REAR+TS_MIN ];
				break;
			default: // unadjustable //
				// --- front stuffs min->max --- //
				SPforc[ WH_FRONT+TS_MIN ] = 17572;	SPforc[ WH_FRONT+TS_MAX ] = SPforc[ WH_FRONT+TS_MIN ];
				SPdamp[ WH_FRONT+TS_MIN ] = 8110;	SPdamp[ WH_FRONT+TS_MAX ] = SPdamp[ WH_FRONT+TS_MIN ];
				SPdReb[ WH_FRONT+TS_MIN ] = 6758;	SPdReb[ WH_FRONT+TS_MAX ] = SPdReb[ WH_FRONT+TS_MIN ];
				SPrest[ WH_FRONT+TS_MIN ] = 30.0;	SPrest[ WH_FRONT+TS_MAX ] = SPrest[ WH_FRONT+TS_MIN ];
				SPminl[ WH_FRONT+TS_MIN ] = 21.5;	SPminl[ WH_FRONT+TS_MAX ] = SPminl[ WH_FRONT+TS_MIN ];
				SPmaxl[ WH_FRONT+TS_MIN ] = 27.5;	SPmaxl[ WH_FRONT+TS_MAX ] = SPmaxl[ WH_FRONT+TS_MIN ];

				RBforc[ WH_FRONT+TS_MIN ] = 4055;	RBforc[ WH_FRONT+TS_MAX ] = RBforc[ WH_FRONT+TS_MIN ];
				RBdamp[ WH_FRONT+TS_MIN ] = 81;	RBdamp[ WH_FRONT+TS_MAX ] = RBdamp[ WH_FRONT+TS_MIN ];

				WHcamb[ WH_FRONT+TS_MIN ] = 0.0;	WHcamb[ WH_FRONT+TS_MAX ] = WHcamb[ WH_FRONT+TS_MIN ];
				WHtoea[ WH_FRONT+TS_MIN ] = 0.0;	WHtoea[ WH_FRONT+TS_MAX ] = WHtoea[ WH_FRONT+TS_MIN ];
				WHtrak[ WH_FRONT+TS_MIN ] = 0.0;	WHtrak[ WH_FRONT+TS_MAX ] = WHtrak[ WH_FRONT+TS_MIN ];

				// --- rear stuffs min->max --- //
				SPforc[  WH_REAR+TS_MIN ] = 17086;	SPforc[  WH_REAR+TS_MAX ] = SPforc[  WH_REAR+TS_MIN ];
				SPdamp[  WH_REAR+TS_MIN ] = 7886;	SPdamp[  WH_REAR+TS_MAX ] = SPdamp[  WH_REAR+TS_MIN ];
				SPdReb[  WH_REAR+TS_MIN ] = 6572;	SPdReb[  WH_REAR+TS_MAX ] = SPdReb[  WH_REAR+TS_MIN ];
				SPrest[  WH_REAR+TS_MIN ] = 30.0;	SPrest[  WH_REAR+TS_MAX ] = SPrest[  WH_REAR+TS_MIN ];
				SPminl[  WH_REAR+TS_MIN ] = 21.5;	SPminl[  WH_REAR+TS_MAX ] = SPminl[  WH_REAR+TS_MIN ];
				SPmaxl[  WH_REAR+TS_MIN ] = 27.5;	SPmaxl[  WH_REAR+TS_MAX ] = SPmaxl[  WH_REAR+TS_MIN ];

				RBforc[  WH_REAR+TS_MIN ] = 3943;	RBforc[  WH_REAR+TS_MAX ] = RBforc[  WH_REAR+TS_MIN ];
				RBdamp[  WH_REAR+TS_MIN ] = 79;	RBdamp[  WH_REAR+TS_MAX ] = RBdamp[  WH_REAR+TS_MIN ];

				WHcamb[  WH_REAR+TS_MIN ] = 0.0;	WHcamb[  WH_REAR+TS_MAX ] = WHcamb[  WH_REAR+TS_MIN ];
				WHtoea[  WH_REAR+TS_MIN ] = 0.0;	WHtoea[  WH_REAR+TS_MAX ] = WHtoea[  WH_REAR+TS_MIN ];
				WHtrak[  WH_REAR+TS_MIN ] = 0.0;	WHtrak[  WH_REAR+TS_MAX ] = WHtrak[  WH_REAR+TS_MIN ];
				break;
		}

		updateSuspension_UpdateSpringsAndWheels( Custom0, Custom1 );
		updateSuspension_AddAntiRollBars( Custom0, Custom1 );
	}
// end of updateSuspension //

// updateBrake //
	public void updateBrake(int Stage, float Custom0, float Custom1)
	{
		switch (Stage)
		{
			case 3:  // 5 presets (0.00 0.25 0.50 0.75 1.00) adjustable //
				DTbrak_F[TS_MIN] = 1550;	DTbrak_F[TS_MAX] = DTbrak_F[TS_MIN];
				DTbrak_R[TS_MIN] = 2050;	DTbrak_R[TS_MAX] = DTbrak_R[TS_MIN];
				DTbrak_Em = 0;
				break;
			case 2:  // 5 presets (0.00 0.25 0.50 0.75 1.00) unadjustable //
				DTbrak_F[TS_MIN] = 1400;	DTbrak_F[TS_MAX] = DTbrak_F[TS_MIN];
				DTbrak_R[TS_MIN] = 1900;	DTbrak_R[TS_MAX] = DTbrak_R[TS_MIN];
				DTbrak_Em = 2100;
				break;
			case 1:  // 3 presets (0.00      0.50      1.00) unadjustable //
				DTbrak_F[TS_MIN] = 1300;	DTbrak_F[TS_MAX] = DTbrak_F[TS_MIN];
				DTbrak_R[TS_MIN] = 1700;	DTbrak_R[TS_MAX] = DTbrak_R[TS_MIN];
				DTbrak_Em = 2000;
				break;
			default: // unadjustable //
				DTbrak_F[TS_MIN] = 1200;	DTbrak_F[TS_MAX] = DTbrak_F[TS_MIN];
				DTbrak_R[TS_MIN] = 1600;	DTbrak_R[TS_MAX] = DTbrak_R[TS_MIN];
				DTbrak_Em = 1900;
				break;
		}

		super.updateBrake( Stage, Custom0, Custom1 );
	}
// end of updateBrake //

// updateTransmission //
	public void updateTransmission(int Stage, float Custom0, float Custom1)
	{
		switch (Stage)
		{
			case 3:  // 3 presets (0.00      0.50      1.00) adjustable //
				gears = 6;
				DTgear[TS_MIN*8+0] =  0.00;	DTgear[TS_MAX*8+0] =  0.00;
				DTgear[TS_MIN*8+1] =  4.12;	DTgear[TS_MAX*8+1] =  3.65;
				DTgear[TS_MIN*8+2] =  2.24;	DTgear[TS_MAX*8+2] =  1.92;
				DTgear[TS_MIN*8+3] =  1.55;	DTgear[TS_MAX*8+3] =  1.25;
				DTgear[TS_MIN*8+4] =  1.13;	DTgear[TS_MAX*8+4] =  0.97;
				DTgear[TS_MIN*8+5] =  0.84;	DTgear[TS_MAX*8+5] =  0.80;
				DTgear[TS_MIN*8+6] =  0.68;	DTgear[TS_MAX*8+6] =  0.68;
				DTgear[TS_MIN*8+7] = -4.30;	DTgear[TS_MAX*8+7] = -3.60;
				DTendr[TS_MIN]     =  4.72;	DTendr[TS_MAX] =  4.36;
				setTransmissionTimes(0,0.100, 0.200, 1.000, 0.075, 0.200, 1.000);
				break;
			case 2:  // 3 presets (0.00      0.50      1.00) unadjustable //
				gears = 6;
				DTgear[TS_MIN*8+0] =  0.00;	DTgear[TS_MAX*8+0] =  0.00;
				DTgear[TS_MIN*8+1] =  4.45;	DTgear[TS_MAX*8+1] =  4.45;
				DTgear[TS_MIN*8+2] =  2.48;	DTgear[TS_MAX*8+2] =  2.48;
				DTgear[TS_MIN*8+3] =  1.78;	DTgear[TS_MAX*8+3] =  1.78;
				DTgear[TS_MIN*8+4] =  1.33;	DTgear[TS_MAX*8+4] =  1.33;
				DTgear[TS_MIN*8+5] =  1.05;	DTgear[TS_MAX*8+5] =  1.05;
				DTgear[TS_MIN*8+6] =  0.85;	DTgear[TS_MAX*8+6] =  0.85;
				DTgear[TS_MIN*8+7] = -3.60;	DTgear[TS_MAX*8+7] = -3.60;
				DTendr[TS_MIN]     =  3.70;	DTendr[TS_MAX] =  3.23;
				setTransmissionTimes(0,0.349, 0.200, 1.000, 0.262, 0.200, 1.000);
				break;
			case 1:  // 2 presets (0.00                1.00) unadjustable //
				gears = 5;
				DTgear[TS_MIN*8+0] =  0.00;	DTgear[TS_MAX*8+0] =  0.00;
				DTgear[TS_MIN*8+1] =  4.45;	DTgear[TS_MAX*8+1] =  4.45;
				DTgear[TS_MIN*8+2] =  2.48;	DTgear[TS_MAX*8+2] =  2.48;
				DTgear[TS_MIN*8+3] =  1.78;	DTgear[TS_MAX*8+3] =  1.78;
				DTgear[TS_MIN*8+4] =  1.33;	DTgear[TS_MAX*8+4] =  1.33;
				DTgear[TS_MIN*8+5] =  1.05;	DTgear[TS_MAX*8+5] =  1.05;
				DTgear[TS_MIN*8+6] =  0.85;	DTgear[TS_MAX*8+6] =  0.85;
				DTgear[TS_MIN*8+7] = -3.60;	DTgear[TS_MAX*8+7] = -3.60;
				DTendr[TS_MIN]     =  3.63;	DTendr[TS_MAX] =  3.23;
				setTransmissionTimes(0,0.349, 0.200, 1.000, 0.262, 0.200, 1.000);
				break;
			default: // unadjustable //
				gears = 5;
				DTgear[TS_MIN*8+0] =  0.00;	DTgear[TS_MAX*8+0] =  0.00;
				DTgear[TS_MIN*8+1] =  4.45;	DTgear[TS_MAX*8+1] =  4.45;
				DTgear[TS_MIN*8+2] =  2.48;	DTgear[TS_MAX*8+2] =  2.48;
				DTgear[TS_MIN*8+3] =  1.78;	DTgear[TS_MAX*8+3] =  1.78;
				DTgear[TS_MIN*8+4] =  1.33;	DTgear[TS_MAX*8+4] =  1.33;
				DTgear[TS_MIN*8+5] =  1.05;	DTgear[TS_MAX*8+5] =  1.05;
				DTgear[TS_MIN*8+6] =  0.85;	DTgear[TS_MAX*8+6] =  0.85;
				DTgear[TS_MIN*8+7] = -3.60;	DTgear[TS_MAX*8+7] = -3.60;
				DTendr[TS_MIN]     =  3.15;	DTendr[TS_MAX] =  3.23;
				setTransmissionTimes(0,0.349, 0.200, 1.000, 0.262, 0.200, 1.000);
				break;
		}

		BMW_635csi_sounds.setTransmissionSounds( this, Stage );
		super.updateTransmission( Stage, Custom0, Custom1 );
	}
// end of updateTransmission //

// updateDrivetrain //
	public void updateDrivetrain(int Stage, float Custom0, float Custom1)
	{
		switch (Stage)
		{
			case 3:  // freely adjustable                    +10 preset diff.lock (0.00 0.11 0.22 0.33 0.44 0.55 0.66 0.77 0.88 1.00)  //
				DTdriv[TS_MIN] =  1.00;	DTdriv[TS_MAX] =  0.00;
				DTdiff[TS_MIN] =  0.00;	DTdiff[TS_MAX] =  0.35;
				break;
			case 2:  // 3 presets (0.00      0.50      1.00) + 3 preset diff.lock (0.00                   0.50                  1.00) //
				DTdriv[TS_MIN] =  1.00;	DTdriv[TS_MAX] =  0.00;
				DTdiff[TS_MIN] =  0.00;	DTdiff[TS_MAX] =  0.00;
				break;
			case 1:  // 2 presets (0.00                1.00) unadjustable //
				DTdriv[TS_MIN] =  0.00;	DTdriv[TS_MAX] =  0.00;
				DTdiff[TS_MIN] =  0.00;	DTdiff[TS_MAX] =  0.00;
				break;
			default: // 2 presets (0.00                1.00) unadjustable //
				DTdriv[TS_MIN] =  0.00;	DTdriv[TS_MAX] =  0.00;
				DTdiff[TS_MIN] =  0.00;	DTdiff[TS_MAX] =  0.00;
				break;
		}

		super.updateDrivetrain(Stage,Custom0,Custom1);
	}
// end of updateDrivetrain //

// updateEngine //
	public void updateEngine(int Stage, float Custom0, float Custom1)
	{
		dynodata.clear();

		float[]	tq;
		float	maxrpm;

		switch (Stage)
		{
                         case 1:
				starter_torque = 70.1;
				engine_rpm_idle = 950.0;
				RPM_limit = 8000.0;

				engine_friction_fwd = 0.00100000;
				engine_friction_rev = 0.00100000;
				engine_inertia = 0.128;

				{ float[] bt = { 25.000,  3.000,   0.750,   0.000 }; engineBrakeTorque = bt; };
				{ float[] cl = { -90.000, 180.000,  4.500,   0.000 }; throttleClosedLoss = cl; };

				// torque table //
				maxrpm = 8000.0;
				tq = new float[80];
				tq[0] = 0.0;
				tq[1] = 18.0;
				tq[2] = 36.0;
				tq[3] = 54.0;
				tq[4] = 72.0;
				tq[5] = 90.0;
				tq[6] = 108.0;
				tq[7] = 126.0;
				tq[8] = 144.0;
				tq[9] = 162.0;
				tq[10] = 167.0;
				tq[11] = 172.0;
				tq[12] = 176.0;
				tq[13] = 181.0;
				tq[14] = 186.0;
				tq[15] = 191.0;
				tq[16] = 195.0;
				tq[17] = 200.0;
				tq[18] = 205.0;
				tq[19] = 210.0;
				tq[20] = 214.0;
				tq[21] = 219.0;
				tq[22] = 224.0;
				tq[23] = 229.0;
				tq[24] = 232.0;
				tq[25] = 233.0;
				tq[26] = 231.0;
				tq[27] = 229.0;
				tq[28] = 236.0;
				tq[29] = 243.0;
				tq[30] = 251.0;
				tq[31] = 258.0;
				tq[32] = 266.0;
				tq[33] = 273.0;
				tq[34] = 275.0;
				tq[35] = 277.0;
				tq[36] = 277.0;
				tq[37] = 278.0;
				tq[38] = 279.0;
				tq[39] = 280.0;
				tq[40] = 282.0;
				tq[41] = 281.0;
				tq[42] = 279.0;
				tq[43] = 277.0;
				tq[44] = 275.0;
				tq[45] = 275.0;
				tq[46] = 298.0;
				tq[47] = 330.0;
				tq[48] = 362.0;
				tq[49] = 365.0;
				tq[50] = 365.0;
				tq[51] = 365.0;
				tq[52] = 364.0;
				tq[53] = 361.0;
				tq[54] = 361.0;
				tq[55] = 361.0;
				tq[56] = 361.0;
				tq[57] = 361.0;
				tq[58] = 361.0;
				tq[59] = 361.0;
				tq[60] = 358.0;
				tq[61] = 353.0;
				tq[62] = 350.0;
				tq[63] = 350.0;
				tq[64] = 350.0;
				tq[65] = 349.0;
				tq[66] = 347.0;
				tq[67] = 346.0;
				tq[68] = 346.0;
				tq[69] = 346.0;
				tq[70] = 346.0;
				tq[71] = 345.0;
				tq[72] = 345.0;
				tq[73] = 344.0;
				tq[74] = 342.0;
				tq[75] = 340.0;
				tq[76] = 339.0;
				tq[77] = 338.0;
				tq[78] = 336.0;
				tq[79] = 0.0;

				break;
			default:
				starter_torque = 70.1;
				engine_rpm_idle = 950.0;
				RPM_limit = 7000.0;

				engine_friction_fwd = 0.00100000;
				engine_friction_rev = 0.00100000;
				engine_inertia = 0.128;

				{ float[] bt = { 25.000,  3.000,   0.750,   0.000 }; engineBrakeTorque = bt; };
				{ float[] cl = { -90.000, 180.000,  4.500,   0.000 }; throttleClosedLoss = cl; };

				// torque table //
				maxrpm = 7600.0;
				tq = new float[76];
				tq[0] = 0.0;
				tq[1] = 13.1;
				tq[2] = 26.2;
				tq[3] = 39.3;
				tq[4] = 52.4;
				tq[5] = 65.5;
				tq[6] = 72.1;
				tq[7] = 78.7;
				tq[8] = 85.2;
				tq[9] = 91.8;
				tq[10] = 118.0;
				tq[11] = 144.0;
				tq[12] = 157.0;
				tq[13] = 169.0;
				tq[14] = 173.0;
				tq[15] = 176.0;
				tq[16] = 180.0;
				tq[17] = 192.0;
				tq[18] = 203.0;
				tq[19] = 223.0;
				tq[20] = 243.0;
				tq[21] = 254.0;
				tq[22] = 264.0;
				tq[23] = 270.0;
				tq[24] = 275.0;
				tq[25] = 281.0;
				tq[26] = 286.0;
				tq[27] = 286.0;
				tq[28] = 286.0;
				tq[29] = 291.0;
				tq[30] = 296.0;
				tq[31] = 298.0;
				tq[32] = 300.0;
				tq[33] = 305.0;
				tq[34] = 310.0;
				tq[35] = 311.0;
				tq[36] = 312.0;
				tq[37] = 313.0;
				tq[38] = 313.0;
				tq[39] = 314.0;
				tq[40] = 316.0;
				tq[41] = 310.0;
				tq[42] = 304.0;
				tq[43] = 301.0;
				tq[44] = 297.0;
				tq[45] = 295.0;
				tq[46] = 292.0;
				tq[47] = 290.0;
				tq[48] = 288.0;
				tq[49] = 286.0;
				tq[50] = 284.0;
				tq[51] = 281.0;
				tq[52] = 278.0;
				tq[53] = 274.0;
				tq[54] = 270.0;
				tq[55] = 269.0;
				tq[56] = 267.0;
				tq[57] = 264.0;
				tq[58] = 260.0;
				tq[59] = 258.0;
				tq[60] = 255.0;
				tq[61] = 253.0;
				tq[62] = 250.0;
				tq[63] = 248.0;
				tq[64] = 246.0;
				tq[65] = 243.0;
				tq[66] = 240.0;
				tq[67] = 235.0;
				tq[68] = 230.0;
				tq[69] = 220.0;
				tq[70] = 210.0;
				tq[71] = 163.0;
				tq[72] = 130.0;
				tq[73] = 97.0;
				tq[74] = 64.0;
				tq[75] = 31.0;

				break;
		}

		BMW_635csi_sounds.setEngineSounds( this, Stage );
		dynodata.setTorques(0, maxrpm, tq);
		setEngineLosses();
	}
// end of updateEngine //
}
