3rd person animations synced with 1st person animations
This commit is contained in:
@@ -23,7 +23,7 @@ struct EntityWrapper
|
|||||||
|
|
||||||
static const EntityWrapper Invalid;
|
static const EntityWrapper Invalid;
|
||||||
|
|
||||||
const std::string Name();
|
const std::string Name() const;
|
||||||
bool HasComponent(const std::string& componentType);
|
bool HasComponent(const std::string& componentType);
|
||||||
void AttachComponent(const char* componentName);
|
void AttachComponent(const char* componentName);
|
||||||
EntityWrapper Parent();
|
EntityWrapper Parent();
|
||||||
|
|||||||
@@ -153,6 +153,31 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
m_EventBroker->Publish(aeb);
|
m_EventBroker->Publish(aeb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
||||||
|
if (firstPersonModel.Valid()) {
|
||||||
|
if (val > 0) { // Walk/Run
|
||||||
|
if (!m_Crouching) {
|
||||||
|
Events::AutoAnimationBlend aeb;
|
||||||
|
aeb.Duration = 0.1;
|
||||||
|
aeb.NodeName = "Run";
|
||||||
|
aeb.RootNode = firstPersonModel;
|
||||||
|
aeb.Start = true;
|
||||||
|
m_EventBroker->Publish(aeb);
|
||||||
|
}
|
||||||
|
} else if (val < 0) { // Walk/run Backwards
|
||||||
|
if (!m_Crouching) {
|
||||||
|
Events::AutoAnimationBlend aeb;
|
||||||
|
aeb.Duration = 0.1;
|
||||||
|
aeb.NodeName = "Run";
|
||||||
|
aeb.RootNode = firstPersonModel;
|
||||||
|
aeb.Start = true;
|
||||||
|
aeb.Reverse = true;
|
||||||
|
m_EventBroker->Publish(aeb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.Command == "Right") {
|
if (e.Command == "Right") {
|
||||||
@@ -187,27 +212,36 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Animation
|
//Animation
|
||||||
if (glm::length2(m_Movement) < 0.1f) {
|
if (glm::length2(m_Movement) < 0.25f) {
|
||||||
//Blend to Idle
|
//Blend to Idle
|
||||||
if (m_PlayerEntity.Valid()) {
|
if (m_PlayerEntity.Valid()) {
|
||||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||||
if (playerModel.Valid()) {
|
if (playerModel.Valid()) {
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.1;
|
||||||
aeb.NodeName = "Idle";
|
aeb.NodeName = "Idle";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
|
aeb.Start = true;
|
||||||
|
m_EventBroker->Publish(aeb);
|
||||||
|
}
|
||||||
|
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
||||||
|
if (firstPersonModel.Valid()) {
|
||||||
|
Events::AutoAnimationBlend aeb;
|
||||||
|
aeb.Duration = 0.1;
|
||||||
|
aeb.NodeName = "Idle";
|
||||||
|
aeb.RootNode = firstPersonModel;
|
||||||
|
aeb.Start = true;
|
||||||
m_EventBroker->Publish(aeb);
|
m_EventBroker->Publish(aeb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//Blend to movement
|
//Blend to movement
|
||||||
if (m_PlayerEntity.Valid()) {
|
if (m_PlayerEntity.Valid()) {
|
||||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||||
if (playerModel.Valid()) {
|
if (playerModel.Valid()) {
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.1;
|
||||||
aeb.NodeName = "MovementBlend";
|
aeb.NodeName = "DirectionBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
m_EventBroker->Publish(aeb);
|
m_EventBroker->Publish(aeb);
|
||||||
}
|
}
|
||||||
@@ -226,7 +260,7 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
glm::vec2 direction = glm::normalize(glm::vec2(m_Movement.x, m_Movement.z));
|
glm::vec2 direction = glm::normalize(glm::vec2(m_Movement.x, m_Movement.z));
|
||||||
double weight = glm::abs(glm::dot(glm::vec2(1, 0), direction));
|
double weight = glm::abs(glm::dot(glm::vec2(1, 0), direction));
|
||||||
Events::SetBlendWeight sbw;
|
Events::SetBlendWeight sbw;
|
||||||
sbw.NodeName = "MovementBlend";
|
sbw.NodeName = "DirectionBlend";
|
||||||
sbw.Weight = weight;
|
sbw.Weight = weight;
|
||||||
sbw.RootNode = playerModel;
|
sbw.RootNode = playerModel;
|
||||||
m_EventBroker->Publish(sbw);
|
m_EventBroker->Publish(sbw);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:NetworkComponent/>
|
|
||||||
<c:AABB>
|
<c:AABB>
|
||||||
<Origin X="0" Y="0.772000015" Z="0"/>
|
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||||
<Size X="1" Y="1.60000002" Z="1"/>
|
<Size X="1" Y="1.60000002" Z="1"/>
|
||||||
@@ -22,6 +21,7 @@
|
|||||||
</c:DefenderWeapon>
|
</c:DefenderWeapon>
|
||||||
<c:DoubleJump/>
|
<c:DoubleJump/>
|
||||||
<c:Health/>
|
<c:Health/>
|
||||||
|
<c:NetworkComponent/>
|
||||||
<c:Physics>
|
<c:Physics>
|
||||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||||
</c:Physics>
|
</c:Physics>
|
||||||
@@ -463,7 +463,7 @@
|
|||||||
<Color A="1" B="0.392156869" G="0.392156869" R="0.392156869"/>
|
<Color A="1" B="0.392156869" G="0.392156869" R="0.392156869"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Icons/Abilities/Superman-01.png</DiffuseTexture>
|
<DiffuseTexture>Textures\Icons\Abilities\Superman-01.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
<DepthSort>false</DepthSort>
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0.206628323" G="0.78039217" R="0.192802757"/>
|
<Color A="1" B="0.206628323" G="0.78039217" R="0.192802757"/>
|
||||||
@@ -504,25 +504,25 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="PrimaryAttachment">
|
<Entity name="PrimaryAttachment">
|
||||||
<Components>
|
<Components>
|
||||||
<c:WeaponAttachment>
|
|
||||||
<Weapon>AssaultWeapon</Weapon>
|
|
||||||
</c:WeaponAttachment>
|
|
||||||
<c:Spawner>
|
<c:Spawner>
|
||||||
<EntityFile>Schema/Entities/WeaponAssaultBlueView.xml</EntityFile>
|
<EntityFile>Schema/Entities/WeaponAssaultBlueView.xml</EntityFile>
|
||||||
</c:Spawner>
|
</c:Spawner>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
|
<c:WeaponAttachment>
|
||||||
|
<Weapon>AssaultWeapon</Weapon>
|
||||||
|
</c:WeaponAttachment>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="SecondaryAttachment">
|
<Entity name="SecondaryAttachment">
|
||||||
<Components>
|
<Components>
|
||||||
<c:WeaponAttachment>
|
|
||||||
<Weapon>DefenderWeapon</Weapon>
|
|
||||||
</c:WeaponAttachment>
|
|
||||||
<c:Spawner>
|
<c:Spawner>
|
||||||
<EntityFile>Schema/Entities/WeaponDefenderBlueView.xml</EntityFile>
|
<EntityFile>Schema/Entities/WeaponDefenderBlueView.xml</EntityFile>
|
||||||
</c:Spawner>
|
</c:Spawner>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
|
<c:WeaponAttachment>
|
||||||
|
<Weapon>DefenderWeapon</Weapon>
|
||||||
|
</c:WeaponAttachment>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
@@ -566,19 +566,19 @@
|
|||||||
<c:BoneAttachment>
|
<c:BoneAttachment>
|
||||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.17052114" Y="1.03320956" Z="-0.224843055"/>
|
||||||
|
<Orientation X="-0.035638921" Y="-0.0872893855" Z="0.133119702"/>
|
||||||
|
</c:Transform>
|
||||||
<c:WeaponAttachment>
|
<c:WeaponAttachment>
|
||||||
<Weapon>AssaultWeapon</Weapon>
|
<Weapon>AssaultWeapon</Weapon>
|
||||||
<Person>
|
<Person>
|
||||||
<ThirdPerson/>
|
<ThirdPerson/>
|
||||||
</Person>
|
</Person>
|
||||||
</c:WeaponAttachment>
|
</c:WeaponAttachment>
|
||||||
<c:Spawner>
|
|
||||||
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
|
|
||||||
</c:Spawner>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.153499424" Y="1.04221034" Z="-0.231716871"/>
|
|
||||||
<Orientation X="-0.0108785164" Y="-0.0253766086" Z="0.137640417"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
@@ -587,26 +587,26 @@
|
|||||||
<c:BoneAttachment>
|
<c:BoneAttachment>
|
||||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.17052114" Y="1.03320956" Z="-0.224843055"/>
|
||||||
|
<Orientation X="-0.035638921" Y="-0.0872893855" Z="0.133119702"/>
|
||||||
|
</c:Transform>
|
||||||
<c:WeaponAttachment>
|
<c:WeaponAttachment>
|
||||||
<Weapon>SidearmWeapon</Weapon>
|
<Weapon>SidearmWeapon</Weapon>
|
||||||
<Person>
|
<Person>
|
||||||
<ThirdPerson/>
|
<ThirdPerson/>
|
||||||
</Person>
|
</Person>
|
||||||
</c:WeaponAttachment>
|
</c:WeaponAttachment>
|
||||||
<c:Spawner>
|
|
||||||
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
|
|
||||||
</c:Spawner>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.153499424" Y="1.04221034" Z="-0.231716871"/>
|
|
||||||
<Orientation X="-0.0108785164" Y="-0.0253766086" Z="0.137640417"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="BlendTreeLower">
|
<Entity name="BlendTreeLower">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Blend>
|
<c:Blend>
|
||||||
<Pose1>StandCrouchBlend</Pose1>
|
<Pose1>MovementBlend</Pose1>
|
||||||
<Pose2>JumpDashBlend</Pose2>
|
<Pose2>JumpDashBlend</Pose2>
|
||||||
<Weight>2.5146881298480398e-63</Weight>
|
<Weight>2.5146881298480398e-63</Weight>
|
||||||
<SubTreeRoot>true</SubTreeRoot>
|
<SubTreeRoot>true</SubTreeRoot>
|
||||||
@@ -628,7 +628,7 @@
|
|||||||
<Entity name="CrouchMovement">
|
<Entity name="CrouchMovement">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Blend>
|
<c:Blend>
|
||||||
<Pose1>MovementBlend</Pose1>
|
<Pose1>DirectionBlend</Pose1>
|
||||||
<Pose2>Idle</Pose2>
|
<Pose2>Idle</Pose2>
|
||||||
<Weight>1</Weight>
|
<Weight>1</Weight>
|
||||||
</c:Blend>
|
</c:Blend>
|
||||||
@@ -659,7 +659,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>CrouchStrafeLeftF</AnimationName>
|
<AnimationName>CrouchStrafeLeftF</AnimationName>
|
||||||
<Time>0.15801023731376773</Time>
|
<Time>0.79179726223533642</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -670,7 +670,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>CrouchStrafeRightF</AnimationName>
|
<AnimationName>CrouchStrafeRightF</AnimationName>
|
||||||
<Time>0.085331699264550309</Time>
|
<Time>0.719118724186119</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -683,7 +683,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>CrouchWalkF</AnimationName>
|
<AnimationName>CrouchWalkF</AnimationName>
|
||||||
<Time>0.86370568444195328</Time>
|
<Time>0.49749270936352197</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -696,7 +696,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>CrouchF</AnimationName>
|
<AnimationName>CrouchF</AnimationName>
|
||||||
<Time>0.99862473341677438</Time>
|
<Time>1.1707202063102131</Time>
|
||||||
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -707,7 +708,7 @@
|
|||||||
<Entity name="StandMovement">
|
<Entity name="StandMovement">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Blend>
|
<c:Blend>
|
||||||
<Pose1>MovementBlend</Pose1>
|
<Pose1>DirectionBlend</Pose1>
|
||||||
<Pose2>Idle</Pose2>
|
<Pose2>Idle</Pose2>
|
||||||
<Weight>1</Weight>
|
<Weight>1</Weight>
|
||||||
</c:Blend>
|
</c:Blend>
|
||||||
@@ -738,7 +739,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>WalkF</AnimationName>
|
<AnimationName>WalkF</AnimationName>
|
||||||
<Time>0.36886031385172657</Time>
|
<Time>0.0026473387732952602</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -749,7 +750,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>RunF</AnimationName>
|
<AnimationName>RunF</AnimationName>
|
||||||
<Time>0.64087381787562947</Time>
|
<Time>0.60179430680919843</Time>
|
||||||
|
<Speed>2</Speed>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -772,7 +774,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>StrafeLeftF</AnimationName>
|
<AnimationName>StrafeLeftF</AnimationName>
|
||||||
<Time>0.55045293488526426</Time>
|
<Time>0.20450294221067544</Time>
|
||||||
|
<Speed>2</Speed>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -783,7 +786,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>StrafeRightF</AnimationName>
|
<AnimationName>StrafeRightF</AnimationName>
|
||||||
<Time>0.57396846476537888</Time>
|
<Time>0.28191395104664174</Time>
|
||||||
|
<Speed>2</Speed>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -798,7 +802,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>IdleF</AnimationName>
|
<AnimationName>IdleF</AnimationName>
|
||||||
<Time>1.0177411602680451</Time>
|
<Time>0.96819454985941356</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -856,7 +860,7 @@
|
|||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>DashForwardF</AnimationName>
|
<AnimationName>DashForwardF</AnimationName>
|
||||||
<Time>1</Time>
|
<Time>1</Time>
|
||||||
<Speed>2</Speed>
|
<Speed>1.7999999523162842</Speed>
|
||||||
<Loop>false</Loop>
|
<Loop>false</Loop>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -868,7 +872,7 @@
|
|||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>DashBackwardF</AnimationName>
|
<AnimationName>DashBackwardF</AnimationName>
|
||||||
<Time>1</Time>
|
<Time>1</Time>
|
||||||
<Speed>2</Speed>
|
<Speed>1.7999999523162842</Speed>
|
||||||
<Loop>false</Loop>
|
<Loop>false</Loop>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -887,24 +891,24 @@
|
|||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="DashLeft">
|
<Entity name="DashRight">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>DashLeftF</AnimationName>
|
<AnimationName>DashRightF</AnimationName>
|
||||||
<Time>1</Time>
|
<Time>1</Time>
|
||||||
<Speed>2</Speed>
|
<Speed>1.7999999523162842</Speed>
|
||||||
<Loop>false</Loop>
|
<Loop>false</Loop>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="DashRight">
|
<Entity name="DashLeft">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>DashRightF</AnimationName>
|
<AnimationName>DashLeftF</AnimationName>
|
||||||
<Time>1</Time>
|
<Time>1</Time>
|
||||||
<Speed>2</Speed>
|
<Speed>1.7999999523162842</Speed>
|
||||||
<Loop>false</Loop>
|
<Loop>false</Loop>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
@@ -981,7 +985,7 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="MovementBlend">
|
<Entity name="MovementBlend2">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Blend>
|
<c:Blend>
|
||||||
<Pose1>Idle</Pose1>
|
<Pose1>Idle</Pose1>
|
||||||
@@ -995,6 +999,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>IdleAssaultRifleU</AnimationName>
|
<AnimationName>IdleAssaultRifleU</AnimationName>
|
||||||
|
<Time>1.6337870249215687</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
<Additive>true</Additive>
|
<Additive>true</Additive>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
@@ -1006,6 +1011,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName>IdleAssaultRifleU</AnimationName>
|
<AnimationName>IdleAssaultRifleU</AnimationName>
|
||||||
|
<Time>1.6337870249215687</Time>
|
||||||
<Play>true</Play>
|
<Play>true</Play>
|
||||||
<Additive>true</Additive>
|
<Additive>true</Additive>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
|
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
|
||||||
|
|
||||||
const std::string EntityWrapper::Name()
|
const std::string EntityWrapper::Name() const
|
||||||
{
|
{
|
||||||
return World->GetName(ID);
|
return World->GetName(ID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,9 +127,12 @@ void AnimationSystem::UpdateAnimations(double dt)
|
|||||||
void AnimationSystem::UpdateWeights(double dt)
|
void AnimationSystem::UpdateWeights(double dt)
|
||||||
{
|
{
|
||||||
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
||||||
|
LOG_INFO("%s", it->first.Name().c_str());
|
||||||
|
it->second.PrintQueue();
|
||||||
|
|
||||||
if(it->second.HasActiveBlendJob()) {
|
if(it->second.HasActiveBlendJob()) {
|
||||||
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
||||||
|
LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
||||||
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
||||||
if (blendTree != nullptr) {
|
if (blendTree != nullptr) {
|
||||||
if (blendJob.Duration != 0.0) {
|
if (blendJob.Duration != 0.0) {
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return blendInfo;
|
return blendInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +332,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return blendInfo;
|
return blendInfo;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
// Set third person model aim pitch
|
// Set third person model aim pitch
|
||||||
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
||||||
if (playerModel.Valid()) {
|
if (playerModel.Valid()) {
|
||||||
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("AimPrimary");
|
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("Aim");
|
||||||
if(aimPrimaryEntity.Valid()){
|
if(aimPrimaryEntity.Valid()){
|
||||||
if(aimPrimaryEntity.HasComponent("Animation")) {
|
if(aimPrimaryEntity.HasComponent("Animation")) {
|
||||||
float pitch = cameraOrientation.x;
|
float pitch = cameraOrientation.x;
|
||||||
@@ -93,14 +93,6 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
(double&)aimPrimaryEntity["Animation"]["Time"] = time;
|
(double&)aimPrimaryEntity["Animation"]["Time"] = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EntityWrapper aimSecondaryEntity = playerModel.FirstChildByName("AimSecondary");
|
|
||||||
if (aimSecondaryEntity.Valid()) {
|
|
||||||
if (aimSecondaryEntity.HasComponent("Animation")) {
|
|
||||||
float pitch = cameraOrientation.x;
|
|
||||||
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
|
|
||||||
(double&)aimSecondaryEntity["Animation"]["Time"] = time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +204,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.25;
|
aeb.Duration = 0.25;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
@@ -243,11 +235,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.25;
|
aeb.Duration = 0.25;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
aeb.AnimationEntity = playerModel.FirstChildByName("Jump");
|
aeb.AnimationEntity = playerModel.FirstChildByName("BlendTreeLower").FirstChildByName("Jump");
|
||||||
m_EventBroker->Publish(aeb);
|
m_EventBroker->Publish(aeb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,12 +368,12 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target)
|
|||||||
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||||
{
|
{
|
||||||
EntityWrapper player(m_World, e.Player);
|
EntityWrapper player(m_World, e.Player);
|
||||||
if (!player.Valid() || !IsClient){// || player.ID == LocalPlayer.ID) {
|
if (!player.Valid()){// || !IsClient || player.ID == LocalPlayer.ID) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
|
// auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
|
||||||
EntityWrapper dashEffect = entityFile->MergeInto(m_World);
|
// EntityWrapper dashEffect = entityFile->MergeInto(m_World);
|
||||||
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
||||||
|
|
||||||
for (auto& kv : m_PlayerInputControllers) {
|
for (auto& kv : m_PlayerInputControllers) {
|
||||||
@@ -409,9 +401,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.2;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Delay = 0.2;
|
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashRight");
|
aeb.AnimationEntity = playerModel.FirstChildByName("DashRight");
|
||||||
@@ -430,9 +421,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.2;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Delay = 0.2;
|
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashLeft");
|
aeb.AnimationEntity = playerModel.FirstChildByName("DashLeft");
|
||||||
@@ -453,9 +443,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.2;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Delay = 0.2;
|
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
||||||
@@ -474,9 +463,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
|||||||
{
|
{
|
||||||
Events::AutoAnimationBlend aeb;
|
Events::AutoAnimationBlend aeb;
|
||||||
aeb.Duration = 0.2;
|
aeb.Duration = 0.2;
|
||||||
aeb.NodeName = "StandCrouchBlend";
|
aeb.NodeName = "MovementBlend";
|
||||||
aeb.RootNode = playerModel;
|
aeb.RootNode = playerModel;
|
||||||
aeb.Delay = 0.2;
|
|
||||||
aeb.Start = true;
|
aeb.Start = true;
|
||||||
aeb.Restart = false;
|
aeb.Restart = false;
|
||||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashBackward");
|
aeb.AnimationEntity = playerModel.FirstChildByName("DashBackward");
|
||||||
|
|||||||
@@ -133,11 +133,6 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi)
|
|||||||
b1.Restart = true;
|
b1.Restart = true;
|
||||||
b1.Start = true;
|
b1.Start = true;
|
||||||
m_EventBroker->Publish(b1);
|
m_EventBroker->Publish(b1);
|
||||||
Events::AutoAnimationBlend b2;
|
|
||||||
b2.RootNode = wi.ThirdPersonPlayerModel;
|
|
||||||
b2.NodeName = "MovementBlend";
|
|
||||||
b2.AnimationEntity = wi.ThirdPersonPlayerModel.FirstChildByName("AssaultWeaponBlend").FirstChildByName("Reload");
|
|
||||||
m_EventBroker->Publish(b2);
|
|
||||||
|
|
||||||
// Spawn explosion effect
|
// Spawn explosion effect
|
||||||
if (wi.FirstPersonEntity.Valid()) {
|
if (wi.FirstPersonEntity.Valid()) {
|
||||||
@@ -247,6 +242,7 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
|
|
||||||
// Play animation
|
// Play animation
|
||||||
playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Fire");
|
playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Fire");
|
||||||
|
|
||||||
// Third person anim
|
// Third person anim
|
||||||
Events::AutoAnimationBlend b1;
|
Events::AutoAnimationBlend b1;
|
||||||
b1.RootNode = wi.ThirdPersonPlayerModel;
|
b1.RootNode = wi.ThirdPersonPlayerModel;
|
||||||
@@ -254,11 +250,6 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
b1.Restart = true;
|
b1.Restart = true;
|
||||||
b1.Start = true;
|
b1.Start = true;
|
||||||
m_EventBroker->Publish(b1);
|
m_EventBroker->Publish(b1);
|
||||||
Events::AutoAnimationBlend b2;
|
|
||||||
b2.RootNode = wi.ThirdPersonPlayerModel;
|
|
||||||
b2.NodeName = "MovementBlend";
|
|
||||||
b2.AnimationEntity = wi.ThirdPersonPlayerModel.FirstChildByName("AssaultWeaponBlend").FirstChildByName("Fire");
|
|
||||||
m_EventBroker->Publish(b2);
|
|
||||||
|
|
||||||
// Sound
|
// Sound
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
|
|||||||
Reference in New Issue
Block a user