diff options
author | Justin Clark-Casey (justincc) | 2013-12-03 02:27:40 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-12-03 02:27:40 +0000 |
commit | 62a2d7836fb36f66a0e42b20f4596e517eb52354 (patch) | |
tree | 42a17766c9800f05ceac9265d4609139dfbdc469 /OpenSim/Region | |
parent | Actually use the SP.AgentControlStopSlowWhilstMoving parameter intoroduced fo... (diff) | |
download | opensim-SC_OLD-62a2d7836fb36f66a0e42b20f4596e517eb52354.zip opensim-SC_OLD-62a2d7836fb36f66a0e42b20f4596e517eb52354.tar.gz opensim-SC_OLD-62a2d7836fb36f66a0e42b20f4596e517eb52354.tar.bz2 opensim-SC_OLD-62a2d7836fb36f66a0e42b20f4596e517eb52354.tar.xz |
Ignore X and Y body rotations when sent by mouse look.
Fixes http://opensimulator.org/mantis/view.php?id=3274
When not in mouselook, avatar only sends rotations around the Z plane (since that's the only way an avatar can rotate).
However, in mouselook it also sends X and Y information. But sending X and Y in terse updates causes issues with wrong camera movement in mouselook.
So strip out X and Y components for now. If this is an issue, then could strip out before sending avatar terse update, though this generates more cpu work.
Thanks to mirceakitsune for suggesting an initial fix
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1dc7e20..dae20a5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1648,12 +1648,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1648 | 1648 | ||
1649 | if (AllowMovement && !SitGround) | 1649 | if (AllowMovement && !SitGround) |
1650 | { | 1650 | { |
1651 | Quaternion bodyRotation = agentData.BodyRotation; | 1651 | // m_log.DebugFormat("[SCENE PRESENCE]: Initial body rotation {0} for {1}", agentData.BodyRotation, Name); |
1652 | |||
1652 | bool update_rotation = false; | 1653 | bool update_rotation = false; |
1653 | 1654 | ||
1654 | if (bodyRotation != Rotation) | 1655 | // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis |
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) | ||
1655 | { | 1667 | { |
1656 | Rotation = bodyRotation; | 1668 | Rotation = new Quaternion(0, 0, agentData.BodyRotation.Z, agentData.BodyRotation.W); |
1657 | update_rotation = true; | 1669 | update_rotation = true; |
1658 | } | 1670 | } |
1659 | 1671 | ||