00001 #ifndef EXPLOSIVE_H_INCLUDED 00002 #define EXPLOSIVE_H_INCLUDED 00003 00004 #include "Horde3D.h" 00005 #include <btBulletDynamicsCommon.h> 00006 00007 #include "Physics.h" 00008 #include "Game.h" 00009 #include "Vec3.h" 00010 #include "IShootable.h" 00011 00016 class Explosive : public IShootable { 00017 private: 00018 btCylinderShape* _cylinder; 00019 btDefaultMotionState* _groundMotionState; 00020 H3DNode _model, _emitter, _parent; 00021 float _cylinderHeight, _cylinderRadius, _levelBelowCylinder, _scale; 00022 bool _doExplode; 00023 public: 00024 Explosive(Game* game, H3DNode parent, Physics* physics, const int id, H3DRes modelRes, const Vec3 position, const Vec3 rotation, const float scale); 00025 ~Explosive(); 00026 void update(const float timeStep); 00027 Vec3 getPosition(); 00028 bool castRayAndCorrectPosition(Vec3& calculatedCurrentPosition, Vec3& collisionPoint); 00029 private: 00030 void setPosition(Vec3 newPosition); 00031 void hit(); 00032 }; 00033 00034 #endif