diff options
Changed it so the avatar's rotation is now sent as part of a full avatar update.
This should fix the wrong rotation on existing sitting avatar when logging in bug.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 29 |
2 files changed, 26 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 72520c4..4b42f9e 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -496,7 +496,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
496 | } | 496 | } |
497 | 497 | ||
498 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, | 498 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, |
499 | uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) | 499 | uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID, LLQuaternion rotation) |
500 | { | 500 | { |
501 | } | 501 | } |
502 | 502 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 39718dc..2434180 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
118 | 118 | ||
119 | private bool m_setAlwaysRun = false; | 119 | private bool m_setAlwaysRun = false; |
120 | 120 | ||
121 | private Quaternion m_bodyRot; | 121 | private Quaternion m_bodyRot= Quaternion.Identity; |
122 | 122 | ||
123 | public bool IsRestrictedToRegion = false; | 123 | public bool IsRestrictedToRegion = false; |
124 | 124 | ||
@@ -1266,7 +1266,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1266 | SendFullUpdateToAllClients(); | 1266 | SendFullUpdateToAllClients(); |
1267 | // This may seem stupid, but Our Full updates don't send avatar rotation :P | 1267 | // This may seem stupid, but Our Full updates don't send avatar rotation :P |
1268 | // So we're also sending a terse update (which has avatar rotation) | 1268 | // So we're also sending a terse update (which has avatar rotation) |
1269 | SendTerseUpdateToAllClients(); | 1269 | // [Update] We do now. |
1270 | //SendTerseUpdateToAllClients(); | ||
1270 | } | 1271 | } |
1271 | 1272 | ||
1272 | /// <summary> | 1273 | /// <summary> |
@@ -1617,9 +1618,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
1617 | if (m_appearance.Texture == null) | 1618 | if (m_appearance.Texture == null) |
1618 | return; | 1619 | return; |
1619 | 1620 | ||
1621 | LLQuaternion rot; | ||
1622 | if (m_bodyRot != null) | ||
1623 | { | ||
1624 | rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); | ||
1625 | } | ||
1626 | else | ||
1627 | { | ||
1628 | rot = LLQuaternion.Identity; | ||
1629 | } | ||
1630 | |||
1620 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, | 1631 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, |
1621 | LocalId, m_pos, m_appearance.Texture.ToBytes(), | 1632 | LocalId, m_pos, m_appearance.Texture.ToBytes(), |
1622 | m_parentID); | 1633 | m_parentID, rot); |
1623 | m_scene.AddAgentUpdates(1); | 1634 | m_scene.AddAgentUpdates(1); |
1624 | } | 1635 | } |
1625 | 1636 | ||
@@ -1671,8 +1682,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
1671 | // Needed for standalone | 1682 | // Needed for standalone |
1672 | m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | 1683 | m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
1673 | 1684 | ||
1685 | LLQuaternion rot; | ||
1686 | if (m_bodyRot != null) | ||
1687 | { | ||
1688 | rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); | ||
1689 | } | ||
1690 | else | ||
1691 | { | ||
1692 | rot = LLQuaternion.Identity; | ||
1693 | } | ||
1694 | |||
1674 | m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, | 1695 | m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, |
1675 | m_pos, m_appearance.Texture.ToBytes(), m_parentID); | 1696 | m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot); |
1676 | 1697 | ||
1677 | if (!m_isChildAgent) | 1698 | if (!m_isChildAgent) |
1678 | { | 1699 | { |