rayIntersect

abstract fun rayIntersect(startPoint: Vec2, endPoint: Vec2, maxDistance: Double, rayLength: Double): Shape.IntersectionReturnElement

Checks if a ray intersects with the shape.

Return

Double Returns the distance to the intersection point. maxDistance if no intersection was found.

Parameters

startPoint

The start point of the ray.

endPoint

The end point of the ray.

maxDistance

The ray information.

rayInformation

The object to store the information in.