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

useBVH Storybook: Demo does not demonstrate how to set BVH split strategy correctly #639

Open
gkjohnson opened this issue Nov 20, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@gkjohnson
Copy link

Problem description:

Hello! I was taking a look at the useBVH storybook and noticed that changing the "splitStrategy" drop down option did not actually change the BVH structure. It seems the line below returns a string rather than one of the three-mesh-bvh constants resulting in an invalid option.

In the newest version of three-mesh-bvh (v0.5.3) a warning will be logged and no splits will be made when an invalid split strategy is provided. Typescript declaration files have also been added which may make these things easier to spot.

Relevant code:

  const strat = select('split strategy', ['CENTER', 'AVERAGE', 'SAH'], 'CENTER')

Suggested solution:

Change the above line to return the appropriate constant rather than a string.

@gkjohnson gkjohnson added the bug Something isn't working label Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant