Merge branch 'Movement' of github.com:teamfisk/TacticalZ into Movement
This commit is contained in:
@@ -163,6 +163,7 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Run";
|
||||
aeb.RootNode = firstPersonModel;
|
||||
aeb.SingleLevelBlend = true;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
@@ -172,6 +173,7 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Run";
|
||||
aeb.RootNode = firstPersonModel;
|
||||
aeb.SingleLevelBlend = true;
|
||||
aeb.Start = true;
|
||||
aeb.Reverse = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
@@ -211,10 +213,10 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
}
|
||||
}
|
||||
|
||||
//Animation
|
||||
if (glm::length2(m_Movement) < 0.25f) {
|
||||
//Blend to Idle
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
glm::vec2 movementXZ = glm::vec2(m_Movement.x, m_Movement.z);
|
||||
if (glm::length(movementXZ) < 0.1f) {
|
||||
//Blend to Idle
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
@@ -233,10 +235,8 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Blend to movement
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
} else {
|
||||
//Blend to movement
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
@@ -248,8 +248,7 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (glm::length2(m_Movement) > 0) {
|
||||
if (glm::length(m_Movement) > 0) {
|
||||
m_Movement = glm::normalize(m_Movement);
|
||||
|
||||
//Animation
|
||||
|
||||
@@ -49,9 +49,7 @@ public:
|
||||
next = next->Child[0];
|
||||
}
|
||||
}
|
||||
|
||||
return next;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -82,6 +80,7 @@ public:
|
||||
BlendTree::Node* FirstCommonParent(Node* node1, Node* node2);
|
||||
|
||||
EntityWrapper GetSubTreeRoot(std::string nodeName);
|
||||
std::vector<EntityWrapper> GetSubTreeRoots(std::string nodeName);
|
||||
|
||||
std::vector<EntityWrapper> GetSingleLevelRoots(std::string name);
|
||||
std::vector<EntityWrapper> GetEntitesByName(std::string name);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Core/EntityFile.h"
|
||||
#include "Core/EPlayerDamage.h"
|
||||
#include "Common.h"
|
||||
#include "SpawnerSystem.h"
|
||||
|
||||
class BoostSystem : public System
|
||||
{
|
||||
@@ -17,5 +18,7 @@ private:
|
||||
bool OnPlayerDamage(Events::PlayerDamage& e);
|
||||
|
||||
std::string DetermineClass(EntityWrapper player);
|
||||
|
||||
void giveAmmo(EntityWrapper giver, EntityWrapper receiver);
|
||||
};
|
||||
#endif
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
bool playerInFirstPerson(EntityWrapper player);
|
||||
|
||||
bool dealDamage(ComponentWrapper cWeapon, WeaponInfo& wi);
|
||||
void giveAmmo(ComponentWrapper cWeapon, WeaponInfo& wi, EntityWrapper receiver);
|
||||
// void giveAmmo(ComponentWrapper cWeapon, WeaponInfo& wi, EntityWrapper receiver);
|
||||
|
||||
|
||||
void CheckAmmo(ComponentWrapper cWeapon, WeaponInfo& wi);
|
||||
|
||||
@@ -305,6 +305,8 @@ private:
|
||||
wi.ThirdPersonEntity = thirdPersonWeapon;
|
||||
wi.ThirdPersonPlayerModel = thirdPersonWeapon.FirstParentWithComponent("Model");
|
||||
|
||||
player["Player"]["CurrentWeapon"] = cWeapon.Info.Name;
|
||||
|
||||
OnEquip(cWeapon, wi);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user