1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-20 20:19:57 +01:00

Fix division by zero

This commit is contained in:
Miloslav Ciz 2023-11-17 21:51:10 +01:00
parent dc843e6bab
commit e484dd6bd1

View file

@ -26,7 +26,7 @@
author: Miloslav "drummyfish" Ciz author: Miloslav "drummyfish" Ciz
license: CC0 1.0 license: CC0 1.0
version: 0.908d version: 0.909d
Version numbering: major.minor[d], id 'd' is appended, this is a Version numbering: major.minor[d], id 'd' is appended, this is a
in-development version based on the previous stable major.minor version. Two in-development version based on the previous stable major.minor version. Two
@ -1784,7 +1784,7 @@ RCL_Unit RCL_castRay3D(
ray.direction.x = pos2.x - pos1.x; ray.direction.x = pos2.x - pos1.x;
ray.direction.y = pos2.y - pos1.y; ray.direction.y = pos2.y - pos1.y;
distance = RCL_len(ray.direction); distance = RCL_nonZero(RCL_len(ray.direction));
ray.direction = RCL_normalize(ray.direction); ray.direction = RCL_normalize(ray.direction);