Skip to content
pubscout

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
$ flutter pub add flutter_scene_rapier
Source repository

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.

  • forge2d

    Pick forge2d if you need 2D physics instead of 3D physics.

  • flame

    Pick flame if you want a complete 2D game engine rather than just a 3D physics backend for flutter_scene.

Works with

Packages commonly used together with flutter_scene_rapier: ones it builds on, ones built on it, and its own family.