aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-12-05 02:10:46 +0000
committerJustin Clark-Casey (justincc)2013-12-05 02:10:46 +0000
commit17b32b764acd815400d9eb903aaec6dcebd60ac7 (patch)
treeba6ccf9987f40940b77f779d07ba187c463c9c4a /OpenSim/Region
parentIgnore X and Y body rotations when sent by mouse look. (diff)
downloadopensim-SC-17b32b764acd815400d9eb903aaec6dcebd60ac7.zip
opensim-SC-17b32b764acd815400d9eb903aaec6dcebd60ac7.tar.gz
opensim-SC-17b32b764acd815400d9eb903aaec6dcebd60ac7.tar.bz2
opensim-SC-17b32b764acd815400d9eb903aaec6dcebd60ac7.tar.xz
Fix regression where mouse look flight direction no longer worked by zeroing x/y rot before sending agent updates, instead of before any agent update processing
It turns out that the x/y rot data in mouselook is needed to implement this and to push the avatar against the ground if walking in mouselook. Doing this in the terse send so that we preserve mouselook rotation information
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
2 files changed, 26 insertions, 14 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c1aae3f..a04ded5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5091,7 +5091,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5091// acceleration = new Vector3(1, 0, 0); 5091// acceleration = new Vector3(1, 0, 0);
5092 5092
5093 angularVelocity = presence.AngularVelocity; 5093 angularVelocity = presence.AngularVelocity;
5094
5095 // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis
5096 // it rotates around.
5097 // In mouselook, X and Y co-ordinate will also be sent but when used in Rotation, these cause unwanted
5098 // excessive up and down movements of the camera when looking up and down.
5099 // See http://opensimulator.org/mantis/view.php?id=3274
5100 // This does not affect head movement, since this is controlled entirely by camera movement rather than
5101 // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
5102 // effect, not the avatar rotation.
5094 rotation = presence.Rotation; 5103 rotation = presence.Rotation;
5104 rotation.X = 0;
5105 rotation.Y = 0;
5095 5106
5096 if (sendTexture) 5107 if (sendTexture)
5097 textureEntry = presence.Appearance.Texture.GetBytes(); 5108 textureEntry = presence.Appearance.Texture.GetBytes();
@@ -5207,7 +5218,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5207 data.OffsetPosition.ToBytes(objectData, 16); 5218 data.OffsetPosition.ToBytes(objectData, 16);
5208// data.Velocity.ToBytes(objectData, 28); 5219// data.Velocity.ToBytes(objectData, 28);
5209// data.Acceleration.ToBytes(objectData, 40); 5220// data.Acceleration.ToBytes(objectData, 40);
5210 data.Rotation.ToBytes(objectData, 52); 5221
5222 // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis
5223 // it rotates around.
5224 // In mouselook, X and Y co-ordinate will also be sent but when used in Rotation, these cause unwanted
5225 // excessive up and down movements of the camera when looking up and down.
5226 // See http://opensimulator.org/mantis/view.php?id=3274
5227 // This does not affect head movement, since this is controlled entirely by camera movement rather than
5228 // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
5229 // effect, not the avatar rotation.
5230 Quaternion rot = data.Rotation;
5231 rot.X = 0;
5232 rot.Y = 0;
5233 rot.ToBytes(objectData, 52);
5211 //data.AngularVelocity.ToBytes(objectData, 64); 5234 //data.AngularVelocity.ToBytes(objectData, 64);
5212 5235
5213 ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); 5236 ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index dae20a5..7ed3a4b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1652,20 +1652,9 @@ namespace OpenSim.Region.Framework.Scenes
1652 1652
1653 bool update_rotation = false; 1653 bool update_rotation = false;
1654 1654
1655 // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis 1655 if (agentData.BodyRotation != Rotation)
1656 // it rotates around.
1657 // In mouselook, X and Y co-ordinate will also be sent but when used in Rotation, these cause unwanted
1658 // excessive up and down movements of the camera when looking up and down.
1659 // See http://opensimulator.org/mantis/view.php?id=3274
1660 // This does not affect head movement, since this is controlled entirely by camera movement rather than
1661 // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
1662 // effect, not the avatar rotation.
1663 // However, if we do need to store X and Y rotations in the future, another solution needs to be found
1664 // for the mouselook bug. Possibly, one could strip out X and Y rotations before sending the avatar
1665 // update messages.
1666 if (agentData.BodyRotation.Z != Rotation.Z || agentData.BodyRotation.W != Rotation.W)
1667 { 1656 {
1668 Rotation = new Quaternion(0, 0, agentData.BodyRotation.Z, agentData.BodyRotation.W); 1657 Rotation = agentData.BodyRotation;
1669 update_rotation = true; 1658 update_rotation = true;
1670 } 1659 }
1671 1660