Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llEuler2Rot C# (CSharp) Method

llEuler2Rot() public method

public llEuler2Rot ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 v ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
v Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
        public LSL_Rotation llEuler2Rot(LSL_Vector v)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_Rotation();


            double c1 = Math.Cos(v.x * 0.5);
            double c2 = Math.Cos(v.y * 0.5);
            double c3 = Math.Cos(v.z * 0.5);
            double s1 = Math.Sin(v.x * 0.5);
            double s2 = Math.Sin(v.y * 0.5);
            double s3 = Math.Sin(v.z * 0.5);

            double x = s1 * c2 * c3 + c1 * s2 * s3;
            double y = c1 * s2 * c3 - s1 * c2 * s3;
            double z = s1 * s2 * c3 + c1 * c2 * s3;
            double s = c1 * c2 * c3 - s1 * s2 * s3;

            return new LSL_Rotation(x, y, z, s);
        }
LSL_Api