Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
BoxCollisionComponent.h
Go to the documentation of this file.
1#pragma once
2
4#include <glm/glm.hpp>
5
6namespace Engine::Components {
11 public:
12 static constexpr const char* ComponentName = "BoxCollision";
20 Entities::Scene * scene,
21 entt::entity entity,
22 const glm::vec3 & halfExtents = glm::vec3( 0.5f )
23 );
24
25 ~BoxCollision() override = default;
26
27 btCollisionShape* createShape() override;
28
33 void debugDraw(const glm::mat4& worldTransform) const override;
34
39 void setHalfExtents(const glm::vec3& halfExtents);
40
45 [[nodiscard]] glm::vec3 getHalfExtents() const { return halfExtents_; }
46
47 private:
48 glm::vec3 halfExtents_;
49 };
50
51} // namespace EngineCore
BoxCollision(Entities::Scene *scene, entt::entity entity, const glm::vec3 &halfExtents=glm::vec3(0.5f))
Constructs a BoxCollisionComponent.
glm::vec3 getHalfExtents() const
Gets the half extents of the box.
void setHalfExtents(const glm::vec3 &halfExtents)
Sets the half extents of the box.
static constexpr const char * ComponentName
void debugDraw(const glm::mat4 &worldTransform) const override
Draws debug visualization of the box.
btCollisionShape * createShape() override
Creates the Bullet collision shape. Must be implemented by derived classes.
~BoxCollision() override=default
Base class for collision shape components.
A scene is the overarching structure which can spawn, contain and destroy actors or entities.
Definition Scene.h:56