1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 06:50:27 +00:00

solv:: applymodel takes local_perspective into account

This commit is contained in:
Zeno Rogue 2019-07-31 16:14:20 +02:00
parent 44b9968ff8
commit 794f8b679e

View File

@ -313,6 +313,7 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
switch(pmodel) {
case mdPerspective: {
ld ratio = vid.xres / current_display->tanfov / current_display->radius / 2;
if(solv::local_perspective_used()) H = solv::local_perspective * H;
ret[0] = H[0]/H[2] * ratio;
ret[1] = H[1]/H[2] * ratio;
ret[2] = 1;
@ -321,6 +322,7 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
case mdSolPerspective: {
auto S = solv::inverse_exp(H, false);
if(solv::local_perspective_used()) S = solv::local_perspective * S;
ld ratio = vid.xres / current_display->tanfov / current_display->radius / 2;
ret[0] = S[0]/S[2] * ratio;
ret[1] = S[1]/S[2] * ratio;
@ -343,6 +345,7 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
}
case mdDisk: {
if(solv::local_perspective_used()) H = solv::local_perspective * H;
ld tz = get_tz(H);
if(!vid.camera_angle) {
ret[0] = H[0] / tz;