WIP. Improving player walk logic.

This commit is contained in:
stiffly
2016-02-05 17:21:48 +01:00
parent febbadbd01
commit 454eef8225
5 changed files with 47 additions and 52 deletions
+4 -4
View File
@@ -69,12 +69,11 @@ protected:
void stopSound(Source* source);
void playerJumps();
void playerStep(double dt);
EntityID createChildEmitter();
EntityID createChildEmitter(EntityWrapper localPlayer);
// Logic
World* m_World = nullptr;
EventBroker* m_EventBroker = nullptr;
std::unordered_map<EntityID, Source*> m_Sources;
private:
// Help functions for working with OpenaAL
@@ -98,7 +97,8 @@ private:
void setGain(Source* source, float gain);
void setSoundProperties(Source* source, ComponentWrapper* soundComponent);
std::unordered_map<EntityID, Source*> m_Sources;
// OpenAL system variables
ALCdevice* m_ALCdevice = nullptr;
@@ -109,7 +109,7 @@ private:
float m_BGMVolumeChannel = 1.0f;
float m_SFXVolumeChannel = 1.0f;
bool m_EditorEnabled = false;
EntityID m_LocalPlayer = EntityID_Invalid;
EntityWrapper m_LocalPlayer = EntityWrapper();
std::default_random_engine generator;
// Events
+3 -1
View File
@@ -9,7 +9,9 @@ public:
LifetimeSystem(World* world, EventBroker* eventBroker)
: System(world, eventBroker)
, PureSystem("Lifetime")
{ }
{
LOG_INFO("ASDASDASSA");
}
virtual void Update(double dt) override;
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cLifetime, double dt) override;
+3 -2
View File
@@ -20,8 +20,9 @@ private:
EventBroker* m_EventBroker = nullptr;
// TODO: WIP Update this
double m_TimeSinceLastFootstep = 0.0;
const double m_PlayerFootstepInterval = 1.0;
double m_DistanceMoved = 0.0;
const float m_PlayerStepLength = 1.0;
glm::vec3 m_LastPosition = glm::vec3();
bool m_LeftFoot = false;
EventRelay<SoundSystem, Events::PlayerSpawned> m_EPlayerSpawned;