diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs index 1f1b5390bb..d548a464b3 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs @@ -668,23 +668,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde public static Vector3 Xrot(Quaternion rot) { - Vector3 vec; rot.Normalize(); // just in case - vec.X = 2 * (rot.X * rot.X + rot.W * rot.W) - 1; - vec.Y = 2 * (rot.X * rot.Y + rot.Z * rot.W); - vec.Z = 2 * (rot.X * rot.Z - rot.Y * rot.W); - return vec; - } - - public static Vector3 Zrot(Quaternion rot) - { - Vector3 vec; - rot.Normalize(); // just in case - vec.X = 2 * (rot.X * rot.Z + rot.Y * rot.W); - vec.Y = 2 * (rot.Y * rot.Z - rot.X * rot.W); - vec.Z = 2 * (rot.Z * rot.Z + rot.W * rot.W) - 1; - - return vec; + return Vector3.UnitXRotated(rot); } private const float pi = MathF.PI; @@ -878,7 +863,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde perr *= (1.0f + ldampZ) / m_VhoverTimescale; - // force.Z += perr - curVel.Z * tmp; + //force.Z += perr - curVel.Z * tmp; force.Z += perr; ldampZ *= -curVel.Z; @@ -899,8 +884,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde float len = curVel.Length(); if (len > 0.01f) // if moving { - Vector3 atAxis; - atAxis = Xrot(rotq); // where are we pointing to + Vector3 atAxis = Xrot(rotq); // where are we pointing to atAxis *= len; // make it same size as world velocity vector tmpV = -atAxis; // oposite direction @@ -999,7 +983,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde broll /= m_bankingTimescale; - tmpV = Zrot(irotq); + tmpV = Vector3.UnitZRotated(irotq); tmpV *= broll; torque.X += tmpV.X; diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 94fd764df6..f924ddc284 100755 Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index f0a0adb1fc..61ecf3f41a 100755 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 81bb6c5299..cee9ca4e7f 100755 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 34a5b0dab5..0112f55808 100755 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