Packagecom.fileitup.fisixengine.utils
Classpublic final class Raycaster

Used to find the closest object between a starting point to an ending point. The methods in this class provide you with the following:
- The object that the ray intersects with first
- The point on the object where it intersects



Public Methods
 MethodDefined by
  
raycastAll(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData
[static]Checks intersection with all objects in the given FisixObject.
Raycaster
  
raycastParticles(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData
[static]Checks intersection with all particles in the given FisixObject who's radius is greater than 0.
Raycaster
  
raycastSurfaces(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData
[static]Checks intersection with all surfaces in the given FisixObject.
Raycaster
Method detail
raycastAll()method
public static function raycastAll(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData

Checks intersection with all objects in the given FisixObject. This is a combination of raycastSurfaces() and raycastParticles()

Parameters
container:FisixObject — A FisixObject which holds the objects you'd like to check against. In most cases, this will be an instance of FisixEngine
 
start:Vector — A vector specifying the starting point of the ray
 
end:Vector — A vector specifying where the ray ends. you can also make it infinite through the infiniteRay argument (see below)
 
rad:Number (default = 0) — The radius of the ray
 
infiniteRay:Boolean (default = false) — When set to true, the ray checks for intersection beyond the specified end point
 
recursive:Boolean (default = true) — If the raytracing is recursive, the ray will check intersection with all children FisixObjects of the given FisixObject. If you are unsure which to use, leave it as true.

Returns
RaycastData — The object that intersected first and the position of the collision. If there was no intersection, returns null.

See also

raycastParticles()method 
public static function raycastParticles(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData

Checks intersection with all particles in the given FisixObject who's radius is greater than 0.

Parameters
container:FisixObject — A FisixObject which holds the objects you'd like to check against. In most cases, this will be an instance of FisixEngine
 
start:Vector — A vector specifying the starting point of the ray
 
end:Vector — A vector specifying where the ray ends. you can also make it infinite through the infiniteRay argument (see below)
 
rad:Number (default = 0) — The radius of the ray
 
infiniteRay:Boolean (default = false) — When set to true, the ray checks for intersection beyond the specified end point
 
recursive:Boolean (default = true) — If the raytracing is recursive, the ray will check intersection with all children FisixObjects of the given FisixObject. If you are unsure which to use, leave it as true.

Returns
RaycastData — The object that intersected first and the position of the collision. If there was no intersection, returns null.

See also

raycastSurfaces()method 
public static function raycastSurfaces(container:FisixObject, start:Vector, end:Vector, rad:Number = 0, infiniteRay:Boolean = false, recursive:Boolean = true):RaycastData

Checks intersection with all surfaces in the given FisixObject.

Parameters
container:FisixObject — A FisixObject which holds the objects you'd like to check against. In most cases, this will be an instance of FisixEngine
 
start:Vector — A vector specifying the starting point of the ray
 
end:Vector — A vector specifying where the ray ends. you can also make it infinite through the infiniteRay argument (see below)
 
rad:Number (default = 0) — The radius of the ray
 
infiniteRay:Boolean (default = false) — When set to true, the ray checks for intersection beyond the specified end point
 
recursive:Boolean (default = true) — If the raytracing is recursive, the ray will check intersection with all children FisixObjects of the given FisixObject. If you are unsure which to use, leave it as true.

Returns
RaycastData — The object that intersected first and the position of the collision. If there was no intersection, returns null.

See also