rays fixed

This commit is contained in:
A-lex-Ra
2023-12-10 20:06:18 +06:00
parent 5bc75c3f2d
commit 1e39b5d05d
4 changed files with 192 additions and 235 deletions
+3 -2
View File
@@ -234,8 +234,9 @@ voxel* Chunks::rayCast(vec3 start,
const AABB& box = def->rotatable
? def->rt.hitboxes[voxel->rotation()]
: def->hitbox;
rayvec3 in, out; // <- now not used, but for future...
if (Rays::rayIntersectAABB(start, dir, iend, box, maxDist, in, out, norm) > RayRelation::None){
scalar_t distance;
if (Rays::rayIntersectAABB(start, dir, iend, box, maxDist, norm, distance) > RayRelation::None){
end = start + (dir * vec3(distance));
return voxel;
}