Jump to content

Problems aligning custom physics hulls


Maeve Balfour
 Share

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

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

Recommended Posts

Chances are I am missing some obvious step or two.

I have been creating custom physics hulls for my mesh constructions (room prefabs etc) - heavily optimised physics meshes representing basic surfaces and openings to match the main LOD meshes. In my modeler, they align perfectly (in scale etc); however, once combined inworld, they seem to be out of synch - the floor of the physics hull is often slightly higher than the actual mesh floor, resulting in AVs "walking on air". Doorways seem to align in regards to walls etc... just the floors themselves are out a bit.

I have been ensuring the floor plane and the ceiling planes are in alignment, and ensuring the physics mesh is still the same overall exact dimensions as the main LOD mesh etc. All normals are correct and in working order.

In the uploader, the surfaces appear to be in synch... so i am left scratching my head here.

Any suggestions? :matte-motes-smile:

Link to comment
Share on other sites

From my experience, mesh objects have the "gap" even when they are convex shapes.  You could try to cheat the physics for floors. Place the physics floor plane slightly below the mesh floor, and add geometry to one edge of the physics floor, to cover the dimensions of the mesh floor correctly.

  • Like 1
Link to comment
Share on other sites

Hmm... Thanks Arton. At least that confirms in theory that I'm not missing any required steps. :matte-motes-smile:

Your workaround suggestion should solve this, although I can see a lot of trial and error in getting it to look right. It is interesting to note, though, that if I use the auto generated physics hull, it is perfectly aligned with the mesh, but when I use my optimised hull, it is out - despite being exactly matched.

Ah, the price we pay if we strive for perfection! Gotta love it! :matte-motes-wink:

Link to comment
Share on other sites

Yes, I always take great care to ensure that the bounding boxes are exactly the same for both the physics hull AND the mesh. Usually I take the LOD1 mesh, and reduce it to its barest form for the physics hull, and in the process ensure that the outermost vertices for both remain identical to retain overall matching size - which I assume will result in the exact same bounding box.

(Please correct me if I am making any incorrect assumptions). :matte-motes-smile:

Link to comment
Share on other sites

I experimented with a workaround to my issue (misaligned physics hull) which works quite well. Not exactly an elegant solution, but the PE it saves me makes it worthwhile in my case.

In essence... I upload my original mesh room prefab with a minimal 3-vertex flat triangle as its physics shape. This is used inworld as a phantom object. I then upload my extremely basic physics hull for this prefab (34 triangles) as a mesh in its own right, using it for both the LOD1 and its physics hull in the uploader. Inworld, this is used for the physics of the original prefab mesh, with an alpha applied to hide it. When hidden and aligned, the prefab in general functions as expected inworld (walls and doorways etc).

My biggest surprise by separating these was the savings in PE. The original prefab, with the same hull (including misalignment issues) in the one mesh object was about 10PE. Separated out... the phantom version of the mesh prefab is 1PE... and the physics hull mesh I assume is around 0.5PE (as a test, two of these physics hulls linked is 1PE). So by separating my prefab example into two meshes and faking the physics in a hidden mesh... I dropped the PE from about 10 down to roughly 1.5! My jaw is still hurting from it hitting the floor LOL.

So yah... although inelegant, I think my workaround is sufficient for my needs at least. Just thought I'd share this. :matte-motes-smile:

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4646 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...