8#include "physics/RigidBody.h"
9#include "scene/Component.h"
37 void Update(
float deltaTime)
override;
40 void SetRigidBody(
const std::shared_ptr<RigidBody> &body);
44 std::shared_ptr<RigidBody> m_rigidBody;
Component bridge between a GameObject and the physics world.
const std::shared_ptr< RigidBody > & GetRigidBody()
void LoadProperties(const nlohmann::json &json) override
Parse collider + body sub-objects and build the RigidBody.
void Update(float deltaTime) override
Copy the simulated pose onto the owning GameObject.
void SetRigidBody(const std::shared_ptr< RigidBody > &body)
Replace the component's rigid body at runtime.
PhysicsComponent()=default
void Init() override
Register the rigid body with the PhysicsManager.
#define COMPONENT(ComponentClass)