Jump to content

Prim Physics Shapes


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

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

Recommended Posts

So I've been doing a lot of work with physics for some projects and ran across what I consider to be an issue. Has anyone else ever noticed that when you make any dimension of a prim smaller than .2 the physics shape gets ignored and becomes a cube?

In the example below the regular prim is a cylinder with the diameter being less than .2. the physics shape becomes a cube. A slightly larger cylinder is beside with the proper physics shape. I've been adding more prims to work around but is this normal? No matter what I search I cannot find information on this subject.

064d5d2f181e9e9f7de7473b9eebcd86.png

 Keep in mind these are regular prims with the physics shape set to prim.

 

Link to comment
Share on other sites

   I had never actually noticed this phenomenon. It's possible LL may have decided it should work this way because the functional difference between a cylinder and cube physics shape for objects below a certain size was negligible. I'm curious what would happen to a mesh cylinder with an implicitly specified cylindrical physics shape at sizes below 0.2 meters.

Link to comment
Share on other sites

If you make a cylinder 0.199 x 0.199 x 1.000, and make it physical, lay it on the ground, then try nudging it gently to roll, you will see some very odd behaviour. I had never noticed this either. I suppose it is intended to help the physics engine, which hates small triangles, but I don't think that's right for cylunders with x=y. In physics shape view, as you lower the dimensions, you can see the change from triangle-based shape (triangle edges visible) when the x and y are different, even by 0.001, to the havok primitive cylinder when they are identical. The primitive cylinder is supposed to be very easy for the engine. So why isn't it still used when the identical x and y dimensions are below 0.2? Makes no sense to me.

Link to comment
Share on other sites

I wasn't sure so I tested. The physics shape stays the same oddly enough. Although there is the problem with mesh physics, no matter the size, have a .05 or .1 gap between the edge of the physics shape and anything else. You can see below the physics shape is the same but the gap is there. 

 

Edit: Disregard. The only reason the physics shape stayed the same is because the Z size is above .2. If all sides are below .2 then the physics shape changes too a cube no matter prim or convex hull. 

 

43000a73447b08b542a32dcc5d62c658.png

 

Also for anyone curious, you can render physics shape in the developer menu -> render metadata -> physics shapes.

Link to comment
Share on other sites

   I tested a cylinder mesh I created, uploaded with the same dae file serving as an implicitly specified physics shape. With the Z axis outsized, but X and Y both below 0.2 meters, the physics shape changed to that of a cube. I observed what was probably the same behavior Drongle noted. Made physical and given a nudge, the cylinder would roll clunkily, as one might expect an elongated cube to roll. Instead of quickly coming to a stop, it would roll a bit and rock back and forth, gaining more momentum and then rolling in the opposite direction, slowing, rocking again bakc and forth, and them rolling in the original direction again. This continued until my foot stopped it. This was if it were set to physics type Convex Hull, when set to Prim, it became much more stable, still rolling clunkily, but slowing and stopping normally.

   Also, while scaled down below that threshold, the physics shape of the mesh object was oversized relative to the geometry, while a regular prim treated the same way had an undersized physics shape. Put another way, the physics shape of the mesh object appeared, visually, as a bounding box for its geometry, while the geometry of the regular prim appeared as a bounding box (though cylindrical) might for its physics shape.

Link to comment
Share on other sites

Stranger and stranger. I don't see that. I'm using the SL viewer, but physics is done on the server. So it should be the same. (The physics display, though, is done by the viewer. So the display could be different from the actual physics in either viewer.)  It makes no difference whether I make the cylinder physical or not, or whether it's on Aditi or the main grid. I see the shrunken cuboid with the same (as near as possible) dimensions as in your picture (left). If I reduce the Z dimension below 0.2m then it shrinks inside the bounding box on that dimension too (middle). As soon as I make the x and y unequal, the shrinkage disappears so that the shape fits the bounding box (right). That happens whether or not Z is bigger than 0.2m.

cylphys.jpg

Link to comment
Share on other sites


BrownBoxStudio wrote:

So I've been doing a lot of work with physics for some projects and ran across what I consider to be an issue. Has anyone else ever noticed that when you make any dimension of a prim smaller than .2 the physics shape gets ignored and becomes a cube?

I haven't noticed it for cylinders but for toruses, yes. Never looked at it in detail but it seems all prims, and probably meshes too, are converted to convex hull once they're scaled down below a certain size.

As for bounding boxes, do they have any relevance to physics shapes at all anymore? I thought that connection disappeared with the introduction of HAVOK(?)

Link to comment
Share on other sites

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