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
Skin raycast #6911
Skin raycast #6911
Conversation
@@ -17042,6 +17043,24 @@ THREE.Mesh.prototype.getMorphTargetIndexByName = function ( name ) { | |||
|
|||
}; | |||
|
|||
THREE.Mesh.prototype.makeVertexGetter = function () { | |||
|
|||
// we need this to avoid geometry type checks in actual getter |
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.
How about adding getVertex
directly to Geometry
and BufferGeometry
instead?
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.
the getter is different for Mesh and SkinnedMesh
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.
Ah...
Also, try not to include |
Force-pushed last commit without builds. |
Maybe it would be simpler to implement what you need in |
May be, if you are code duplication fan. As it says, this is only
You can solve it in another way. |
Closing as it now has conflicts. |
@donmccurdy the only difference is that you would have to loop over array of numbers rather than array of vertices. you can try THREE.Mesh with same Geometry and BufferGeometry to see the difference, it would be roughly the same for skins |
I personally made no good experiences with raycasting and skinning. It might work for simple models but in all other cases the computational overhead is too high. So raycasting per simulation step on geometry level just kills the performance. Working with bounding volumes is one approach to solve this problem. |
still useable in click handlers where you can tolerate delays more than
1/60-th of second
|
That's true. |
Here is an example of one way #6440 could be solved. I did not do much testing with this, basically I made sure decal example keeps working (means Mesh is not broken) and modified another example to test SkinnedMesh with old geometry. I did not test this with SkinnedMesh + buffer geometry, although very similar code is working with this combination in my r70-based project (see #3187).