summaryrefslogtreecommitdiff
path: root/servers/physics_2d/shape_2d_sw.cpp
diff options
context:
space:
mode:
authorAndrea Catania <info@andreacatania.com>2018-02-19 20:59:57 +0100
committerAndrea Catania <info@andreacatania.com>2018-02-19 20:59:57 +0100
commitffc3ef86778f486823bedf66cc5a937fc09abe6a (patch)
tree15581f9cc2b0fedbacf20dbf989700682f6661c0 /servers/physics_2d/shape_2d_sw.cpp
parentcbdd410a6f476503ee4bc27ac2f475a73960236d (diff)
Improved ray shape (2D and 3D) by addiing the possibility to act as regular shape
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 4605516fe0..abd513d936 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;
}
/*********************************************************/