From 3c690711457c96f7f00d15f1ef5055cb7349ffc2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 20 Oct 2015 18:21:13 +0100 Subject: [PATCH] also apply axis locks, when creating a prim physics actor --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6e7b5687cb..4d193ba24d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4880,6 +4880,20 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter pa.Friction = Friction; pa.Restitution = Restitution; + 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); + } + if (VolumeDetectActive) // change if not the default only pa.SetVolumeDetect(1);