struct Eagle::Physics2D::RayHit

Overview

Where a ray hit: the point, surface normal, distance, body and shape.

Defined in:

eagle/physics/collision2d.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(point : Eagle::Vec2, normal : Eagle::Vec2, distance : Float32, body : Eagle::Physics2D::Body, shape : Eagle::Physics2D::Shape) #

Instance Method Detail

def body : Body #

The body that was hit.


def distance : Float32 #

Distance from the ray's origin to the hit.


def normal : Vec2 #

Surface normal at the hit.


def point : Vec2 #

Where the ray hit, in world space.


def shape : Shape #

The shape on that body that was hit.