mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-06 14:10:11 +00:00
shift+PageUp/Down now zooms
This commit is contained in:
parent
4575a672d6
commit
f1a38b8389
14
control.cpp
14
control.cpp
@ -301,8 +301,20 @@ transmatrix zforward_push(ld z) {
|
|||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX void zoom_or_fov(ld t) {
|
||||||
|
if(in_perspective()) {
|
||||||
|
auto tanfov = tan(vid.fov * degree / 2);
|
||||||
|
tanfov *= t;
|
||||||
|
vid.fov = atan(tanfov) * 2 / degree;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pconf.scale *= t;
|
||||||
|
}
|
||||||
|
|
||||||
EX void full_forward_camera(ld t) {
|
EX void full_forward_camera(ld t) {
|
||||||
if(GDIM == 3) {
|
if(anyshiftclick)
|
||||||
|
zoom_or_fov(exp(-t/10.));
|
||||||
|
else if(GDIM == 3) {
|
||||||
shift_view(ctangent(2, t));
|
shift_view(ctangent(2, t));
|
||||||
didsomething = true;
|
didsomething = true;
|
||||||
playermoved = false;
|
playermoved = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user