diff options
author | Homer Horwitz | 2008-09-13 18:42:09 +0000 |
---|---|---|
committer | Homer Horwitz | 2008-09-13 18:42:09 +0000 |
commit | ae9e4e8144c5f787d71eafe2e0470887f36e3566 (patch) | |
tree | 249cefab9705639c83c469969a60d49a1dcc0a66 /OpenSim | |
parent | Remove the cruft of accessing a private member of another module's class (diff) | |
download | opensim-SC-ae9e4e8144c5f787d71eafe2e0470887f36e3566.zip opensim-SC-ae9e4e8144c5f787d71eafe2e0470887f36e3566.tar.gz opensim-SC-ae9e4e8144c5f787d71eafe2e0470887f36e3566.tar.bz2 opensim-SC-ae9e4e8144c5f787d71eafe2e0470887f36e3566.tar.xz |
Update avatar-position while avatar is sitting and the prim is moved (#2159).
I decided to make ParentPosition a public property in ScenePresence, because
that's exactly what happens (the parent position changes on prim move).
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2b0ad12..b4b9f00 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -498,6 +498,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
498 | Console.WriteLine(e.Message); | 498 | Console.WriteLine(e.Message); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | |||
502 | // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too | ||
503 | if(m_sitTargetAvatar != UUID.Zero) { | ||
504 | if (m_parentGroup != null) // TODO can there be a SOP without a SOG? | ||
505 | { | ||
506 | ScenePresence avatar; | ||
507 | if(m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar)) { | ||
508 | avatar.ParentPosition = GetWorldPosition(); | ||
509 | } | ||
510 | } | ||
511 | } | ||
501 | 512 | ||
502 | } | 513 | } |
503 | } | 514 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index ff043fb..f58bba6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -287,6 +287,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
287 | } | 287 | } |
288 | 288 | ||
289 | protected Vector3 m_parentPosition = new Vector3(); | 289 | protected Vector3 m_parentPosition = new Vector3(); |
290 | public Vector3 ParentPosition | ||
291 | { | ||
292 | get { return m_parentPosition; } | ||
293 | set { m_parentPosition = value; } | ||
294 | } | ||
290 | 295 | ||
291 | /// <summary> | 296 | /// <summary> |
292 | /// Absolute position of this avatar in 'region cordinates' | 297 | /// Absolute position of this avatar in 'region cordinates' |