diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs | 15 |
2 files changed, 16 insertions, 21 deletions
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 | |||
3861 | 3861 | ||
3862 | if (pa != null) | 3862 | if (pa != null) |
3863 | { | 3863 | { |
3864 | // physics should also get a byte and not a Vector3 TODO | 3864 | pa.LockAngularMotion(RotationAxisLocks); |
3865 | Vector3 lrRotationAxis = Vector3.One; | ||
3866 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0 ) | ||
3867 | lrRotationAxis.X = 0f; | ||
3868 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0 ) | ||
3869 | lrRotationAxis.Y = 0f; | ||
3870 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0 ) | ||
3871 | lrRotationAxis.Z = 0f; | ||
3872 | |||
3873 | pa.LockAngularMotion(lrRotationAxis); | ||
3874 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); | 3865 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); |
3875 | } | 3866 | } |
3876 | } | 3867 | } |
@@ -4882,16 +4873,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4882 | 4873 | ||
4883 | if(LocalId == ParentGroup.RootPart.LocalId) | 4874 | if(LocalId == ParentGroup.RootPart.LocalId) |
4884 | { | 4875 | { |
4885 | // ugly code: physics should also get a byte and not a Vector3 TODO | 4876 | pa.LockAngularMotion(RotationAxisLocks); |
4886 | Vector3 lrRotationAxis = Vector3.One; | ||
4887 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_X) != 0 ) | ||
4888 | lrRotationAxis.X = 0f; | ||
4889 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Y) != 0 ) | ||
4890 | lrRotationAxis.Y = 0f; | ||
4891 | if((RotationAxisLocks & (byte)SceneObjectGroup.axisSelect.STATUS_ROTATE_Z) != 0 ) | ||
4892 | lrRotationAxis.Z = 0f; | ||
4893 | |||
4894 | pa.LockAngularMotion(lrRotationAxis); | ||
4895 | } | 4877 | } |
4896 | 4878 | ||
4897 | if (VolumeDetectActive) // change if not the default only | 4879 | 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 a5c2c0e..83f8af8 100644 --- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs | |||
@@ -230,7 +230,20 @@ namespace OpenSim.Region.PhysicsModules.SharedBase | |||
230 | 230 | ||
231 | public abstract void delink(); | 231 | public abstract void delink(); |
232 | 232 | ||
233 | public abstract void LockAngularMotion(Vector3 axis); | 233 | public virtual void LockAngularMotion(Vector3 axis) { } |
234 | |||
235 | public virtual void LockAngularMotion(byte axislocks) | ||
236 | { | ||
237 | Vector3 lrRotationAxis = Vector3.One; | ||
238 | if((axislocks & 0x02) != 0 ) | ||
239 | lrRotationAxis.X = 0f; | ||
240 | if((axislocks & 0x04) != 0 ) | ||
241 | lrRotationAxis.Y = 0f; | ||
242 | if((axislocks & 0x08) != 0 ) | ||
243 | lrRotationAxis.Z = 0f; | ||
244 | |||
245 | LockAngularMotion(lrRotationAxis); | ||
246 | } | ||
234 | 247 | ||
235 | public virtual void RequestPhysicsterseUpdate() | 248 | public virtual void RequestPhysicsterseUpdate() |
236 | { | 249 | { |