hmd orient, vr ui

This commit is contained in:
2018-10-28 22:25:15 +01:00
parent 0fff9f2010
commit b366d6b61f
11 changed files with 145 additions and 16 deletions

View File

@@ -19,6 +19,7 @@ void App::tick(float dt)
void App::resize(float w, float h)
{
uirtt.create(w, h);
redraw = true;
width = w;
height = h;
@@ -181,6 +182,7 @@ bool App::mouse_down(int button, float x, float y, float pressure, kEventSource
}
bool App::mouse_move(float x, float y, float pressure, kEventSource source, bool eraser)
{
cursor = { x / zoom, y / zoom };
redraw = true;
MouseEvent e;
e.m_type = kEventType::MouseMove;
@@ -264,6 +266,8 @@ bool App::gesture_end()
}
bool App::key_down(kKey key)
{
if (key == kKey::KeySpacebar)
canvas->m_canvas->m_cam_rot = vr_rot;
redraw = true;
keys[(int)key] = true;
KeyEvent e;