Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2026-07-20

### Changes

---

Packages with breaking changes:

- [`forge2d` - `v0.15.0`](#forge2d---v0150)

Packages with other changes:

- There are no other changes in this release.

---

#### `forge2d` - `v0.15.0`

> Upgrading from 0.14 requires code changes throughout: see the
> [Forge2D migration guide](https://docs.flame-engine.org/main/other_modules/forge2d/migration.html).

- **FEAT**: Add an interactive web example gallery deployed to GitHub Pages ([#117](https://github.com/flame-engine/forge2d/issues/117)). ([664f9443](https://github.com/flame-engine/forge2d/commit/664f9443e72c3261ed8149c0a267348e05cc0d1c))
- **FEAT**: Run on the web via a WebAssembly build of Box2D ([#116](https://github.com/flame-engine/forge2d/issues/116)). ([409b2750](https://github.com/flame-engine/forge2d/commit/409b27507936ae1d7c0a67ff211d24687c6d06c3))
- **BREAKING** **FEAT**: Replace the pure-Dart engine with native Box2D v3 bindings ([#115](https://github.com/flame-engine/forge2d/issues/115)). ([3ea15287](https://github.com/flame-engine/forge2d/commit/3ea152877a3c2a71b0b0666823fffb32102bf53b))


## 2025-10-26

### Changes
Expand Down
60 changes: 45 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,53 @@ The standard [bench2d](https://github.com/joelgwebber/bench2d) benchmark

## Migrating from forge2d 0.14

Forge2D 0.15 is a ground-up rewrite on the Box2D v3 API. The high-level
concepts map as follows:

- Call `await initializeForge2D()` once before creating a world.
- `Fixture` is gone: bodies now carry `Shape`s directly, created with
Forge2D 0.15 is a ground-up rewrite on the Box2D v3 API. For the full
walkthrough, see the [Forge2D migration
guide](https://docs.flame-engine.org/main/other_modules/forge2d/migration.html).
The high-level concepts map as follows:

- Dart 3.12+ and a C toolchain are required, see [Requirements](#requirements).
This is usually the biggest practical hurdle of the upgrade.
- On the web, `await initializeForge2D()` has to run before the first
`World` is created. On native it is a no-op (the backend is created
lazily), but cross-platform code should always await it.
- `World`, `Body`, `Shape`, `Chain`, and joints are value-like handles over
native ids rather than Dart objects owning their state. Nothing is
garbage collected: destroy things explicitly, and check `isValid` if a
handle may have outlived what it points at.
- `Fixture` is gone: bodies carry `Shape`s directly, created with
`body.createShape(geometry, ShapeDef(...))` where the geometry is a
`Circle`, `Capsule`, `Segment`, `Polygon`, or a `Chain` via
`body.createChain`.
`Circle`, `Capsule`, `Segment`, or `Polygon`. Chains have their own
`body.createChain(ChainDef(points: ...))`.
- `EdgeShape` is replaced by `Segment` (standalone) and one-sided chain
shapes for level geometry.
- `ContactListener` callbacks are replaced by polled events:
`world.contactEvents` after each step, opted in per shape with
`ShapeDef(enableContactEvents: true)`.
- Query and ray-cast callback classes are replaced by methods on `World`
returning results directly.
- The joints are now distance, filter, motor, mouse, prismatic, revolute,
weld, and wheel. Gear, pulley, rope, friction, and constant-volume
joints do not exist in Box2D v3.
- Friction, restitution, and rolling resistance live on
`ShapeDef(material: SurfaceMaterial(...))` instead of being fields on the
old `FixtureDef`.
- `ContactListener` callbacks are replaced by events polled after each
step: `world.contactEvents`, `world.sensorEvents`, and
`world.bodyMoveEvents`. Contact and sensor events are opted in per shape
with `ShapeDef(enableContactEvents: true)` and
`ShapeDef(isSensor: true, enableSensorEvents: true)`; hit events need
`enableHitEvents`. Custom filtering is a `world.customFilterCallback`.
- Query and ray-cast callback classes are gone: `world.castRayClosest`,
`world.castRayAll`, and `world.overlapAabb` return their results
directly, and `world.castRay` takes a plain closure. `AABB` is now
`Aabb`.
- Joints are created with type-specific methods such as
`world.createRevoluteJoint(RevoluteJointDef(...))`, and the set is now
distance, filter, motor, mouse, prismatic, revolute, weld, and wheel.
Gear, pulley, rope, friction, and constant-volume joints do not exist in
Box2D v3.
- Rotations are a `Rot` rather than a raw angle: `BodyDef(rotation: ...)`
and `body.setTransform(position, rotation)` take one, built with
`Rot.fromAngle(radians)`. `body.angle` still reads back a double.
- `body.applyForce` and `body.applyLinearImpulse` take the point of
application as a named argument, `applyForce(force, point: ..., wake:
true)`, and applying at the centre of mass is just leaving `point` out.
`applyForceToCenter` is gone.
- `DebugDraw` is an abstract class you implement and pass to
`world.draw(debugDraw)`, with colors as `0xRRGGBB` ints.
- The particle system (LiquidFun) is not part of Box2D v3 and has been
removed; stay on forge2d 0.14 if you depend on it.
- Worlds default to `subStepCount: 4` in `step` instead of velocity and
Expand All @@ -121,6 +150,7 @@ concepts map as follows:
- Destroying bodies, shapes, chains, or joints while the world is stepping
(from a collision callback) is deferred until the step ends; creating
them mid-step throws a `StateError` instead of the old silent queueing.
`world.destroy()` itself is not deferred and throws mid-step.

## Timeline

Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
sdk: ^3.12.0

dependencies:
forge2d: ^0.14.2+1
forge2d: ^0.15.0

dev_dependencies:
flame_lint: ^1.4.1
11 changes: 11 additions & 0 deletions packages/forge2d/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.15.0

> Note: This release has breaking changes.
>
> Upgrading from 0.14 requires code changes throughout: see the
> [Forge2D migration guide](https://docs.flame-engine.org/main/other_modules/forge2d/migration.html).

- **FEAT**: Add an interactive web example gallery deployed to GitHub Pages ([#117](https://github.com/flame-engine/forge2d/issues/117)). ([664f9443](https://github.com/flame-engine/forge2d/commit/664f9443e72c3261ed8149c0a267348e05cc0d1c))
- **FEAT**: Run on the web via a WebAssembly build of Box2D ([#116](https://github.com/flame-engine/forge2d/issues/116)). ([409b2750](https://github.com/flame-engine/forge2d/commit/409b27507936ae1d7c0a67ff211d24687c6d06c3))
- **BREAKING** **FEAT**: Replace the pure-Dart engine with native Box2D v3 bindings ([#115](https://github.com/flame-engine/forge2d/issues/115)). ([3ea15287](https://github.com/flame-engine/forge2d/commit/3ea152877a3c2a71b0b0666823fffb32102bf53b))

## 0.14.2+1

- **FIX**: Create and destroy joints after world has been locked ([#110](https://github.com/flame-engine/forge2d/issues/110)). ([0704959f](https://github.com/flame-engine/forge2d/commit/0704959fa0ef904a056228846c006498d9361520))
Expand Down
2 changes: 1 addition & 1 deletion packages/forge2d/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
sdk: ^3.12.0

dependencies:
forge2d: ^0.14.2+1
forge2d: ^0.15.0
web: ^1.1.1

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion packages/forge2d/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: forge2d
version: 0.14.2+1
version: 0.15.0
description: A 2D physics engine for Dart, binding to the native Box2D v3 library. Also works with the Flame game engine in Flutter.
homepage: https://github.com/flame-engine/forge2d
resolution: workspace
Expand Down
Loading