static void ContactPoint_otherCollider(JSVCall vc)
    {
        UnityEngine.ContactPoint _this = (UnityEngine.ContactPoint)vc.csObj;
        var result = _this.otherCollider;

        JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
    }
    static void ContactPoint_normal(JSVCall vc)
    {
        UnityEngine.ContactPoint _this = (UnityEngine.ContactPoint)vc.csObj;
        var result = _this.normal;

        JSApi.setVector3S((int)JSApi.SetType.Rval, result);
    }
Ejemplo n.º 3
0
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.ContactPoint o;
         o = new UnityEngine.ContactPoint();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 4
0
 public Collision(Vector3 relativeVelocity,
                  ITransform transform,
                  TestableGameObject gameObject,
                  ContactPoint[] contacts) : this() {
     this.relativeVelocity = relativeVelocity;
     this.transform = transform;
     this.gameObject = gameObject;
     this.contacts = contacts;
 }
Ejemplo n.º 5
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.ContactPoint o;
         o = new UnityEngine.ContactPoint();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.ContactPoint o;
			o=new UnityEngine.ContactPoint();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 7
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.ContactPoint o;
         o = new UnityEngine.ContactPoint();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.ContactPoint o;
         o=new UnityEngine.ContactPoint();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Ejemplo n.º 9
0
 static int GetContact(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Collision obj = (UnityEngine.Collision)ToLua.CheckObject <UnityEngine.Collision>(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         UnityEngine.ContactPoint o = obj.GetContact(arg0);
         ToLua.PushValue(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 10
0
    static int get_thisCollider(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ContactPoint obj = (UnityEngine.ContactPoint)o;
            UnityEngine.Collider     ret = obj.thisCollider;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index thisCollider on a nil value" : e.Message));
        }
    }
Ejemplo n.º 11
0
    static int get_separation(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ContactPoint obj = (UnityEngine.ContactPoint)o;
            float ret = obj.separation;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index separation on a nil value" : e.Message));
        }
    }
Ejemplo n.º 12
0
        private CollisionFlags CollisionLocation(Vector3 tubeBottom, Vector3 tubeHeight, ContactPoint contact)
        {
            Vector3 contactOffset = contact.point - tubeBottom;

            float c1 = Vector3.Dot(contactOffset, tubeHeight);
            if (c1 < 0.0f)
            {
                return CollisionFlags.Below;
            }

            float c2 = Vector3.Dot(tubeHeight, tubeHeight);
            if (c2 < c1)
            {
                return CollisionFlags.Above;
            }

            return CollisionFlags.Sides;
        }
Ejemplo n.º 13
0
 static public int get_otherCollider(IntPtr l)
 {
     UnityEngine.ContactPoint o = (UnityEngine.ContactPoint)checkSelf(l);
     pushValue(l, o.otherCollider);
     return(1);
 }
Ejemplo n.º 14
0
 static public int get_normal(IntPtr l)
 {
     UnityEngine.ContactPoint o = (UnityEngine.ContactPoint)checkSelf(l);
     pushValue(l, o.normal);
     return(1);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Called by the game when a collision continues. Used to query latests collision information.
 /// </summary>
 /// <param name="c">collision information</param>
 public void OnCollisionStay(Collision c)
 {
     if (isActive)
     {
         collidingObject = c.collider.gameObject;
         collisionPoint = c.contacts[0];
     }
 }
Ejemplo n.º 16
0
 static int _CreateUnityEngine_ContactPoint(IntPtr L)
 {
     UnityEngine.ContactPoint obj = new UnityEngine.ContactPoint();
     ToLua.PushValue(L, obj);
     return(1);
 }