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

Checking bounding box hit every time before checking mesh hit. #42

Merged
merged 2 commits into from
Dec 18, 2020
Merged

Checking bounding box hit every time before checking mesh hit. #42

merged 2 commits into from
Dec 18, 2020

Conversation

DenchiSoft
Copy link
Contributor

This checks if the the intersection is within the bounding box before checking if it is within the mesh even if the CubismRaycastable has CubismRaycastablePrecision.Triangles set as Precision, potentially ruling out CubismDrawables without doing the costly mesh check.

It comes at a small overhead in general, but for my use-case (complex models with many vertices, all Drawables are Raycastable), not having this pre-check with the bounding box lags the application for ~0.5 seconds on mobile every time I raycast the model.

@wada-at-live2d-com
Copy link
Contributor

@DenchiSoft
Thank you for pull request and investigation!

We are going to approve your pull request. Please wait for a while while we check the operation for it.
If there are any problems, we will contact you.

Sincerely,

Fixed unnecessary changes.
@ono-at-live2d-com ono-at-live2d-com merged commit b9aca62 into Live2D:develop Dec 18, 2020
@wada-at-live2d-com
Copy link
Contributor

@DenchiSoft

We have seen performance improvements with your Pull Request.
We fixed some code formatting and merged it.
Thanks for the report!

Sincerely,

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.

3 participants