-
-
Notifications
You must be signed in to change notification settings - Fork 298
Fix InstancedMesh raycast
#673
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
Conversation
| this.getWorldScale( worldScale ); | ||
| getWorldScale( this.matrixWorld, worldScale ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting... So the previous issue was caused by Object3D.getWorldScale implicitly updating the world matrix without having synchronized position, rotation, and scale values. Confusing.
Why don't we use Matrix4.decompose, instead, and pass a dummy position and rotation into the function? I think it will be simpler than copying logic and directly accessing matrix elements.
If you don't mind I think this would be good to have |
|
Accelerated raycasting does not seem to work on https://github.com/mrdoob/three.js/blob/master/src/objects/BatchedMesh.js#L876 I don't think it is a good idea to create a BVH from the merged geometry (containing the repeated geometries), so I would say to wait until your new changes are released. I have some ideas in mind, but it may be better to talk about them later, in any case I think it will be necessary to add the possibility of creating separate BVH based on a range of indexes. I hope I am not wrong 😂 |
Oh ha yes I should have known this 😅
Definitely agree.
Yeah I think this is separate from this PR. #660 was opened in order to afford the ability to create a BVH from the subrange of a geometry specifically for BatchedMesh but it remains unfinished. We can ping or finish up that PR if we'd like to move it along. I think in the long run we'd want to keep a list of BVH's per batched geometry and then we'd have to add a special case in the |
Okay, if he cannot I will continue his work. |
I fixed the problem related to
getScaleWorldand added tests.I need to clean up the code, but can you tell me if the
InstancedMeshtests are okay?Shall I add tests on
BatchedMeshtoo? (after mrdoob/three.js#28462)related #671