#include <RigidBodyComponent.h>
|
| ABody * | m_body = nullptr |
| glm::vec3 | m_size |
| float | m_mass |
| bool | m_isStatic |
| AEntity * | m_owner = nullptr |
| | Pointer to the entity that owns this component. This allows the component to access its parent entity and other components attached to it.
|
◆ RigidBodyComponent()
| RigidBodyComponent::RigidBodyComponent |
( |
glm::vec3 | size, |
|
|
float | mass = 1.0f, |
|
|
bool | isStatic = false ) |
|
inline |
◆ ApplyPush()
| void RigidBodyComponent::ApplyPush |
( |
glm::vec3 | force | ) |
|
Applies a push force to the rigid body
- Parameters
-
| force | The force vector to be applied to the rigid body |
◆ ApplyTorque()
| void RigidBodyComponent::ApplyTorque |
( |
glm::vec3 | torque | ) |
|
Apply torque to the rigid body
- Parameters
-
| torque | The torque vector to apply in world coordinates |
◆ IsGrounded()
| bool RigidBodyComponent::IsGrounded |
( |
| ) |
|
Checks if the rigid body is currently grounded
- Returns
- true if the rigid body is on the ground, false otherwise
◆ OnInit()
| void RigidBodyComponent::OnInit |
( |
AEntity * | owner | ) |
|
|
overridevirtual |
◆ OnRender()
| void RigidBodyComponent::OnRender |
( |
AShader * | shader | ) |
|
|
inlineoverridevirtual |
Called to render the component.
- Parameters
-
| shader | The shader program to use for rendering. |
Implements IComponent.
◆ OnUpdate()
| void RigidBodyComponent::OnUpdate |
( |
float | dt | ) |
|
|
overridevirtual |
Update method for the RigidBodyComponent, called each frame
- Parameters
-
| dt | Delta time since last update, used for time-based calculations |
Implements IComponent.
◆ SetBouciness()
| void RigidBodyComponent::SetBouciness |
( |
float | bounciness | ) |
|
Sets the bounciness of the rigid body
- Parameters
-
| bounciness | A value between 0 and 1 that determines how bouncy the object is 0 means no bounce, 1 means perfect bounce |
◆ m_body
| ABody* RigidBodyComponent::m_body = nullptr |
◆ m_isStatic
| bool RigidBodyComponent::m_isStatic |
◆ m_mass
| float RigidBodyComponent::m_mass |
◆ m_size
| glm::vec3 RigidBodyComponent::m_size |
The documentation for this class was generated from the following files: