b2w_castRayAll function

  1. @Native<Int32 Function(Int64, Float, Float, Float, Float, Uint64, Uint64, Pointer<Int64>, Pointer<Float>, Int32)>(ffi.Int64, ffi.Float, ffi.Float, ffi.Float, ffi.Float, ffi.Uint64, ffi.Uint64, ffi.Pointer<ffi.Int64>, ffi.Pointer<ffi.Float>, ffi.Int32)>()
int b2w_castRayAll(
  1. int worldHandle,
  2. double originX,
  3. double originY,
  4. double translationX,
  5. double translationY,
  6. int categoryBits,
  7. int maskBits,
  8. Pointer<Int64> outBodies,
  9. Pointer<Float> outBuffer,
  10. int maxHits,
)

Cast a ray and report up to maxHits hits, in no order, one per shape (a body of several shapes can be there more than once). outBodies: maxHits handles. outBuffer: maxHits * 5 floats, per hit pointX, pointY, normalX, normalY, fraction A shape the ray starts inside is a hit at fraction 0, at the origin, with a zero normal. Returns how many it wrote.

Implementation

@ffi.Native<
  ffi.Int32 Function(
    ffi.Int64,
    ffi.Float,
    ffi.Float,
    ffi.Float,
    ffi.Float,
    ffi.Uint64,
    ffi.Uint64,
    ffi.Pointer<ffi.Int64>,
    ffi.Pointer<ffi.Float>,
    ffi.Int32,
  )
>()
external int b2w_castRayAll(
  int worldHandle,
  double originX,
  double originY,
  double translationX,
  double translationY,
  int categoryBits,
  int maskBits,
  ffi.Pointer<ffi.Int64> outBodies,
  ffi.Pointer<ffi.Float> outBuffer,
  int maxHits,
);