Birch-san / box2d-wasm

Box2D physics engine compiled to WebAssembly. Supports TypeScript and ES modules.
263 stars 21 forks source link

AABB Queries #12

Closed gpeles closed 3 years ago

gpeles commented 3 years ago

I'm trying to implement AABB queries similar to the following example: https://box2d.org/documentation/md__d_1__git_hub_box2d_docs_dynamics.html#autotoc_md118

That would be with something like:

class MyQueryCallback extends Box2D.b2QueryCallback {
  ReportFixture(fixture: Box2D.b2Fixture) {
    const body = fixture.GetBody()
    body.SetAwake(true)
    return true
  }
}

But then when I instantiate the class I get this error: 'cannot construct a b2QueryCallback, no constructor in IDL'

What am I doing wrong? Would appreciate any help... Thanks!

gpeles commented 3 years ago

OK should have had a closer look at your docs, this is basically the same as the Raycasting example...