Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Alembic Cache Mesh as Collider?
#3
(03-11-2020, 09:35 AM)josemendez Wrote: animated MeshColliders are not supported by Unity, or at the very least, not intended to be used like this. (and as a consequence, not supported by Obi either). Same goes for pretty much any realtime game engine.

There's some workarounds, but they universally result in terrible performance as MeshColliders rely on pre-processing the mesh to allow for fast collision queries. The mesh is inserted into a spatial subdivision structure (BVH, BIH, KD-Tree, or similar) when the MeshCollider is created, then this structure is used to quickly find the closes triangle(s) to a certain position during collision detection. If you change the shared mesh every frame, then this structure needs to be recreated from scratch every frame which pretty much defeats the purpose of using it (as generating the entire structure can be slower than brute-forcing collision detection by iterating trough all triangles).

For one such workaround, see:
https://answers.unity.com/questions/1197...inned.html

This updates the collider in sync with a SkinnedMeshRenderer. You should be able to adapt the code to update the collider in sync with the alembic cache.

Thank you Jose, this is very informative, much appreciated!  For this particular project, I'm aiming to use Unity as an "offline" renderer for a film-type project rather than real-time, so I'm not quite as concerned with the speed performance.  I just like your sim tools more, as they're more effective and easier to use than I find Maya's sim tools.  Anyhow...  Thanks again!

-Matt
Reply


Messages In This Thread
Alembic Cache Mesh as Collider? - by mattstrangio - 31-10-2020, 08:04 PM
RE: Alembic Cache Mesh as Collider? - by mattstrangio - 05-11-2020, 06:07 PM