struct Ray

type Ray* = struct {
	pos: th.Vf2
	l: th.fu // length
	r: th.fu // rotation
}

Ray is a line specified by an origin, length and a rotation.

fn mk

fn mk*(pos: th.Vf2, l: th.fu, r: th.fu = 0.0): Ray {

Ray constructor

fn Ray.getColl

fn (r: ^Ray) getColl*(s: []^ent.Ent, maxColls: th.uu): []ent.Coll {

Checks the ray's collisions with a scene of ents. Similar to ent.Ent.getColl

fn Ray.getTilemapColl

fn (r: ^Ray) getTilemapColl*(t: tilemap.Tilemap, ic: ^th.Vf2): bool {

Gets ray's collision to a tilemap.

fn Ray.getEnd

fn (r: ^Ray) getEnd*(): th.Vf2 {

Returns the other point of the ray.

fn Ray.draw

fn (r: ^Ray) draw*(color: uint32, thickness: th.fu) {

Draws the ray to the screen.