00001 #ifndef WORLD_H_INCLUDED
00002 #define WORLD_H_INCLUDED
00003
00004 #include <vector>
00005 #include <btBulletDynamicsCommon.h>
00006 #include "Horde3D.h"
00007
00008 #include "Explosive.h"
00009
00010
00011 class Physics;
00012 class Game;
00013
00024 class World {
00025 private:
00026 btMotionState* motionstate;
00027 btTriangleMesh* trimesh;
00028 btBvhTriangleMeshShape* shape;
00029 btDefaultMotionState* groundMotionState;
00030 btRigidBody* body;
00031 H3DNode _vulcanoEmitter, _ship;
00032 H3DRes _waterplaneRes, _crateRes;
00033 Physics* _physics;
00034 Game* _game;
00035 int _waterplaneMeshMaterial;
00036 std::vector<Explosive*> _models;
00037 bool _debugMode;
00038 float _waterAnimationTime;
00039 public:
00040 World(Game* game, Physics* physics);
00041 ~World();
00042 void update(const float timeStep);
00043 bool testInboundXZ(const Vec3 position);
00044 void addLight(const char* name, const float px, const float py, const float pz,
00045 const float rx, const float ry, const float rz,
00046 const int length, const int fov, const int shadowCount,
00047 const float r, const float g, const float b);
00048 private:
00049 void buildGraphicsWorld();
00050 void buildPhysicsWorld();
00051 void addPhysicsBox(const Vec3 halfsize, const Vec3 position, const float rotationY);
00052 H3DNode addModel(H3DRes ressource, Vec3 position, Vec3 rotation, float scale);
00053 };
00054
00055 #endif