x


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?

more ▼

asked Feb 22 '12 at 10:00 PM

ysperanza gravatar image

ysperanza
1 2 2 2

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.

Feb 22 '12 at 10:39 PM Berenger

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?

Feb 23 '12 at 02:31 AM ysperanza

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.

Feb 23 '12 at 03:23 AM Berenger
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2584
x1947
x1404
x123
x5

asked: Feb 22 '12 at 10:00 PM

Seen: 604 times

Last Updated: Feb 23 '12 at 03:23 AM