OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llEuler2Rot C# (CSharp) Method

llEuler2Rot() public method

public llEuler2Rot ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 v ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion
v OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion
        public LSL_Rotation llEuler2Rot(LSL_Vector v)
        {
            m_host.AddScriptLPS(1);

            double x,y,z,s;
            v.x *= 0.5;
            v.y *= 0.5;
            v.z *= 0.5;
            double c1 = Math.Cos(v.x);
            double c2 = Math.Cos(v.y);
            double c1c2 = c1 * c2;
            double s1 = Math.Sin(v.x);
            double s2 = Math.Sin(v.y);
            double s1s2 = s1 * s2;
            double c1s2 = c1 * s2;
            double s1c2 = s1 * c2;
            double c3 = Math.Cos(v.z);
            double s3 = Math.Sin(v.z);

            x = s1c2 * c3 + c1s2 * s3;
            y = c1s2 * c3 - s1c2 * s3;
            z = s1s2 * c3 + c1c2 * s3;
            s = c1c2 * c3 - s1s2 * s3;

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