ObjectHelper.collision
Summary
Collision checking.
Constructor
ObjectHelper.collision
Syntax
ObjectHelper.collision
()
static
Summary
Item Index
Methods
AABBtoAABB
Syntax
AABBtoAABB
-
box -
box
Summary
Tests the collision between two Axis Aligned Bounding Boxes
Parameters:
-
boxAABB1st Axis Aligned Bounding Box
-
boxAABB2nd Axis Aligned Bounding Box
Returns:
false if there is no collision, true if there is
AABBtoOBB
Syntax
AABBtoOBB
-
box -
box
Summary
Tests the collision between an Axis Aligned Bounding Box and an Oriented Bounding Box
Parameters:
-
boxAABBthe Axis Aligned Bounding Box
-
boxOBBthe Oriented Bounding Box
Returns:
false if there is no collision, true if there is
AABBtoOyBB
Syntax
AABBtoOyBB
-
box -
box
Summary
Tests the collision between an Axis Aligned Bounding Box and a Bounding Box Oriented along y axis
Parameters:
-
boxAABBthe Axis Aligned Bounding Box
-
boxOyBBthe Bounding Box Oriented along Y axis
Returns:
false if there is no collision, true if there is
interval
Syntax
interval
-
a1 -
b1 -
a2 -
b2
Summary
Tests the collision in one dimension between two intervals [a1,b1] , [a2,b2]
a1------b1 a2------------b2
without numeric imprecision is a2 < b1 == a1 < b2
Parameters:
Returns:
false if there is no collision, true if there is
MeshToAABB
Syntax
MeshToAABB
-
worldMatrix -
positions -
indices -
box
Summary
Tests the collision between a mesh and an Axis Aligned Bounding Box. /!\ This method has a high impact on performance, use with caution.
Parameters:
-
worldMatrixBABYLON.Matrixthe transformation matrix of the mesh
-
positionsNumber[]indices of the mesh vertices, as returned by babylon.Mesh.getVertexBuffer ( ie vertices coordinates concatenated in an array )
-
indicesNumber[]indices of the face vertices, as returned by babylon.Mesh.getVertexBuffer ( ie faces indices concatenated in an array )
-
boxAABBthe Axis Aligned Bounding Box
Returns:
false if there is no collision, true if there is
OBBtoOBB
Syntax
OBBtoOBB
-
box -
box
Summary
Tests the collision between two Oriented Bounding Boxes
Parameters:
-
boxOBB1st Oriented Bounding Box
-
boxOBB2nd Oriented Bounding Box
Returns:
false if there is no collision, true if there is
rayToAABB
Syntax
rayToAABB
-
o -
v -
box
Summary
Tests the collision between a ray and an Axis Aligned Bounding Box
Parameters:
-
oBABYLON.Vector3the origin of the ray
-
vBABYLON.Vector3the direction of the ray
-
boxAABBthe Axis Aligned Bounding Box
Returns:
false if there is no collision, else return a number t such that o+v*t is the point where the ray first collides the box, /!\ t can be 0 ( beware of untyped test )
triangleToAABB
Syntax
triangleToAABB
-
trianglesPoints -
box
Summary
Tests the collision between a triangle and an Axis Aligned Bounding Box
Parameters:
-
trianglesPointsBABYLON.Vector3three points which are the vertices of the triangle
-
boxAABBthe Axis Aligned Bounding Box
Returns:
false if there is no collision, true if there is