You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add functions to apply impulse and force to SoftBody on GodotPhysics and JoltPhysics
This commit is contained in:
@@ -288,6 +288,34 @@ void JoltPhysicsServer3D::area_set_space(RID p_area, RID p_space) {
|
||||
area->set_space(space);
|
||||
}
|
||||
|
||||
void JoltPhysicsServer3D::soft_body_apply_point_impulse(RID p_body, int p_point_index, const Vector3 &p_impulse) {
|
||||
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
body->apply_vertex_impulse(p_point_index, p_impulse);
|
||||
}
|
||||
|
||||
void JoltPhysicsServer3D::soft_body_apply_point_force(RID p_body, int p_point_index, const Vector3 &p_force) {
|
||||
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
body->apply_vertex_force(p_point_index, p_force);
|
||||
}
|
||||
|
||||
void JoltPhysicsServer3D::soft_body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) {
|
||||
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
body->apply_central_impulse(p_impulse);
|
||||
}
|
||||
|
||||
void JoltPhysicsServer3D::soft_body_apply_central_force(RID p_body, const Vector3 &p_force) {
|
||||
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
body->apply_central_force(p_force);
|
||||
}
|
||||
|
||||
RID JoltPhysicsServer3D::area_get_space(RID p_area) const {
|
||||
const JoltArea3D *area = area_owner.get_or_null(p_area);
|
||||
ERR_FAIL_NULL_V(area, RID());
|
||||
|
||||
Reference in New Issue
Block a user