From 6f2d0773565039cf4318afe8f2f6f11772480d9b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 11 Oct 2008 23:47:35 +0000 Subject: Fix llSetPos to handle child prims correctly. This will fix linked sliding doors --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 11 +++++++++++ .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index f5cc680..f47e4d7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -550,6 +550,17 @@ namespace OpenSim.Region.Environment.Scenes // Ignore, and skip over. //} //m_log.Info("[PART]: OFFSET:" + m_offsetPosition.ToString()); + + if (_parentID != 0) + { + Vector3 resultingposition = GetWorldPosition(); + PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z); + Quaternion resultingrot = GetWorldRotation(); + PhysActor.Orientation = resultingrot; + + // Tell the physics engines that this prim changed. + m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6bda61e..447a4fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1724,11 +1724,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { part.UpdateOffSet(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } - else + else if (part.ParentGroup.RootPart == part) { SceneObjectGroup parent = part.ParentGroup; parent.UpdateGroupPosition(new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z)); } + else + { + part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); + SceneObjectGroup parent = part.ParentGroup; + parent.HasGroupChanged = true; + parent.ScheduleGroupForTerseUpdate(); + } } public LSL_Vector llGetPos() -- cgit v1.1