- Home /
Concave colliders from smaller pieces
What should I do, when I need to have many space ships using concave collision? When I was using Havok, we always divided such complicated collisions into many (for example 20-30) boxes and other primitives. So I did the same thing for unity. Hovewer, it threat it as concave mesh instead of multiple convex. Example collision for one ship. Green is a collision made from simple objects like boxes, etc. I'm not happy about placing all that boxes via unity editor. It will take hours (especially, that ship has interior).
Any fix? I doubt that PhysX is less superior than Havok.
Answer by Wolfram · Jun 18, 2012 at 08:32 PM
Well, it mostly depends on how precise you need the colliders to be. Does it really have to be precise on a triangle level? And does it have to be convex, or would a normal mesh collider suffice?
Maybe a mixture of convex submeshes and hand-placed boxed/capsules? Also, checking the "convex" flag will severely limit the number of polygons the generated mesh collider can have, so it usually won't be a perfect fit anyway.
You could also create a low-poly version of your model (and without interior), probably split it into several convex meshes, and then use a mesh collider for that object, while rendering the high-poly version.
Answer by UGTools · Oct 10, 2012 at 10:54 AM
This is maybe what you are looking for: http://www.youtube.com/watch?v=mu__FxT8Gzk
It generates colliders for concave objects. In the end, it automates the process you are describing (creating multiple convex colliders to fit a concave shape with precision).
It is available at the Unity3D Asset Store: http://u3d.as/content/ultimate-game-tools/concave-collider/3rS
Answer by Madman07 · Jun 19, 2012 at 05:58 PM
@"Does it really have to be precise on a triangle level?"
It has to be when ship shield is not active. Energy bullets and other weapons cannot explode meters from hull.
@"You could also create a low-poly version of your model (and without interior), probably split it into several convex meshes, and then use a mesh collider for that object, while rendering the high-poly version."
And this is exactly what I've proposed. Hovewer how to get concave mesh from convex parts if they are placed in one signle file? I'm not happy of exporting many small parts.
Please use comments when not providing a Solution. There is an Add New Comment button hidden on the right of the screen.
Also mesh colliders are subject to back face culling I believe. That is really not helpful.
Your answer
Follow this Question
Related Questions
Alternatives to OnCollision methods/messages for many physics objects? 0 Answers
What is the best way to prevent a physics object from going through thin colliders? 2 Answers
Excluding some physics collisions 3 Answers
PhysX and multiple instances at same location 1 Answer
Getting "Internal error: Too many pairs created" without any apparent reason 0 Answers