PCG-FPS
v2 m0.22.4
Simple First Person Shooter with Procedurally Generated Level
|
defines a box used to collision More...
#include <CollisionBox.h>
Public Member Functions | |
CollisionBox () | |
Default constructor initiliazes all pointers as null_ptr. More... | |
CollisionBox (rp3d::CollisionWorld *world, rp3d::Vector3 position, rp3d::Vector3 size, CollisionCategory category=CollisionCategory::WALL) | |
constructor More... | |
CollisionCategory | GetCollisionCategory () |
returns the collision categories of this box More... | |
void | SetCollisionCatergory (CollisionCategory category) |
sets CollisionCategory using the enum More... | |
void | SetCollisionCatergory (unsigned short category) |
set CollisionCategory using indices for enum More... | |
void | UpdatePosition (glm::vec3 pos) |
Updates position of this CollisionBox as glm vec3. More... | |
void | UpdatePosition (rp3d::Vector3 pos) |
Updates position of this CollisionBox as rp3d vector3. More... | |
void | DrawCollisionShape (skr::fps2::Renderer::OpenGL::Shader shader, glm::mat4 view, glm::mat4 proj, glm::mat4 model, glm::vec3 color=glm::vec3(1.0f, 0.0f, 0.0f)) const |
Draws the collision shape. More... | |
Public Attributes | |
rp3d::CollisionWorld * | _world |
RP3D collision world. More... | |
rp3d::CollisionBody * | _body |
collision body of the box More... | |
rp3d::CollisionShape * | _shape |
shape of the collision object More... | |
rp3d::ProxyShape * | _proxyShape |
proxy shape of the collision object More... | |
glm::vec3 | _position |
position More... | |
Private Attributes | |
BoundingBox | _boundingBox |
bounding box of the collision shape More... | |
defines a box used to collision
skr::fps2::Collision::CollisionBox::CollisionBox | ( | ) |
Default constructor initiliazes all pointers as null_ptr.
skr::fps2::Collision::CollisionBox::CollisionBox | ( | rp3d::CollisionWorld * | world, |
rp3d::Vector3 | position, | ||
rp3d::Vector3 | size, | ||
CollisionCategory | category = CollisionCategory::WALL |
||
) |
constructor
world | RP3D collision world |
position | Position of the CollisionBox |
size | Size of the CollisionBox |
category | Collision Categories the CollisionBox has. Default: Wall |
void skr::fps2::Collision::CollisionBox::DrawCollisionShape | ( | skr::fps2::Renderer::OpenGL::Shader | shader, |
glm::mat4 | view, | ||
glm::mat4 | proj, | ||
glm::mat4 | model, | ||
glm::vec3 | color = glm::vec3(1.0f, 0.0f, 0.0f) |
||
) | const |
Draws the collision shape.
shader | Shader used to draw |
view | View Matrix |
proj | Projection Matrix |
model | Model Matrix |
color | Color to draw the collision shape with. Default: Red (1,0,0) |
CollisionCategory skr::fps2::Collision::CollisionBox::GetCollisionCategory | ( | ) |
returns the collision categories of this box
void skr::fps2::Collision::CollisionBox::SetCollisionCatergory | ( | CollisionCategory | category | ) |
sets CollisionCategory using the enum
category | category enum |
void skr::fps2::Collision::CollisionBox::SetCollisionCatergory | ( | unsigned short | category | ) |
set CollisionCategory using indices for enum
category | CollisionCategorie inidices for enum |
void skr::fps2::Collision::CollisionBox::UpdatePosition | ( | glm::vec3 | pos | ) |
Updates position of this CollisionBox as glm vec3.
pos | new Position |
void skr::fps2::Collision::CollisionBox::UpdatePosition | ( | rp3d::Vector3 | pos | ) |
Updates position of this CollisionBox as rp3d vector3.
pos | new Position |
rp3d::CollisionBody* skr::fps2::Collision::CollisionBox::_body |
collision body of the box
|
private |
bounding box of the collision shape
glm::vec3 skr::fps2::Collision::CollisionBox::_position |
position
rp3d::ProxyShape* skr::fps2::Collision::CollisionBox::_proxyShape |
proxy shape of the collision object
rp3d::CollisionShape* skr::fps2::Collision::CollisionBox::_shape |
shape of the collision object
rp3d::CollisionWorld* skr::fps2::Collision::CollisionBox::_world |
RP3D collision world.