Open ctrlaltmilk opened 4 years ago
As I understand it, until recently this functionality was not implemented in the underlying physics library.
I think these Bullet physic engine issues/PRs are relevant to this proposal:
If this is the case, then the Bullet physics library version included with Godot will need to be updated & then the new functionality exposed.
Updated:
In the interim it might be possible to attach the SoftBody to a RigidBody & apply the force to the rigid body? Possible related issues:
Ammo.js does have a way to apply forces on soft bodies, either on the full SoftBody or on a node-by-node basis: https://github.com/kripken/ammo.js/blob/79190a1f03845794b1bba1777f30037349967658/ammo.idl#L1059-L1060
Is it still possible to add apply_impulse
and apply_force
functions to the SoftBody node in Bullet (3.x) and Godot Physics (4.x)?
Current workaround for this proposal: Use a physics layer and an Area3D with a vary large collision shape. The Area3D is set to add "gravity" on a specific physics layer only, which is also used by the player's SoftBody. The direction of the added force is controlled by player input.
Limitations of the above workaround:
apply_force
function. In other words, jump height for SoftBody avatars, for example, would be dependent on framerate. A consistent jump height would still require the apply_impulse
function for soft bodies, which can't be replicated as easily with existing features compared to apply_force
.
Describe the project you are working on:
I was seeing if I could make a controllable blob that could squish through tight spaces.
Describe the problem or limitation you are having in your project:
Without any way to apply forces to the blob, it's hard to get an accurate simulation of the movement.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
These new functions would make the SoftBody easier to work with, and would mean more potential uses for this node type.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
The RigidBody node has
apply_impulse()
andapply_force()
as well as central versions, so I propose adding those to the SoftBody as well.If this enhancement will not be used often, can it be worked around with a few lines of script?:
I do not see any way to work around this issue.
Is there a reason why this should be core and not an add-on in the asset library?:
I believe it should be a core functionality of the SoftBody because it seems like a good fit for the node's purpose.