HitLagSystem implemented.

This commit is contained in:
PlatinumSkink
2015-09-30 16:42:35 +02:00
parent c31ff4cfcb
commit c63ec035a7
11 changed files with 147 additions and 90 deletions
+1 -12
View File
@@ -14,7 +14,6 @@
#include "Physics/EContact.h"
#include "Physics/ESetImpulse.h"
#include "Game/EPause.h"
#include "Game/EHitLag.h"
#include "Game/CPad.h"
#include "Game/CBall.h"
#include "Transform/TransformSystem.h"
@@ -56,10 +55,8 @@ public:
// Called when an entity is removed
void OnEntityRemoved(EntityID entity) override;
bool Pause() const { return m_Pause; }
bool IsPaused() const { return m_Pause; }
void SetPause(const bool& pause) { m_Pause = pause; }
bool HitLag() const { return m_HitLag; }
void SetHitLag(const bool& hitLag) { m_HitLag = hitLag; }
private:
b2Vec2 m_Gravity;
@@ -68,16 +65,8 @@ private:
double m_Accumulator;
bool m_Pause = false;
bool m_HitLag = false;
float m_Time;
float m_SlowdownTime;
float m_HitLagTimer = 0;
float m_HitLagPlacement = 0;
dd::EventRelay<PhysicsSystem, dd::Events::Pause> m_EPause;
dd::EventRelay<PhysicsSystem, dd::Events::HitLag> m_EHitLag;
bool OnPause(const dd::Events::Pause &event);
bool OnHitLag(const dd::Events::HitLag &event);
int m_VelocityIterations, m_PositionIterations;