Commit Graph

17 Commits

Author SHA1 Message Date
Dion Moult e089d4c78a Use vectors instead of unordered_map for 15% speed boost 2024-02-08 11:44:08 +11:00
Dion Moult 155f0abbfe Refactor out BVH-BVH clash into its own function. 2024-02-08 10:35:35 +11:00
Dion Moult 77d9688296 Replace threeyd tri-tri intersect library with physx implementation. 2024-02-08 10:21:56 +11:00
Dion Moult 09efd68e6e Move vendor functions into clash_utils 2024-02-07 23:01:21 +11:00
Dion Moult 0b3e9e7c5a Reuse geom iterator triangulation data, don't use optimal OBBs for speed, verts now use gp_Pnt instead of BVH_Vec3d, and optimise add_triangulated. 2024-02-07 17:49:12 +11:00
Dion Moult b658b74b90 Fix missing clearance AABB check and add check_all clearance bool. Minor cleanup to use vert/normal maps. 2024-02-07 09:28:19 +11:00
Dion Moult 47dd8ec4dd Use map for verts and normals, basic implementation of piercing checks. 2024-02-06 22:21:33 +11:00
Dion Moult 9ba1596e30 Implement early return bool for intersection tests. 2024-02-05 18:47:08 +11:00
Dion Moult 930020bf05 Use NVIDIA's ray-tri intersection implementation under BSD-3 license. 2024-02-04 22:51:51 +11:00
Dion Moult 1fe69e5f19 Simple implementation of clearance clash. 2024-02-04 16:02:45 +11:00
Dion Moult 988c8f16f3 Implement collision clash type (pure tri intersection regardless of protrusion)
This should be equivalent to select(element) but faster and with an allow_touching toggle.
2024-02-04 09:01:35 +11:00
Dion Moult 080b628df5 Optimise by removing unnecessary (very slow) triangle shrinking, more optimal OBBs, check OBB first for points_in_b prior to doing raycast (much faster now), and return the surface point of the protrusion too for convenience. 2024-02-03 16:14:26 +11:00
Dion Moult d0333ac7cd Penetration distances now are influenced by the normal for better results.
Add cache for points that have already been checked.

Separate out new add_triangulated function with new kwarg add_element(should_triangulate=True) so that you can still have the old geom tree using aabb only if you want, also because add() is used in boolean_utils. Tolerance is now a kwarg.

I misunderstood the OBB dimension and should *2 not /2 which now makes it much slower since there's more triangles to check.
2024-02-02 23:35:06 +11:00
Dion Moult e95e16c102 First attempt at implementation of intersection clash checks.
This considers only protruding clashes. It does not consider touching nor encroaching clashes and does not consider protrusion direction in the protrusion distance.
2024-02-01 18:30:20 +11:00
Thomas Krijnen c18458b3db Refactoring 2022-11-13 11:21:58 +01:00
Thomas Krijnen 3736a8b4b4 Refactoring 2022-11-13 11:04:16 +01:00
Thomas Krijnen bc2d76e685 Include-what-you-use 2022-06-15 13:41:13 +02:00