third_person_rotation

This commit is contained in:
Zeno Rogue 2021-11-30 20:56:36 +01:00
parent a4ec0cabf0
commit 8220611718
2 changed files with 5 additions and 0 deletions

View File

@ -1043,6 +1043,7 @@ EX void initConfig() {
param_f(camera_speed, "camspd", "camera-speed", 1);
param_f(camera_rot_speed, "camrot", "camera-rot-speed", 1);
param_f(third_person_rotation, "third_person_rotation", 0);
param_f(panini_alpha, "panini_alpha", 0);
param_f(stereo_alpha, "stereo_alpha", 0);

View File

@ -364,6 +364,8 @@ EX void full_strafe_camera(ld t) {
}
}
EX ld third_person_rotation = 0;
EX void full_rotate_camera(int dir, ld val) {
if(rug::rug_control() && lshiftclick) {
val *= camera_rot_speed;
@ -389,6 +391,7 @@ EX void full_rotate_camera(int dir, ld val) {
#endif
else if(GDIM == 3) {
val *= camera_rot_speed;
if(third_person_rotation) shift_view(ctangent(2, -third_person_rotation)), didsomething = true, playermoved = false;
if(keep_vertical()) {
hyperpoint vv = vertical_vector();
ld alpha = -atan2(vv[2], vv[1]);
@ -403,6 +406,7 @@ EX void full_rotate_camera(int dir, ld val) {
}
else
rotate_view(cspin(dir, 2, val));
if(third_person_rotation) shift_view(ctangent(2, third_person_rotation));
if(!rug::rug_control()) didsomething = true;
}
else