Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to query Obi geometry with raycasts?
#7
Could you please write a simple script that shows how it'd be used?

Judging from what I understand so far, I'd recommend allowing a list to be provided for query results. I know you could just use a really huge array. But I understand if this could possibly mess up some sort of optimization or simplicity with regards to how the parallelization is done.

I'm guessing a raycast (similar to Physics.Raycast) would be done by enumerating through the results and:
  • Discarding results that have a positive distance
  • Converting the "point" result to a raycast distance using a dot product "dot(point-rayOrigin,rayDirection)" and discarding all but the smallest positive result (the closest point ahead of the ray).
  • Returning the result if they weren't all discarded.

Also, I LOVE the idea of contactOffset! This is something I wish Unity exposed in UnityEngine.Physics.
Reply


Messages In This Thread
RE: How to query Obi geometry with raycasts? - by Hatchling - 21-05-2021, 03:45 PM