just_box_2d 0.1.0
just_box_2d: ^0.1.0 copied to clipboard
Box2D v3.2 for Dart: a C layer of checked handles, batched reads, events, queries, character-mover queries and one-way platforms, built from source by a hook.
0.1.0 #
First release: Box2D for Dart, moved out of just_physics_engine 1.4.0 so other code can use it and the physics engine is plain Dart.
- Box2D v3.2 (our fork of erincatto/box2d,
a7a2e57) compiled from source by a two-stage build hook: a staticbox2d_core, linked into the bundled librarypackage:just_box_2d/just_box_2d. Builds by default on every native platform and every Android ABI; an app turns it off withhooks: user_defines: just_box_2d: build: false. Box2D(inpackage:just_box_2d/just_box_2d.dart, safe on the web): whether the library is in the build — one call up front, so a missing library is reported, not found mid-game — and its version (b2w_version).package:just_box_2d/ffi.dartadds the bindings.- The
b2w_*C layer: worlds on their own thread pool at 100 units to the metre with min-restitution mixing; int64 handles carrying their world's generation, checked on every call; finalizers that only queue a destroy, performed on the next call from Dart; batched transform reads; contact, sensor and body-move events, and an impact callback from Box2D's hit events; ray and AABB queries; character-mover collide and cast queries; one-way platforms; circles, boxes, polygons of any vertex count (cut into convex pieces past 8), rounded polygons, capsules, segments and chains; revolute, prismatic, distance (rope, rod or spring), weld and wheel joints. Every function's rules and units are documented inbox2d_wrapper.hand carried into the bindings' doc comments. - Only the
b2w_*functions are exported: Box2D's own symbols, and the C++ runtime Android and Linux link in, stay hidden. - Web, compiled to JavaScript or to WebAssembly:
package:just_box_2d/just_box_2d.dartcompiles, andBox2D.isAvailableis false. - An example,
example/example.dart: a ball dropped on a floor. LICENSEcarries Box2D's MIT text beside ours, in the form Flutter's licence page reads.