From fbed2455965283e7cec92f8cceb89a333e1dca14 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 23 May 2014 01:34:02 +0100 Subject: Compensate camera-at and camera-eye for child prim rotation when sitting on child prim with camera-eye set --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 026b0b6..eaac71d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2764,7 +2764,19 @@ namespace OpenSim.Region.Framework.Scenes cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset(); if (cameraEyeOffset != Vector3.Zero || cameraAtOffset != Vector3.Zero) + { + if (!part.IsRoot) + { + cameraEyeOffset = cameraEyeOffset * part.RotationOffset; + cameraAtOffset = part.OffsetPosition; + } + cameraEyeOffset += part.OffsetPosition; + } + +// m_log.DebugFormat( +// "[SCENE PRESENCE]: Using cameraAtOffset {0}, cameraEyeOffset {1} for sit on {2} by {3} in {4}", +// cameraAtOffset, cameraEyeOffset, part.Name, Name, Scene.Name); forceMouselook = part.GetForceMouselook(); -- cgit v1.1