Class: CollisionsUtilities

CollisionsUtilities

Utility class with a functions used for managing special collisions

new CollisionsUtilities ()

Members

isPointOnRectangle

Indicate if a point is inside a rectangle

isPointOnTriangle

Indicate if a point is inside a triangle

isOverlapping

Indicate if min and max are overlapping

Methods

CollisionsUtilities.orthogonalProjection (p, p0, p1, p2)number static

Get the orthogonal projection between two vectors
Name Type Description
p THREE.Vector2 The point to test
p0 number One of the point of the triangle
p1 number One of the point of the triangle
p2 number One of the point of the triangle
Returns:
Type Description
number

CollisionsUtilities.obbVSobb (shapeA, shapeB)boolean static

Check collision between two OBB
Name Type Description
shapeA THREE.Geometry First shape
shapeB THREE.Geometry Second shape
Returns:
Type Description
boolean

CollisionsUtilities.checkFaces (shapes, verticesA, verticesB, lA, lB)boolean static

Check the faces for OBB collision
Name Type Description
shapes Array.<THREE.Face3> The faces to check
verticesA Array.<THREE.Vector3> First vertices to check
verticesB Array.<THREE.Vector3> Second vertices to check
lA number The first vertices length
lB number The second vertices length
Returns:
Type Description
boolean

CollisionsUtilities.overlapOnThisNormal (verticesA, verticesB, lA, lB, normal)boolean static

Check if vertices overlap on one of the faces normal
Name Type Description
verticesA Array.<THREE.Vector3> First vertices to check
verticesB Array.<THREE.Vector3> Second vertices to check
lA number The first vertices length
lB number The second vertices length
normal Vector3 The face normal
Returns:
Type Description
boolean