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
5#include <glm/glm.hpp>
6
7namespace Engine::Components
8{
13 {
14 public:
15 static constexpr const char * ComponentName = "BoxCollision";
23 Entities::Scene * scene,
24 entt::entity entity,
25 const glm::vec3 & halfExtents = glm::vec3( 0.5f )
26 );
27
29 const Entities::SpawnContext & context,
30 const glm::vec3 & halfExtents = glm::vec3( 0.5f )
31 );
32
33 ~BoxCollision() override = default;
34
35 btCollisionShape * createShape() override;
36
41 void debugDraw( const glm::mat4 & worldTransform ) const override;
42
47 void setHalfExtents( const glm::vec3 & halfExtents );
48
53 [[nodiscard]] glm::vec3 getHalfExtents() const
54 {
55 return halfExtents_;
56 }
57
58 private:
59 glm::vec3 halfExtents_;
60 };
61
62} // namespace Engine::Components
BoxCollision(Entities::Scene *scene, entt::entity entity, const glm::vec3 &halfExtents=glm::vec3(0.5f))
Constructs a BoxCollisionComponent.
BoxCollision(const Entities::SpawnContext &context, const glm::vec3 &halfExtents=glm::vec3(0.5f))
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:62
Scene ownership data passed to actor and component constructors during spawning.