From 126e73c5ed7bb95b36739d46921375b78f6207e1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 8 Jan 2013 02:29:21 +0000 Subject: [PATCH] put back position and rot change check before sending releasing plane constrain --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a19f02935a..cdba2824b4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1421,6 +1421,9 @@ namespace OpenSim.Region.Framework.Scenes public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal) { + const float POSITION_TOLERANCE = 0.02f; + const float ROTATION_TOLERANCE = 0.02f; + m_doingCamRayCast = false; if (hitYN && localid != LocalId) { @@ -1436,11 +1439,11 @@ namespace OpenSim.Region.Framework.Scenes Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z, Vector3.Dot(collisionPoint, pNormal)); UpdateCameraCollisionPlane(plane); } - else + else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || + !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) { Vector4 plane = new Vector4(0.9f, 0.0f, 0.361f, -9000f); // not right... UpdateCameraCollisionPlane(plane); - CameraConstraintActive = false; } } @@ -1543,8 +1546,8 @@ namespace OpenSim.Region.Framework.Scenes if (!m_doingCamRayCast && !m_mouseLook && ParentID == 0) { Vector3 posAdjusted = AbsolutePosition; - posAdjusted.Z += 0.5f * Appearance.AvatarSize.Z - 0.5f; - +// posAdjusted.Z += 0.5f * Appearance.AvatarSize.Z - 0.5f; + posAdjusted.Z += 1.0f; // viewer current camera focus point Vector3 tocam = CameraPosition - posAdjusted; tocam.X = (float)Math.Round(tocam.X, 1); tocam.Y = (float)Math.Round(tocam.Y, 1);