From bb402d0d95c934fbcd8b1c03e228ec1d0a14f14d Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 15 Jul 2011 12:08:40 -0700 Subject: Add localid support to ch0de properly --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 ++++-- .../Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs | 8 +------- .../Physics/BulletDotNETPlugin/BulletDotNETScene.cs | 7 +------ OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | 8 +------- OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 3 ++- OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs | 14 ++++---------- OpenSim/Region/Physics/Manager/PhysicsScene.cs | 19 +++++++------------ OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 8 +------- .../Region/Physics/OdePlugin/Tests/ODETestClass.cs | 2 +- OpenSim/Region/Physics/POSPlugin/POSScene.cs | 8 +------- OpenSim/Region/Physics/PhysXPlugin/PhysXScene.cs | 8 +------- 12 files changed, 26 insertions(+), 68 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 482597d..aeb03a2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1767,7 +1767,8 @@ namespace OpenSim.Region.Framework.Scenes part.AbsolutePosition, part.Scale, part.RotationOffset, - part.PhysActor.IsPhysical); + part.PhysActor.IsPhysical, + m_localId); part.PhysActor.SetMaterial((int)part.Material); part.PhysActor.LocalID = part.LocalId; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 980f7a3..2214f2f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1633,7 +1633,8 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition, Scale, RotationOffset, - RigidBody); + RigidBody, + m_localId); PhysActor.SetMaterial(Material); } catch @@ -4442,7 +4443,8 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition, Scale, RotationOffset, - UsePhysics); + UsePhysics, + m_localId); PhysActor.SetMaterial(Material); pa = PhysActor; diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs index b6e1cb4..6c9d9ab 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs @@ -84,13 +84,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin */ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { return null; } diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs index 6df213d..0d1bd82 100644 --- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs +++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs @@ -213,12 +213,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin return newPrim; } - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation) - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical) + public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { PhysicsActor result; IMesh mesh = null; diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index f4245b6..8e9edac 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -626,13 +626,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, - OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation) - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, - OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, bool isPhysical) + OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, bool isPhysical, uint localid) { PhysicsActor result; diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 7cd2dd1..82f1b94 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs @@ -256,8 +256,9 @@ namespace OpenSim.Region.Physics.OdePlugin public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, - Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) + Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode, uint localid) { + m_localID = localid; ode = dode; if (!pos.IsFinite()) { diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs index a622745..353db44 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs @@ -1717,7 +1717,7 @@ namespace OpenSim.Region.Physics.OdePlugin } private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, - IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) + IMesh mesh, PrimitiveBaseShape pbs, bool isphysical, uint localid) { Vector3 pos = position; @@ -1727,7 +1727,7 @@ namespace OpenSim.Region.Physics.OdePlugin OdePrim newPrim; lock (OdeLock) { - newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode); + newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode, localid); lock (_prims) _prims.Add(newPrim); @@ -1749,13 +1749,7 @@ namespace OpenSim.Region.Physics.OdePlugin } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) //To be removed - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { PhysicsActor result; IMesh mesh = null; @@ -1763,7 +1757,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (needsMeshing(pbs)) mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); - result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical); + result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical, localid); return result; } diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 13ea084..de22fae 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -77,15 +77,16 @@ namespace OpenSim.Region.Physics.Manager public abstract void RemovePrim(PhysicsActor prim); + //public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, + // Vector3 size, Quaternion rotation); //To be removed - Actually removed! + public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation); //To be removed - public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical); + Vector3 size, Quaternion rotation, bool isPhysical, uint localid); public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { - PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical); + PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); if (ret != null) ret.LocalID = localID; @@ -262,13 +263,7 @@ namespace OpenSim.Region.Physics.Manager */ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) //To be removed - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size); return PhysicsActor.Null; diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index f5172aa..88902b0 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1708,13 +1708,7 @@ namespace OpenSim.Region.Physics.OdePlugin } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) //To be removed - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { #if SPAM m_log.DebugFormat("[PHYSICS]: Adding physics actor to {0}", primName); diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs index a7f8baa..5dcd6f5 100644 --- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs @@ -83,7 +83,7 @@ namespace OpenSim.Region.Physics.OdePlugin Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f); Vector3 size = new Vector3(0.5f, 0.5f, 0.5f); Quaternion rot = Quaternion.Identity; - PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true); + PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true, 0); OdePrim oprim = (OdePrim)prim; OdeScene pscene = (OdeScene) ps; diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/Physics/POSPlugin/POSScene.cs index c3f5040..2f24a50 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSScene.cs @@ -91,13 +91,7 @@ namespace OpenSim.Region.Physics.POSPlugin */ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { POSPrim prim = new POSPrim(); prim.Position = position; diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXScene.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXScene.cs index 4de4b01..beb3404 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXScene.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXScene.cs @@ -108,13 +108,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin } public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation) //To be removed - { - return AddPrimShape(primName, pbs, position, size, rotation, false); - } - - public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, - Vector3 size, Quaternion rotation, bool isPhysical) + Vector3 size, Quaternion rotation, bool isPhysical, uint localid) { return AddPrim(position, size, rotation); } -- cgit v1.1