summaryrefslogtreecommitdiffstats
path: root/scene/2d/collision_shape_2d.h
diff options
context:
space:
mode:
authorreduz <juan@okamstudio.com>2015-09-15 22:07:03 -0300
committerreduz <juan@okamstudio.com>2015-09-15 22:07:03 -0300
commit2580ca01e6b73a54def5a8f6e61d19509d3278ee (patch)
tree1cbe33b030a308a461dab8070bbe80b48c23d5c5 /scene/2d/collision_shape_2d.h
parent4773c19e6099a29fc19f566f6c590330e223c6d0 (diff)
downloadredot-engine-2580ca01e6b73a54def5a8f6e61d19509d3278ee.tar.gz
Ability to keep collisionshapes and collisionpolygons when running the game.
Works for 2D and 3D These are still just helpers in case you want to animate them or access them directly. Modifying the real shapes is still done via CollisionObject and CollisionObject2D APIs But an API was added so you can query which shapes from CollisionObject correspond to which CollisionShape. Have Fun!
Diffstat (limited to 'scene/2d/collision_shape_2d.h')
-rw-r--r--scene/2d/collision_shape_2d.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h
index 507912d31e..82e1137174 100644
--- a/scene/2d/collision_shape_2d.h
+++ b/scene/2d/collision_shape_2d.h
@@ -39,7 +39,13 @@ class CollisionShape2D : public Node2D {
Rect2 rect;
bool trigger;
bool unparenting;
+ bool can_update_body;
void _shape_changed();
+ int update_shape_index;
+
+ void _set_update_shape_index(int p_index);
+ int _get_update_shape_index() const;
+
protected:
void _update_parent();
@@ -55,6 +61,8 @@ public:
void set_trigger(bool p_trigger);
bool is_trigger() const;
+ int get_collision_object_shape_index() const { return _get_update_shape_index(); }
+
CollisionShape2D();
};