HavokPlugin.raycast does not use collideWith filterMask correctly when raycasting against trigger shapes

Hello!

I ran into an issue when trying to raycast against triggers. The raycast works fine as long as I don’t use the collideWith filter. However, as soon as I define that, the raycast no longer collides with the triggers, even if all the filters line up.

The bug can be seen here: https://playground.babylonjs.com/#BF7GJA#2

Looking through the source code here:

It seems like shouldHitTriggers is always set to false. It’s very odd that a raycast without a collideWith mask hits a trigger then. I just tested locally by reimplementing the functionality and raycasting with shouldHitTriggers=true, and it works like expected.

Is it possible that you could include a configuration option in the raycast query so we can make raycasts that hit triggers aswell. It seems a little odd to leave it out, especially when it is not mentioned in the documentation.

Let me add that to the query options!

2 Likes

Thanks Cedric! :slight_smile: