5#include <btBulletDynamicsCommon.h>
6#include <glm/gtc/matrix_transform.hpp>
79 glm::mat4 transform = glm::mat4(1.0f);
glm::mat4 getLocalTransform() const
Gets the local transform matrix.
btCollisionShape * shape_
void endPlay() override
Called when the component is removed or the game ends.
virtual void destroyShape()
Destroys the current shape.
PhysicsBodyComponent * bodyComponent_
virtual void onCollisionStay(CollisionComponent *other)
Called every frame while colliding with another object.
virtual void onCollisionBegin(CollisionComponent *other)
Called when a collision with another object begins.
void setIsTrigger(bool trigger)
Sets whether this collision is a trigger (overlap only, no physics response).
void unregisterFromBody()
virtual void onCollisionEnd(CollisionComponent *other)
Called when a collision with another object ends.
virtual btCollisionShape * createShape()=0
Creates the Bullet collision shape. Must be implemented by derived classes.
void setLocalOffset(const glm::vec3 &offset)
Sets the local position offset relative to the body.
~CollisionComponent() override
void beginPlay() override
Called when the component is added to the scene or the game starts.
void setLocalRotation(const glm::quat &rotation)
Sets the local rotation relative to the body.
CollisionComponent(Scene *scene, entt::entity entity)
Constructs a CollisionComponent.
void markDirty()
Marks the shape as needing rebuild. Call after changing shape properties (halfExtents,...
friend class PhysicsBodyComponent
void rebuild()
Rebuilds the shape and notifies PhysicsBodyComponent.
T * getComponent() const
Returns the first component of type T found.
virtual void endPlay()
Called when the component is removed or the game ends.
virtual void beginPlay()
Called when the component is added to the scene or the game starts.
LogicComponent(Scene *owningScene)
Entity * getOwningEntity() const
Gets the entity this component belongs to.
A scene is the overarching structure which can spawn actors.
Log category system implementation.