mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
moved vr_scale_factor and vr_zshift to pconf, and added some new projection parameters for the future
This commit is contained in:
parent
319bd1574f
commit
ec70119c3e
9
hyper.h
9
hyper.h
@ -258,6 +258,10 @@ struct projection_configuration {
|
|||||||
ld skiprope;
|
ld skiprope;
|
||||||
ld product_z_scale;
|
ld product_z_scale;
|
||||||
ld rotational_nil;
|
ld rotational_nil;
|
||||||
|
|
||||||
|
ld depth_scaling;
|
||||||
|
ld hyperboloid_scaling;
|
||||||
|
ld vr_angle, vr_zshift, vr_scale_factor;
|
||||||
|
|
||||||
projection_configuration() {
|
projection_configuration() {
|
||||||
formula = "z^2"; top_z = 5; model_transition = 1; spiral_angle = 70; spiral_x = 10; spiral_y = 7;
|
formula = "z^2"; top_z = 5; model_transition = 1; spiral_angle = 70; spiral_x = 10; spiral_y = 7;
|
||||||
@ -273,6 +277,11 @@ struct projection_configuration {
|
|||||||
loximuthal_parameter = 0;
|
loximuthal_parameter = 0;
|
||||||
winkel_parameter = .5;
|
winkel_parameter = .5;
|
||||||
show_hyperboloid_flat = true;
|
show_hyperboloid_flat = true;
|
||||||
|
depth_scaling = 1;
|
||||||
|
vr_angle = 0;
|
||||||
|
hyperboloid_scaling = 1;
|
||||||
|
vr_zshift = 0;
|
||||||
|
vr_scale_factor = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
11
vr.cpp
11
vr.cpp
@ -387,9 +387,6 @@ EX void vr_shift() {
|
|||||||
|
|
||||||
EX ld absolute_unit_in_meters = 3;
|
EX ld absolute_unit_in_meters = 3;
|
||||||
|
|
||||||
EX ld vr_scale_factor = 2;
|
|
||||||
EX ld vr_zshift = 0;
|
|
||||||
|
|
||||||
void move_according_to(vr::ETrackedControllerRole role, bool last, bool cur) {
|
void move_according_to(vr::ETrackedControllerRole role, bool last, bool cur) {
|
||||||
if(!last && !cur) return;
|
if(!last && !cur) return;
|
||||||
int id = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(role);
|
int id = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(role);
|
||||||
@ -753,7 +750,7 @@ EX void render() {
|
|||||||
|
|
||||||
transmatrix mu;
|
transmatrix mu;
|
||||||
bool pers = in_perspective();
|
bool pers = in_perspective();
|
||||||
ld sca = pers ? absolute_unit_in_meters : vr_scale_factor;
|
ld sca = pers ? absolute_unit_in_meters : pconf.vr_scale_factor;
|
||||||
for(int i=0; i<4; i++)
|
for(int i=0; i<4; i++)
|
||||||
for(int j=0; j<4; j++)
|
for(int j=0; j<4; j++)
|
||||||
mu[i][j] = i!=j ? 0 : i==3 ? 1 : sca;
|
mu[i][j] = i!=j ? 0 : i==3 ? 1 : sca;
|
||||||
@ -795,7 +792,7 @@ EX void render() {
|
|||||||
hmd_mvp = NLP * hmd_mvp;
|
hmd_mvp = NLP * hmd_mvp;
|
||||||
}
|
}
|
||||||
hmd_mvp = sm * hmd_mvp;
|
hmd_mvp = sm * hmd_mvp;
|
||||||
if(vr_zshift) hmd_mvp = euclidean_translate(0, 0, -vr_zshift) * hmd_mvp;
|
if(pconf.vr_zshift) hmd_mvp = euclidean_translate(0, 0, -pconf.vr_zshift) * hmd_mvp;
|
||||||
hmd_mvp = mu * hmd_mvp;
|
hmd_mvp = mu * hmd_mvp;
|
||||||
if(hsm == eHeadset::model_viewing) {
|
if(hsm == eHeadset::model_viewing) {
|
||||||
hmd_mvp = sm * hmd_at * inverse(hmd_ref_at) * sm * hmd_mvp;
|
hmd_mvp = sm * hmd_at * inverse(hmd_ref_at) * sm * hmd_mvp;
|
||||||
@ -917,11 +914,11 @@ int readArgs() {
|
|||||||
}
|
}
|
||||||
else if(argis("-vr-scale")) {
|
else if(argis("-vr-scale")) {
|
||||||
PHASEFROM(2);
|
PHASEFROM(2);
|
||||||
shift_arg_formula(vr_scale_factor);
|
shift_arg_formula(pconf.vr_scale_factor);
|
||||||
}
|
}
|
||||||
else if(argis("-vr-z")) {
|
else if(argis("-vr-z")) {
|
||||||
PHASEFROM(2);
|
PHASEFROM(2);
|
||||||
shift_arg_formula(vr_zshift);
|
shift_arg_formula(pconf.vr_zshift);
|
||||||
}
|
}
|
||||||
else if(argis("-d:vr")) {
|
else if(argis("-d:vr")) {
|
||||||
PHASEFROM(2); launch_dialog(show_vr_settings);
|
PHASEFROM(2); launch_dialog(show_vr_settings);
|
||||||
|
Loading…
Reference in New Issue
Block a user