So, in my playground link, I have a checkerboard grid. The grid cells all have their own physics box. What I want to do is to listen for collision events above the checkerboard cells.
Basically the bullets are shooting over top of the gridcells, and I’d like to have an event fire off when it intersects a new cell. Is there a method I could use to elevate the physicsImposter?
If the phsyicsImposter weren’t actually attached to the object, this could work.
Hi Cedric, that’s exactly right. I have a checkered grid on the floor, but bullet fly through the air above the grid. I was trying to find a way to have the grid cells have an effect and light up when bullet cells fly over them.
I thought if I could put the physicsImposter for the cells above the grid, that this would work. Now I’m leaning towards making a 1:1 invisible grid above the floor, and using filterEvents instead (so that way the bullets won’t bounce off or be stopped by the physics imposters).
IMHO, it’s overkill.
if you have cells of 1x1 units, the cell number is the Math.trunc(bulletPosition).
if the cell is 2x2, then the cell number is Math.trunc(bulletPosition/2)
It would be lovely though if you could pass in an array to obj.intersectsMesh(obj2). Then you wouldn’t need to iterate using a forLoop like I am doing here