Exemplo n.º 1
0
 private Vector4 Get2DPlane(Vector2 firstPoint, float angle)
 {
     Vector4 vector = new Vector4();
     angle = angle % 6.283185f;
     Vector2 vector2 = new Vector2(firstPoint.x + Mathf.Sin(angle), firstPoint.y + Mathf.Cos(angle));
     Vector2 vector3 = vector2 - firstPoint;
     if (Mathf.Abs(vector3.x) < 1E-05)
     {
         vector.Set(-1f, 0f, firstPoint.x, 0f);
         float num = (Mathf.Cos(angle) <= 0f) ? -1f : 1f;
         vector = (Vector4) (vector * num);
     }
     else
     {
         float num2 = vector3.y / vector3.x;
         vector.Set(-num2, 1f, -(firstPoint.y - (num2 * firstPoint.x)), 0f);
     }
     if (angle > 3.141593f)
     {
         vector = -vector;
     }
     float num3 = Mathf.Sqrt((vector.x * vector.x) + (vector.y * vector.y));
     return (Vector4) (vector / num3);
 }
    static bool Vector4_Set__Single__Single__Single__Single(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 4)
        {
            System.Single       arg0    = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
            System.Single       arg1    = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
            System.Single       arg2    = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
            System.Single       arg3    = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
            UnityEngine.Vector4 argThis = (UnityEngine.Vector4)vc.csObj;        argThis.Set(arg0, arg1, arg2, arg3);
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Exemplo n.º 3
0
 static int Set(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UnityEngine.Vector4 obj = (UnityEngine.Vector4)ToLua.CheckObject(L, 1, typeof(UnityEngine.Vector4));
         float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         float arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
         float arg3 = (float)LuaDLL.luaL_checknumber(L, 5);
         obj.Set(arg0, arg1, arg2, arg3);
         ToLua.SetBack(L, 1, obj);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
 static public int Set(IntPtr l)
 {
     try{
         UnityEngine.Vector4 self = (UnityEngine.Vector4)checkSelf(l);
         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);
         self.Set(a1, a2, a3, a4);
         setBack(l, self);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }