flame_forge2d library

Classes

Aabb
An axis-aligned bounding box.
Body
A rigid body.
BodyComponent<T extends Forge2DGame<Forge2DWorld>>
Since a pure BodyComponent doesn't have anything drawn on top of it, it is a good idea to turn on debugMode for it so that the bodies can be seen
BodyDef
The data needed to construct a rigid body.
BodyMoveEvent
A body moved during the last step.
Capsule
A capsule: a line segment with a radius, forming an extruded circle.
Chain
A chain of one-sided line segments attached to a body, designed for static level geometry.
ChainDef
The data needed to construct a chain of line segments.
Circle
A circle with an optional local offset.
Contact
The contact data that is delivered to ContactCallbacks by the ContactEventsDispatcher.
ContactBeginEvent
Two shapes began touching.
ContactCallbacks
Used to listen to a BodyComponent's contact events.
ContactEndEvent
Two shapes stopped touching.
ContactEvents
The contact events of the last step.
ContactEventsDispatcher
Dispatches the physics world's polled contact and sensor events to the ContactCallbacks found in the userData of the involved bodies and shapes.
ContactHitEvent
Two shapes hit each other faster than the world's hit event threshold.
ContactPoint
A contact point of a begin-touch event's manifold.
DebugDraw
Receives the world's debug geometry when passed to World.draw.
DistanceJoint
Keeps two points on two bodies at a fixed distance apart, optionally softened into a spring with limits and a motor.
DistanceJointDef
The data needed to construct a DistanceJoint.
ExplosionDef
The data needed to apply an explosion to a world.
Filter
Collision filtering data for a shape.
FilterJoint
Disables collision between the two attached bodies, with no other constraint.
FilterJointDef
The data needed to construct a FilterJoint.
Forge2DGame<T extends Forge2DWorld>
The base game class for creating games that uses the Forge2D physics engine.
Forge2DViewfinder
A Viewfinder that renders a world measured in meters onto a screen measured in pixels.
Forge2DWorld
The root component when using Forge2DGame, can handle both BodyComponents and normal Flame components.
Joint
A constraint connecting two bodies.
JointDef
The data shared by all joint definitions: the two bodies to connect and whether they may keep colliding with each other.
MassData
The mass properties of a body.
MotorJoint
Drives the relative transform between two bodies towards a target, useful for moving platforms and kinematic-style control of dynamic bodies.
MotorJointDef
The data needed to construct a MotorJoint.
MouseJoint
Pulls a point on a body towards a target point, designed for picking up and dragging bodies with a pointer.
MouseJointDef
The data needed to construct a MouseJoint.
Polygon
A convex polygon with at most maxVertices vertices, with an optional rounding radius.
PrismaticJoint
Allows relative translation of two bodies along an axis while preventing relative rotation, like an elevator or a piston.
PrismaticJointDef
The data needed to construct a PrismaticJoint.
QueryFilter
Collision filtering data for queries, such as ray casts.
RayHit
A ray cast hit.
RevoluteJoint
Allows relative rotation of two bodies around a point, like a hinge or a pin, with an optional limit, motor, and spring.
RevoluteJointDef
The data needed to construct a RevoluteJoint.
Rot
A 2D rotation, stored as the cosine and sine of an angle.
Segment
A standalone line segment.
SensorEvent
A shape began or stopped overlapping a sensor shape.
SensorEvents
The sensor events of the last step.
Shape
A collision shape attached to a body.
ShapeDef
The data needed to construct a shape on a body.
ShapeGeometry
The geometry used to create a shape on a body.
ShapeSpec
A pairing of a ShapeGeometry with an optional ShapeDef, used by BodyComponent.shapeSpecs to describe the shapes that should be created on the body.
SurfaceMaterial
The surface properties of a shape.
Tolerances
The Box2D tolerances that scale with the length unit.
Transform
A rigid 2D transform: a rotation followed by a translation.
Vector2
2D column vector.
WeldJoint
Rigidly attaches two bodies, with optional softness in the connection.
WeldJointDef
The data needed to construct a WeldJoint.
WheelJoint
Provides wheel suspension: body B may rotate freely around its anchor while translating along an axis on body A with a spring and optional limit and motor.
WheelJointDef
The data needed to construct a WheelJoint.
World
The simulation world: a container for bodies, shapes, and joints.
WorldDef
The data needed to construct a world.

Enums

BodyType
The type of a body, which determines how it moves.
JointType
The type of a joint.
ShapeType
The type of a shape's geometry.

Functions

debugResetLengthUnitLock() → void
Forgets that a world has been created, so that a test can set a different length unit than an earlier test did.
initializeForge2D({Uri? wasmUri, double? lengthUnitsPerMeter}) Future<void>
Initializes forge2d.