From dfd60d6f71514f03386a0b97988a63e88001a86a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 20 Oct 2015 15:37:43 +0100 Subject: STATUS_ROTATE are linkset flags and not prim --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 29 ++++++++++++++-------- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 ++----- 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a4a33a4..48fce3d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -4363,17 +4363,9 @@ namespace OpenSim.Region.Framework.Scenes internal void SetAxisRotation(int axis, int rotate10) { - bool setX = false; - bool setY = false; - bool setZ = false; - - int xaxis = 2; - int yaxis = 4; - int zaxis = 8; - - setX = ((axis & xaxis) != 0) ? true : false; - setY = ((axis & yaxis) != 0) ? true : false; - setZ = ((axis & zaxis) != 0) ? true : false; + bool setX = ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0); + bool setY = ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0); + bool setZ = ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0); float setval = (rotate10 > 0) ? 1f : 0f; @@ -4388,6 +4380,21 @@ namespace OpenSim.Region.Framework.Scenes RootPart.SetPhysicsAxisRotation(); } + public int GetAxisRotation(int axis) + { + Vector3 rotAxis = RootPart.RotationAxis; + + // if multiple return the one with higher id + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) + return (int)rotAxis.Z; + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) + return (int)rotAxis.Y; + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) + return (int)rotAxis.X; + + return 0; + } + public int registerRotTargetWaypoint(Quaternion target, float tolerance) { scriptRotTarget waypoint = new scriptRotTarget(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 43d522a..0ea4ab8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2516,13 +2516,8 @@ namespace OpenSim.Region.Framework.Scenes public int GetAxisRotation(int axis) { - //Cannot use ScriptBaseClass constants as no referance to it currently. - if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) - return STATUS_ROTATE_X; - if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) - return STATUS_ROTATE_Y; - if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) - return STATUS_ROTATE_Z; + if (!ParentGroup.IsDeleted) + return ParentGroup.GetAxisRotation(axis); return 0; } -- cgit v1.1