RigidActor¶
A body fully simulated by the physics engine.
Description¶
Rigid actors respond to gravity, forces, and impulses. They are used for dynamic objects that should behave naturally, like falling crates or debris.
Namespace¶
Inheritance¶
- Base class: PhysicsActor
Constructors¶
-
RigidActor(Scalar x, Scalar y, int w, int h)Constructs a new RigidActor. -
RigidActor(Vector2 position, int w, int h)Constructs a new RigidActor using a position vector.
Public Methods¶
-
void applyForce(const Vector2& f)Applies a force to the center of mass. -
void applyImpulse(const Vector2& j)Applies an instantaneous impulse (velocity change). -
void integrate(Scalar dt)Integrates forces to update velocity. Note: Position integration is handled automatically byCollisionSystemafter this step. -
void update(unsigned long deltaTime)Logic update called every frame. Only integrates velocity/forces. Position update is delegated toCollisionSystem. -
void draw(pixelroot32::graphics::Renderer& renderer)Draws the actor.