Skip to content

Conversation

@chrisfromwork
Copy link
Contributor

@chrisfromwork chrisfromwork commented Jan 25, 2021

This review contains the following changes:

  1. We move input handlers off the ui thread
  2. We consume a newer NativeInput component in BabylonNative

We should not check in this review until the following is completed:

we will also need to update the submodule commit to this BabylonNative pr commit once its completed.

}
});

_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to move this off the main thread?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a suggestion from @tymlipari they may have more context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have to right now, but CoreIndependentInputSource supports this in general. If we ever want to move the Babylon rendering off-thread, we can similarly move the input sink with it.

@tymlipari
Copy link
Contributor

Does pointer capture work here? Meaning, if I press down within the window and then drag the cursor outside the window bounds without releasing, does Babylon continue to receive the input? For things like camera manipulation and such that'd be a necessary feature, and we might need a mechanism to mark the pointers as captured until we're done with them.

@ryantrem
Copy link
Member

ryantrem commented Jan 26, 2021

Does pointer capture work here? Meaning, if I press down within the window and then drag the cursor outside the window bounds without releasing, does Babylon continue to receive the input? For things like camera manipulation and such that'd be a necessary feature, and we might need a mechanism to mark the pointers as captured until we're done with them.

Do we know how it works in the browser, and should we match whatever that behavior is?
I just checked and in the browser it captures the mouse, so seems like we should match that behavior.

@chrisfromwork chrisfromwork merged commit ddf1b0b into BabylonJS:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NativeInput does not appear to work correctly for UWP experiences

3 participants