neoGFX
C++ GPU-oriented GUI library and app/game creation framework.
i_collidable_object.hpp
Go to the documentation of this file.
1 // i_collidable_object.hpp
2 /*
3  neogfx C++ GUI Library
4  Copyright (c) 2015 Leigh Johnston. All Rights Reserved.
5 
6  This program is free software: you can redistribute it and / or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #pragma once
20 
21 #include <neogfx/neogfx.hpp>
23 #include "i_game_object.hpp"
24 
25 namespace neogfx
26 {
27  class i_collidable_object : public virtual i_game_object
28  {
29  public:
30  virtual const neogfx::aabb& aabb() const = 0;
31  virtual const neogfx::aabb& saved_aabb() const = 0;
32  virtual void save_aabb() = 0;
33  virtual void clear_saved_aabb() = 0;
34  virtual bool collidable() const = 0;
35  virtual uint64_t collision_mask() const { return 0ull; }
36  virtual void set_collision_mask(uint64_t) { throw not_implemented(); }
37  virtual bool has_collided(const i_collidable_object& aOther) const = 0;
38  virtual void collided(i_collidable_object& aOther) = 0;
39  public:
40  virtual uint32_t collision_update_id() const = 0;
41  virtual void set_collision_update_id(uint32_t aCollisionCheckId) = 0;
42  public:
43  virtual void clear_aabb_cache() = 0;
44  };
45 }
virtual void set_collision_mask(uint64_t)
virtual bool has_collided(const i_collidable_object &aOther) const =0
virtual uint32_t collision_update_id() const =0
virtual uint64_t collision_mask() const
virtual void clear_saved_aabb()=0
virtual void save_aabb()=0
virtual void collided(i_collidable_object &aOther)=0
virtual void clear_aabb_cache()=0
virtual const neogfx::aabb & aabb() const =0
virtual void set_collision_update_id(uint32_t aCollisionCheckId)=0
virtual bool collidable() const =0
virtual const neogfx::aabb & saved_aabb() const =0