From a3bd708e772a108169eead039ca4490dd3a52f8b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 11 Sep 2014 20:59:20 +0100 Subject: Fix regression from recent a02dae5 where stand positions are no longer correct when a sit target is specified. Adjusts stand position using just avatar position relative to the root prim instead. Fixes http://opensimulator.org/mantis/view.php?id=7315 and preserves previous fix for http://opensimulator.org/mantis/view.php?id=7299 --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 59b521d..87063c6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2618,7 +2618,6 @@ namespace OpenSim.Region.Framework.Scenes } } - Vector3 sitPartWorldPosition = part.GetWorldPosition(); ControllingClient.SendClearFollowCamProperties(part.ParentUUID); ParentID = 0; @@ -2647,13 +2646,13 @@ namespace OpenSim.Region.Framework.Scenes // Vector3 standPositionAdjustment // = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f); - Vector3 adjustmentForSitPosition = (part.SitTargetPosition + OffsetPosition) * part.GetWorldRotation(); + Vector3 adjustmentForSitPosition = (OffsetPosition - SIT_TARGET_ADJUSTMENT) * part.GetWorldRotation(); // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than // hardcoding here. Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotation; - Vector3 standPos = sitPartWorldPosition + adjustmentForSitPosition + adjustmentForSitPose; + Vector3 standPos = part.ParentGroup.AbsolutePosition + adjustmentForSitPosition + adjustmentForSitPose; // m_log.DebugFormat( // "[SCENE PRESENCE]: Setting stand to pos {0}, (adjustmentForSitPosition {1}, adjustmentForSitPose {2}) rotation {3} for {4} in {5}", -- cgit v1.1