From a0265300aa09be0bdd2d4629d6a22394d5b219be Mon Sep 17 00:00:00 2001 From: dan miller Date: Sat, 29 Sep 2007 03:56:36 +0000 Subject: Hollow prims (box only), thanks Gerard! Enjoy --- .../Region/Environment/Scenes/Scene.Inventory.cs | 9 +++++-- OpenSim/Region/Environment/Scenes/Scene.cs | 13 +++++++--- .../Region/Environment/Scenes/SceneObjectGroup.cs | 29 ++++++++++++++++------ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 +- 4 files changed, 40 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 81c0b73..bcc02ea 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -429,12 +429,17 @@ namespace OpenSim.Region.Environment.Scenes group.AbsolutePosition = pos; SceneObjectPart rootPart = group.GetChildPart(group.UUID); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) - rootPart.PhysActor = phyScene.AddPrim( + { + PrimitiveBaseShape pbs = rootPart.Shape; + rootPart.PhysActor = phyScene.AddPrimShape( + rootPart.Name, + pbs, new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 8ad8147..579ec90 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -531,7 +531,9 @@ namespace OpenSim.Region.Environment.Scenes AddEntityFromStorage(prim); SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) - rootPart.PhysActor = phyScene.AddPrim( + rootPart.PhysActor = phyScene.AddPrimShape( + rootPart.Name, + rootPart.Shape, new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), @@ -579,7 +581,10 @@ namespace OpenSim.Region.Environment.Scenes // if not phantom, add to physics if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = - phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), + phyScene.AddPrimShape( + rootPart.Name, + rootPart.Shape, + new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), new Quaternion()); } @@ -662,7 +667,9 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) - rootPart.PhysActor = phyScene.AddPrim( + rootPart.PhysActor = phyScene.AddPrimShape( + rootPart.Name, + rootPart.Shape, new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 890008d..da9f366 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -314,12 +314,16 @@ namespace OpenSim.Region.Environment.Scenes /// may need to create a new Physics actor. if (dupe.RootPart.PhysActor != null) { - dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrim( - new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, - dupe.RootPart.AbsolutePosition.Z), - new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), - new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, - dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z)); + PrimitiveBaseShape pbs = dupe.RootPart.Shape; + + dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrimShape( + dupe.RootPart.Name, + pbs, + new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z), + new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), + new Axiom.Math.Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, + dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z)); + } List partList = new List(m_parts.Values); @@ -838,6 +842,17 @@ namespace OpenSim.Region.Environment.Scenes { part.UpdateShape(shapeBlock); } + if (m_rootPart.PhysActor != null) + { + this.m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor); + m_rootPart.PhysActor = m_scene.PhysScene.AddPrimShape( + m_rootPart.Name, + m_rootPart.Shape, + new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y, m_rootPart.AbsolutePosition.Z), + new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z), + new Axiom.Math.Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, + m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z)); + } } #endregion @@ -1252,4 +1267,4 @@ namespace OpenSim.Region.Environment.Scenes Text = text; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 0338572..428b771 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -914,7 +914,7 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); - m_physicsActor = scene.AddAvatar(pVec); + m_physicsActor = scene.AddAvatar(this.Firstname+"."+this.Lastname, pVec); } internal void Close() -- cgit v1.1