diff options
author | Melanie | 2011-07-15 12:08:40 -0700 |
---|---|---|
committer | Melanie | 2011-07-15 19:36:00 +0200 |
commit | c7dbd7cbd035ccc412624cd221348479d43798d6 (patch) | |
tree | f1e1791757cef6d0818d7c5d16b9fec687bf55cc /OpenSim/Region | |
parent | Revert "Add localid support to ch0de properly" (diff) | |
download | opensim-SC_OLD-c7dbd7cbd035ccc412624cd221348479d43798d6.zip opensim-SC_OLD-c7dbd7cbd035ccc412624cd221348479d43798d6.tar.gz opensim-SC_OLD-c7dbd7cbd035ccc412624cd221348479d43798d6.tar.bz2 opensim-SC_OLD-c7dbd7cbd035ccc412624cd221348479d43798d6.tar.xz |
Fox some local id issues in physics glue
Diffstat (limited to 'OpenSim/Region')
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 | |||
1767 | part.AbsolutePosition, | 1767 | part.AbsolutePosition, |
1768 | part.Scale, | 1768 | part.Scale, |
1769 | part.RotationOffset, | 1769 | part.RotationOffset, |
1770 | part.PhysActor.IsPhysical); | 1770 | part.PhysActor.IsPhysical, |
1771 | m_localId); | ||
1771 | part.PhysActor.SetMaterial((int)part.Material); | 1772 | part.PhysActor.SetMaterial((int)part.Material); |
1772 | 1773 | ||
1773 | part.PhysActor.LocalID = part.LocalId; | 1774 | 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 | |||
1633 | AbsolutePosition, | 1633 | AbsolutePosition, |
1634 | Scale, | 1634 | Scale, |
1635 | RotationOffset, | 1635 | RotationOffset, |
1636 | RigidBody); | 1636 | RigidBody, |
1637 | m_localId); | ||
1637 | PhysActor.SetMaterial(Material); | 1638 | PhysActor.SetMaterial(Material); |
1638 | } | 1639 | } |
1639 | catch | 1640 | catch |
@@ -4442,7 +4443,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4442 | AbsolutePosition, | 4443 | AbsolutePosition, |
4443 | Scale, | 4444 | Scale, |
4444 | RotationOffset, | 4445 | RotationOffset, |
4445 | UsePhysics); | 4446 | UsePhysics, |
4447 | m_localId); | ||
4446 | PhysActor.SetMaterial(Material); | 4448 | PhysActor.SetMaterial(Material); |
4447 | 4449 | ||
4448 | pa = PhysActor; | 4450 | 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 | |||
84 | */ | 84 | */ |
85 | 85 | ||
86 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 86 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
87 | Vector3 size, Quaternion rotation) | 87 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
88 | { | ||
89 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
90 | } | ||
91 | |||
92 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
93 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
94 | { | 88 | { |
95 | return null; | 89 | return null; |
96 | } | 90 | } |
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 | |||
213 | return newPrim; | 213 | return newPrim; |
214 | } | 214 | } |
215 | 215 | ||
216 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation) | 216 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
217 | { | ||
218 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
219 | } | ||
220 | |||
221 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical) | ||
222 | { | 217 | { |
223 | PhysicsActor result; | 218 | PhysicsActor result; |
224 | IMesh mesh = null; | 219 | 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 | |||
626 | } | 626 | } |
627 | 627 | ||
628 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, | 628 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, |
629 | OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation) | 629 | OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, bool isPhysical, uint localid) |
630 | { | ||
631 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
632 | } | ||
633 | |||
634 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, | ||
635 | OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, bool isPhysical) | ||
636 | { | 630 | { |
637 | PhysicsActor result; | 631 | PhysicsActor result; |
638 | 632 | ||
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 | |||
256 | 256 | ||
257 | 257 | ||
258 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, | 258 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, |
259 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) | 259 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode, uint localid) |
260 | { | 260 | { |
261 | m_localID = localid; | ||
261 | ode = dode; | 262 | ode = dode; |
262 | if (!pos.IsFinite()) | 263 | if (!pos.IsFinite()) |
263 | { | 264 | { |
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 | |||
1717 | } | 1717 | } |
1718 | 1718 | ||
1719 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, | 1719 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, |
1720 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) | 1720 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical, uint localid) |
1721 | { | 1721 | { |
1722 | 1722 | ||
1723 | Vector3 pos = position; | 1723 | Vector3 pos = position; |
@@ -1727,7 +1727,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1727 | OdePrim newPrim; | 1727 | OdePrim newPrim; |
1728 | lock (OdeLock) | 1728 | lock (OdeLock) |
1729 | { | 1729 | { |
1730 | newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode); | 1730 | newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode, localid); |
1731 | 1731 | ||
1732 | lock (_prims) | 1732 | lock (_prims) |
1733 | _prims.Add(newPrim); | 1733 | _prims.Add(newPrim); |
@@ -1749,13 +1749,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 1751 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
1752 | Vector3 size, Quaternion rotation) //To be removed | 1752 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
1753 | { | ||
1754 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
1755 | } | ||
1756 | |||
1757 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
1758 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
1759 | { | 1753 | { |
1760 | PhysicsActor result; | 1754 | PhysicsActor result; |
1761 | IMesh mesh = null; | 1755 | IMesh mesh = null; |
@@ -1763,7 +1757,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1763 | if (needsMeshing(pbs)) | 1757 | if (needsMeshing(pbs)) |
1764 | mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); | 1758 | mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); |
1765 | 1759 | ||
1766 | result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical); | 1760 | result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical, localid); |
1767 | 1761 | ||
1768 | return result; | 1762 | return result; |
1769 | } | 1763 | } |
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 | |||
77 | 77 | ||
78 | public abstract void RemovePrim(PhysicsActor prim); | 78 | public abstract void RemovePrim(PhysicsActor prim); |
79 | 79 | ||
80 | //public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
81 | // Vector3 size, Quaternion rotation); //To be removed - Actually removed! | ||
82 | |||
80 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 83 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
81 | Vector3 size, Quaternion rotation); //To be removed | 84 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); |
82 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
83 | Vector3 size, Quaternion rotation, bool isPhysical); | ||
84 | 85 | ||
85 | public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position, | 86 | public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position, |
86 | Vector3 size, Quaternion rotation, bool isPhysical) | 87 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
87 | { | 88 | { |
88 | PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical); | 89 | PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); |
89 | 90 | ||
90 | if (ret != null) | 91 | if (ret != null) |
91 | ret.LocalID = localID; | 92 | ret.LocalID = localID; |
@@ -262,13 +263,7 @@ namespace OpenSim.Region.Physics.Manager | |||
262 | */ | 263 | */ |
263 | 264 | ||
264 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 265 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
265 | Vector3 size, Quaternion rotation) //To be removed | 266 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
266 | { | ||
267 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
268 | } | ||
269 | |||
270 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
271 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
272 | { | 267 | { |
273 | m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size); | 268 | m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size); |
274 | return PhysicsActor.Null; | 269 | 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 | |||
1708 | } | 1708 | } |
1709 | 1709 | ||
1710 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 1710 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
1711 | Vector3 size, Quaternion rotation) //To be removed | 1711 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
1712 | { | ||
1713 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
1714 | } | ||
1715 | |||
1716 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
1717 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
1718 | { | 1712 | { |
1719 | #if SPAM | 1713 | #if SPAM |
1720 | m_log.DebugFormat("[PHYSICS]: Adding physics actor to {0}", primName); | 1714 | 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 | |||
83 | Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f); | 83 | Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f); |
84 | Vector3 size = new Vector3(0.5f, 0.5f, 0.5f); | 84 | Vector3 size = new Vector3(0.5f, 0.5f, 0.5f); |
85 | Quaternion rot = Quaternion.Identity; | 85 | Quaternion rot = Quaternion.Identity; |
86 | PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true); | 86 | PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true, 0); |
87 | OdePrim oprim = (OdePrim)prim; | 87 | OdePrim oprim = (OdePrim)prim; |
88 | OdeScene pscene = (OdeScene) ps; | 88 | OdeScene pscene = (OdeScene) ps; |
89 | 89 | ||
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 | |||
91 | */ | 91 | */ |
92 | 92 | ||
93 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 93 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
94 | Vector3 size, Quaternion rotation) | 94 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
95 | { | ||
96 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
97 | } | ||
98 | |||
99 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
100 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
101 | { | 95 | { |
102 | POSPrim prim = new POSPrim(); | 96 | POSPrim prim = new POSPrim(); |
103 | prim.Position = position; | 97 | 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 | |||
108 | } | 108 | } |
109 | 109 | ||
110 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 110 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
111 | Vector3 size, Quaternion rotation) //To be removed | 111 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
112 | { | ||
113 | return AddPrimShape(primName, pbs, position, size, rotation, false); | ||
114 | } | ||
115 | |||
116 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
117 | Vector3 size, Quaternion rotation, bool isPhysical) | ||
118 | { | 112 | { |
119 | return AddPrim(position, size, rotation); | 113 | return AddPrim(position, size, rotation); |
120 | } | 114 | } |