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
8
#include "
graphics/GLTransformable.hpp
"
9
#include "
physics/DynamicBody.hpp
"
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
;
36
DynamicBody
m_body
;
37
double
m_aliveTime
;
38
double
m_destroyDelay
;
39
};
40
41
}
42
43
#endif // BULLET_HPP
pk::Bullet::setVelocity
void setVelocity(glm::vec2 velocity)
pk
Definition:
Game.hpp:7
pk::Bullet::isAlive
bool isAlive()
pk::DynamicBody
A class wrapper to ease the instantiation and use of Box2D dynamic bodies. It also performs conversio...
Definition:
DynamicBody.hpp:20
DynamicBody.hpp
pk::Bullet::m_world
b2World * m_world
Definition:
Bullet.hpp:35
pk::Bullet::getPosition
glm::vec2 getPosition()
pk::Bullet::fire
void fire(float speed)
pk::Bullet::m_aliveTime
double m_aliveTime
Definition:
Bullet.hpp:37
GLTransformable.hpp
pk::Bullet::getVelocity
glm::vec2 getVelocity()
pk::Bullet::m_destroyDelay
double m_destroyDelay
Definition:
Bullet.hpp:38
pk::GLRect
Useful for defining size and origin of an OpenGL object.
Definition:
GLTransformable.hpp:15
pk::Bullet::m_body
DynamicBody m_body
Definition:
Bullet.hpp:36
pk::Bullet
Definition:
Bullet.hpp:14
pk::Bullet::getRotation
float getRotation()
pk::Bullet::~Bullet
virtual ~Bullet()
pk::Bullet::setPosition
void setPosition(glm::vec2 position)
pk::Bullet::Bullet
Bullet()
include
gameplay
Bullet.hpp
Generated on Sun Dec 1 2019 17:04:22 for PROTO::KLUDGE by
1.8.14