Closed lo-th closed 2 years ago
I think with eDEFAULT
flags the raycast reports multiple hits instead of a single blocking one (although according to the doc it should not)
You should be able to iterate over the result in a loop (until rayBuffer.getNbAnyHits()
) and take the nearest from rayBuffer.getAnyHit()
. The results are not ordered by distance, so simply taking the first one might give you a wrong result. Alternatively you can try to play around with the flags but I don't know if that makes a difference.
yes is perfect many thank's
let r = rayBuffer.getAnyHit()
r.position, r.normal , r.actor are good
and rayBuffer.getNbAnyHits() return 1 with default
Hi me again about raycast
standard init for ray is
after on step
let hit = root.scene.raycast( v1, v2, distance, rayBuffer, rayFlags, rayFilter )
hit work is return good true or false but rayBuffer.block not return good position normal and actor ? if you have idea, thank's