From 94b03aa09d2937f95511f07c9ae41e1d94150f8f Mon Sep 17 00:00:00 2001 From: dan miller Date: Sun, 9 Sep 2007 15:28:15 +0000 Subject: [PATCH] ODE: added support for Phantom flag. Presently you need to add 1024 to ObjectFlags by hand --- .../Environment/Scenes/Scene.Inventory.cs | 9 ++++---- OpenSim/Region/Environment/Scenes/Scene.cs | 23 +++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 879cd79468..e5ab41ffef 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -415,10 +415,11 @@ namespace OpenSim.Region.Environment.Scenes this.AddEntity(group); group.AbsolutePosition = pos; SceneObjectPart rootPart = group.GetChildPart(group.UUID); - rootPart.PhysActor = phyScene.AddPrim( - new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), - new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), - new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, + if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + rootPart.PhysActor = phyScene.AddPrim( + new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), + new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), + new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 4f8d60bc15..17b01d5d46 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -528,10 +528,11 @@ namespace OpenSim.Region.Environment.Scenes { AddEntityFromStorage(prim); SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); - rootPart.PhysActor = phyScene.AddPrim( - new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), - new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), - new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, + if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + rootPart.PhysActor = phyScene.AddPrim( + new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), + new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), + new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); } MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); @@ -567,7 +568,8 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); AddEntity(sceneOb); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); - rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), + if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), new Axiom.Math.Quaternion()); } } @@ -648,11 +650,12 @@ namespace OpenSim.Region.Environment.Scenes AddEntity(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); - rootPart.PhysActor = phyScene.AddPrim( - new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), - new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), - new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + rootPart.PhysActor = phyScene.AddPrim( + new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), + new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), + new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, + rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); primCount++; } }