JoltPhysicsEngine class final
Jolt Physics (through just_jolt) as a PhysicsEngine3D.
PhysicsEngineFactory.create3D() makes one and throws when it cannot
run. Where it cannot — the web, a 32-bit Android ABI, an app whose
pubspec did not ask for Jolt to be built — unavailableReason says why.
All worlds share one job system for the whole process, with workerThreads threads (cores minus one by default; the first engine started decides). Contacts bounce as much as the less bouncy of their two bodies, as in the 2-D engines.
- Implemented types
Constructors
- JoltPhysicsEngine({int workerThreads = -1})
-
An engine whose job system has
workerThreadsthreads; below 0 is "cores minus one".
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- joltVersion → String?
-
Jolt's version,
major.minor.patch; null when it is not available. Like everything here, it starts Jolt with workerThreads threads.no setter - liveWorlds → int
-
How many native worlds are alive in this process (for leak checks).
no setter
- name → String
-
A short name for logs:
jolt,fake.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Why this engine cannot run here (the web, a native library not in the
build), or null when it can.
no setteroverride
- workerThreads → int
-
Threads in the process-wide job system, if this engine starts it.
final
Methods
-
createWorld(
PhysicsWorldSettings3D settings) → PhysicsWorld3D -
Makes a world. Throws a Physics3DUnsupportedError saying why when
unavailableReason is not null.
override
-
destroyAll(
) → void -
Destroys every world this engine made in this process, whoever made
it — for a hot restart, when the Dart objects that owned them are gone
but native memory is not. A world still held reads as disposed.
override
-
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