From bc323957754751ddcd37838b371daba537c15c5c Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 4 Jun 2008 14:34:35 +0000 Subject: Mantis#1446. Thank you kindly, Grumly57 for a patch that solves "trees are too small when rezzed" --- OpenSim/Region/Environment/Scenes/Scene.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e4fdc31..725efb4 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) { -- cgit v1.1