T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic interface RaycastCollisionDetector<T extends com.badlogic.gdx.math.Vector<T>>
RaycastCollisionDetector finds the closest intersection between a ray and any object in the game world.| Modifier and Type | Method and Description |
|---|---|
boolean |
collides(Ray<T> ray)
Casts the given ray to test if it collides with any objects in the game world.
|
boolean |
findCollision(Collision<T> outputCollision,
Ray<T> inputRay)
Find the closest collision between the given input ray and the objects in the game world.
|
boolean collides(Ray<T> ray)
ray - the ray to cast.true in case of collision; false otherwise.boolean findCollision(Collision<T> outputCollision, Ray<T> inputRay)
outputCollision will contain the collision point and the normal vector of the obstacle at the point of collision.outputCollision - the output collision.inputRay - the ray to cast.true in case of collision; false otherwise.