aboutsummaryrefslogtreecommitdiff
path: root/servers/physics_2d/shape_2d_sw.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2018-02-19 22:15:49 +0100
committerGitHub2018-02-19 22:15:49 +0100
commitb2aeb02e7d43d98973334e39db5c39626ba9f775 (patch)
treed0d97ce31a873972558a01d7e12d3157f7162869 /servers/physics_2d/shape_2d_sw.cpp
parent6ee4298ee3192e2c82e7b26b078f32302764ace5 (diff)
parentffc3ef86778f486823bedf66cc5a937fc09abe6a (diff)
downloadgodot-b2aeb02e7d43d98973334e39db5c39626ba9f775.tar.gz
godot-b2aeb02e7d43d98973334e39db5c39626ba9f775.tar.zst
godot-b2aeb02e7d43d98973334e39db5c39626ba9f775.zip
Merge pull request #16530 from AndreaCatania/rays
Improved ray shape (2D and 3D) by addiing the possibility to act as r…
Diffstat (limited to 'servers/physics_2d/shape_2d_sw.cpp')
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 5893f1982..433942708 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -184,13 +184,18 @@ real_t RayShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale)
void RayShape2DSW::set_data(const Variant &p_data) {
- length = p_data;
+ Dictionary d = p_data;
+ length = d["length"];
+ slips_on_slope = d["slips_on_slope"];
configure(Rect2(0, 0, 0.001, length));
}
Variant RayShape2DSW::get_data() const {
- return length;
+ Dictionary d;
+ d["length"] = length;
+ d["slips_on_slope"] = slips_on_slope;
+ return d;
}
/*********************************************************/