Jump to content

Invisible Barriers


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

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

Recommended Posts

I do rudimentary building, and have recently begun making meshes from prim linksets using Mesh Generator. I have encountered invisible barriers to avatar movement near some of them. I cannot see the barriers using any setting I can find in Firestorm. I would like to understand how they work so that I can plan my projects to avoid having them where avatars need to go.

Is there something I can read that will explain how they work?

Thanks.

Link to comment
Share on other sites

9 minutes ago, Jennifer Boyle said:

I cannot see the barriers using any setting I can find in Firestorm.

Developer menu: Render Metadata: Physics Shapes

 

10 minutes ago, Jennifer Boyle said:

I would like to understand how they work so that I can plan my projects to avoid having them where avatars need to go.

Can you post a picture or two of the problematic items? How to make a good physics model depends a lot on what kind of item it is. 99 times out of 100 the best solution is to select "Cube" as the physics model but I assume that doesn't work in these cases.

Link to comment
Share on other sites

I use a similar tool Nanao watanabe's Mesh Generator. If you try to make mesh shapes that are hollowed, or have several prims at tight angles to each other, (for example making a pair of walls), the resulting physics won't let an avatar into the enclosed area.  Similarly, making a wall that includes a doorway won't result in a mesh that lets you actually walk through the apparent aperture.

It should be possible to make an appropriate physics shape using the in-world tool but as yet it's just another item on my "things to do when I grow up" list.

Link to comment
Share on other sites

And to make use of a custom physics shape, you need to set the Physics Shape Type to Prim, on the Features tab in the Build floater. The Prim option is only available  when you do specify a physics mesh during upload, though.

Edited by arton Rotaru
  • Like 1
Link to comment
Share on other sites

1 hour ago, Profaitchikenz Haiku said:

Similarly, making a wall that includes a doorway won't result in a mesh that lets you actually walk through the apparent aperture.

That's actually quite simple.

Assuming it's a wall with a doorway as a separate Mesh like this:

bilde.png.8dda7e39c8274c3d16cc622869ae473f.png

Remove the prim above the doorway (or just make it 100% transparent):

bilde.png.eae92a70b01fabb65ff09cc2f08e381e.png

Save this as a separate dae file and use it as the physics model. Click on the Analyze button before you upload (this is one of the very rare cases where analyzed physics is the best option) and, as Arton already said, remember to change the physics type to Prim after you've uploaded.

---

Assuming you want to upload a whole house as a single mesh, something like this:

bilde.png.ab27731c01d4dd93ce7f0f79e55d750b.png

Make all surfaces an avatar isn't going to bump into or walk on invisible, close the window openings and replace parallel surfaces with single big ones like this:

bilde.png.cff503bf4a709327f7ac15d71e515650.png

Here's the physics model from different angles with each prim face given a different random color:

bilde.png.e61ae0aadb7a864b23f5beaf1a5af933.png

Use this as a physics model, do not click the Analyze button but remember to change physics type to Prim after you have uploaded.

Edit: Don't worry about texture faces or repeats for the physics model, it's not relevant there.

Edit 2: This was just a quick build to use as an illustration but looking at it now, it isn't actually that bad. Should I keep it?

Edited by ChinRey
  • Like 3
  • Thanks 2
Link to comment
Share on other sites

             Adding this just to illustrate where to load up the Physics model in the mesh uploader and where to change the Physics shape type to Prim ......................

AS mentioned above you will need to create a separate simplified building from prims to act as collision surfaces.

 

After following Reys instructions given in the first part of her answer on how to create a physics / collision model using solid prims, not setting any of the prims faces to 100% transparent,  (where possible it will be a  simplified version of the visual building. Only having prims where you really need to have collision surfaces) you will have two "buildings" to use the Mesh Generator on. The first will be the Visual building and the second will be the Physic building.

Use the Mesh Generator to convert them so that you will have two separate .dae files.

To import back into SL :

  1.  Upload as usual the Visual Building.dae into the SL mesh uploader.

  2.  Next you will need to tell the mesh uploader which .dae file you want to use for collision surfaces. To do that open the Physics tab of the mesh uploader and in Step 1: load up the   Building Physics .dae file and then in Step 2: hit the Analyze button. In the preview window you should then see your physics model as a collection of pastel coloured blocks. See screenshot below.

1.thumb.png.57d76bd58b4acc002582e91db412e12b.png

Upload the building and rezz it out on the ground.

By default the Physics shape of a mesh object is a Convex Hull. Think mesh wrapped in cling film. thats why you cant get inside because all the openings are covered over. To get your building to use the Physics model that you custom made for it you need to Edit your  rezzed Building, open the Features tab in the build floater and change the Physics Shape Type from the default Convex Hull to the Prim .

Now you can get inside :)

2-min.thumb.png.ff811d61c0fcaf90fe4e847cc771b948.png

 

Note that to the right of the Physics Shape Type drop-down there is a little eye icon , click on this and it toggles Firestorms  "Show physics" option. The Collision surfaces will usually show as blue surfaces on the selected object. With this enabled you don't need to run around physically checking all the collision surfaces of your building you can just view them instead.

Note in the above example the Physics cost of the object is alot higher than the download cost causing the final LI cost to be higher than it could be if the physics cost were lower.

If this is a problem then there is an alternative way of creating your collision model using prims but its slightly more complicated. It  involves setting some of the prims faces 100% transparent as shown in the second part of Reys answer, (the images of the prims with coloured faces) before using the the Mesh Generator and then NOT using the Analyze button in the Physics tab of the mesh uploader. Using this other method will quite often reduce the physics cost by quite alot. If you think you really need to lower the physics cost then we can explain this in a little more detail.

 

 

