![]() |
YAPOG
0.0.1
Yet Another Pokemon Online Game
|
Component on which forces can be applied that generates a resulting move. More...
#include <PhysicsCore.hpp>
Public Member Functions | |
| virtual | ~PhysicsCore () |
| void | ApplyForce (const Vector2 &force) |
| Applies a force on the core. | |
| void | ResetForces () |
| const Vector2 & | GetMove () const |
| Gets the resulting move of this PhysicsCore from the applied forces on it. | |
| void | SetVelocityBounds (const Vector2 &min, const Vector2 &max) |
| Stores min and max bounds for the velocity of this PhysicsCore. | |
| void | RawSetVelocity (const Vector2 &velocity) |
| Forces the value of velocity for this PhysicsCore. To use to synchronize velocity from server to client. | |
IUpdateable members. | |
| virtual void | Update (const Time &dt) |
| Makes the object evolve for one frame of the game. | |
ICloneable members. | |
| virtual PhysicsCore * | Clone () const |
Public Member Functions inherited from yap::IUpdateable | |
| virtual | ~IUpdateable () |
Public Member Functions inherited from yap::ICloneable | |
| virtual | ~ICloneable () |
Public Attributes | |
Events. | |
| Event< const PhysicsCore &, const EmptyEventArgs & > | OnStopped |
| Event< const PhysicsCore &, const EmptyEventArgs & > | OnMoved |
| Event< const PhysicsCore &, const ChangeEventArgs < const Vector2 & > & > | OnVelocityChanged |
Protected Member Functions | |
| PhysicsCore () | |
| PhysicsCore (const PhysicsCore ©) | |
| const Vector2 & | GetVelocity () const |
| void | SetVelocity (const Vector2 &velocity) |
| void | ResetVelocity (const Vector2 &velocity) |
| Reset velocity value with velocity. To use in ResetVelocity (const Time&). Does not call OnVelocityChanged event. | |
Private Member Functions | |
| DISALLOW_ASSIGN (PhysicsCore) | |
| void | BoundVelocity (const Vector2 &velocity, Vector2 &result) |
| virtual void | HandleApplyForce (const Vector2 &force)=0 |
| virtual void | ResetVelocity (const Time &dt)=0 |
Private Attributes | |
| Vector2 | velocity_ |
| Vector2 | lastVelocity_ |
| Vector2 | minVelocity_ |
| Vector2 | maxVelocity_ |
| Vector2 | move_ |
Static Private Attributes | |
| static const Vector2 | DEFAULT_MIN_VELOCITY_BOUNDS |
| static const Vector2 | DEFAULT_MAX_VELOCITY_BOUNDS |
Component on which forces can be applied that generates a resulting move.
Definition at line 14 of file PhysicsCore.hpp.
|
virtual |
Definition at line 25 of file PhysicsCore.cpp.
|
protected |
Definition at line 13 of file PhysicsCore.cpp.
|
protected |
Definition at line 29 of file PhysicsCore.cpp.
| void yap::PhysicsCore::ApplyForce | ( | const Vector2 & | force | ) |
Applies a force on the core.
| force | Force to apply on the core. |
Definition at line 41 of file PhysicsCore.cpp.
Definition at line 129 of file PhysicsCore.cpp.
|
inlinevirtual |
Implements yap::ICloneable.
Reimplemented in yap::BasicPhysicsCore, yap::ForceToVelocityPhysicsCore, and yap::PersistentPhysicsCore.
Definition at line 51 of file PhysicsCore.hpp.
|
private |
| const Vector2 & yap::PhysicsCore::GetMove | ( | ) | const |
Gets the resulting move of this PhysicsCore from the applied forces on it.
Definition at line 54 of file PhysicsCore.cpp.
|
protected |
|
privatepure virtual |
Implemented in yap::BasicPhysicsCore, yap::ForceToVelocityPhysicsCore, and yap::PersistentPhysicsCore.
| void yap::PhysicsCore::RawSetVelocity | ( | const Vector2 & | velocity | ) |
Forces the value of velocity for this PhysicsCore. To use to synchronize velocity from server to client.
Definition at line 86 of file PhysicsCore.cpp.
| void yap::PhysicsCore::ResetForces | ( | ) |
|
protected |
Reset velocity value with velocity. To use in ResetVelocity (const Time&). Does not call OnVelocityChanged event.
| velocity | Value to change current velocity with. |
Definition at line 122 of file PhysicsCore.cpp.
|
privatepure virtual |
Implemented in yap::BasicPhysicsCore, yap::ForceToVelocityPhysicsCore, and yap::PersistentPhysicsCore.
|
protected |
Definition at line 96 of file PhysicsCore.cpp.
Stores min and max bounds for the velocity of this PhysicsCore.
| min | Min velocity that this PhysicsCore must have. |
| max | Max velocity that this PhysicsCore must have. |
Definition at line 76 of file PhysicsCore.cpp.
|
virtual |
Makes the object evolve for one frame of the game.
| dt | Delta time since the last frame. |
Implements yap::IUpdateable.
Definition at line 59 of file PhysicsCore.cpp.
|
staticprivate |
Definition at line 85 of file PhysicsCore.hpp.
|
staticprivate |
Definition at line 84 of file PhysicsCore.hpp.
|
private |
Definition at line 89 of file PhysicsCore.hpp.
|
private |
Definition at line 91 of file PhysicsCore.hpp.
|
private |
Definition at line 90 of file PhysicsCore.hpp.
|
private |
Definition at line 93 of file PhysicsCore.hpp.
| Event<const PhysicsCore&, const EmptyEventArgs&> yap::PhysicsCore::OnMoved |
Definition at line 57 of file PhysicsCore.hpp.
| Event<const PhysicsCore&, const EmptyEventArgs&> yap::PhysicsCore::OnStopped |
Definition at line 56 of file PhysicsCore.hpp.
| Event<const PhysicsCore&, const ChangeEventArgs<const Vector2&>&> yap::PhysicsCore::OnVelocityChanged |
Definition at line 59 of file PhysicsCore.hpp.
|
private |
Definition at line 87 of file PhysicsCore.hpp.