PhysicsEngineFactory class abstract final

The platform's physics engines.

create gives the 2-D engine: Box2DPhysicsEngine (Box2D v3.2 through just_box_2d) on native platforms, which falls back to the pure-Dart engine where the library is not built, and the pure-Dart PhysicsEngine on the web. create3D gives the 3-D engine, Jolt Physics, where it can run; supports3D and unavailable3DReason ask first.

final physics = PhysicsEngineFactory.create()..initialize();

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

supports3D → bool
Whether create3D can make an engine here (see unavailable3DReason).
no setter
unavailable3DReason → String?
Why create3D would throw here, or null when 3-D physics can run.
no setter

Static Methods

create() → PhysicsEngine
Create the best available physics engine for the current platform.
create3D({int workerThreads = -1}) → PhysicsEngine3D
The platform's 3-D physics engine: Jolt Physics, through just_jolt, its job system started with workerThreads threads (below 0: cores minus one; the first engine started decides).