godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

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

Closed Axeltherabbit closed 2 months ago

Axeltherabbit commented 3 years ago

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

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;

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 commented 3 years ago

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

Christakou commented 9 months ago

Any updates on this issue?

Axeltherabbit commented 9 months ago

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 commented 9 months ago

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 :)