STATUS_ROTATE are linkset flags and not prim

avinationmerge
UbitUmarov 2015-10-20 15:37:43 +01:00
parent 2718018cb8
commit dfd60d6f71
2 changed files with 20 additions and 18 deletions

View File

@ -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();

View File

@ -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;
}