neoGFX
C++ GPU-oriented GUI library and app/game creation framework.
i_sprite.hpp
Go to the documentation of this file.
1 // i_sprite.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>
22 #include <chrono>
23 #include <boost/optional.hpp>
25 #include <neogfx/core/path.hpp>
26 #include "i_shape.hpp"
27 #include "i_physical_object.hpp"
28 
29 namespace neogfx
30 {
31  class i_sprite : public virtual i_shape, public virtual i_physical_object
32  {
33  // types
34  public:
39  // object
40  public:
41  virtual ~i_sprite() {}
42  // physics
43  public:
44  virtual bool update(const optional_time_interval& aNow, const vec3& aForce) = 0;
45  virtual const optional_time_interval& update_time() const = 0;
46  virtual void set_update_time(const optional_time_interval& aLastUpdateTime) = 0;
47  // geometry
48  public:
49  virtual vec3 origin() const = 0;
50  virtual vec3 position() const = 0;
51  virtual void set_origin(const vec3& aOrigin) = 0;
52  virtual void set_position(const vec3& aPosition) = 0;
53  // physics
54  public:
55  virtual const optional_path& path() const = 0;
56  virtual void set_path(const optional_path& aPath) = 0;
57  };
58 }
boost::optional< time_interval > optional_time_interval
virtual ~i_sprite()
Definition: i_sprite.hpp:41
boost::optional< step_time_interval > optional_step_time_interval
virtual void set_origin(const vec3 &aOrigin)=0
virtual const optional_path & path() const =0
virtual void set_path(const optional_path &aPath)=0
virtual void set_update_time(const optional_time_interval &aLastUpdateTime)=0
virtual void set_position(const vec3 &aPosition)=0
virtual bool update(const optional_time_interval &aNow, const vec3 &aForce)=0
boost::optional< path > optional_path
Definition: path.hpp:248
i_physical_object::step_time_interval step_time_interval
Definition: i_sprite.hpp:37
i_physical_object::optional_time_interval optional_time_interval
Definition: i_sprite.hpp:36
virtual vec3 position() const =0
i_physical_object::time_interval time_interval
Definition: i_sprite.hpp:35
i_physical_object::optional_step_time_interval optional_step_time_interval
Definition: i_sprite.hpp:38
virtual vec3 origin() const =0
virtual const optional_time_interval & update_time() const =0