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/PhysicsModules/SharedBase/PhysicsActor.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/PhysicsModules/SharedBase') 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 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() { -- cgit v1.1