Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llAxes2Rot C# (CSharp) Метод

llAxes2Rot() публичный Метод

public llAxes2Rot ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 fwd, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 left, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 up ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
fwd Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
left Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
up Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
Результат Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
        public LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_Rotation();

            double s;
            double tr = fwd.x + left.y + up.z + 1.0;

            if (tr >= 1.0)
            {
                s = 0.5 / Math.Sqrt(tr);
                return new LSL_Rotation(
                        (left.z - up.y) * s,
                        (up.x - fwd.z) * s,
                        (fwd.y - left.x) * s,
                        0.25 / s);
            }
            double max = (left.y > up.z) ? left.y : up.z;

            if (max < fwd.x)
            {
                s = Math.Sqrt(fwd.x - (left.y + up.z) + 1.0);
                double x = s * 0.5;
                s = 0.5 / s;
                return new LSL_Rotation(
                    x,
                    (fwd.y + left.x) * s,
                    (up.x + fwd.z) * s,
                    (left.z - up.y) * s);
            }
            if (max == left.y)
            {
                s = Math.Sqrt(left.y - (up.z + fwd.x) + 1.0);
                double y = s * 0.5;
                s = 0.5 / s;
                return new LSL_Rotation(
                    (fwd.y + left.x) * s,
                    y,
                    (left.z + up.y) * s,
                    (up.x - fwd.z) * s);
            }
            s = Math.Sqrt(up.z - (fwd.x + left.y) + 1.0);
            double z = s * 0.5;
            s = 0.5 / s;
            return new LSL_Rotation(
                (up.x + fwd.z) * s,
                (left.z + up.y) * s,
                z,
                (fwd.y - left.x) * s);
        }
LSL_Api