Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
BoxCollisionComponent.cpp
Go to the documentation of this file.
3
4#include <btBulletDynamicsCommon.h>
5
6namespace EngineCore {
7
9 const glm::vec3& halfExtents)
10 : CollisionComponent(scene, entity)
11 , halfExtents_(halfExtents)
12 {
13 }
14
16 return new btBoxShape(bt::getVec3(halfExtents_));
17 }
18
19 void BoxCollisionComponent::setHalfExtents(const glm::vec3& halfExtents) {
20 halfExtents_ = halfExtents;
21 markDirty();
22 }
23
24} // namespace EngineCore
void setHalfExtents(const glm::vec3 &halfExtents)
Sets the half extents of the box.
BoxCollisionComponent(Scene *scene, entt::entity entity, const glm::vec3 &halfExtents=glm::vec3(0.5f))
Constructs a BoxCollisionComponent.
btCollisionShape * createShape() override
Creates the Bullet collision shape. Must be implemented by derived classes.
CollisionComponent(Scene *scene, entt::entity entity)
Constructs a CollisionComponent.
void markDirty()
Marks the shape as needing rebuild. Call after changing shape properties (halfExtents,...
A scene is the overarching structure which can spawn actors.
Definition Scene.h:17
Log category system implementation.
btVector3 getVec3(glm::vec3 v)
Definition Converter.cpp:12