Extending RayHit by TriangleIndex and BarycentricCoordinate

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BrightBit
Posts: 21
Joined: Fri Jul 08, 2016 12:11 pm

Extending RayHit by TriangleIndex and BarycentricCoordinate

Post by BrightBit »

Long time no see! :)

Can I somehow motivate you to extend the RayHit struct by an index and the Barycentric Coordinate of the triangle a corresponding ray hit? :) If not, do you plan something like this for version 2.0 of your engine?
I ask this because I am trying to use QueryAccelerator and FindRayTriangleIntersection to get the triangle index on my own and I now noticed that an extension of the RayHit struct as mentioned above might be easy to add and would solve my problem.

BTW: It's not important but I always wondered: What does BEPU stand for?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Extending RayHit by TriangleIndex and BarycentricCoordin

Post by Norbo »

I'm hesitant to modify v1.X to include triangle-specific information in the RayHit. It's designed to contain only common geometry information- a minkowski sum doesn't have barycentric coordinates, for example.

That said, I do find it too annoying to get type specific information out of the space-spanning helpers right now. v2 is definitely going to change things here somehow, I'm just not yet sure how. It might be a higher level change, or maybe it would just be the obvious union approach. A union would have some extensibility issues, but realistically... the problematic sort of extension would be really rare. There are some similar questions to be answered about contacts, too- it would be nice to have an easy pay-to-play way to get type specific contact generation information. That would help with varying friction across a mesh or playing different sounds based on mesh materials.
BTW: It's not important but I always wondered: What does BEPU stand for?
I'm taking that secret to my grave.





(it's a nonsense word originating from some friend-conversations many many moons ago)
Post Reply