Handbook
Glossary
get-ray-collision-ground ( ray ground-height -- ray-collision )
Vocabulary
raylib
Inputs
ray
a
Ray
ground-height
a
float
Outputs
ray-collision
a
RayCollision
Definition
USING:
accessors
classes.struct
kernel
math
raylib.private
;
IN:
raylib
::
get-ray-collision-ground
( ray ground-height -- ray-collision )
RayCollision
<struct>
ray
direction>>
y>>
abs
0.000001
>
[
ray
position>>
y>>
ground-height
-
ray
direction>>
y>>
neg
/
:>
distance distance 0.0
>=
[
t
>>hit
distance
>>distance
dup
normal>>
1.0
>>y
drop
ray
position>>
ray
direction>>
distance
Vector3Scale
Vector3Add
ground-height
>>y
>>point
]
when
]
when
;