From b135f1d58a1f3532cb198bf25680864e335d4cb1 Mon Sep 17 00:00:00 2001 From: Vegaslon Date: Thu, 9 May 2013 10:25:44 -0400 Subject: [PATCH] BulletSim: Fix for mantis 6487, also minor adjustment to fix flying while you are running. Signed-off-by: Robert Adams --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 3671fc2f28..ff5b6ab820 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -419,7 +419,7 @@ public sealed class BSCharacter : BSPhysObject DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value); m_targetVelocity = value; OMV.Vector3 targetVel = value; - if (_setAlwaysRun) + if (_setAlwaysRun && !_flying) targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 0f); if (m_moveActor != null) @@ -481,7 +481,10 @@ public sealed class BSCharacter : BSPhysObject _orientation = value; PhysScene.TaintedObject("BSCharacter.setOrientation", delegate() { - ForceOrientation = _orientation; + // 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); }); } }