Good Building Practices: Difference between revisions
Hyper Mole (talk | contribs) No edit summary |
Hyper Mole (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
Physics Optimization: | Physics Optimization: | ||
(See handy script at bottom of page) | |||
The less the physics engine has to calculate, the smoother your region will perform. Creating clean low poly physics shapes for your meshes is helpful, but you can also remove prim, mesh, and sculpted objects from the physics calculations completely. | The less the physics engine has to calculate, the smoother your region will perform. Creating clean low poly physics shapes for your meshes is helpful, but you can also remove prim, mesh, and sculpted objects from the physics calculations completely. | ||
Line 23: | Line 23: | ||
File:Physics_added_physics_in_navmesh.jpg|As seen by the navmesh | File:Physics_added_physics_in_navmesh.jpg|As seen by the navmesh | ||
</gallery> | </gallery> | ||
---- | |||
Here is another example scenario. This is a sculpted prim fence. The physics shape is not as clean as it could be, and the edges don't cover all edges of the fence itself. To fix it, I created a cube physics shape, linked the fence to the cube with the cube as the root prim, and set the fence to Physics Shape Type: None. As you can see, the resulting physics shape is lower in polygons and better covers the fence area. | |||
<gallery> | |||
File:Sculpty_optimization_001.jpg|Sculpted fence physics shape | |||
File:Sculpty_optimization_002.jpg|Adding cube physics shape | |||
File:Sculpty_optimization_003.jpg|Final Static Object physics shape | |||
</gallery> | |||
Use the following script to set all child prims to None. Be sure to check what physics are needed for your linkset prior to using, and/or add a simple cube as the root prim. | Use the following script to set all child prims to None. Be sure to check what physics are needed for your linkset prior to using, and/or add a simple cube as the root prim. |
Revision as of 12:02, 6 April 2012
Physics Optimization: (See handy script at bottom of page) The less the physics engine has to calculate, the smoother your region will perform. Creating clean low poly physics shapes for your meshes is helpful, but you can also remove prim, mesh, and sculpted objects from the physics calculations completely.
-
Two trees set to Prim
-
Physical shape of trees
-
Results in the navmesh
Link your complicated geometry to simple shapes. Here we linked to a cube and set all child prims to physics shape type None (in Edit > Features > Physics Shape Type):
-
No physics on trees
-
Navmesh sees only cube set to Prim
To simulate a physics shape and keep avatars from walking through your optimized object, just add physics where it's needed.
-
Adding physics
-
As seen by physics engine
-
As seen by the navmesh
Here is another example scenario. This is a sculpted prim fence. The physics shape is not as clean as it could be, and the edges don't cover all edges of the fence itself. To fix it, I created a cube physics shape, linked the fence to the cube with the cube as the root prim, and set the fence to Physics Shape Type: None. As you can see, the resulting physics shape is lower in polygons and better covers the fence area.
-
Sculpted fence physics shape
-
Adding cube physics shape
-
Final Static Object physics shape
Use the following script to set all child prims to None. Be sure to check what physics are needed for your linkset prior to using, and/or add a simple cube as the root prim. <lsl> default {
state_entry() { llShout(0, "Setting all child prims to PRIM_PHYSICS_SHAPE_NONE"); llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); llRemoveInventory(llGetScriptName()); }
} </lsl>