b2w_createWorld function

  1. @Native<Int64 Function(Float, Float, Int32)>(ffi.Float, ffi.Float, ffi.Int32)>()
int b2w_createWorld(
  1. double gravityX,
  2. double gravityY,
  3. int numThreads
)

Create a world with gravity (gravityX, gravityY) and a thread pool of its own for Box2D's work. numThreads <= 0 → cores - 1, at most 4. Returns its handle; 0 when every world slot is taken (Box2D has 128).

Implementation

@ffi.Native<ffi.Int64 Function(ffi.Float, ffi.Float, ffi.Int32)>()
external int b2w_createWorld(double gravityX, double gravityY, int numThreads);