Jump to content

Physics Shape appears correct, yet closes hole (doorway)


Domsson Lean
 Share

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

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

Recommended Posts

So far I was able to solve every problem on my own. However, physics are giving me major headaches right now.

I've got a piece of wall (just one side; the other side is taken care of by a seperate mesh) with a hole that will, later on, hold a door. The Physics shape is a simplified version of that wall piece and the uploader is happy to swallow it without a problem.

What I already figured is that with a proper custom physics mesh, you better not hit "Analyze", let alone "Simplify". Now, in SL, I put the physics type to "Prim", of course. Guess what happens? Yep. Can't walk trough.

Now, what's really creeping me out here is the fact that when I activate rendering of Physics Shapes, I can see that the hole for the door actually is there. It just won't let me walk trough.

screw door physics

A bad workaround is to hit "Analyze", but for some reason that will make the hole smaller by some amount, which leads to a "bump" when walking trough. Not what I want.

Any suggestions? I'd be happy about every hint.

Link to comment
Share on other sites

I am guessing that this is because your mesh is less than 0.5m thick. When any dimension of the physics shape is less than 0.5, the physics engine switches it silently from "Prim" to "Convex hull", closing all holes. It switches back to "Prim" if that is set and it is stretched to 0.5m or more. The switch to convex hull does not show up in the physics shape display or the edit dialog because the engine is on the server and the viewer is not informed of these switches. It does affect the physics weight which is always obtained from the server when the viewer has to display it. To get the hole open again, you need to use only shapes with all dimensions 0.5m or larger. If you stretch and squeeze the wall in the thin direction, you can detect the opening and closing of the hole as you go through the 0.5m threshold.

I have some time ago submitted a jira request for the physics shape display to reflect the switch. So maybe that will work in the future.

Link to comment
Share on other sites

Hey Drongle,

thanks for this very, very important piece of information. This puzzled me with previous projects, too, but I was able to work around it there in other ways.

It's still weird that when hitting "Analyze", the physics shape will *not* turn back to convex hull silently, although the piece is still just 0.4m thick.  Is there an explanation for this behaviour, too?

Anyway, now I'm wondering what to do in a case like this? Here, the piece is 0.4m and has to be 0.4m thick. I can't just make it 0.5m. Isn't there some smart way to solve this? :(

I thought about  making the doorway about 0.1m bigger in each direction, then hit the "Analyze" button on upload. I'll do that right now to see what result it gives.

Link to comment
Share on other sites

Also, I wish the whole physics business was more intuitive. Without reading through the wiki and dozens of forum posts, it is impossible to just "understand" the physics stuff. And even then, stuff like the .5m minium size will kick in and ruin your day.

Instead of a Jira request to display the switch, shouldn't we request that the minium size is changed to, for example, 0.1m? And what about Analyze - why does that give basically the same result as without, but about 0.1m thicker in each direction? Is stuff like that discussed at the mesh meetings? I haven't been there in a while. Or is there some wiki (or whatever) page (or other resource) that documents all this in a comprehensive and readable manner? :|

Link to comment
Share on other sites

I thought bthe 0.5 applied whether it was "Analyzed" or not, but maybe it's only triangle-based shapes. You could easily increase the width to >0.5m by adding a flat triangle underground that would not affect collisions and would be invisible (if not buried, use a new material and set to default transparent library texture). Better make it cross from the opposite side of the wall so that it's not so small/narrow that it increases the physics weight too much.

By the way, looking at your shape display, you have some narrow triangles on the edges of the pillars. If you can remove these without spoiling the collision behaviour, it may reduce your physics weight substantially. Narrow triangles are bad. Just make a new mesh without them and select "From file" in the physics tab of the uploader to use it.

Link to comment
Share on other sites

Hey you both,

the inivisible face was my first idea, too, though I can't help but feel it's a pretty dirt workaround for something I would call a bug rather than a restriction.

Again, it's just unintuitive (if not pointless) that the same model will work or not work depending on whether one hit the "Analyze" button or not. And it's also highly unintuitive that the Analyzed model will apparently make the model "thicker". By the way, this might be the reason for it letting you through - if the process of analyzing really adds 0.1m (and that it seems to to according to my tests and prim-measurings) to all faces, then my physics mesh with a thikness of 0.4m would end up being 0.6m, hence the "Prim" option wouldn't be changed by the server.

Again (2): Any place where all these oddities are documented? I'm losing the overview.

PS: Good catch with the triangle, Dongle. I removed that just seconds after taking the screenshot. :)

Link to comment
Share on other sites

The silent switch was once at 0.1m. during the closed beta at least. I have to assume that was increased after actual observations of the strain on the physics engine, and therefore that this change is unlikely until hardware improves a lot. This is the sort of thing that gets discussed at the content creation user group meetings. I don't recall a particular discussion of this point though.

The triangle-based physics weight calculation is described in the wiki, but this has not been updated for 17 months and there are some discrepancies with observed physics weights. I have been trying to understand the details using expermental meshes, but have only succeeded in unearthing some rather dramitic, though fortunately rare, bugs that inflate weights. Given these, I doubt whether it's possible to uncerstand the calculations without seeing the source code - which we can't see because it's in the server, not the viewer.

 

Link to comment
Share on other sites

My approach of making the hole for the door bigger by 0.1m in each direction, then hitting "Analyze" on upload gave a pretty pleasing result. However, the physics cost - when turned to "Prim" - are 0.4 for the un-analyzed and 2.1 (!) for the analyzed model. I feel like destroying something.

Link to comment
Share on other sites

Yeah, I'm currently adding steps to the wall piece, which will solve the problem without using hidden faces.

Still, it's uncool that one has to work around this (adding a hidden plane will still leave the physics shape at <0.5m, hence the performance problems are probably not helped) and to dig trough forums to even get to know about it. :(

Link to comment
Share on other sites

"adding a hidden plane will still leave the physics shape at <0.5m"

It won't.  As long as the hidden plane is included in the physics mesh, it will also increase in width, keeping the expected collision shape. If it isn't included in the physics mesh, then that mesh will be stretched to fit the wider bounding box of the visual mesh, so that it will still be >0.5, but probably the physics shape wall will then be too thick to collide as you would wish.

Link to comment
Share on other sites

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