diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e4fdc31f61..725efb4a55 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1311,6 +1311,8 @@ namespace OpenSim.Region.Environment.Scenes { rootPart.AddFlag(LLObject.ObjectFlags.Phantom); //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; + if (rootPart.Shape.PCode != (byte)PCode.Grass) + AdaptTree(ref shape); } // if not phantom, add to physics sceneOb.ApplyPhysics(m_physicalPrim); @@ -1319,6 +1321,26 @@ namespace OpenSim.Region.Environment.Scenes return sceneOb; } + void AdaptTree(ref PrimitiveBaseShape tree) + { + // Tree size has to be adapted depending on its type + switch((Tree)tree.State) + { + case Tree.Cypress1: + case Tree.Cypress2: + tree.Scale = new LLVector3(4, 4, 10); + break; + + // case... other tree types + // tree.Scale = new LLVector3(?, ?, ?); + // break; + + default: + tree.Scale = new LLVector3(4, 4, 4); + break; + } + } + public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, Tree treeType, bool newTree) {