Exemple #1
0
    public static bool GetResult(out ScriptRuntime.Quaternion res)
    {
        object obj;
        bool   ret = GetResult(out obj);

        res = (ScriptRuntime.Quaternion)obj;
        return(ret);
    }
Exemple #2
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         ScriptRuntime.Quaternion o;
         if (argc == 5)
         {
             System.Single a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             System.Single a4;
             checkType(l, 5, out a4);
             o = new ScriptRuntime.Quaternion(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 3)
         {
             System.Single a1;
             checkType(l, 2, out a1);
             ScriptRuntime.Vector3 a2;
             checkValueType(l, 3, out a2);
             o = new ScriptRuntime.Quaternion(a1, a2);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(ScriptRuntime.Vector3), typeof(ScriptRuntime.Vector3), typeof(ScriptRuntime.Vector3)))
         {
             ScriptRuntime.Vector3 a1;
             checkValueType(l, 2, out a1);
             ScriptRuntime.Vector3 a2;
             checkValueType(l, 3, out a2);
             ScriptRuntime.Vector3 a3;
             checkValueType(l, 4, out a3);
             o = new ScriptRuntime.Quaternion(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(float), typeof(float), typeof(float)))
         {
             System.Single a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             o = new ScriptRuntime.Quaternion(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc <= 1)
         {
             o = new ScriptRuntime.Quaternion();
             pushValue(l, true);
             pushObject(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }