create3D static method

PhysicsEngine3D create3D({
  1. int workerThreads = -1,
})

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).

Throws a Physics3DUnsupportedError where it cannot run: the web, a 32-bit Android ABI, or an app whose pubspec does not ask for Jolt to be built (hooks: user_defines: just_jolt: build: true). Nothing 3-D is in an app that never calls it.

Implementation

static PhysicsEngine3D create3D({int workerThreads = -1}) {
  final engine = JoltPhysicsEngine(workerThreads: workerThreads);
  final reason = engine.unavailableReason;
  if (reason != null) throw Physics3DUnsupportedError(reason);
  return engine;
}