-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
CSGShape's _update_shape() doesn't produce indices #29275
Comments
Hi, I was about to open a bug report due to "navMesh.create_from_mesh()" not working. I didn't found out the lack of indices on the ArrayMesh. Right now CSGMesh is the easier way to create navigation meshes on the flight so it's sad that it's not working :( Meanwhile, @TheSHEEEP may I ask you how do you create the index for the ArrayMesh? SurfaceTool maybe? Im kinda puzzled on how to do it. |
This is the code I used to create the indices from an ArrayMesh and add it to a navMesh. create_from_mesh() is really only useful if you pass it what is basically already a navigation mesh. Anyway, here's the code:
|
The mesh I use is made only for the purpose of using it in the NavMesh, so in my case it's fine.I tweaked your code and it's working nicely for me. I hope that Navigation gains more attention, it's a part of the engine that looks kinda under-developed to me. Anyway, thank you so much for sharing your code, it helped me a lot. |
Feel free to add your voice or thumbs to the "main" navmesh improvement issue here. Also, how do you use CSGMesh to create a mesh to put into NavMesh? Do you add a plane and then use the walls to "cut out" holes in it? How do you deal with stuff like stairs in that scenario? |
My use case is a bit weird. I use the NavMesh to create a plane where enemies can go, basically to avoid static objects (the levels will be procedural). I don't know if I can link youtube videos... so... if you search for "Gravity Wars Godot" you can find a video called "Prototype 0" to check what I mean. I'll write on the issue; life would be way easier if we had "agents" with an avoidance system. |
Not reproducible on 3.2.3.rc3. |
Closing as resolved in 3.2 per @hoontee's comment. |
Godot version:
3.1.1
OS/device including version:
Ubuntu 18.04
GeForce GTX 1070, NVIDIA 418.56
Issue description:
While CSG generally works, when using the following code to create and export an actual mesh from it...
... the resulting Mesh will not have its indices set. It still displays fine when duplicated, exported, loaded, etc., but it shows the following error whenever used anywhere:
For example, this code will show the error, and the lack of indices also prevents it from working:
Looking at the code of _update_shape() in csg_shape.cpp, indeed no indices are created.
They may not be necessary to display the result of the CSGShape, but this lack of indices seems to cause aforementioned error as well as other problems down the line (I'm certain not only navmesh's create_from_mesh is affected here).
So far, the only workaround is to produce the indices manually afterwards - which isn't too hard as the order simply seems to be [0, 1, 2][3, 4, 5][6, 7, 8] etc - but this shouldn't be necessary at all. _update_shape() creates normals, UVs and tangents, so why not add indices?
Steps to reproduce:
See above.
Minimal reproduction project:
Any project using CSGMesh (or possibly other CSG nodes) would probably do, but here is my project from another issue, also showing the problem:
procmeshtest.zip
The text was updated successfully, but these errors were encountered: