From 5444b3b1a5578224c5760f565c375fb1773a5bf4 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 22 May 2013 16:06:06 -0700 Subject: [PATCH] BulletSim: fix problem with walking up stairs that are oriented in certain directions. The problem was really that the avatar capsule orientation was being set incorrectly. --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index ff5b6ab820..48f842e91e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -483,8 +483,15 @@ public sealed class BSCharacter : BSPhysObject { // Bullet assumes we know what we are doing when forcing orientation // so it lets us go against all the rules and just compensates for them later. - // This keeps us from flipping the capsule over which the veiwer does not understand. - ForceOrientation = new OMV.Quaternion(0, 0, _orientation.Z,0); + // This forces rotation to be only around the Z axis and doesn't change any of the other axis. + // This keeps us from flipping the capsule over which the veiwer does not understand. + float oRoll, oPitch, oYaw; + _orientation.GetEulerAngles(out oRoll, out oPitch, out oYaw); + OMV.Quaternion trimmedOrientation = OMV.Quaternion.CreateFromEulers(0f, 0f, oYaw); + // DetailLog("{0},BSCharacter.setOrientation,taint,val={1},valDir={2},conv={3},convDir={4}", + // LocalID, _orientation, OMV.Vector3.UnitX * _orientation, + // trimmedOrientation, OMV.Vector3.UnitX * trimmedOrientation); + ForceOrientation = trimmedOrientation; }); } }