Godot: CSG Working with RigidBody or having an option to have it behave as a RigidBody

Created on 27 Oct 2018  路  7Comments  路  Source: godotengine/godot

I am playing around with CSG, and I tried to place a csg shape with collisions enabled under a rigid body node. Of course it doesn't work, but I'm wondering if it wouldn't be possible to modify godot in order to get that information from a CSG shape instead of only from collision shape + mesh instance.
EDIT: Alternatively have an option within CSG that allows the node to behave as RigidBody or StaticBody.

If someone is interested in contributing, you'll have at least one happy(er) user.

I have searched in the issues to see if there's any mention onf this feature request, but found nothing.
Also I am referring to version 3.1, but I guess it was already implied.

archived enhancement core physics

Most helpful comment

It should be possible to do this, by just not creating a StaticBody in the CSG, but exposing the shape to the parent PhysicsBody.

So, just checking the type of the parent node, and reusing its instance if possible here:
https://github.com/godotengine/godot/blob/720f543caa9cdefbc92273a419d17bb6441b027e/modules/csg/csg_shape.cpp#L46

All 7 comments

I tried and works for me, placing a CSGBox and CollisionShape as child of RigidBody. Don't work with CSGCombiner with collision activated.

Sure man, but that would be redundant, as CSG shape have the "use collision" option included, so in theory it could be possible to have the csg node to behave as a rigid body directly, or else to just place it below a rigid body and let the rigid body detect the collision shape of the object below.
csg_use_collision

I added a minimal example, IMHO, both nodes shoud behave the same.
csg_rigid_body_test

csg_rigid_body.zip

Anyway where is the problem of add a collision shape? Is really easy to do. And CSG system is not for use individual primitives, for that you have mesh instance.

Yeah, maybe there's the problem, if you place multiple csg shapes under rigid body it will probably be more difficult to extract a valid collision..

It should be possible to do this, by just not creating a StaticBody in the CSG, but exposing the shape to the parent PhysicsBody.

So, just checking the type of the parent node, and reusing its instance if possible here:
https://github.com/godotengine/godot/blob/720f543caa9cdefbc92273a419d17bb6441b027e/modules/csg/csg_shape.cpp#L46

Could optionally do something similar to CollisionShape

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings