[go: up one dir, main page]

Menu

[r3]: / include / world.h  Maximize  Restore  History

Download this file

111 lines (88 with data), 1.7 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
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
#ifndef WORLD_H
#define WORLD_H
#define OBJ_NADA -1
#define OBJ_HIERBA 0
#define OBJ_ARBOL 1
#define OBJ_ROAD_VER 2
#define OBJ_ROAD_HOR 3
#define OBJ_CURV_DR 4
#define OBJ_CURV_DL 5
#define OBJ_CURV_UR 6
#define OBJ_CURV_UL 7
#define OBJ_CRUCE 8
#define OBJ_MOLINO 9
#define OBJ_TRAMP_L 10
#define OBJ_TRAMP_R 11
#define OBJ_TRAMP_U 12
#define OBJ_TRAMP_D 13
#define OBJ_HIGH_H 14
#define OBJ_HIGH_V 15
#define OBJ_HIGH_HC 16
#define OBJ_HIGH_VC 17
#define OBJ_PELOTA 18
#define OBJ_BONYO 19
#define OBJ_CASA 20
#define OBJ_SALIDA 21
#define OBJ_CPOINT_H 22
#define OBJ_CPOINT_V 23
#define OBJ_CAJAS 24
#define NUM_OBJS 25
struct Geom
{
int type;
dGeomID geom;
};
struct Body
{
int type;
dBodyID body;
dGeomID geom;
ObjModel model;
};
struct Object
{
int type;
int posx,posy;
int num_geoms;
int num_bodies;
ObjModel model;
Geom *geom;
Body *body;
};
struct Map
{
int length;
int area;
int *data;
};
class World
{
dGeomID muro[4];
dGeomID ground;
void draw_object(int i);
void draw_object_gllist(int i);
void draw_toys(int i);
void draw_sky();
void draw_muros();
void draw_mountain_side();
GLuint *objs_list,muros_list;
int lists_created_obj, lists_created_muros;
public:
World();
~World();
dJointGroupID contactgroup;
dSpaceID space;
dWorldID world_id;
float step_size, real_step_size, time_speed;
static void nearCallback (void *pData, dGeomID o1, dGeomID o2);
void nearCallback (dGeomID o1, dGeomID o2);
void prestep ();
void step ();
void create();
void destroy();
void draw();
void load_map(char *filename);
Map map;
Object *object;
};
#endif