From d15bfcf61404914c3d64c965db9e66295655bea5 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 18 Dec 2012 14:59:41 -0800 Subject: Replace axis rotation numeric constants (STATUS_ROTATE_XYZ) with symbols. Also made it so llSetStatus() can individually enable disable rotation axi using the bitmask of flags. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 64a5811..35e7c45 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -99,6 +99,15 @@ namespace OpenSim.Region.Framework.Scenes /// public partial class SceneObjectGroup : EntityBase, ISceneObject { + // Axis selection bitmask used by SetAxisRotation() + // Just happen to be the same bits used by llSetStatus() and defined in ScriptBaseClass. + public enum axisSelect : int + { + STATUS_ROTATE_X = 0x002, + STATUS_ROTATE_Y = 0x004, + STATUS_ROTATE_Z = 0x008, + } + // private PrimCountTaintedDelegate handlerPrimCountTainted = null; /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index af7fae3..7a97e5f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1918,11 +1918,11 @@ namespace OpenSim.Region.Framework.Scenes public int GetAxisRotation(int axis) { //Cannot use ScriptBaseClass constants as no referance to it currently. - if (axis == 2)//STATUS_ROTATE_X + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) return STATUS_ROTATE_X; - if (axis == 4)//STATUS_ROTATE_Y + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) return STATUS_ROTATE_Y; - if (axis == 8)//STATUS_ROTATE_Z + if (axis == (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) return STATUS_ROTATE_Z; return 0; @@ -2671,13 +2671,13 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.SetAxisRotation(axis, rotate); //Cannot use ScriptBaseClass constants as no referance to it currently. - if (axis == 2)//STATUS_ROTATE_X + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0) STATUS_ROTATE_X = rotate; - if (axis == 4)//STATUS_ROTATE_Y + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0) STATUS_ROTATE_Y = rotate; - if (axis == 8)//STATUS_ROTATE_Z + if ((axis & (int)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0) STATUS_ROTATE_Z = rotate; } -- cgit v1.1