mantis 8106: improve avatar walk in mouselook
parent
f510898188
commit
da08e2e5f5
|
@ -3674,12 +3674,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// vec, Rotation, thisAddSpeedModifier, Name);
|
// vec, Rotation, thisAddSpeedModifier, Name);
|
||||||
|
|
||||||
// rotate from avatar coord space to world
|
// rotate from avatar coord space to world
|
||||||
// for now all controls assume this is only a rotation around Z
|
Quaternion rot = Rotation;
|
||||||
// if not all checks below need to be done before this rotation
|
if (!Flying && PresenceType != PresenceType.Npc)
|
||||||
Vector3 direc = vec * Rotation;
|
{
|
||||||
|
// force rotation to be around Z only, if not flying
|
||||||
|
// needed for mouselook
|
||||||
|
rot.X = 0;
|
||||||
|
rot.Y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3 direc = vec * rot;
|
||||||
direc.Normalize();
|
direc.Normalize();
|
||||||
|
|
||||||
// mouse look situation ?
|
|
||||||
if ((vec.Z == 0f) && !Flying)
|
if ((vec.Z == 0f) && !Flying)
|
||||||
direc.Z = 0f; // Prevent camera WASD up.
|
direc.Z = 0f; // Prevent camera WASD up.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue