b2w_setBodyMass function

  1. @Native<Void Function(Int64, Float)>(ffi.Int64, ffi.Float)>()
void b2w_setBodyMass(
  1. int bodyHandle,
  2. double mass
)

Give the body this mass instead of the one its shapes' density adds up to. The centre of mass stays where the shapes put it, and the rotational inertia scales with the mass, so the body turns as before. Call it after adding the shapes (adding one sums the mass again), and again after b2w_setBodyType.

Implementation

@ffi.Native<ffi.Void Function(ffi.Int64, ffi.Float)>()
external void b2w_setBodyMass(int bodyHandle, double mass);