Merge pull request #106321 from elzewyr/shrink-factor
SoftBody3D: Add a property for scaling rest lengths of edge constraints
This commit is contained in:
@ -338,6 +338,9 @@ void PhysicsServer3DExtension::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_soft_body_set_linear_stiffness, "body", "linear_stiffness");
|
||||
GDVIRTUAL_BIND(_soft_body_get_linear_stiffness, "body");
|
||||
|
||||
GDVIRTUAL_BIND(_soft_body_set_shrinking_factor, "body", "shrinking_factor");
|
||||
GDVIRTUAL_BIND(_soft_body_get_shrinking_factor, "body");
|
||||
|
||||
GDVIRTUAL_BIND(_soft_body_set_pressure_coefficient, "body", "pressure_coefficient");
|
||||
GDVIRTUAL_BIND(_soft_body_get_pressure_coefficient, "body");
|
||||
|
||||
|
||||
@ -445,6 +445,9 @@ public:
|
||||
EXBIND2(soft_body_set_linear_stiffness, RID, real_t)
|
||||
EXBIND1RC(real_t, soft_body_get_linear_stiffness, RID)
|
||||
|
||||
EXBIND2(soft_body_set_shrinking_factor, RID, real_t)
|
||||
EXBIND1RC(real_t, soft_body_get_shrinking_factor, RID)
|
||||
|
||||
EXBIND2(soft_body_set_pressure_coefficient, RID, real_t)
|
||||
EXBIND1RC(real_t, soft_body_get_pressure_coefficient, RID)
|
||||
|
||||
|
||||
@ -876,6 +876,9 @@ void PhysicsServer3D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("soft_body_set_linear_stiffness", "body", "stiffness"), &PhysicsServer3D::soft_body_set_linear_stiffness);
|
||||
ClassDB::bind_method(D_METHOD("soft_body_get_linear_stiffness", "body"), &PhysicsServer3D::soft_body_get_linear_stiffness);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("soft_body_set_shrinking_factor", "body", "shrinking_factor"), &PhysicsServer3D::soft_body_set_shrinking_factor);
|
||||
ClassDB::bind_method(D_METHOD("soft_body_get_shrinking_factor", "body"), &PhysicsServer3D::soft_body_get_shrinking_factor);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("soft_body_set_pressure_coefficient", "body", "pressure_coefficient"), &PhysicsServer3D::soft_body_set_pressure_coefficient);
|
||||
ClassDB::bind_method(D_METHOD("soft_body_get_pressure_coefficient", "body"), &PhysicsServer3D::soft_body_get_pressure_coefficient);
|
||||
|
||||
|
||||
@ -607,6 +607,9 @@ public:
|
||||
virtual void soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) = 0;
|
||||
virtual real_t soft_body_get_linear_stiffness(RID p_body) const = 0;
|
||||
|
||||
virtual void soft_body_set_shrinking_factor(RID p_body, real_t p_shrinking_factor) = 0;
|
||||
virtual real_t soft_body_get_shrinking_factor(RID p_body) const = 0;
|
||||
|
||||
virtual void soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) = 0;
|
||||
virtual real_t soft_body_get_pressure_coefficient(RID p_body) const = 0;
|
||||
|
||||
|
||||
@ -341,6 +341,9 @@ public:
|
||||
virtual void soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) override {}
|
||||
virtual real_t soft_body_get_linear_stiffness(RID p_body) const override { return 0; }
|
||||
|
||||
virtual void soft_body_set_shrinking_factor(RID p_body, real_t p_shrinking_factor) override {}
|
||||
virtual real_t soft_body_get_shrinking_factor(RID p_body) const override { return 0; }
|
||||
|
||||
virtual void soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) override {}
|
||||
virtual real_t soft_body_get_pressure_coefficient(RID p_body) const override { return 0; }
|
||||
|
||||
|
||||
@ -309,6 +309,9 @@ public:
|
||||
FUNC2(soft_body_set_linear_stiffness, RID, real_t);
|
||||
FUNC1RC(real_t, soft_body_get_linear_stiffness, RID);
|
||||
|
||||
FUNC2(soft_body_set_shrinking_factor, RID, real_t);
|
||||
FUNC1RC(real_t, soft_body_get_shrinking_factor, RID);
|
||||
|
||||
FUNC2(soft_body_set_pressure_coefficient, RID, real_t);
|
||||
FUNC1RC(real_t, soft_body_get_pressure_coefficient, RID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user