Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
CapsuleCollisionComponent.h
1#pragma once
2
3#include "Engine/Component/Collision/CollisionComponent.h"
4
5namespace Engine::Components {
6
13 public:
14 static constexpr const char* ComponentName = "CapsuleCollision";
22 CapsuleCollision(Entities::Scene* scene, entt::entity entity,
23 float radius = 0.5f, float height = 1.0f);
24
28 ~CapsuleCollision() override = default;
29
30 btCollisionShape* createShape() override;
31
36 void debugDraw(const glm::mat4& worldTransform) const override;
37
42 void setRadius(float radius);
43
48 [[nodiscard]] float getRadius() const { return radius_; }
49
54 void setHeight(float height);
55
60 [[nodiscard]] float getHeight() const { return height_; }
61
62 private:
63 float radius_;
64 float height_;
65 };
66
67} // namespace EngineCore
void debugDraw(const glm::mat4 &worldTransform) const override
Draws debug visualization of the capsule.
CapsuleCollision(Entities::Scene *scene, entt::entity entity, float radius=0.5f, float height=1.0f)
Constructs a CapsuleCollisionComponent.
static constexpr const char * ComponentName
Component registry name.
~CapsuleCollision() override=default
Destroys the capsule collision component.
void setHeight(float height)
Sets the height of the cylindrical portion.
btCollisionShape * createShape() override
Creates the Bullet collision shape.
float getHeight() const
Gets the height of the cylindrical portion.
float getRadius() const
Gets the radius of the capsule.
void setRadius(float radius)
Sets the radius of the capsule.
Base class for collision shape components.
Owns scene entities, actor lifetime, and the scene graph root.
Definition Scene.h:84