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

Only calculate focus point when needed #758

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Conversation

jeevcat
Copy link
Contributor

@jeevcat jeevcat commented Jul 1, 2022

Currently, on every type of input event (include mouse movement), the focus point is calculated. This can be an expensive operation for complex meshes.

If the mouse is moved just right (try small circular motions), many mouse movement events will be triggered, each causing a focus point recalculation. All of these mouse movement events must be handled before a new frame is rendered.

This PR just moves focus point calculation into the mouse click events which need it, preventing the much more frequent mouse movement events from triggering the calculations.

@jeevcat jeevcat requested a review from hannobraun as a code owner July 1, 2022 11:45
@hannobraun
Copy link
Owner

Thank you, @jeevcat! I'll take a closer look later, but this seems like a nice improvement.

Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

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

Just tested this. Works as great as it looks. Thank you, @jeevcat!

@hannobraun hannobraun merged commit fb4ae09 into hannobraun:main Jul 1, 2022
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.

2 participants