From ab778c4114d694e284ac711b7500e9ced7d01bad Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 1 Aug 2008 02:33:28 +0000 Subject: Mantis#1859. Thank you kindly, Lmmz for a patch that: Implements llForceMouselook(). --- .../Region/Environment/Scenes/SceneObjectPart.cs | 30 ++++++++++++++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 9 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1d719b2..675322a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -195,6 +195,12 @@ namespace OpenSim.Region.Environment.Scenes protected LLUUID m_uuid; protected LLVector3 m_velocity; + // TODO: Those have to be changed into persistent properties at some later point, + // or sit-camera on vehicles will break on sim-crossing. + private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); + private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); + private bool m_forceMouselook = false; + #endregion Fields #region Constructors @@ -3313,6 +3319,30 @@ namespace OpenSim.Region.Environment.Scenes } } + public void SetCameraAtOffset(LLVector3 v) { + m_cameraAtOffset = v; + } + + public void SetCameraEyeOffset(LLVector3 v) { + m_cameraEyeOffset = v; + } + + public void SetForceMouselook(bool force) { + m_forceMouselook = force; + } + + public LLVector3 GetCameraAtOffset() { + return m_cameraAtOffset; + } + + public LLVector3 GetCameraEyeOffset() { + return m_cameraEyeOffset; + } + + public bool GetForceMouselook() { + return m_forceMouselook; + } + #endregion Public Methods } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b24ee8a..221da0e 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1129,6 +1129,9 @@ namespace OpenSim.Region.Environment.Scenes bool autopilot = true; LLVector3 pos = new LLVector3(); LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); + LLVector3 cameraEyeOffset = LLVector3.Zero; + LLVector3 cameraAtOffset = LLVector3.Zero; + bool forceMouselook = false; //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); SceneObjectPart part = FindNextAvailableSitTarget(targetID); @@ -1183,9 +1186,13 @@ namespace OpenSim.Region.Environment.Scenes RemoveFromPhysicalScene(); } } + + cameraAtOffset = part.GetCameraAtOffset(); + cameraEyeOffset = part.GetCameraEyeOffset(); + forceMouselook = part.GetForceMouselook(); } - ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false); + ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); m_requestedSitTargetUUID = targetID; // This calls HandleAgentSit twice, once from here, and the client calls // HandleAgentSit itself after it gets to the location -- cgit v1.1