Jump to content

Questions about creating custom physics shape


QueenKellee Kuu
 Share

You are about to reply to a thread that has been inactive for 4174 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So I'm trying to get a handle on physics shapes best practices. By custom I'm referring to making them in Blender along with your mesh model and LOD versions.

I've seen in a few threads about how people use boxes that are not touching and would love some more info on this, for example how far away should the boxes be? Is it more important to keep it simple with boxes than to simply have the lowest tri's like in LOD versioning? I do remember reading that when it comes to physics Havoc loves boxes so I am guessing that's the rationale behind this?  

My other questions surrounding this are:  

-Bounding boxes should match btwn physics and main model, but what about materials and UV's, I know that the UVs and materials/faces must always be present in every LOD version, does this apply to the physics only model?  

-Which leads me to wonder about creation, can I simply construct a fresh model without any UVs or relation to the main model or the LOD's as long as the bounding box fits and it works as it should as the physics model?  

Thanks for any input and help! 

Link to comment
Share on other sites

I'm not a master of game physics by any means, but I can answer at least a few of these questions.

The physics shape is just a shape. it doesn't need to have a UV map associated with it nor does it need to have any materials. Remember that the physics shape is not visible, so it has no renderable information to give to the engine.

So the answer to your last question is yes by default. Your physics shape need not have any relation to the visual shape so long as it allows for accurate physics simulation.

Link to comment
Share on other sites

"... for example how far away should the boxes be?"

The boxes are when you are going to use the "Analyze" button which turns your mesh into a set of convex hulls. The reason it helps to keep them simple convex shapes and separated by small spaces is that it helps to get the best possible hulls. When the uploader has to cut up convex shapes, or overlapping shapes, it often does it in an inefficient or obstructive way. If you have to use the simplify function, because the shape mesh is too complicated, that is even more likely to produce poor results. The gaps can be very small.

"...Is it more important to keep it simple with boxes than to simply have the lowest tri's like in LOD versioning?"

See above for "Analyzed" shapes. The physics weight depends on the number of hulls and the number of vertices they have. This can be very high if you have many convex details. So you still need to keep it simple. It's better for the engine too.

"... Havoc loves boxes so I am guessing that's the rationale behind this? "

It loves boxes when it knows that's what they are, but the uploader doesn't recognise boxes and tell havok that they are there (collada has that facility, but it isn't used).  So uploaded boxes are treated like any non-box convex hulls. More efficient than the same shape in triangles, but less efficient than when Havok knows to use it's own primitives. When you use undistorted linked prim boxes as the physics shape, on the other hand, these are recognised and the primitives are used.

"... what about materials and UV's, ... does this apply to the physics only model? "

No. (It used to, but that was a bug fixed long ago).

"... can I simply construct a fresh model without any UVs or relation to the main model or the LOD's as long as the bounding box fits and it works as it should as the physics model? "

You can use anything you like, as long as it doesn't have degenerate triangles (too small in some direction to still have an area after rounding to 16-bit coordinates). Whatever its bounding box, it will be stretched so that it becomes the same as the bounding box of the high LOD mesh. The reason we say use the same bounding box is that this is generally neeeded to make sure the parts of the physics mesh will fit correctly to the visual mesh.

 

  • Like 1
Link to comment
Share on other sites

Thank you both for the replies and the information! The physics thing is something I'm still new at, but want to make sure I get right because the ability do it wrong and cause more lag than necessary (and add to the LI of course). 

I do need to take some time with the references on the physics pane and all the options. I usually just hit analyze and that's it, the times I hit simplify it seemed to make a mess of things previously, will have to try it with the box method now.

Link to comment
Share on other sites

Don't discard the option of triangle based (non-analyzed) physics shapes. Like drongle said, a convex box is easier for the physics engine than a triangle based box, but in most cases you can get away with far less than a complete box, for example a single quad. To the physics engine that looks like 4 triangles with 4 vertices.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4174 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...