mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-30 08:52:52 +00:00
vr:: factored out refdist()
This commit is contained in:
parent
2575e768ac
commit
60c22d6952
10
vr.cpp
10
vr.cpp
@ -1357,12 +1357,16 @@ EX void enable_button() {
|
|||||||
dialog::addInfo(XLAT("VR initialized correctly"), 0x00C000);
|
dialog::addInfo(XLAT("VR initialized correctly"), 0x00C000);
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void reference_button() {
|
EX string refdist() {
|
||||||
if(enabled && among(hsm, eHeadset::reference, eHeadset::model_viewing)) {
|
|
||||||
E4;
|
E4;
|
||||||
hyperpoint h = hmd_at * inverse(hmd_ref_at) * C0;
|
hyperpoint h = hmd_at * inverse(hmd_ref_at) * C0;
|
||||||
|
return state ? fts(hypot_d(3, h)) + "m" : "";
|
||||||
|
}
|
||||||
|
|
||||||
dialog::addSelItem(XLAT("reset the reference point"), state ? fts(hypot_d(3, h)) + "m" : "", 'r');
|
EX void reference_button() {
|
||||||
|
if(enabled && among(hsm, eHeadset::reference, eHeadset::model_viewing)) {
|
||||||
|
|
||||||
|
dialog::addSelItem(XLAT("reset the reference point"), refdist(), 'r');
|
||||||
dialog::add_action([] { hmd_ref_at = hmd_at; });
|
dialog::add_action([] { hmd_ref_at = hmd_at; });
|
||||||
}
|
}
|
||||||
else dialog::addBreak(100);
|
else dialog::addBreak(100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user