Direction of the ray that's currently being worked on (x,y) = (cos, sin)
IMPORTANT: This vector needs to be set from outside BEFORE calling this.ray(..). Otherwise it'll shoot the ray in the wrong direction.
Raycasting range: how far do we want to cast the ray in total?
IMPORTANT: The raycasting range needs to be updated each time we cast a ray aswell
Buffer that's used to store the steps in a ray cast. The idea is to not have to re allocate a whole new array every time a ray is cast.
How far we cast rays by default. See this.currentRange.
Setter for how far we want to cast rays
Determine mapelement we've reached with this step, what the cell offset is, and what distance it currently is from the player
Gets us to the MapElement we want to inspect and save
Delta needed to subtract from step position x
Delta needed to subtract from step position y
Distance traveled so far in the ray (by all the steps)
Current offset from the gridline
Generated using TypeDoc
Performs raycasting on a map Aka shoots a ray and tells you where it hits
Documentation on the raycasting process: