From 0155d42b80ee7b35d0a882052d8cf4976e7d15de Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 8 Jan 2014 00:54:39 +0000 Subject: [PATCH] If an agent is sitting, then do send the rotation in the agent update instead of zeroing it to resolve mouselook camera problems Addresses http://opensimulator.org/mantis/view.php?id=6892 Thanks to tglion for this spot. This resolves a recent regression from 17b32b764acd815400d9eb903aaec6dcebd60ac7 --- .../ClientStack/Linden/UDP/LLClientView.cs | 25 +++++++++++++------ .../Region/Framework/Scenes/ScenePresence.cs | 2 ++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index a04ded5b9a..c38c829886 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5098,11 +5098,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP // excessive up and down movements of the camera when looking up and down. // See http://opensimulator.org/mantis/view.php?id=3274 // This does not affect head movement, since this is controlled entirely by camera movement rather than - // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes - // effect, not the avatar rotation. + // body rotation. We still need to transmit X and Y for sitting avatars but mouselook does not change + // the rotation in this case. rotation = presence.Rotation; - rotation.X = 0; - rotation.Y = 0; + + if (!presence.IsSatOnObject) + { + rotation.X = 0; + rotation.Y = 0; + } if (sendTexture) textureEntry = presence.Appearance.Texture.GetBytes(); @@ -5225,11 +5229,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP // excessive up and down movements of the camera when looking up and down. // See http://opensimulator.org/mantis/view.php?id=3274 // This does not affect head movement, since this is controlled entirely by camera movement rather than - // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes - // effect, not the avatar rotation. + // body rotation. We still need to transmit X and Y for sitting avatars but mouselook does not change + // the rotation in this case. Quaternion rot = data.Rotation; - rot.X = 0; - rot.Y = 0; + + if (!data.IsSatOnObject) + { + rot.X = 0; + rot.Y = 0; + } + rot.ToBytes(objectData, 52); //data.AngularVelocity.ToBytes(objectData, 64); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7ed3a4b113..49f70c4f28 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1640,6 +1640,8 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.SendAgentTerseUpdate(this); PhysicsActor actor = PhysicsActor; + + // This will be the case if the agent is sitting on the groudn or on an object. if (actor == null) { SendControlsToScripts(flagsForScripts);