Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
BoxCollisionComponent.h
1#pragma once
2
3#include "Engine/Component/Collision/CollisionComponent.h"
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
34 const Entities::SpawnContext & context,
35 const glm::vec3 & halfExtents = glm::vec3( 0.5f )
36 );
37
41 ~BoxCollision() override = default;
42
43 btCollisionShape * createShape() override;
44
49 void debugDraw( const glm::mat4 & worldTransform ) const override;
50
55 void setHalfExtents( const glm::vec3 & halfExtents );
56
61 [[nodiscard]] glm::vec3 getHalfExtents() const
62 {
63 return halfExtents_;
64 }
65
66 private:
67 glm::vec3 halfExtents_;
68 };
69
70} // 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))
Constructs a BoxCollisionComponent from spawn context data.
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
Component registry name.
void debugDraw(const glm::mat4 &worldTransform) const override
Draws debug visualization of the box.
btCollisionShape * createShape() override
Creates the Bullet collision shape.
~BoxCollision() override=default
Destroys the box collision component.
Base class for collision shape components.
Owns scene entities, actor lifetime, and the scene graph root.
Definition Scene.h:84
Scene ownership data passed to actor and component constructors during spawning.