physx-rs icon indicating copy to clipboard operation
physx-rs copied to clipboard

Add trampolines for PxSweepCallback, PxRaycastCallback and PxOverlapCallback

Open Hentropy opened this issue 5 years ago • 2 comments

The Problem

Currently, scene queries are not usable because the callback types they need are not instantiable.

The Solution

Add trampolines for PxSweepCallback, PxRaycastCallback and PxOverlapCallback.

Alternatives

I tried passing in the callback viz MaybeUninit, but it crashes with a memory access violation. It's theoretically possible to cobble the vtable together in Rust, but a trampoline is the best solution.

Context

I have written call throughs for sweep, overlap, and raycast but without these types they cannot be called.

Hentropy avatar Oct 27 '20 07:10 Hentropy

Hey @Hentropy, I've got a rough implementation working for this right now that supports usage of PxRaycastBuffer and user-defined PxRaycastCallback implementations. I should have a PR ready this weekend for raycasts, sweeps, and overlaps and I'd love to have you review it when you have the chance. :)

NickCaplinger avatar Dec 12 '20 20:12 NickCaplinger

@NickCaplinger You're a legend, thank you. Gimme a ping and I'll take a look 😄

Hentropy avatar Dec 13 '20 05:12 Hentropy

Closed in #181

Jake-Shadle avatar Mar 04 '23 08:03 Jake-Shadle