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

Docs: Make clear that TriMeshes are not treated as solid for point queries, even when solid flag given #4

Open
clbarnes opened this issue Feb 1, 2021 · 4 comments

Comments

@clbarnes
Copy link

clbarnes commented Feb 1, 2021

The same was true in ncollide.

@clbarnes clbarnes changed the title Docs: TriMeshes are not treated as solid, even when solid flag given Docs: Make clear that TriMeshes are not treated as solid for point queries, even when solid flag given Feb 1, 2021
@clbarnes
Copy link
Author

clbarnes commented Feb 1, 2021

Related: a method to check whether points are inside meshes, see dimforge/ncollide#317

@sebcrozet
Copy link
Member

sebcrozet commented Feb 1, 2021

Hi! The solid flags indicates that the projection will be the point itself if it lies on the interior of the shape. But in 3D, our TriMesh has no interior by definition, therefore the solid flag is meaningless. It does have a meaning in 2D though (because in 2D triangles have an interior).

The ray-cast based alternative you suggested in dimforge/ncollide#317 remains the best way of doing this. Maybe we could provide it as an inherent method of TriMesh?

@clbarnes
Copy link
Author

clbarnes commented Feb 1, 2021

That would certainly be useful to me, although my use case may be atypical (generic mesh queries rather than game engine specific). It's made a bit harder by this bug dimforge/ncollide#335 ; it's safest to fire a number of rays in different directions and find the consensus. I also haven't found any references to backfaces in the codebase, although I haven't been able to search too deeply yet.

@clbarnes
Copy link
Author

This issue is potentially resolved by oriented trimeshes now doing an actual containment check for contains{_local}_point, which is great news! Will do a bit more testing on my end before closing.

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

No branches or pull requests

2 participants