Edited to add :

In the above example the number of prims use in creating the collision building was 14. After using the Analyze button in the mesh uploader it should have created 14 Hulls instead of 22 !   1 Hull for each prim used.  this would almost half the Physcs cost.

One reason this can happen is if you have overlapping prims in the Physics building or prim faces that are touching other prims. This can cause the uploader to create more hulls than necessary when it analyzes the .dae file you gave it. To help avoid this, when making the physics model leave a little space between each prim. A few centimeters ( 5 - 10cm) should be enough to avoid confusing the mesh uploader when it analyzes the model. 

 

Edited again:

I think my answer here has become a bit confusing , Rey is saying "do not click the Analyze button" and my answer is saying the the opposite "in Step 2: hit the Analyze button."

I will try to explain :

There are 2 types of Physics model you can create, Box type and Planes type.  

Sometimes the Box type is called Hull type physics.

Sometimes the Planes tpye is refereed to as triangle type Physcs.

 

 With the Box type physics you create your collision surfaces with boxes (prims, cubes). Using as few boxes as possible. When loading up this type of physics model to the SL mesh uploader you do need to click on the Analyze button in the Physics panel. The uploader will then "analyze" you physics model with the goal of it creating a collection of hulls that will be used for collision surfaces.

In my example even though I used 14 boxes in my physics model after analysing the uploader decided that there needed to be 22 Hulls to have the correct collision surfaces. Thats why I later suggested leaving enough space between each box so that the uploader will find it easier to "analyse" and hopefully arrive at the same number of Hulls as Boxes used in its creation.

Note: Each Hull the uploader creates has a fixed physics cost of 0.360. Lots of Hulls (boxes = higher Physics cost).

 

With the Planes type Physics the collision surfaces are created using simple Planes. Again the rule is to use as few as possible. Fortunately the Mesh Generator ignores prim faces set to 100% transparent so to create a Planes type physics model using prims all you have to do is set the 4 faces of each prim that join the inner wall surface to the outer wall surface 100% transparent. When loading a Planes type physics model to the mesh uploader you don't click on the Analyze button. The result of not hitting the Analyze button is .......... you are asking the uploader to leave your physics model alone and you get a collision model exactly as you intended it to be. Thats a good thing  :). And there is another benefit. For large models like buildings the Physics cost is usually lower than the physics cost using box type physics.

For Planes type physics (not Analyzed) a large part of the physics cost calculation is the average size of the planes used in its creation. The larger the average planes size the LOWER will be the Physics cost !  Keeping your Physics model as simple as possible using large planes (prims) and avoiding as much as possible small planes will, if done correctly always result in the physics cost being lower than the Download cost.

1110917239_PrimPlanesforPhysics-min.thumb.png.809e469c7b3544624c0c9077c981f609.png

 

Long story short, DO as Chinrey suggested. Use the Planes type physics for buildings and don't click on the Analyze button in the mesh uploader.

 

I am sorry if this now all seems so complicated when really it shouldn't be.

I considered deleting this post completely but I think some of the screenshots may be useful so will leave it as it is for now .

Edited by Aquila Kytori
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Aquila Kytori said:

...

you will have two "buildings" to use the Mesh Generator on. The first will be the Visual building and the second will be the Physic building.

Woops, since you mention two models, maybe we should sy something about the other three too!

In addition to the main and physics model, there are also LOD models, simplified versions to be displayed at distances where you won't see all the fine details anyway. These are very important to keep the total number of mesh triangles in a scene down to a manageable amount.

The uploader can generate the LOD models automatically but it's horrendously bad at it. The trick is to remove the details that are to small to be seen and keep the ones that are big enough to be visible and the uploader have a depressing tendency to do exactly the opposite.

The basic technique for making LOD models with a prim-to-mesh converter is the same as for making a physics model: Make the parts you don't want to include 100% transparent and occasionally resize some parts to cover the gaps you create. Then export each model as a separate dae file. Only in this case you have to be careful to keep the texture data too. One possible complication is that hiding some parts of the building may change the sorting order of the mesh faces you may end up with and that can give some rather strange results. The solution is to be very careful with the order of the prims in the linkset.

In the little cottage mockup in my previous post, I would only have eliminated the inside of the front wall for the mid LOD model. For the low and lowest LODs I would also have hidden three sides the foundation and extended the corresponding walls downwards the same way I did for the physics model. (Btw, when you use the same model for two or more LOD levels, do not selec the same model several times. Choose the "Use model above" option instead!)

This is probably not a very good example how to make LOD models with Mesh Generator though. Here's a slightly better example I posted a few months ago.

Link to comment
Share on other sites

I came back to upload pictures, as ChinRey suggested. However, this wonderfully educational, very lucid, and very-much-appreciated discussion has clearly elucidated my problem and the possible solutions, so I don't think my pictures would add anything of value..

My object was seven doorframes for a house that I wanted to make a mesh of to reduce LI.

Thank you all for this information.

Link to comment
Share on other sites

19 minutes ago, Jennifer Boyle said:

My object was seven doorframes for a house that I wanted to make a mesh of to reduce LI.

Normally you sinply set doorframes to physics type none (or good old phantom if they aren't linked to the house). It's the same with windows. If the house is made well, the walls will give all the physics barriers you need for those areas.

Link to comment
Share on other sites

3 hours ago, ChinRey said:

Normally you sinply set doorframes to physics type none (or good old phantom if they aren't linked to the house). It's the same with windows. If the house is made well, the walls will give all the physics barriers you need for those areas.

Thanks again for the great education!

Link to comment
Share on other sites

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