diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4d193ba24d..fed9eafbc4 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 diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs index a5c2c0ed14..83f8af89bb 100644 --- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs @@ -230,7 +230,20 @@ namespace OpenSim.Region.PhysicsModules.SharedBase public abstract void delink(); - public abstract void LockAngularMotion(Vector3 axis); + public virtual void LockAngularMotion(Vector3 axis) { } + + public virtual void LockAngularMotion(byte axislocks) + { + Vector3 lrRotationAxis = Vector3.One; + if((axislocks & 0x02) != 0 ) + lrRotationAxis.X = 0f; + if((axislocks & 0x04) != 0 ) + lrRotationAxis.Y = 0f; + if((axislocks & 0x08) != 0 ) + lrRotationAxis.Z = 0f; + + LockAngularMotion(lrRotationAxis); + } public virtual void RequestPhysicsterseUpdate() {