Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction with 3D scene? #1051

Closed
ghost opened this issue Mar 2, 2017 · 5 comments
Closed

Interaction with 3D scene? #1051

ghost opened this issue Mar 2, 2017 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 2, 2017

Hello. I have in my experimental renderer (based on ray tracing) basic camera control. How to cross-connect camera control (mouse and keyboard) with GUI?

Yes, in simple situation may be bind with callback, but in this situation needs additional hit test (on cursor in gui).

@ratchetfreak
Copy link

check WantCaptureKeyboard and WantCaptureMouse those will tell you when an imgui widget wants input focus and there are methods to turn it off the next frame for when you want to drag the mouse behind a window.

@ocornut
Copy link
Owner

ocornut commented Mar 8, 2017

This is mostly under your control.

You can decide that when clicking a view you'd stop giving a mouse position to ImGui until another action is performed (e.g. pressing escape, or right mouse-click). ImGui will use the mouse input position if it is provided. So maybe your application needs a flag to track whether inputs are passed to imgui or not?

Pseudo code,

if (InvisibleButton(...)) // clicked viewport
{
  m_myapp_input_goes_to_game = true;
}

if (m_myapp_input_goes_to_game && MyAppKeyPressed(ESC))
{
  m_myapp_input_goes_to_game = false;
  HideCursor();
}
else
{
   ShowCursor();
   // pass inputs to imgui
}

@ocornut
Copy link
Owner

ocornut commented Apr 21, 2017

@acterhd Shall we keep this issue open?

@ghost
Copy link
Author

ghost commented Apr 21, 2017

I'm in thinking...
I'm interesting about GUI scaling, why blurry.

@ocornut
Copy link
Owner

ocornut commented May 1, 2017

Closing this until you have a specific related query.
GUI scaling/blurryness would be a different topic.

@ocornut ocornut closed this as completed May 1, 2017
ocornut added a commit that referenced this issue Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants