Jump to content
Sign in to follow this  
Jasmin Helstein

Problems with physics in walls

Recommended Posts

I made a wall with a door opening for a house but I can't walk trough the opening, part of it is shown in the picture.  Now blue should be physics and non-blue should be non-physics right ? But this is something I run into more often, physics shapes that don't even seem related to the physics shown in blue. Apart from the door opening this one seems alright b.t.w. Does anyone know what I could be doing wrong ?

Thanks

 



Share this post


Link to post
Share on other sites

Hi :)

As you have used the Non Analyzed Physics mesh i'm guessing the problem is because the wall thickness is less than 0.5 meters thick. See this earlier thread:  https://community.secondlife.com/t5/Mesh/Physics-Shape-appears-correct-yet-closes-hole-doorway/m-p/1798659#M18629    (message number 4)

This only applies to Non analyzed physics mesh if one of the dimensions of its bounding box is les than 0.5m.

You have a choice of workarounds:

1: Avoid uploading single walls that are less than 0.5m thick, for example add one or more of the other walls of the building to that mesh wall, (must be part of the same mesh object) and so increasing the bounding box dimensions so that non are less than 0.5m.

2: As Drongle mention in the thread I linked to, add extra geometry ................

3: Use the box/hull method to create the physics mesh for the wall and in Step 2 of the Physics tab in the mesh Uploader (MAV) hit the Analyze button.

If the above is not the cause of the problem then i would suggest you post a couple of screen shots from your 3D software of the building and another of the Physics mesh.

Share this post


Link to post
Share on other sites

Thanks for the reply, I found out it was indeed the thickness of the wall that had to do with it, after making it 0.5 m. thick I could walk trough, when I made it 0.49 m. I couldn't.  So I decided to add a balcony floor to it that will be there anyway. This took care of the problem however ... adding a simple cube skyrocketed the physics value.



The values on the right are from the wall with the balcony floor, the ones on the left from the same wall without, the only difference is just one little cube added. The program I'm using is Wings 3D, here is how it looks from there. The darker object is the physics shape, I move it to the same position as the wall before exporting. The program I'm using is Wings 3D, here is how it looks like from there.



Share this post


Link to post
Share on other sites

Arrgghhh! Tiny narrow triangles around edges of the added cuboid -> High physics weight. Remove all except the top surface in the physics mesh (and maybe make that as large as possible without undesirable collision effects). It's counter-intuitive, but the physics weight of triangles get smaller the bigger they are. Tiny or narrow triangles are BAD.

Share this post


Link to post
Share on other sites

This is ridiculous, just removing the balcony floor leaving only the top intact brought back the LI from 13 to 2 ! Making the top any larger or smaller increased the LI again though. I doubt I found the optimal value by accident but at least I know where to look now. Thank you very much for the help people !

Share this post


Link to post
Share on other sites

Yes. The triangle-based physics weights do behave strangely. Removing small triangles usually works, but there's certainly more going on. Changing the order of the triangles in the polylist in the Collada file can sometimes have significant effects, or even just changing the order of the vertices in a triangle. (If you search here for "triangle physics episode" you can find some details, but I wouldn't recommend spending time on it as it doesn't seem to yield a general way of minimising weights.)

Share this post


Link to post
Share on other sites

 

As Drongle said, something is not right, a physics weight of 2 is still too high for such a mesh.

I made an approximate copy of your wall section and then a physics mesh for it and as expected the Physics weight was below 0.5. (that’s the mesh on the right in the screen shot below).

Except for bumpy landscape meshes where accurate physics is important the physics weight should not be dictating the final LI cost.

As an example I used that wall section as a starting point to create a small building and then made a physics mesh for it and even having collision surfaces on both inside and outside the Physics cost was below 2.



Because your mesh has so little geometry I would suggest that, unless you have special reason not to, that you will get more mesh for your L$ if you upload in larger sections. Doing that should also help with getting better LOD switching.

Share this post


Link to post
Share on other sites

I'd already simplified my physics shape some more and got the physics level down to 1.2 (two sided). My original plan was to make all the walls separately as good as I can and then later combine them into larger objects to see if it would make a difference. Seeing the effect it has on your left building I will certainly do that now.

The image does raise a question though, I do see several triangles overlapping squares. When I have this happening I always blindly assume it's no good so I remove them. In your image however it looks as if they are there on purpose. Is there a reason for those triangles to be there ?

Share this post


Link to post
Share on other sites

 

Re-read what Drongle wrote in message number 4 ...........

" Arrgghhh! Tiny narrow triangles around edges of the added cuboid -> High physics weight. Remove all except the top surface in the physics mesh (and maybe make that as large as possible without undesirable collision effects). It's counter-intuitive, but the physics weight of triangles get smaller the bigger they are. Tiny or narrow triangles are BAD."

The Physics mesh was made from unconnected planes (rectangles, quads, which are converted to triangles when the mesh is exported as Collada.dae) so that they could be stretched and overlapped if necessary.

Initially I did that because I didn't like those little quads at the top of each ground floor doorway and wanted one stretched quad (bigger triangles) instead of 2  to cover the tops of both doorways in each wall. Also I was going to do something similar with the little balcony physics planes but as the total Physics weight in the first test upload was already quite low I left them as they were.

It should be noted that to much overlapping, some will say ANY overlapping, will add unnecessary load to the Physics engine. So best not to overdo it :)

 

 

 

Share this post


Link to post
Share on other sites

The larger the triangles the better, I got that part :smileyhappy:

What I found confusing in the image is, if I see something like this:



then given the squares are converted to triangles during import they can be converted to:

two triangles



six triangles



or ten triangles



But while I write this I realise that what I'm seeing is probably the physics shape plus the mesh model. hmm ... never mind then.

 

Share this post


Link to post
Share on other sites

No , what you are seeing are more overlapped quads in the physics mesh. That one is the one on the ground floor in the middle that has been stretched so that it extends from one door opening to the other door opening.

I have a feeling, (not sure from where i got it, my imagination probably) that somewhere in the equation for calculating Physics weights for non Analyzed Physics meshes is a variable "average triangle size" ........................ like divide result by "average triangle size" ...... and so would effect the final value?  Not good is it , lol . Someone like Drongle would know if this is true or not. I'm so not happy with this i'm going to change the font colour to a very light grey.

 

Share this post


Link to post
Share on other sites

"Someone like Drongle ... "

You mean there are others? :matte-motes-agape:

It's in the wiki, here where it says ...

The width of a triangle is defined as the width (smaller side) of the tightest rectangle you can draw around the triangle. The average is computed "harmonically" (1/avg = 1/a + 1/b + ... ), which was done to favor weight smaller triangles more heavily. This average is then clamped to be between 0.001m and 20m (right now) and then used in the simple formula:

C = MAX( constant * num_triangles / triangle_width, minimum_mesh_cost )

The surrounding rectangle thing is why long thin triangles are as bad as ones that are short and thin. The harmonic averaging makes sure smaller triangles have larger effects. The variations I found suggest that these calculations don't really work at all as described there. Otherwise, why would triangle and vertex orders have large effects even when the triangles are identical? But the effects of small triangles are more-or-less as expected.

Share this post


Link to post
Share on other sites

Thanks Drongle (The One and Only)


Drongle McMahon wrote:

"Someone like Drongle ... "

You mean there are others? :matte-motes-agape:


Perhaps it would be helpful for others who may also forget if you add this link to your profile 

                                                         

 

:)

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...