Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
CapsuleCollisionComponent.h
Go to the documentation of this file.
1#pragma once
2
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
25 ~CapsuleCollision() override = default;
26
27 btCollisionShape* createShape() override;
28
33 void debugDraw(const glm::mat4& worldTransform) const override;
34
39 void setRadius(float radius);
40
45 [[nodiscard]] float getRadius() const { return radius_; }
46
51 void setHeight(float height);
52
57 [[nodiscard]] float getHeight() const { return height_; }
58
59 private:
60 float radius_;
61 float height_;
62 };
63
64} // 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
void setHeight(float height)
Sets the height of the cylindrical portion.
btCollisionShape * createShape() override
Creates the Bullet collision shape. Must be implemented by derived classes.
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.
A scene is the overarching structure which can spawn, contain and destroy actors or entities.
Definition Scene.h:56