A square mesh collider. More...
Public Member Functions | |
SquareMeshCollider (Point3 topLeft, Point3 bottomLeft, Point3 bottomRight, Point3 topRight) | |
Constructs a square mesh collider from 4 points. More... | |
boolean | contains (Point3 p) |
Returns true if the given point is contained by the mesh collider. More... | |
Point3 | getIntersectionPoint (Ray r) |
Test whether a ray intersects with the mesh collider. More... | |
boolean | intersects (Ray r) |
Return if the given ray intersects with the mesh collider. More... | |
A square mesh collider.
It's created from four points.
com.beyondar.android.opengl.colision.SquareMeshCollider.SquareMeshCollider | ( | Point3 | topLeft, |
Point3 | bottomLeft, | ||
Point3 | bottomRight, | ||
Point3 | topRight | ||
) |
Constructs a square mesh collider from 4 points.
This 4 points must be contained for the same plane. If not, weird behavior will happen
topLeft | |
bottomLeft | |
bottomRight | |
topRight |
boolean com.beyondar.android.opengl.colision.SquareMeshCollider.contains | ( | Point3 | p | ) |
Returns true if the given point is contained by the mesh collider.
false otherwise
p | the point |
Implements com.beyondar.android.opengl.colision.MeshCollider.
Test whether a ray intersects with the mesh collider.
If it does, returns the intersection point. If it doesn't, returns null
r | the ray |
Implements com.beyondar.android.opengl.colision.MeshCollider.
boolean com.beyondar.android.opengl.colision.SquareMeshCollider.intersects | ( | Ray | r | ) |
Return if the given ray intersects with the mesh collider.
r | the ray |
Implements com.beyondar.android.opengl.colision.MeshCollider.