diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f3e2179..1c5d23d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -507,7 +507,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
507 | /// <summary> | 507 | /// <summary> |
508 | /// Physical scene representation of this Avatar. | 508 | /// Physical scene representation of this Avatar. |
509 | /// </summary> | 509 | /// </summary> |
510 | public PhysicsActor PhysicsActor { get; private set; } | 510 | |
511 | PhysicsActor m_physActor; | ||
512 | public PhysicsActor PhysicsActor | ||
513 | { | ||
514 | get | ||
515 | { | ||
516 | return m_physActor; | ||
517 | } | ||
518 | private set | ||
519 | { | ||
520 | m_physActor = value; | ||
521 | } | ||
522 | } | ||
511 | 523 | ||
512 | /// <summary> | 524 | /// <summary> |
513 | /// Record user movement inputs. | 525 | /// Record user movement inputs. |
@@ -1641,15 +1653,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1641 | /// </summary> | 1653 | /// </summary> |
1642 | public void RemoveFromPhysicalScene() | 1654 | public void RemoveFromPhysicalScene() |
1643 | { | 1655 | { |
1644 | if (PhysicsActor != null) | 1656 | PhysicsActor pa = Interlocked.Exchange(ref m_physActor, null); |
1657 | if (pa != null) | ||
1645 | { | 1658 | { |
1646 | // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; | 1659 | // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; |
1647 | 1660 | ||
1648 | PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; | 1661 | pa.OnOutOfBounds -= OutOfBoundsCall; |
1649 | PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; | 1662 | pa.OnCollisionUpdate -= PhysicsCollisionUpdate; |
1650 | PhysicsActor.UnSubscribeEvents(); | 1663 | pa.UnSubscribeEvents(); |
1651 | m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); | 1664 | m_scene.PhysicsScene.RemoveAvatar(pa); |
1652 | PhysicsActor = null; | ||
1653 | } | 1665 | } |
1654 | // else | 1666 | // else |
1655 | // { | 1667 | // { |
@@ -2542,7 +2554,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2542 | m_pos.X = 127f; | 2554 | m_pos.X = 127f; |
2543 | m_pos.Y = 127f; | 2555 | m_pos.Y = 127f; |
2544 | m_pos.Z = 127f; | 2556 | m_pos.Z = 127f; |
2545 | m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999903"); | 2557 | m_log.Error("[AVATAR]: NonFinite Avatar on lastFiniteposition also. Reset Position. Mantis this please. Error #9999903"); |
2546 | } | 2558 | } |
2547 | 2559 | ||
2548 | if(isphysical) | 2560 | if(isphysical) |
@@ -5012,16 +5024,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
5012 | PhysicsScene scene = m_scene.PhysicsScene; | 5024 | PhysicsScene scene = m_scene.PhysicsScene; |
5013 | Vector3 pVec = AbsolutePosition; | 5025 | Vector3 pVec = AbsolutePosition; |
5014 | 5026 | ||
5015 | PhysicsActor = scene.AddAvatar( | 5027 | PhysicsActor pa = scene.AddAvatar( |
5016 | LocalId, Firstname + "." + Lastname, pVec, | 5028 | LocalId, Firstname + "." + Lastname, pVec, |
5017 | Appearance.AvatarBoxSize,Appearance.AvatarFeetOffset, isFlying); | 5029 | Appearance.AvatarBoxSize,Appearance.AvatarFeetOffset, isFlying); |
5018 | PhysicsActor.Orientation = m_bodyRot; | 5030 | pa.Orientation = m_bodyRot; |
5019 | //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 5031 | //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
5020 | PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 5032 | pa.OnCollisionUpdate += PhysicsCollisionUpdate; |
5021 | PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong | 5033 | pa.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong |
5022 | PhysicsActor.SubscribeEvents(100); | 5034 | pa.SubscribeEvents(100); |
5023 | PhysicsActor.LocalID = LocalId; | 5035 | pa.LocalID = LocalId; |
5024 | PhysicsActor.SetAlwaysRun = m_setAlwaysRun; | 5036 | pa.SetAlwaysRun = m_setAlwaysRun; |
5037 | PhysicsActor = pa; | ||
5025 | } | 5038 | } |
5026 | 5039 | ||
5027 | private void OutOfBoundsCall(Vector3 pos) | 5040 | private void OutOfBoundsCall(Vector3 pos) |