intersects method

bool intersects(
  1. Polyhedron polyhedronA,
  2. Polyhedron polyhedronB
)

Returns true if the given convex polyhedra intersect. A polyhedron is just an array of {@link Polygon} objects.

Implementation

bool intersects(Polyhedron polyhedronA, Polyhedron polyhedronB ) {
	final resultAB = _checkFaceDirections( polyhedronA, polyhedronB );
	if ( resultAB ) return false;

	final resultBA = _checkFaceDirections( polyhedronB, polyhedronA );
	if ( resultBA ) return false;

	final resultEdges = _checkEdgeDirections( polyhedronA, polyhedronB );
	if ( resultEdges ) return false;

	// no separating axis found, the polyhedra must intersect
	return true;
}