//********************************************************************
// This source file is part of Ninfa3D Engine
// 
// Copyright (C) 2008-2009 Viz_fuerte.
// All rights reserved.
// 
// LIMITED WARRANTY
// This software is provided "as-is", without any express or implied warranty.
// In no event shall the author be held liable for any damages arising from the use of this software.
// This is a contract. By accepting the Ninfa3D Engine (the SOFTWARE), 
// you (either an individual or a single entity, the LICENSEE) accept the terms and conditions of this licensing agreement.
// 
// If the LICENSEE does not accept the terms and conditions, then LICENSEE must not accept the SOFTWARE.
// If at a later time the LICENSEE decides not to continue licensing the SOFTWARE under these terms and 
// conditions, then the LICENSEE must delete permanently all files constituting the SOFTWARE.
//
// File: CVehicleSceneNode.h
//********************************************************************

/*--------------------------------------------------------------------
Includos*/

	#include "..\Header Files\Ninfa3D.h"

/*--------------------------------------------------------------------
Clases*/

	class CVehicleSceneNode : public ISceneNode
	{
	public:

		//! constructor
		CVehicleSceneNode(ISceneNode* parent,ISceneManager* mgr,s32 id);
		~CVehicleSceneNode();

		void addVehicle(float X,float Y,float Z,float DX,float DY,float DZ,NewtonBody* carBody);
		void addTire(void* userData,float X,float Y,float Z,float mass,float radius,float width,float friction,float suspensionLenght,float springConst,float springDamper);

		void setApplyTorque(int index,float value);
		//void setApplySteering(int index,float value1,float value2);
		void setApplySteering(int index,float value);
		void setApplyBrake(int index,float value);

		float getVehicleSpeed();

		virtual void remove();
		virtual void OnPreRender();
		virtual void render();

		virtual SMaterial& getMaterial(s32 i);
		virtual const aabbox3d<f32>& getBoundingBox() const;

	private:

		aabbox3d<f32> BBox;
		SMaterial material;

		NewtonCustomJoint* Vehicle;
	};