Objects::Components::Rigidbody

Rigid Bodies in Unified Engine

Rigid bodies in the Unified Engine represent physical objects that can move, rotate, and interact based on physical laws. The RigidBody class incorporates attributes that dictate its movement, rotations, and physical interactions.

Movement and Rotation Restrictions

Defines the restrictions placed on the movement and rotation of the rigid body.

glm::vec3 PositionLock = glm::vec3(1.0);
glm::vec3 RotationLock = glm::vec3(1.0);

Physical Properties

Attributes defining the mass, gravity, friction level, velocity, and behavior of the rigid body in the physical world.

int Mass = 1;
int Gravity = -9.8;
int FrictionLevel = 0;
glm::vec3 Velocity = glm::vec3(0.0);
bool Friction = true;
bool UseGravity = true;

Initialization & Destruction

Handles the setup and cleanup of the RigidBody.

RigidBody(ObjectComponent* parent);
~RigidBody();

Update and Render

Functions dedicated to updating the rigid body's state and rendering its representation.

int Update();
int Render();

Collision Check

Functionality to verify if the rigid body is in collision with another object, using their colliders.

int CheckIfCollided(Collider* collider1, Collider* collider2);

Last updated