RayResult

data class RayResult(val hit: Boolean, val shape: Shape?, val point: Vec2, val normal: Vec2, val fraction: Float)

Result of a raycast query.

Parameters

hit

Whether the ray hit anything

shape

The shape that was hit (null if no hit)

point

The point of intersection in world coordinates

normal

The surface normal at the intersection point

fraction

The fraction along the ray (0 to 1) where the hit occurred. If there is initial overlap, the fraction and normal will be zero while the point is an arbitrary point in the overlap region.

Constructors

Link copied to clipboard
constructor(hit: Boolean, shape: Shape?, point: Vec2, normal: Vec2, fraction: Float)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val point: Vec2
Link copied to clipboard
val shape: Shape?