flutter3d_physics

Collision shapes, a broadphase grid, ray and overlap queries, rigid bodies and a character controller.

No Flutter and no renderer in it. That is the boundary this package exists to keep: it runs under dart test, and the day it needs a widget is the day something has been put in the wrong package.

final world = CollisionWorld();
world.add(Collider(shape: CollisionBox(Vector3(2, 1, 2))));

final body = CharacterController(world: world, position: Vector3(0, 2, 0));
body.step(dt, wishDirection: forward, sprint: false);

What the character controller is for

Walking, which is harder than falling. Slopes it can climb and slopes it slides off, steps it can walk up without a jump, ramps whose surface it follows, a coyote window after walking off an edge and a buffered jump pressed just before landing. Every one of those is a decision with a test beside it saying which way it went and why.

Tolerances

Nearly names the four magnitudes this package compares against, because the number was never the interesting part: a distance nobody can perceive, the slack on two numbers computed different ways, and a denominator guard on a squared quantity are different questions that used to look identical.


Part of flutter3d, an independent implementation of a 3D engine for Flutter — not a fork or a binding of another engine, and not affiliated with the Flutter team. Three switchable rendering backends: Impeller via Flutter GPU, WebGL2, and a software rasteriser. glTF, OBJ and .f3d loading, six lighting models, shadows, bloom, skinning, animation, BVH culling and picking; a deterministic fixed-step game layer with collision, navigation, positional audio, and gamepad and touch input. Three example games — shooter, platformer, racing — each built on its genre package: flutter3d_game_shooter, flutter3d_game_platformer, flutter3d_game_racing. A new game starts from apps/flutter3d_template_app. Documentation: flutter3d.pleion.dev.

Libraries

flutter3d_physics
Collision and character movement, with nothing above them.