00001 #ifndef ENEMY_H_INCLUDED
00002 #define ENEMY_H_INCLUDED
00003
00004 #include "Horde3D.h"
00005 #include "Player.h"
00006 #include "Physics.h"
00007 #include "Game.h"
00008 #include "IShootable.h"
00009
00010
00011 class Player;
00012 class Game;
00013 class Physics;
00014
00027 class Enemy : public IShootable {
00028 private:
00029 H3DNode _model;
00030 H3DRes _modelRes, _texture2, _texture3, _texture4, _fontRes;
00031 btCapsuleShape* _capsule;
00032 btDefaultMotionState* _groundMotionState;
00033 float _capsuleHeight, _bodyRadius, _levelBelowCapsule, _animationTime;
00034 int _level, LEVEL_TEXTURE_COUNT;
00035 bool _isReborn, _hasJumped;
00036 Vec3 _startPosition;
00037 public:
00038 Enemy(Game* game, Physics* physics, H3DRes font, H3DNode parent, const int id);
00039 ~Enemy();
00040 void hit();
00041 void update(H3DNode cam, Player* player, const float timeStep);
00042 bool reset(const bool doRebirth);
00043 void setPosition(const Vec3& newPosition);
00044 Vec3 getPosition() const;
00045 btRigidBody* getBody() const;
00046 H3DNode getModel() const;
00047 bool hasJumped() const;
00048
00049 private:
00050 bool castRayAndCorrectPosition(Vec3& calculatedCurrentPosition, Vec3& collisionPoint);
00051 float calcAngleToPlayer(const Vec3 enemyPos, const Vec3 playerPos);
00052 void displayEnemyInformation(H3DNode cam);
00053 void Enemy::changeTexture();
00054 };
00055
00056 #endif