- Home /
Implementing Meshless Deformation
Hi you all!
I'm interested in implementing a meshless deformation component for Unity. I already have the code that simulates the deformations - what I'd like to do is use Unity's physics to detect mesh interpenetration.
The Unity documentation apparently says that the only way to receive physics collision events is to have a rigid body component attached to the collider, but since the objects I'm trying to simulate are deformable (non rigid), I can't use this. I'm moving the vertices of my deformable mesh individually (each vertex has its own speed).
How can I know exactly which vertices of a mesh in a MeshCollider are colliding (are inside) other colliders?
I think you'll have to code your own collision detection here. First distance, then bounding box and finally vertex. I've never thought about it though.
Could you clarify it? What do you mean by the three steps you mention? Do you mean to first do a "mesh radius" test, to see if the point is inside the bounding sphere, then a similar bounding box test and finally test each vertex/triangle?
I mean, to optimize the algorithm, only do the heavy part (vertices by vertices) when you're sure the objects are colliding. You start by the simplest, a distance check, the a little more accurate, the bounding box, and finally the vertices. That's just the first think I thought about, maybe someone have a clever way, that's why I used a comment and not an answer.
Your answer
Follow this Question
Related Questions
MeshCollider Collision Table 2 Answers
MeshCollider Failure at high velocities 0 Answers
Can I check collision with non-convex mesh colliders? 0 Answers
Non-Convex Mesh Collider triangle limit - is it more than 255? 0 Answers
Using your own mesh for collision? 2 Answers