flutter_scene_rapier
0.5.2, released 7 weeks ago by bdero.dev
Rapier 3D physics backend for flutter_scene using FFI and WebAssembly
WASM-ready
What it does
Implements the abstract physics contract from flutter_scene against the Rapier 3D engine over dart:ffi for native platforms and WebAssembly for the web. Supports rigid bodies, colliders, joints, queries, and collision events.
AI-written summary of version 0.5.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building 3D games or simulations with flutter_scene
- You need 3D rigid body physics, collision detection, and raycasting in Flutter
Skip it when
- You are building a 2D game where a 2D physics engine like forge2d is more appropriate
- You do not use flutter_scene
Strengths
- Provides high-performance 3D physics via Rapier
- Supports multiple platforms including Android, iOS, Web, macOS, Linux, and Windows via prebuilt binaries
- Includes support for world snapshots and full restoration for rollback prediction
Weaknesses
- Experimental status means APIs may change between releases
- Requires building from source with a Rust toolchain for unsupported targets or when editing native code
Setup
- Kind
- FFI (native library)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 6
Requires initializing RapierWorld before use and managing native binaries or web WebAssembly modules.
await RapierWorld.ensureInitialized();
final scene = Scene();
final world = PhysicsWorld(RapierWorld(gravity: Vector3(0, -9.81, 0)));
scene.root.addComponent(world);Alternatives
Packages that do the same job and could replace flutter_scene_rapier.
Works with
Packages commonly used together with flutter_scene_rapier: ones it builds on, ones built on it, and its own family.
- cryptoflutter_scene_rapier depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- hooksflutter_scene_rapier depends on itDart API for the JSON-based protocol for package build and link hooks.
- code_assetsflutter_scene_rapier depends on itProvides the hook protocol specification for bundling native code with Dart packages.
- ffiflutter_scene_rapier depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- vector_mathflutter_scene_rapier depends on itVector math library for 2D/3D/4D vectors, matrices, quaternions, and geometry.
- flutter_sceneSame familyA 3D game engine for Flutter built on Flutter GPU with PBR lighting and glTF support.