From 0045398324debd035c6b3c362a82497852585807 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 20 Oct 2015 19:00:26 +0100 Subject: move ugly convertion of axis locks 3 bit flags to a wasted vector3 down to PhysicsActor. Let engines use LockAngularMotion with either Vector3 argument or byte --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4d193ba..fed9eaf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3861,16 +3861,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter if (pa != null) { - // physics should also get a byte and not a Vector3 TODO - Vector3 lrRotationAxis = Vector3.One; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0 ) - lrRotationAxis.X = 0f; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0 ) - lrRotationAxis.Y = 0f; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0 ) - lrRotationAxis.Z = 0f; - - pa.LockAngularMotion(lrRotationAxis); + pa.LockAngularMotion(RotationAxisLocks); ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); } } @@ -4882,16 +4873,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter if(LocalId == ParentGroup.RootPart.LocalId) { - // ugly code: physics should also get a byte and not a Vector3 TODO - Vector3 lrRotationAxis = Vector3.One; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0 ) - lrRotationAxis.X = 0f; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0 ) - lrRotationAxis.Y = 0f; - if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0 ) - lrRotationAxis.Z = 0f; - - pa.LockAngularMotion(lrRotationAxis); + pa.LockAngularMotion(RotationAxisLocks); } if (VolumeDetectActive) // change if not the default only -- cgit v1.1