Collision and intersection points

Hi there,

I’m completely new to DOTS and DOTS Physics but I’m wondering if this system would allow to compute points of intersecting shapes (primitives, mesh, convex hull).
If possible, any clue on how to achieve this would be awesome.
Here’s a great example coming from : GitHub - jeffvella/UnityNativeCollision: SAT Collision in C# for Unity3D Burst Compiler

Thanks a lot !

The project you linked to already does what you ask for and is DOTS enabled (uses Burst, native containers and so on).

Applying that to physics should just be a matter of converting those shapes to physics colliders.

Thanks for the answer.
I achieved to get something interesting without having to jump onto integrating that library. But I still have a few wonders.

To get those intersecting points, I am using a mesh as a collider, a PointDistanceJob and collects results using DistanceHits. I am able able to collect every intersecting point between the mesh and any other shape.
If I switch from using a mesh and use a primitive, I am only able to get one intersecting point. Is there a way to get multiple points using primitives ?
Also, I can get intersecting/hit points main properties (position and surface normal) but I would like to be able to retrieve other properties such as :

  • point velocity on contact

  • point normal (not hit surface normal but point on mesh used for the query)

  • object velocity

Could I get those properties using that approach ? Or maybe there’s an other approach that could help me get these points with those properties ?
Thanks !

I think that the most useful thing would be to be able to get data from the points on the collider mesh (vertex index, triangle index, etc.) not only from the colliding/hit mesh.
But for the moment I can only get the original position using the hit position, hit normal and distance.