diff options
author | Justin Clark-Casey (justincc) | 2011-11-16 23:01:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-16 23:01:59 +0000 |
commit | b6d83e9c0f4bd1d450e36270278285be50d5ace8 (patch) | |
tree | a5a05ee468964d2a5a8b90b186145e615368de71 /OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |
parent | Call public ForEach instead of using m_entities directly. No semantic changes... (diff) | |
download | opensim-SC-b6d83e9c0f4bd1d450e36270278285be50d5ace8.zip opensim-SC-b6d83e9c0f4bd1d450e36270278285be50d5ace8.tar.gz opensim-SC-b6d83e9c0f4bd1d450e36270278285be50d5ace8.tar.bz2 opensim-SC-b6d83e9c0f4bd1d450e36270278285be50d5ace8.tar.xz |
Stop OdePrim and OdeCharacter insanely overriding set LocalID to set their own private m_localID property but leaving get to return the then unset PhysicsActor.LocalId!
Instead, just have both subclasses use the PhysicsActor.LocalID property.
This restores collision functionality that fell away in 45c7789 yesterday
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 740037f..43d852b 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -1306,8 +1306,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1306 | { | 1306 | { |
1307 | case ActorTypes.Agent: | 1307 | case ActorTypes.Agent: |
1308 | cc1 = (OdeCharacter)p1; | 1308 | cc1 = (OdeCharacter)p1; |
1309 | obj2LocalID = cc1.m_localID; | 1309 | obj2LocalID = cc1.LocalID; |
1310 | cc1.AddCollisionEvent(cc2.m_localID, contact); | 1310 | cc1.AddCollisionEvent(cc2.LocalID, contact); |
1311 | //ctype = (int)CollisionCategories.Character; | 1311 | //ctype = (int)CollisionCategories.Character; |
1312 | 1312 | ||
1313 | //if (cc1.CollidingObj) | 1313 | //if (cc1.CollidingObj) |
@@ -1322,8 +1322,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1322 | if (p1 is OdePrim) | 1322 | if (p1 is OdePrim) |
1323 | { | 1323 | { |
1324 | cp1 = (OdePrim) p1; | 1324 | cp1 = (OdePrim) p1; |
1325 | obj2LocalID = cp1.m_localID; | 1325 | obj2LocalID = cp1.LocalID; |
1326 | cp1.AddCollisionEvent(cc2.m_localID, contact); | 1326 | cp1.AddCollisionEvent(cc2.LocalID, contact); |
1327 | } | 1327 | } |
1328 | //ctype = (int)CollisionCategories.Geom; | 1328 | //ctype = (int)CollisionCategories.Geom; |
1329 | 1329 | ||
@@ -1359,8 +1359,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1359 | if (p1 is OdeCharacter) | 1359 | if (p1 is OdeCharacter) |
1360 | { | 1360 | { |
1361 | cc1 = (OdeCharacter) p1; | 1361 | cc1 = (OdeCharacter) p1; |
1362 | obj2LocalID = cc1.m_localID; | 1362 | obj2LocalID = cc1.LocalID; |
1363 | cc1.AddCollisionEvent(cp2.m_localID, contact); | 1363 | cc1.AddCollisionEvent(cp2.LocalID, contact); |
1364 | //ctype = (int)CollisionCategories.Character; | 1364 | //ctype = (int)CollisionCategories.Character; |
1365 | 1365 | ||
1366 | //if (cc1.CollidingObj) | 1366 | //if (cc1.CollidingObj) |
@@ -1375,8 +1375,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1375 | if (p1 is OdePrim) | 1375 | if (p1 is OdePrim) |
1376 | { | 1376 | { |
1377 | cp1 = (OdePrim) p1; | 1377 | cp1 = (OdePrim) p1; |
1378 | obj2LocalID = cp1.m_localID; | 1378 | obj2LocalID = cp1.LocalID; |
1379 | cp1.AddCollisionEvent(cp2.m_localID, contact); | 1379 | cp1.AddCollisionEvent(cp2.LocalID, contact); |
1380 | //ctype = (int)CollisionCategories.Geom; | 1380 | //ctype = (int)CollisionCategories.Geom; |
1381 | 1381 | ||
1382 | //if (cp1.CollidingObj) | 1382 | //if (cp1.CollidingObj) |
@@ -1638,7 +1638,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1638 | /// <param name="obj"></param> | 1638 | /// <param name="obj"></param> |
1639 | internal void AddCollisionEventReporting(PhysicsActor obj) | 1639 | internal void AddCollisionEventReporting(PhysicsActor obj) |
1640 | { | 1640 | { |
1641 | // m_log.DebugFormat("[PHYSICS]: Adding {0} to collision event reporting", obj.SOPName); | 1641 | // m_log.DebugFormat("[PHYSICS]: Adding {0} {1} to collision event reporting", obj.SOPName, obj.LocalID); |
1642 | 1642 | ||
1643 | lock (_collisionEventPrimChanges) | 1643 | lock (_collisionEventPrimChanges) |
1644 | _collisionEventPrimChanges[obj.LocalID] = obj; | 1644 | _collisionEventPrimChanges[obj.LocalID] = obj; |
@@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1650 | /// <param name="obj"></param> | 1650 | /// <param name="obj"></param> |
1651 | internal void RemoveCollisionEventReporting(PhysicsActor obj) | 1651 | internal void RemoveCollisionEventReporting(PhysicsActor obj) |
1652 | { | 1652 | { |
1653 | // m_log.DebugFormat("[PHYSICS]: Removing {0} from collision event reporting", obj.SOPName); | 1653 | // m_log.DebugFormat("[PHYSICS]: Removing {0} {1} from collision event reporting", obj.SOPName, obj.LocalID); |
1654 | 1654 | ||
1655 | lock (_collisionEventPrimChanges) | 1655 | lock (_collisionEventPrimChanges) |
1656 | _collisionEventPrimChanges[obj.LocalID] = null; | 1656 | _collisionEventPrimChanges[obj.LocalID] = null; |
@@ -1754,9 +1754,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1754 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 1754 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
1755 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) | 1755 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
1756 | { | 1756 | { |
1757 | #if SPAM | 1757 | // m_log.DebugFormat("[ODE SCENE]: Adding physics actor to {0} {1}", primName, localid); |
1758 | m_log.DebugFormat("[PHYSICS]: Adding physics actor to {0}", primName); | ||
1759 | #endif | ||
1760 | 1758 | ||
1761 | return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); | 1759 | return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); |
1762 | } | 1760 | } |
@@ -2810,7 +2808,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
2810 | 2808 | ||
2811 | foreach (PhysicsActor obj in _collisionEventPrim.Values) | 2809 | foreach (PhysicsActor obj in _collisionEventPrim.Values) |
2812 | { | 2810 | { |
2813 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} for collision events", obj.SOPName); | 2811 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} {1} for collision events", obj.SOPName, obj.LocalID); |
2814 | 2812 | ||
2815 | switch ((ActorTypes)obj.PhysicsActorType) | 2813 | switch ((ActorTypes)obj.PhysicsActorType) |
2816 | { | 2814 | { |
@@ -3746,7 +3744,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
3746 | { | 3744 | { |
3747 | if (prm.CollisionScore > 0) | 3745 | if (prm.CollisionScore > 0) |
3748 | { | 3746 | { |
3749 | returncolliders.Add(prm.m_localID, prm.CollisionScore); | 3747 | returncolliders.Add(prm.LocalID, prm.CollisionScore); |
3750 | cnt++; | 3748 | cnt++; |
3751 | prm.CollisionScore = 0f; | 3749 | prm.CollisionScore = 0f; |
3752 | if (cnt > 25) | 3750 | if (cnt > 25) |