b2w_setBodyTransform function

  1. @Native<Void Function(Int64, Float, Float, Float, Int32)>(ffi.Int64, ffi.Float, ffi.Float, ffi.Float, ffi.Int32)>()
void b2w_setBodyTransform(
  1. int bodyHandle,
  2. double x,
  3. double y,
  4. double angle,
  5. int wake,
)

Teleport a body. Box2D calls this fairly expensive (it moves the body's shapes in the broad phase and drops their contacts' warm start): use it for respawns, checkpoints and warps, and velocity for ordinary motion. wake != 0 wakes the body too, which moving it alone does not.

Implementation

@ffi.Native<
  ffi.Void Function(ffi.Int64, ffi.Float, ffi.Float, ffi.Float, ffi.Int32)
>()
external void b2w_setBodyTransform(
  int bodyHandle,
  double x,
  double y,
  double angle,
  int wake,
);