Skip to content
Marek Maskarinec edited this page Oct 9, 2022 · 2 revisions

ray.um

 This module will undergo changes.

struct Ray*

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

Ray type.

fn mk*

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

Makes a ray.

fn getColl*

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

Same as ent.getcoll. Same changes will apply.

fn getTilemapColl*

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

Gets ray's collision to a tilemap.

fn draw*

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

Clone this wiki locally