From 0b3689b0aea018e9ed01b9e8474ac4a94aea3b75 Mon Sep 17 00:00:00 2001 From: zvon Date: Mon, 31 May 2021 18:54:17 +0200 Subject: [PATCH] SDLPP: add option to remove collisions --- sdlpp/sdlpp_renderobject.cpp | 3 +++ sdlpp/sdlpp_renderobject.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/sdlpp/sdlpp_renderobject.cpp b/sdlpp/sdlpp_renderobject.cpp index 101e681..d894c6e 100644 --- a/sdlpp/sdlpp_renderobject.cpp +++ b/sdlpp/sdlpp_renderobject.cpp @@ -63,6 +63,9 @@ RenderObject::colidesWith( const RenderObject &other ) const { } return ret; } +void RenderObject::removeCollisions() { + collisions.clear(); +} bool RenderObject::hasCollisions() const { return !collisions.empty(); } diff --git a/sdlpp/sdlpp_renderobject.hpp b/sdlpp/sdlpp_renderobject.hpp index ef9f97e..d67a1a9 100644 --- a/sdlpp/sdlpp_renderobject.hpp +++ b/sdlpp/sdlpp_renderobject.hpp @@ -59,6 +59,7 @@ public: collisionWidth(), collisionHeight(), getId() ); } + void removeCollisions(); bool hasCollisions() const; const std::vector< std::shared_ptr< CollisionPolygon > > & getCollisions() const;