Jump to content

Physics behaviour of mesh uploads (continued)


anselm Hexicola
 Share

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

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

Recommended Posts

Really, this is a return to a previous query I brought up.

Anyway, that was before the holidays and I have been gnawing at that bone ever since.

Now, I was fortunate enough to bump into Aquila Kytori in a sandbox a couple of days ago and they were able to show me a few quirks of the whole business.

AND ... on the assumption that there are others who a) don't know this already, and b) have at least a passing interest in this stuff, I would like to show you what I have learnt.

 

To recap from the previous thread, whereas certain "inworld" prims (eg. the cube) sit neatly on top of each other when set as Physical, uploaded mesh tends to create a gap between them.

 

SO ... here is a screenshot of 2 sets of demo (uploaded mesh) cubes:-

 

 0.5 cubes.png

 

Both sets above used a simple cube shape as the Physics LOD -the LHS pair were NOT Analysed in the uploader, the RHS ones were. (btw the blue prims are set as Phantom - they are just there as approximate rulers)

Interestingly, the gap between the un-Analysed pair seems to be the expected 0.1m; however it is smaller for the Analysed ones.

And, curiouser and curiouser, if I make the Analysed cubes bigger, then the gap gets smaller. Below is a screenshot of them scaled to 1x1x1m :-

1.0 cubes.png

 

... and when I scale these cubes up to 2x2x2m, the gap has gone:-

Screenshot_74.png

In fact, there is the start of a "negative gap"!!

That said, the trick seems to be:- 

1. Use a simple shape for the Physics LOD (= a cube) - this applies to more elaborate meshes equally

2. Analyse this shape in the uploader

3.Keep the object Convex Hull, not Prim

4.It needs to be big enough

 

(.. tips hat to AK)

 

 

 

Link to comment
Share on other sites

The reduction of the gap when you use physics shape type is because of a feature(bug?)  of the default convex hull physics shapes of mesh, that gets used when you set the shape type to convex hull. The hull is smaller than the actual convex hull. For a simple box, it is 0.945 times the box dimensions; ie smaller by 0.0275 of the dimension at each end. For a 64m box, that's 1.76m, and you can walk inside that depth of the visible mesh. For your 2x2x2 cube, the hull is 0.055 inside the bounding box for each cube, allowing them to get closer by 0.11m, so that they overlap by 0.01m instead of being 0.1m apart. You can see the gap between the physics hull and the bounding box if you select a cube while it's selected in editing mode.

I reported this undersized hull as a bug about three years ago, because I thought being able to walk inside the edges of large meshes was undesirable. Nothing happened. I don't know if the jira is visible, and I can't change visibility for these old ones. It was VWR-28416. I suppose there was a good reason for the effect, but I never learned what it was. It doesn't happen with legacy prims set to type convex hull, which seems to belie any contention that it is necessary. Any ideas wellcome. To avoid the effect, you have to set the physics shape type to Prim, even if the physics shape is Analyzed to give the same single hull that you expected from the default hull.

Link to comment
Share on other sites

You say "The hull is smaller than the actual convex hull. For a simple box, it is 0.945 times the box dimensions;"

That (ie. 0.945) is a usefully precise figure - wonder how you came by it ...

Anyway, I was able to use that figure to calculate an object dimension  that represents the "sweet spot" where the physical behaviour of Analysed convex hulls tallies exactly with the visual boundary.

       x - (0.945x) = 0.1

                         x = 0.1 / 0.055 = 1.818 (recurring)

 

And here are 2 cubes measuring 1.818 on all axes :-

cbe x1.818.png

They sit on the ground and each other nicely.

I think it also applies to uploaded meshes that are not simple shapes (see below ..)

columns2.png

 

You also note : " To avoid the effect, you have to set the physics shape type to Prim, even if the physics shape is Analyzed to give the same single hull that you expected from the default hull."

The plywood ones are "inworld" prims; the RHS column is set Convex Hull, the LHS one is set Prim. This LHS one floats up and makes the cube on top float up likewise - consequently it looks weird.

Now, I was looking to exploit the "feature(bug?)" you detail. But then, the only way to do that would be make everything with 1.818m as the dimension in the relevant axis!!

 

Link to comment
Share on other sites

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