[go: up one dir, main page]

Menu

[r21]: / include / coche.h  Maximize  Restore  History

Download this file

83 lines (69 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* 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