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

There isn't any method to access a CSG node collision shape #1920

Closed
Axeltherabbit opened this issue Dec 2, 2020 · 4 comments · Fixed by godotengine/godot#93252
Closed

Comments

@Axeltherabbit
Copy link

Axeltherabbit commented Dec 2, 2020

Describe the project you are working on

I'm manipulation CSG nodes and I would like to access the resulting collision shape or mesh.
There is the method get_meshes but it only works when the node is the root of the scene, I don't really understand why, it's a bit strange for my little understanding

Describe the problem or limitation you are having in your project

  • If the flag use collisions is on it acts like a StaticBody but I can't access the collision shape or other StaticBody methods.
  • At the moment CSG are limited to StaticBodies, I can't work with RigidBodies

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would make CSG nodes more free

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I would just add;

  • a method csgroot.get_resulting_mesh to get the result of the boolean operations
  • csgroot.get_collision_shape

If this enhancement will not be used often, can it be worked around with a few lines of script?

My c++ and engine understanding is poor but the shape is already there, I believe it would need few extra lines to access it
Looks like the code is there, we just need the methods

Is there a reason why this should be core and not an add-on in the asset library?

CSG nodes are being developed right now and they improved a lot.
I understand that they are designed for quick use but I think it is a bit strange that use collisions creates a StaticBody like object rather then an actual StaticBody.
I have also found this old issue

@Axeltherabbit
Copy link
Author

I have made a first test and it seems quite easy to change commit

@Christakou
Copy link

Any updates on this issue?

@Axeltherabbit
Copy link
Author

I stopped to work on this because godot 4 was about to be released then forgot, I'll have a look later this weekend

@Christakou
Copy link

I ran into this use case recently and resorted to defining a bunch of capsules to 'mimic' my CSG polygon, would be incredibly grateful if we could access the CSG collision shape, and I'm sure i'm not the only one.
Much appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants