/* Car Managing Class.
*
* Copyright (C) 2006 Fixi Studios.
*
* Authors:
* Marvin Stockl Garcia <durmieu@users.sourceforge.net>
* Jeremies Perez Morata <jeremiespm@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef COCHE_H_
#define COCHE_H_
#define TRACC_DEL 0
#define TRACC_TRS 1
#define TRACC_4x4 2
#define TKEYBOARD 0
#define TJOYSTICK 1
#define TROBOT 2
#define TNETWORK 3
#define AACCEL 0
#define ABRAKE 1
#define ATURN 2
#define AHORN 3
class Coche
{
public:
int type;
float x,y,z,xs,ys,zs,vel;
//revoluciones del motor se calculan a partir
//de la velocitat de las ruedas
float rev;
ObjModel chasis;
ObjModel rueda;
dSpaceID car_space;
dBodyID body[5];
void action(int type,float amount);
void create();
void destroy();
void move();
void draw();
private:
dGeomID box[1];
dGeomID sphere[4];
dJointID joint[4];
float length; // chassis length
float width; // chassis width
float height; // chassis height
float radius; // wheel radius
float startz,starty,startx;// starting
float cmass; // chassis mass
float wmass; // wheel mass
float tracc; // wheel mass
float power; // wheel mass
int input;
float speed,steer,brake;
};
#endif