summaryrefslogtreecommitdiff
path: root/scene/resources/box_shape.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov <maxmight@gmail.com>2015-10-13 05:01:54 +0300
committerKostadin Damyanov <maxmight@gmail.com>2015-10-13 05:01:54 +0300
commit29caf2bb5be061cd1ab014cf938f2c71d0bd2663 (patch)
tree859a0c3d2805198672c1e22d4780c3eb68f55a57 /scene/resources/box_shape.cpp
parentc5f574b914b3cb11d97ae616df4a0bced45bb17c (diff)
parent79e5ced7e668fa53567ac6aaf5a26393cea6c9a2 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'scene/resources/box_shape.cpp')
-rw-r--r--scene/resources/box_shape.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp
index 22ee9f8c09..ba29a1b601 100644
--- a/scene/resources/box_shape.cpp
+++ b/scene/resources/box_shape.cpp
@@ -30,6 +30,25 @@
#include "servers/physics_server.h"
+Vector<Vector3> BoxShape::_gen_debug_mesh_lines() {
+
+
+ Vector<Vector3> lines;
+ AABB aabb;
+ aabb.pos=-get_extents();
+ aabb.size=aabb.pos*-2;
+
+ for(int i=0;i<12;i++) {
+ Vector3 a,b;
+ aabb.get_edge(i,a,b);
+ lines.push_back(a);
+ lines.push_back(b);
+ }
+
+
+ return lines;
+}
+
void BoxShape::_update_shape() {
PhysicsServer::get_singleton()->shape_set_data(get_shape(),extents);