From 8808549669002c42c62c6ed602f7753571346d56 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 23 Jul 2014 23:09:13 +0100 Subject: [PATCH] on sit use root prim camera at and eye if child as neither --- .../Region/Framework/Scenes/ScenePresence.cs | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e7462ba18b..5c76964fb5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2705,12 +2705,20 @@ namespace OpenSim.Region.Framework.Scenes { sitOrientation = part.RotationOffset * sitOrientation; offset = offset * part.RotationOffset; - cameraAtOffset = cameraAtOffset * part.RotationOffset; - cameraEyeOffset = cameraEyeOffset * part.RotationOffset; - offset += part.OffsetPosition; - cameraAtOffset += part.OffsetPosition; - cameraEyeOffset += part.OffsetPosition; + + if (CameraAtAxis == Vector3.Zero && cameraEyeOffset == Vector3.Zero) + { + CameraAtAxis = part.ParentGroup.RootPart.GetCameraAtOffset(); + cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset(); + } + else + { + cameraAtOffset = cameraAtOffset * part.RotationOffset; + cameraAtOffset += part.OffsetPosition; + cameraEyeOffset = cameraEyeOffset * part.RotationOffset; + cameraEyeOffset += part.OffsetPosition; + } } @@ -2845,12 +2853,21 @@ namespace OpenSim.Region.Framework.Scenes { Orientation = part.RotationOffset * Orientation; offset = offset * part.RotationOffset; - cameraAtOffset = cameraAtOffset * part.RotationOffset; - cameraEyeOffset = cameraEyeOffset * part.RotationOffset; - offset += part.OffsetPosition; - cameraAtOffset += part.OffsetPosition; - cameraEyeOffset += part.OffsetPosition; + + if (CameraAtAxis == Vector3.Zero && cameraEyeOffset == Vector3.Zero) + { + CameraAtAxis = part.ParentGroup.RootPart.GetCameraAtOffset(); + cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset(); + } + else + { + cameraAtOffset = cameraAtOffset * part.RotationOffset; + cameraAtOffset += part.OffsetPosition; + cameraEyeOffset = cameraEyeOffset * part.RotationOffset; + cameraEyeOffset += part.OffsetPosition; + } + } m_pos = offset;