mirror of
https://github.com/CrispyPin/sinpin-vr.git
synced 2024-11-10 04:20:25 +01:00
don't reset positions while hidden
This commit is contained in:
parent
edca13ca09
commit
0042ee3b58
2 changed files with 28 additions and 20 deletions
21
src/app.cpp
21
src/app.cpp
|
@ -162,10 +162,10 @@ void App::UpdateInput()
|
|||
{
|
||||
panel.SetHidden(_hidden);
|
||||
}
|
||||
_root_overlay.SetHidden(_hidden || !_edit_mode);
|
||||
_controllers[0]->SetHidden(_hidden || !_edit_mode);
|
||||
_controllers[1]->SetHidden(_hidden || !_edit_mode);
|
||||
UpdateUIVisibility();
|
||||
}
|
||||
if (!_hidden)
|
||||
{
|
||||
if (IsInputJustPressed(_input_handles.reset))
|
||||
{
|
||||
_root_overlay.SetTransformWorld(&root_start_pose);
|
||||
|
@ -175,18 +175,25 @@ void App::UpdateInput()
|
|||
panel.ResetTransform();
|
||||
}
|
||||
}
|
||||
if (!_hidden && IsInputJustPressed(_input_handles.edit_mode))
|
||||
if (IsInputJustPressed(_input_handles.edit_mode))
|
||||
{
|
||||
_edit_mode = !_edit_mode;
|
||||
_root_overlay.SetHidden(_hidden || !_edit_mode);
|
||||
_controllers[0]->SetHidden(_hidden || !_edit_mode);
|
||||
_controllers[1]->SetHidden(_hidden || !_edit_mode);
|
||||
UpdateUIVisibility();
|
||||
}
|
||||
if (_edit_mode)
|
||||
{
|
||||
_controllers[0]->Update();
|
||||
_controllers[1]->Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void App::UpdateUIVisibility()
|
||||
{
|
||||
bool state = _hidden || !_edit_mode;
|
||||
_root_overlay.SetHidden(state);
|
||||
_controllers[0]->SetHidden(state);
|
||||
_controllers[1]->SetHidden(state);
|
||||
}
|
||||
|
||||
void App::UpdateFramebuffer()
|
||||
|
|
|
@ -78,4 +78,5 @@ class App
|
|||
|
||||
void UpdateFramebuffer();
|
||||
void UpdateInput();
|
||||
void UpdateUIVisibility();
|
||||
};
|
Loading…
Reference in a new issue