aboutsummaryrefslogtreecommitdiff
path: root/servers/physics_2d/joints_2d_sw.cpp
diff options
context:
space:
mode:
authorBiliogadafr2015-10-10 23:28:05 +0300
committerBiliogadafr2015-10-10 23:28:05 +0300
commit2ffc90d8b4d3f420e57adefbc880183ac0635a7e (patch)
treedbd4a99422f06de28f97538865086a5abcb3a6af /servers/physics_2d/joints_2d_sw.cpp
parentaad2bbdb6fb7c8217d7e75480b38e45f00cb3abd (diff)
downloadgodot-2ffc90d8b4d3f420e57adefbc880183ac0635a7e.tar.gz
godot-2ffc90d8b4d3f420e57adefbc880183ac0635a7e.tar.zst
godot-2ffc90d8b4d3f420e57adefbc880183ac0635a7e.zip
Expose softness parameter of pin joint to the editor.
Diffstat (limited to 'servers/physics_2d/joints_2d_sw.cpp')
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index b4c149e7e..7c1200008 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -279,6 +279,18 @@ void PinJoint2DSW::solve(float p_step){
P += impulse;
}
+void PinJoint2DSW::set_param(Physics2DServer::PinJointParam p_param, real_t p_value) {
+
+ if(p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
+ softness = p_value;
+}
+
+real_t PinJoint2DSW::get_param(Physics2DServer::PinJointParam p_param) const {
+
+ if(p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
+ return softness;
+ ERR_FAIL_V(0);
+}
PinJoint2DSW::PinJoint2DSW(const Vector2& p_pos,Body2DSW* p_body_a,Body2DSW* p_body_b) : Joint2DSW(_arr,p_body_b?2:1) {