-
Notifications
You must be signed in to change notification settings - Fork 426
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
Don't give up when encountering lines/points/... in collision mesh data #1888
Conversation
Instead just skipping them. As this makes the isMeshPrimitiveValid() check obsolete, I removed the whole implementation of it (which, after all, was just a very verbose way to print the mesh primitive name, and could be done in a single expression instead). Furthermore, a call to this function was also the only reason why addStage() too the collision mesh group parameter, so I removed it from there as well. The check is now moved to inside constructBulletSceneFromMeshes(), where it just skips unsupported primitives with a warning. If the code could access the originating Magnum::Trade::MeshData instead of CollisionMeshData, it could be easily extended to support also triangle fans and triangle strips (since there's a MeshTools utility for converting them to triangle list), but right now it skips those as well.
I was looking for it in the --help output and it wasn't there since it wasn't documented. Bad usability.
48c85bb
to
b02886b
Compare
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.
This fix looks good to me. Thanks! 👍
Hey @mosra @aclegg3 , I just noticed that even though these changes are allowing the scenes to be loaded, the navmesh construction is still faulty. I have identified a list of (at least) 28 scenes with this issue. Here are scene IDs of two of those: This should be easy to reproduce using the habitat-viewer with the
|
As I said above,
unfortunately I know too little about this area of the codebase to be able to understand what's going on 😅 I only made a best-intention attempt to not discard everything when some of the meshes are not triangles, and that part, to my understanding, should be working. If it means some new meshes, which were completely skipped before, are now showing up in the navmesh generation, there's possibly some additional problem. But also I may have overlooked something important that the original code was doing and that the new code isn't anymore, which is why I'm deferring to people who actually know the navmesh generation code, such as Alex. Scenes that loaded correctly before are loading correctly now as well? Or neither that? Do you see any
messages in the output for the scenes that load wrong? |
Thanks @mosra.
Yes!
Yes, I do. |
Sorry for the long delay here. Quick fix is to again filter by primitive during the mesh join phase of navmesh re-computation. See PR #1951. Try this out and see if it works. |
Motivation and Context
Instead just skipping them. See this Slack thread for background info.
As this makes the
isMeshPrimitiveValid()
check obsolete, I removed the whole implementation of it (which, after all, was just a very verbose way to print the mesh primitive name originating back in the days when Habitat used glog and thus couldn't just call Magnum's builtin output operator for MeshPrimitive). Furthermore, a call to this function was also the only reason whyaddStage()
too the collision mesh group parameter, so I removed it from there as well. Which is a documentation TODO:addStage()
docs probably need to be updated as they mention collision data that are no longer passed there. I don't know what should be said there, tho.The check is now moved to inside
constructBulletSceneFromMeshes()
, where it just skips unsupported primitives with a warning. If the code could access the originating MagnumTrade::MeshData
instead ofCollisionMeshData
, it could be easily extended to support also triangle fans and triangle strips (since there's a MeshTools utility for converting them to triangle lists), but right now it skips those as well.Also contains a drive-by fix for viewer
--help
output and use of a deprecated Magnum API.How Has This Been Tested