PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
Bullet.hpp
Go to the documentation of this file.
1 #ifndef BULLET_HPP
2 #define BULLET_HPP
3 
4 #include <SDL2/SDL_timer.h>
5 
6 #include "Box2D/Box2D.h"
7 
10 
11 namespace pk
12 {
13 
14 class Bullet
15 {
16  public:
17  Bullet();
18  Bullet(b2World* world, GLRect rect, float delay);
19  virtual ~Bullet();
20 
21  void setVelocity(glm::vec2 velocity);
22 
23  glm::vec2 getVelocity();
24 
25  glm::vec2 getPosition();
26  void setPosition(glm::vec2 position);
27 
28  float getRotation();
29 
30  void fire(float speed);
31 
32  bool isAlive();
33 
34  private:
35  b2World* m_world;
37  double m_aliveTime;
39 };
40 
41 }
42 
43 #endif // BULLET_HPP
void setVelocity(glm::vec2 velocity)
Definition: Game.hpp:7
bool isAlive()
A class wrapper to ease the instantiation and use of Box2D dynamic bodies. It also performs conversio...
Definition: DynamicBody.hpp:20
b2World * m_world
Definition: Bullet.hpp:35
glm::vec2 getPosition()
void fire(float speed)
double m_aliveTime
Definition: Bullet.hpp:37
glm::vec2 getVelocity()
double m_destroyDelay
Definition: Bullet.hpp:38
Useful for defining size and origin of an OpenGL object.
Definition: GLTransformable.hpp:15
DynamicBody m_body
Definition: Bullet.hpp:36
Definition: Bullet.hpp:14
float getRotation()
virtual ~Bullet()
void setPosition(glm::vec2 position)