Mantis#1446. Thank you kindly, Grumly57 for a patch

that solves "trees are too small when rezzed"
0.6.0-stable
Charles Krinke 2008-06-04 14:34:35 +00:00
parent d635b526e5
commit bc32395775
1 changed files with 22 additions and 0 deletions

View File

@ -1311,6 +1311,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
rootPart.AddFlag(LLObject.ObjectFlags.Phantom); rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
//rootPart.ObjectFlags += (uint)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 // if not phantom, add to physics
sceneOb.ApplyPhysics(m_physicalPrim); sceneOb.ApplyPhysics(m_physicalPrim);
@ -1319,6 +1321,26 @@ namespace OpenSim.Region.Environment.Scenes
return sceneOb; 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, public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position,
Tree treeType, bool newTree) Tree treeType, bool newTree)
{ {