Movement animations

This commit is contained in:
viktorljung
2016-03-04 09:39:16 +01:00
parent 7ba0e4ea9d
commit c1f5cf65a7
3 changed files with 117 additions and 51 deletions
@@ -129,14 +129,23 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
if (val > 0) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Run";
if(m_Crouching) {
aeb.NodeName = "Walk";
} else {
aeb.NodeName = "Run";
}
aeb.RootNode = playerModel;
aeb.Start = true;
m_EventBroker->Publish(aeb);
} else if (val < 0) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Run";
if (m_Crouching) {
aeb.NodeName = "Walk";
} else {
aeb.NodeName = "Run";
}
aeb.RootNode = playerModel;
aeb.Start = true;
aeb.Reverse = true;