Would it be possible to add the ignoreBody flag present in IPhysicsShapeCastQuery to IRaycastQuery?
My use case is to filter out the player’s body when raycasting from behind the player.
This change in havokPlugin.ts works for me:
public raycast(from: Vector3, to: Vector3, result: PhysicsRaycastResult, query?: IRaycastQuery): void {
const queryMembership = query?.membership ?? ~0;
const queryCollideWith = query?.collideWith ?? ~0;
const shouldHitTriggers = query?.shouldHitTriggers ?? false;
result.reset(from, to);
//const bodyToIgnore = [BigInt(0)];
const bodyToIgnore = query.ignoreBody ? [BigInt(query.ignoreBody._pluginData.hpBodyId[0])] : [BigInt(0)]; // copied from shapeCast
Of course, IRaycastQuery would need to be updated as well.
Thank you!
Edit: PR created: Add ignoreBody filter for IRaycastQuery by lwp-joel · Pull Request #17390 · BabylonJS/Babylon.js · GitHub