Nez.Collider.collidesWithAny C# (CSharp) Method

collidesWithAny() public method

checks to see if this Collider collides with any other Colliders in the Scene. The first Collider it intersects will have its collision data returned in the CollisionResult.
public collidesWithAny ( CollisionResult &result ) : bool
result CollisionResult Result.
return bool
		public bool collidesWithAny( out CollisionResult result )
		{
			result = new CollisionResult();

			// fetch anything that we might collide with at our new position
			var neighbors = Physics.boxcastBroadphaseExcludingSelf( this, collidesWithLayers );

			foreach( var neighbor in neighbors )
			{
				// skip triggers
				if( neighbor.isTrigger )
					continue;

				if( collidesWith( neighbor, out result ) )
					return true;
			}

			return false;
		}

Same methods

Collider::collidesWithAny ( Vector2 &motion, CollisionResult &result ) : bool