Raycasting hit point
Posted: Sat Aug 22, 2020 11:01 pm
Hello! Having a great time with the library, really well done.
I'm looking to implement a very primitive "is the body airborne" check by simply ray casting straight down, and if a hit occurs check whether the distance to the hit point is greater than some arbitrary value. Two questions there:
1. I see how the IHitHandler interface will provide the Collidable that was hit, but I don't see the actual Vector3 point of the hit. Is that available?
2. I'm assuming Simulation.Raycast reports all collidables that would be struck by the ray. For performance sake is there a way to call it as "report ONLY the closest hit, and then stop considering others" ?
Thanks much!
I'm looking to implement a very primitive "is the body airborne" check by simply ray casting straight down, and if a hit occurs check whether the distance to the hit point is greater than some arbitrary value. Two questions there:
1. I see how the IHitHandler interface will provide the Collidable that was hit, but I don't see the actual Vector3 point of the hit. Is that available?
2. I'm assuming Simulation.Raycast reports all collidables that would be struck by the ray. For performance sake is there a way to call it as "report ONLY the closest hit, and then stop considering others" ?
Thanks much!