diff options
author | reduz <juan@okamstudio.com> | 2015-09-15 22:07:03 -0300 |
---|---|---|
committer | reduz <juan@okamstudio.com> | 2015-09-15 22:07:03 -0300 |
commit | 2580ca01e6b73a54def5a8f6e61d19509d3278ee (patch) | |
tree | 1cbe33b030a308a461dab8070bbe80b48c23d5c5 /scene/3d/collision_polygon.h | |
parent | 4773c19e6099a29fc19f566f6c590330e223c6d0 (diff) | |
download | redot-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/3d/collision_polygon.h')
-rw-r--r-- | scene/3d/collision_polygon.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index efb3666778..9b9afea34f 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -24,9 +24,17 @@ protected: BuildMode build_mode; Vector<Point2> polygon; + void _add_to_collision_object(Object *p_obj); void _update_parent(); + bool can_update_body; + int shape_from; + int shape_to; + + void _set_shape_range(const Vector2& p_range); + Vector2 _get_shape_range() const; + protected: void _notification(int p_what); @@ -43,6 +51,10 @@ public: Vector<Point2> get_polygon() const; virtual AABB get_item_rect() const; + + int get_collision_object_first_shape() const { return shape_from; } + int get_collision_object_last_shape() const { return shape_to; } + CollisionPolygon(); }; |