1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

hyperbolic raycast: fix the matrices

This commit is contained in:
Zeno Rogue 2020-05-28 13:44:32 +02:00
parent 91338d047e
commit 98b1e659a5

View File

@ -812,12 +812,10 @@ void enable_raycaster() {
else fmain +=
"position = position + tangent * dist;\n";
#if CAP_FIX_RAYCAST
if(hyperbolic) fmain +=
"position /= sqrt(position.w*position.w - dot(position.xyz, position.xyz));\n"
"tangent -= dot(vec4(-position.xyz, position.w), tangent) * position;\n"
"tangent /= sqrt(dot(tangent.xyz, tangent.xyz) - tangent.w*tangent.w);\n";
#endif
if(hyperbolic && bt::in()) {
fmain +=