From 1ff91a5c5d595342ec8bb7b992ea0dfdf4fdabb4 Mon Sep 17 00:00:00 2001 From: viktorljung Date: Fri, 4 Mar 2016 02:30:05 +0100 Subject: [PATCH] fixup! Blend duration can now be 0.0 Commited input test stuff --- include/Engine/Rendering/AnimationSystem.h | 2 -- src/Engine/Rendering/AnimationSystem.cpp | 40 ---------------------- 2 files changed, 42 deletions(-) diff --git a/include/Engine/Rendering/AnimationSystem.h b/include/Engine/Rendering/AnimationSystem.h index ec8db2dd..30c6fce5 100644 --- a/include/Engine/Rendering/AnimationSystem.h +++ b/include/Engine/Rendering/AnimationSystem.h @@ -28,8 +28,6 @@ private: EventRelay m_EAutoAnimationBlend; bool OnAutoAnimationBlend(Events::AutoAnimationBlend& e); - EventRelay m_EInputCommand; - bool OnInputCommand(const Events::InputCommand& e); std::unordered_map m_AutoBlendQueues; }; diff --git a/src/Engine/Rendering/AnimationSystem.cpp b/src/Engine/Rendering/AnimationSystem.cpp index 9d785a5c..5bac27f9 100644 --- a/src/Engine/Rendering/AnimationSystem.cpp +++ b/src/Engine/Rendering/AnimationSystem.cpp @@ -4,7 +4,6 @@ AnimationSystem::AnimationSystem(SystemParams params) : System(params) { EVENT_SUBSCRIBE_MEMBER(m_EAutoAnimationBlend, &AnimationSystem::OnAutoAnimationBlend); - EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &AnimationSystem::OnInputCommand); } void AnimationSystem::Update(double dt) @@ -221,42 +220,3 @@ bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e) m_AutoBlendQueues[subTreeRoot].Insert(abj); return true; } - -bool AnimationSystem::OnInputCommand(const Events::InputCommand& e) -{ - if (e.Value == 1.0f) { - if (e.Command == "Shoot") { - auto blendComponents = m_World->GetComponents("Model"); - - if (blendComponents == nullptr) { - return false; - } - for (auto& bc : *blendComponents) { - EntityWrapper entity = EntityWrapper(m_World, bc.EntityID); - - if (entity.Name() == "Hands") { - { - Events::AutoAnimationBlend aeb; - aeb.Duration = 0.0; - aeb.NodeName = "Fire"; - aeb.RootNode = entity; - aeb.Start = true; - aeb.Restart = true; - m_EventBroker->Publish(aeb); - } - { - Events::AutoAnimationBlend aeb; - aeb.Duration = 0.1; - aeb.NodeName = "Idle"; - aeb.RootNode = entity; - aeb.Delay = 0.0; - aeb.Start = true; - aeb.Restart = false; - aeb.AnimationEntity = entity.FirstChildByName("PrimaryBlendTree").FirstChildByName("Fire"); - m_EventBroker->Publish(aeb); - } - } - } - } - } -}