Exemple #1
0
        public override bool ReportFixture(b2Fixture fixture)
        {
            if ((fixture.GetFilterData().categoryBits & _CollisionMask) == 0)
            {
                return(true);
            }
            ICollider collider = _Physics2DControl.GetPhysicsObject(fixture.GetBody().GetUserData().data).GetCollider(fixture.GetUserData().data);

            return(_Callback.Invoke(collider));
        }
Exemple #2
0
        public override float ReportFixture(b2Fixture fixture, b2Vec2 point, b2Vec2 normal, float fraction)
        {
            if ((fixture.GetFilterData().categoryBits & _CollisionMask) == 0)
            {
                return(-1f);
            }
            ICollider collider = _Physics2DControl.GetPhysicsObject(fixture.GetBody().GetUserData().data).GetCollider(fixture.GetUserData().data);

            return(_Callback.Invoke(collider, point.ToVector2(), normal.ToVector2(), fraction));
        }
        public bool QueryCallback(Fixture fixture)
        {
            if ((fixture.Filter.CategoryBits & _CollisionMask) == 0)
            {
                return(true);
            }
            ICollider collider = _Physics2DControl.GetPhysicsObject((int)fixture.Body.UserData).GetCollider((int)fixture.UserData);

            return(_Callback.Invoke(collider));
        }