Files
vgstation13/code/__HELPERS/math/ray/rayCastHit.dm
ShiftyRail d79c1fe070 Byond 516 v2.0 (#37553)
* The TGS thing

* Revert the 516 revert

* Further segment the world/New() proc

* Fixes an issue here
2025-05-12 00:50:25 -05:00

34 lines
826 B
Plaintext

/rayCastHit
var/ray/used_ray
var/datum/weakref/hit_atom
var/_vector/point
var/_vector/point_raw
var/distance
var/hit_type // see defines in ray.dm
/rayCastHit/New(var/rayCastHitInfo/info, var/hit_type)
src.used_ray = info.used_ray
src.hit_atom = info.hit_atom
src.point = info.point
src.point_raw = info.point_raw
src.distance = info.distance
src.hit_type = hit_type
/rayCastHit/Destroy()
used_ray = null
hit_atom = null
point = null
point_raw = null
..()
//see ray.dm for defines
/rayCastHit/proc/hit_code()
if(hit_type < RAY_CAST_NO_HIT_CONTINUE)
return RAY_CAST_NO_HIT_EXIT
else if(hit_type == RAY_CAST_NO_HIT_CONTINUE)
return RAY_CAST_NO_HIT_CONTINUE
else if(hit_type <= RAY_CAST_HIT_CONTINUE)
return RAY_CAST_HIT_CONTINUE
else if(hit_type > RAY_CAST_HIT_CONTINUE)
return RAY_CAST_HIT_EXIT