RigidBody class

Represents a rigid body with 2D force accumulation (convenience wrapper).

For most use cases, prefer PhysicsBody directly. This class exists for code that needs a simpler interface without collision shape requirements.

Constructors

RigidBody()

Properties

hashCode → int
The hash code for this object.
no setterinherited
mass ↔ double
Mass of the rigid body
getter/setter pair
position → Vector2
Current position.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
velocity → Vector2
Current velocity.
final

Methods

applyForce(double x, double y) → void
Apply a 2D force.
integrate(double dt) → void
Integrate forces → velocity → position for one timestep.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited