YAPOG  0.0.1
Yet Another Pokemon Online Game
PhysicsCore.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_PHYSICSCORE_HPP
2 # define YAPOG_PHYSICSCORE_HPP
3 
4 # include "YAPOG/Macros.hpp"
9 
10 namespace yap
11 {
15  , public ICloneable
16  {
18 
19  public:
20 
21  virtual ~PhysicsCore ();
22 
25  void ApplyForce (const Vector2& force);
26 
27  void ResetForces ();
28 
32  const Vector2& GetMove () const;
33 
38  void SetVelocityBounds (const Vector2& min, const Vector2& max);
39 
42  void RawSetVelocity (const Vector2& velocity);
43 
46  virtual void Update (const Time& dt);
48 
51  virtual PhysicsCore* Clone () const { return nullptr; }
53 
58  Event<const PhysicsCore&,
61 
62  protected:
63 
64  PhysicsCore ();
65 
66  PhysicsCore (const PhysicsCore& copy);
67 
68  const Vector2& GetVelocity () const;
69  void SetVelocity (const Vector2& velocity);
70 
75  void ResetVelocity (const Vector2& velocity);
76 
77  private:
78 
79  void BoundVelocity (const Vector2& velocity, Vector2& result);
80 
81  virtual void HandleApplyForce (const Vector2& force) = 0;
82  virtual void ResetVelocity (const Time& dt) = 0;
83 
86 
88 
92 
94  };
95 } // namespace yap
96 
97 #endif // YAPOG_PHYSICSCORE_HPP