Merge pull request #192 from teamfisk/Movement

Movement
This commit is contained in:
2016-03-09 18:37:56 +01:00
21 changed files with 1460 additions and 238 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ struct EntityWrapper
static const EntityWrapper Invalid;
const std::string Name();
const std::string Name() const;
bool HasComponent(const std::string& componentType);
void AttachComponent(const char* componentName);
EntityWrapper Parent();
+109 -46
View File
@@ -7,6 +7,7 @@
#include "../Game/Events/EDashAbility.h"
#include "InputHandler.h"
#include "Rendering/EAutoAnimationBlend.h"
#include "Rendering/ESetBlendWeight.h"
template <typename EventContext>
class FirstPersonInputController : public InputController<EventContext>
@@ -45,7 +46,6 @@ protected:
bool m_Crouching = false;
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
double m_AssaultDashDoubleTapDeltaTime = 0.0;
double m_DashEffectResetTimer = 0.0;
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
//and its very unlikely that someone wants to change that value
const float m_AssaultDashDoubleTapSensitivityTimer = 0.25f;
@@ -110,7 +110,6 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
if (e.Command == "Pitch") {
float val = glm::radians(e.Value);
m_Rotation.x += -val;
//m_Rotation.x = glm::clamp(m_Rotation.x, -glm::half_pi<float>(), glm::half_pi<float>());
}
if (e.Command == "Yaw") {
@@ -123,22 +122,11 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
float val = glm::clamp(e.Value, -1.f, 1.f);
m_Movement.z = -val;
//Animation
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
if (val > 0) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
if(m_Crouching) {
aeb.NodeName = "Walk";
} else {
aeb.NodeName = "Run";
}
aeb.RootNode = playerModel;
aeb.Start = true;
m_EventBroker->Publish(aeb);
} else if (val < 0) {
if (val > 0) { // Walk/Run
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
if (m_Crouching) {
@@ -148,10 +136,46 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
}
aeb.RootNode = playerModel;
aeb.Start = true;
aeb.SingleLevelBlend = true;
m_EventBroker->Publish(aeb);
} else if (val < 0) { // Walk/run Backwards
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
if (m_Crouching) {
aeb.NodeName = "Walk";
} else {
aeb.NodeName = "Run";
}
aeb.RootNode = playerModel;
aeb.Start = true;
aeb.SingleLevelBlend = true;
aeb.Reverse = true;
m_EventBroker->Publish(aeb);
} else {
}
}
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);
}
}
}
}
@@ -160,49 +184,92 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
float val = glm::clamp(e.Value, -1.f, 1.f);
m_Movement.x = val;
//Animation
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
if (playerModel.Valid()) { //Right Strafe
if (val > 0) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Right";
aeb.RootNode = playerModel;
aeb.SingleLevelBlend = true;
aeb.Start = true;
m_EventBroker->Publish(aeb);
} else if (val < 0) {
} else if (val < 0) { //LeftStrafe
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Left";
aeb.RootNode = playerModel;
aeb.SingleLevelBlend = true;
aeb.Start = true;
m_EventBroker->Publish(aeb);
} else {
}
}
}
}
if (glm::length2(m_Movement) > 0) {
m_Movement = glm::normalize(m_Movement);
} else {
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Idle";
aeb.RootNode = playerModel;
m_EventBroker->Publish(aeb);
}
}
}
}
//Animation
if (glm::length2(m_Movement) < 0.25f) {
//Blend to Idle
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "Idle";
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);
}
}
} else {
//Blend to movement
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.1;
aeb.NodeName = "DirectionBlend";
aeb.RootNode = playerModel;
m_EventBroker->Publish(aeb);
}
}
}
if (glm::length2(m_Movement) > 0) {
m_Movement = glm::normalize(m_Movement);
//Animation
// movement direction blend
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
glm::vec2 direction = glm::normalize(glm::vec2(m_Movement.x, m_Movement.z));
double weight = glm::abs(glm::dot(glm::vec2(1, 0), direction));
Events::SetBlendWeight sbw;
sbw.NodeName = "DirectionBlend";
sbw.Weight = weight;
sbw.RootNode = playerModel;
m_EventBroker->Publish(sbw);
}
}
}
if (e.Command == "Forward" || e.Command == "Right") {
if (e.Value != 0) {
m_CurrentDirectionVector = e.Command == "Right" ? (e.Value > 0 ? "Right" : "Left") : (e.Value > 0 ? "Forward" : "Backward");
@@ -235,6 +302,8 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
if (e.Command == "Crouch") {
m_Crouching = e.Value > 0;
//Animation
if (m_PlayerEntity.Valid()) {
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
@@ -288,17 +357,10 @@ bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMou
template <typename EventContext>
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID) {
m_AssaultDashDoubleTapDeltaTime += dt;
m_DashEffectResetTimer += dt;
assaultDashCoolDownTimer -= dt;
//cooldown = assaultDashCoolDownMaxTimer sec, pretend the dash lasts 0.25 sec (for friction to do its work)
if (assaultDashCoolDownTimer > (assaultDashCoolDownMaxTimer - 0.25f)) {
m_PlayerIsDashing = true;
if (m_DashEffectResetTimer > 0.05) {
Events::DashAbility e;
e.Player = playerID;
m_EventBroker->Publish(e);
m_DashEffectResetTimer = 0.0;
}
} else {
m_PlayerIsDashing = false;
}
@@ -310,6 +372,7 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
m_AssaultDashDoubleTapped = true;
m_AssaultDashDoubleTapDeltaTime = 0.f;
Events::DashAbility e;
e.Player = playerID;
m_EventBroker->Publish(e);
@@ -13,6 +13,8 @@
#include "../Core/EntityWrapper.h"
#include "Rendering/AutoBlendQueue.h"
#include "../Input/EInputCommand.h"
#include "../Core/EEntityDeleted.h"
#include "Rendering/ESetBlendWeight.h"
#include "imgui/imgui.h"
class AnimationSystem : public ImpureSystem
@@ -28,6 +30,13 @@ private:
EventRelay<AnimationSystem, Events::AutoAnimationBlend> m_EAutoAnimationBlend;
bool OnAutoAnimationBlend(Events::AutoAnimationBlend& e);
EventRelay<AnimationSystem, Events::EntityDeleted> m_EEntityDeleted;
bool OnEntityDeleted(Events::EntityDeleted& e);
EventRelay<AnimationSystem, Events::SetBlendWeight> m_ESetBlendWeight;
bool OnSetBlendWeight(Events::SetBlendWeight& e);
std::unordered_map<EntityWrapper, AutoBlendQueue> m_AutoBlendQueues;
};
@@ -37,6 +37,8 @@ public:
std::shared_ptr<BlendTree> GetBlendTree();
AutoBlendQueue::AutoBlendJob& GetActiveBlendJob();
bool Empty() { return m_BlendQueue.empty(); }
private:
std::list<AutoblendNode> m_BlendQueue;
+6 -3
View File
@@ -75,7 +75,6 @@ public:
std::vector<glm::mat4> GetFinalPose() { return m_FinalPose; }
glm::mat4 GetBoneTransform(int boneID);
bool IsValid() { return (m_Root == nullptr ? false : true); }
void PrintTree();
BlendTree::AutoBlendInfo AutoBlendStep(AutoBlendInfo blendInfo);
@@ -84,16 +83,20 @@ public:
EntityWrapper GetSubTreeRoot(std::string nodeName);
std::vector<EntityWrapper> GetSingleLevelRoots(std::string name);
std::vector<EntityWrapper> GetEntitesByName(std::string name);
void SetWeightByName(std::string name, double weight);
private:
Skeleton* m_Skeleton = nullptr;
Node* m_Root = nullptr;
std::vector<glm::mat4> m_FinalPose;
std::map<int, glm::mat4> m_FinalBoneTransforms;
std::vector<BlendTree::Node*> FindNodesByName(std::string name);
std::vector<glm::mat4> AccumulateFinalPose();
BlendTree::Node* FillTreeByName(Node* parentNode, std::string name, EntityWrapper parentEntity);
std::vector<BlendTree::Node*> FindNodesByName(std::string name);
void Blend(std::map<int, Skeleton::PoseData>& pose);
};
@@ -18,7 +18,6 @@ struct AutoAnimationBlend : Event
bool Reverse = false;
bool Restart = false;
bool SingleLevelBlend = false;
double Weight = -1.0;
EntityWrapper AnimationEntity = EntityWrapper::Invalid;
@@ -0,0 +1,20 @@
#ifndef Events_SetBlendWeight_h__
#define Events_SetBlendWeight_h__
#include "../Core/EventBroker.h"
#include "../Core/EntityWrapper.h"
namespace Events
{
//Sets the blend weight for all nodes with "NodeName"
struct SetBlendWeight : Event
{
EntityWrapper RootNode = EntityWrapper::Invalid;
std::string NodeName;
double Weight;
};
}
#endif
+3 -8
View File
@@ -2,17 +2,12 @@
<Entity name="DashEffect" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Animation/>
<c:Lifetime>
<Lifetime>0.5</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<Velocity X="0" Y="0" Z="0"/>
<TimeSinceDeath>0</TimeSinceDeath>
<ExplosionDuration>0.5</ExplosionDuration>
<EndColor A="0" B="0" G="0" R="0"/>
</c:ExplosionEffect>
<c:Model/>
<c:Transform/>
</Components>
<Children/>
</Entity>
+134 -30
View File
@@ -2,64 +2,168 @@
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform>
<Position X="0" Y="0" Z="-0.313012958"/>
</c:Transform>
<c:Transform/>
</Components>
<Children>
<Entity>
<Entity name="RedSpawn">
<Components>
<c:Camera/>
<c:Listener/>
<c:Team>
<Team>
<Red/>
</Team>
</c:Team>
<c:PlayerSpawn/>
<c:Spawner>
<EntityFile>Schema/Entities/PlayerAssaultFallbackRed.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="2.56531811" Y="0.637967348" Z="0.202344239"/>
<Orientation X="2.68780756" Y="1.36143553" Z="3.14159179"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>../assets/Models/Core/Tri.obj</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="2" Y="2" Z="0.200000003"/>
<Orientation X="2.70100021" Y="2.37000012" Z="0.266000003"/>
<Position X="0.300000012" Y="0.0270000007" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>../assets/Models/Core/Tri.obj</Resource>
<Resource>Models/Characters/Assault/AssaultRed.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Orientation X="0" Y="3.14159274" Z="4.71238899"/>
<Position X="0.800000012" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultRed.mesh</Resource>
<Color A="1" B="0.0117647061" G="0" R="1"/>
</c:Model>
<c:Transform>
<Position X="-0.600000024" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity>
<Entity name="DirectionalLight">
<Components>
<c:AABB/>
<c:Collidable/>
<c:SceneLight>
<Gamma>0.5</Gamma>
<Exposure>4</Exposure>
</c:SceneLight>
<c:DirectionalLight/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Resource>sModels/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
</c:Model>
<c:Physics/>
<c:Transform>
<Position X="-1.95333278" Y="0.296304941" Z="2.56487775"/>
<Position X="-6.00145912" Y="1.42697716" Z="3.04144025"/>
<Orientation X="5.69400024" Y="841.179565" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="ObstacleCourse">
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Test/ObstacleCourse.mesh</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="BlueSpawn">
<Components>
<c:Team>
<Team>
<Blue/>
</Team>
</c:Team>
<c:PlayerSpawn/>
<c:Spawner>
<EntityFile>Schema/Entities/Player.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.300000012" Y="0.0270000007" Z="6.67400026"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
<Color A="1" B="1" G="0.254901975" R="0"/>
</c:Model>
<c:Transform>
<Position X="-0.600000024" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
<Color A="1" B="1" G="0.254901975" R="0"/>
</c:Model>
<c:Transform>
<Position X="0.800000012" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="Arms">
<Components>
<c:Blend>
<Pose1>ActivateDeactive</Pose1>
<Pose2></Pose2>
</c:Blend>
<c:Model>
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="1.30585015" Z="2.01450038"/>
</c:Transform>
</Components>
<Children>
<Entity name="ActivateDeactive">
<Components>
<c:Animation>
<AnimationName>ActivateDeactiveShieldF</AnimationName>
<Time>0.68323420867830964</Time>
<Speed>1</Speed>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Weapon">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-0.0621522591" Y="-0.169021279" Z="-0.219918266"/>
<Orientation X="-0.709758997" Y="1.22785306" Z="-0.154755235"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
+46 -1
View File
@@ -54,7 +54,10 @@
</Entity>
<Entity name="DirectionalLight">
<Components>
<c:SceneLight/>
<c:SceneLight>
<Gamma>0.49999982118606567</Gamma>
<Exposure>2.5599997043609619</Exposure>
</c:SceneLight>
<c:DirectionalLight/>
<c:Model>
<Resource>sModels/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
@@ -120,6 +123,48 @@
</Entity>
</Children>
</Entity>
<Entity name="Arms">
<Components>
<c:Blend>
<Pose1>ActivateDeactive</Pose1>
<Pose2></Pose2>
</c:Blend>
<c:Model>
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="1.30585015" Z="2.01450038"/>
</c:Transform>
</Components>
<Children>
<Entity name="ActivateDeactive">
<Components>
<c:Animation>
<AnimationName>ActivateDeactiveShieldF</AnimationName>
<Time>0.44649605185380015</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Weapon">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0.00681143999" Y="-0.204994932" Z="-0.209244296"/>
<Orientation X="-0.581807375" Y="0.562133908" Z="-0.0719003305"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
+49 -43
View File
@@ -2,7 +2,6 @@
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -22,6 +21,7 @@
</c:DefenderWeapon>
<c:DoubleJump/>
<c:Health/>
<c:NetworkComponent/>
<c:Physics>
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
</c:Physics>
@@ -463,7 +463,7 @@
<Color A="1" B="0.392156869" G="0.392156869" R="0.392156869"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Icons/Abilities/Superman-01.png</DiffuseTexture>
<DiffuseTexture>Textures\Icons\Abilities\Superman-01.png</DiffuseTexture>
<GlowMap></GlowMap>
<DepthSort>false</DepthSort>
<Color A="1" B="0.206628323" G="0.78039217" R="0.192802757"/>
@@ -504,25 +504,25 @@
<Children>
<Entity name="PrimaryAttachment">
<Components>
<c:WeaponAttachment>
<Weapon>AssaultWeapon</Weapon>
</c:WeaponAttachment>
<c:Spawner>
<EntityFile>Schema/Entities/WeaponAssaultBlueView.xml</EntityFile>
</c:Spawner>
<c:Transform/>
<c:WeaponAttachment>
<Weapon>AssaultWeapon</Weapon>
</c:WeaponAttachment>
</Components>
<Children/>
</Entity>
<Entity name="SecondaryAttachment">
<Components>
<c:WeaponAttachment>
<Weapon>DefenderWeapon</Weapon>
</c:WeaponAttachment>
<c:Spawner>
<EntityFile>Schema/Entities/WeaponDefenderBlueView.xml</EntityFile>
</c:Spawner>
<c:Transform/>
<c:WeaponAttachment>
<Weapon>DefenderWeapon</Weapon>
</c:WeaponAttachment>
</Components>
<Children/>
</Entity>
@@ -566,19 +566,19 @@
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</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>
<Weapon>AssaultWeapon</Weapon>
<Person>
<ThirdPerson/>
</Person>
</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>
<Children/>
</Entity>
@@ -587,26 +587,26 @@
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</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>
<Weapon>SidearmWeapon</Weapon>
<Person>
<ThirdPerson/>
</Person>
</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>
<Children/>
</Entity>
<Entity name="BlendTreeLower">
<Components>
<c:Blend>
<Pose1>StandCrouchBlend</Pose1>
<Pose1>MovementBlend</Pose1>
<Pose2>JumpDashBlend</Pose2>
<Weight>2.5146881298480398e-63</Weight>
<SubTreeRoot>true</SubTreeRoot>
@@ -628,7 +628,7 @@
<Entity name="CrouchMovement">
<Components>
<c:Blend>
<Pose1>MovementBlend</Pose1>
<Pose1>DirectionBlend</Pose1>
<Pose2>Idle</Pose2>
<Weight>1</Weight>
</c:Blend>
@@ -659,7 +659,7 @@
<Components>
<c:Animation>
<AnimationName>CrouchStrafeLeftF</AnimationName>
<Time>0.15801023731376773</Time>
<Time>0.79179726223533642</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -670,7 +670,7 @@
<Components>
<c:Animation>
<AnimationName>CrouchStrafeRightF</AnimationName>
<Time>0.085331699264550309</Time>
<Time>0.719118724186119</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -683,7 +683,7 @@
<Components>
<c:Animation>
<AnimationName>CrouchWalkF</AnimationName>
<Time>0.86370568444195328</Time>
<Time>0.49749270936352197</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -696,7 +696,8 @@
<Components>
<c:Animation>
<AnimationName>CrouchF</AnimationName>
<Time>0.99862473341677438</Time>
<Time>1.1707202063102131</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
@@ -707,7 +708,7 @@
<Entity name="StandMovement">
<Components>
<c:Blend>
<Pose1>MovementBlend</Pose1>
<Pose1>DirectionBlend</Pose1>
<Pose2>Idle</Pose2>
<Weight>1</Weight>
</c:Blend>
@@ -738,7 +739,7 @@
<Components>
<c:Animation>
<AnimationName>WalkF</AnimationName>
<Time>0.36886031385172657</Time>
<Time>0.0026473387732952602</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -749,7 +750,8 @@
<Components>
<c:Animation>
<AnimationName>RunF</AnimationName>
<Time>0.64087381787562947</Time>
<Time>0.60179430680919843</Time>
<Speed>2</Speed>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -772,7 +774,8 @@
<Components>
<c:Animation>
<AnimationName>StrafeLeftF</AnimationName>
<Time>0.55045293488526426</Time>
<Time>0.20450294221067544</Time>
<Speed>2</Speed>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -783,7 +786,8 @@
<Components>
<c:Animation>
<AnimationName>StrafeRightF</AnimationName>
<Time>0.57396846476537888</Time>
<Time>0.28191395104664174</Time>
<Speed>2</Speed>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -798,7 +802,7 @@
<Components>
<c:Animation>
<AnimationName>IdleF</AnimationName>
<Time>1.0177411602680451</Time>
<Time>0.96819454985941356</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
@@ -856,7 +860,7 @@
<c:Animation>
<AnimationName>DashForwardF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Speed>1.7999999523162842</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
@@ -868,7 +872,7 @@
<c:Animation>
<AnimationName>DashBackwardF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Speed>1.7999999523162842</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
@@ -887,24 +891,24 @@
<c:Transform/>
</Components>
<Children>
<Entity name="DashLeft">
<Entity name="DashRight">
<Components>
<c:Animation>
<AnimationName>DashLeftF</AnimationName>
<AnimationName>DashRightF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Speed>1.7999999523162842</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="DashRight">
<Entity name="DashLeft">
<Components>
<c:Animation>
<AnimationName>DashRightF</AnimationName>
<AnimationName>DashLeftF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Speed>1.7999999523162842</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
@@ -981,7 +985,7 @@
</Entity>
</Children>
</Entity>
<Entity name="MovementBlend">
<Entity name="MovementBlend2">
<Components>
<c:Blend>
<Pose1>Idle</Pose1>
@@ -995,6 +999,7 @@
<Components>
<c:Animation>
<AnimationName>IdleAssaultRifleU</AnimationName>
<Time>1.6337870249215687</Time>
<Play>true</Play>
<Additive>true</Additive>
</c:Animation>
@@ -1006,6 +1011,7 @@
<Components>
<c:Animation>
<AnimationName>IdleAssaultRifleU</AnimationName>
<Time>1.6337870249215687</Time>
<Play>true</Play>
<Additive>true</Additive>
</c:Animation>
+273
View File
@@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="ShootingRange" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform>
<Position X="0" Y="0.736272275" Z="-10.0567217"/>
</c:Transform>
</Components>
<Children>
<Entity name="TargetBoard">
<Components>
<c:Transform>
<Position X="-2" Y="0" Z="0"/>
<Orientation X="1.5" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="1" Y="0.100000001" Z="1"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0.00392156886" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="TargetBoard">
<Components>
<c:Transform>
<Orientation X="1.5" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="1" Y="0.100000001" Z="1"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0.00392156886" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="TargetBoard">
<Components>
<c:Transform>
<Position X="2" Y="0" Z="0"/>
<Orientation X="1.5" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="1" Y="0.100000001" Z="1"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="1" G="0.392156869" R="0"/>
</c:Model>
<c:Transform>
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
<Color A="1" B="0" G="0.00392156886" R="1"/>
</c:Model>
<c:Transform>
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,528 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="PlayerModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:BlendAdditive>
<Adder>BlendTreeAim</Adder>
<Receiver>BlendTreeAssault</Receiver>
</c:BlendAdditive>
<c:Shielded/>
<c:HiddenForLocalPlayer/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
<Color A="1" B="1" G="0.25" R="0"/>
</c:Model>
<c:Transform/>
</Components>
<Children>
<Entity name="PrimaryAttachment">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:WeaponAttachment>
<Weapon>AssaultWeapon</Weapon>
<Person>
<ThirdPerson/>
</Person>
</c:WeaponAttachment>
<c:Spawner>
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.158476353" Y="1.07276821" Z="-0.235679001"/>
<Orientation X="0.150311232" Y="-0.0436343439" Z="0.10047026"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="SecondaryAttachment">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:WeaponAttachment>
<Weapon>SidearmWeapon</Weapon>
<Person>
<ThirdPerson/>
</Person>
</c:WeaponAttachment>
<c:Spawner>
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.158476353" Y="1.07276821" Z="-0.235679001"/>
<Orientation X="0.150311232" Y="-0.0436343439" Z="0.10047026"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="BlendTreeAim">
<Components>
<c:Blend>
<Pose1>AimPrimary</Pose1>
<Pose2>AimSecondary</Pose2>
<Weight>0</Weight>
<SubTreeRoot>true</SubTreeRoot>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="AimSecondary">
<Components>
<c:Animation>
<AnimationName>AimSecWepA</AnimationName>
<Time>0.57222229242324829</Time>
<Loop>false</Loop>
<Additive>true</Additive>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="AimPrimary">
<Components>
<c:Animation>
<AnimationName>AimRifleA</AnimationName>
<Time>0.57222229242324829</Time>
<Loop>false</Loop>
<Additive>true</Additive>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BlendTreeAssault">
<Components>
<c:BlendOverride>
<Master>ReloadSwitchBlend</Master>
<Slave>FinalMovementBlend</Slave>
</c:BlendOverride>
<c:Transform/>
</Components>
<Children>
<Entity name="FinalMovementBlend">
<Components>
<c:Blend>
<Pose1>StandCrouchBlend</Pose1>
<Pose2>JumpDashBlend</Pose2>
<Weight>2.5146881298480398e-63</Weight>
<SubTreeRoot>true</SubTreeRoot>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="StandCrouchBlend">
<Components>
<c:Blend>
<Pose1>StandMovement</Pose1>
<Pose2>CrouchMovement</Pose2>
<Weight>0</Weight>
<SubTreeRoot>true</SubTreeRoot>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="CrouchMovement">
<Components>
<c:Blend>
<Pose1>MovementBlend</Pose1>
<Pose2>Idle</Pose2>
<Weight>1</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="MovementBlend">
<Components>
<c:Blend>
<Pose1>Walk</Pose1>
<Pose2>StrafeLRBlend</Pose2>
<Weight>0</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="StrafeLRBlend">
<Components>
<c:Blend>
<Pose1>Left</Pose1>
<Pose2>Right</Pose2>
<Weight>0.033793529385008014</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="Left">
<Components>
<c:Animation>
<AnimationName>CrouchStrafeLeftF</AnimationName>
<Time>0.37873000664436773</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Right">
<Components>
<c:Animation>
<AnimationName>CrouchStrafeRightF</AnimationName>
<Time>0.30605146859515031</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="Walk">
<Components>
<c:Animation>
<AnimationName>CrouchWalkF</AnimationName>
<Time>0.084425453772553283</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="Idle">
<Components>
<c:Animation>
<AnimationName>CrouchF</AnimationName>
<Time>0.99862473341677438</Time>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="StandMovement">
<Components>
<c:Blend>
<Pose1>MovementBlend</Pose1>
<Pose2>Idle</Pose2>
<Weight>1</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="MovementBlend">
<Components>
<c:Blend>
<Pose1>RunWalkBlend</Pose1>
<Pose2>StrafeLRBlend</Pose2>
<Weight>0</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="RunWalkBlend">
<Components>
<c:Blend>
<Pose1>Walk</Pose1>
<Pose2>Run</Pose2>
<Weight>1</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="Walk">
<Components>
<c:Animation>
<AnimationName>WalkF</AnimationName>
<Time>0.58958008318232658</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Run">
<Components>
<c:Animation>
<AnimationName>RunF</AnimationName>
<Time>0.45938030142915665</Time>
<Play>true</Play>
<Reverse>true</Reverse>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="StrafeLRBlend">
<Components>
<c:Blend>
<Pose1>Left</Pose1>
<Pose2>Right</Pose2>
<Weight>0.033793529385008014</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="Left">
<Components>
<c:Animation>
<AnimationName>StrafeLeftF</AnimationName>
<Time>0.77117270421586426</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="Right">
<Components>
<c:Animation>
<AnimationName>StrafeRightF</AnimationName>
<Time>0.79468823409597888</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="Idle">
<Components>
<c:Animation>
<AnimationName>IdleF</AnimationName>
<Time>1.8384679867885865</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="JumpDashBlend">
<Components>
<c:Blend>
<Pose1>Jump</Pose1>
<Pose2>DashBlend</Pose2>
<Weight>1</Weight>
<SubTreeRoot>true</SubTreeRoot>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="Jump">
<Components>
<c:Animation>
<AnimationName>JumpF</AnimationName>
<Time>0.5</Time>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="DashBlend">
<Components>
<c:Blend>
<Pose1>DashFBBlend</Pose1>
<Pose2>DashLRBlend</Pose2>
<Weight>0.014621149736541383</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="DashFBBlend">
<Components>
<c:Blend>
<Pose1>DashForward</Pose1>
<Pose2>DashBackward</Pose2>
<Weight>0.014363533804961248</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="DashForward">
<Components>
<c:Animation>
<AnimationName>DashForwardF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="DashBackward">
<Components>
<c:Animation>
<AnimationName>DashBackwardF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="DashLRBlend">
<Components>
<c:Blend>
<Pose1>DashLeft</Pose1>
<Pose2>DashRight</Pose2>
<Weight>4.3244885367500671e-16</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="DashLeft">
<Components>
<c:Animation>
<AnimationName>DashLeftF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="DashRight">
<Components>
<c:Animation>
<AnimationName>DashRightF</AnimationName>
<Time>1</Time>
<Speed>2</Speed>
<Loop>false</Loop>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="ReloadSwitchBlend">
<Components>
<c:Blend>
<Pose1>ReloadSwitch</Pose1>
<Pose2>WeaponActionBlend</Pose2>
<Weight>1</Weight>
<SubTreeRoot>true</SubTreeRoot>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="ReloadSwitch">
<Components>
<c:Animation>
<AnimationName>ReloadSwitchU</AnimationName>
<Time>0.00030848838797092881</Time>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="WeaponActionBlend">
<Components>
<c:Blend>
<Pose1>IdleBlend</Pose1>
<Pose2>ShootBlend</Pose2>
<Weight>0</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="IdleBlend">
<Components>
<c:Blend>
<Pose1>IdlePrimary</Pose1>
<Pose2>IdleSecondary</Pose2>
<Weight>0</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="IdlePrimary">
<Components>
<c:Animation>
<AnimationName>IdleAssaultRifleU</AnimationName>
<Time>1.0138027682248349</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="IdleSecondary">
<Components>
<c:Animation>
<AnimationName>IdleSecWepU</AnimationName>
<Time>1.0173278085146222</Time>
<Play>true</Play>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="ShootBlend">
<Components>
<c:Blend>
<Pose1>ShootPrimary</Pose1>
<Pose2>ShootSecondary</Pose2>
<Weight>0</Weight>
</c:Blend>
<c:Transform/>
</Components>
<Children>
<Entity name="ShootPrimary">
<Components>
<c:Animation>
<AnimationName>ShootFastRifleU</AnimationName>
<Time>0.12914212153428517</Time>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="ShootSecondary">
<Components>
<c:Animation>
<AnimationName>ShootSecWepFastU</AnimationName>
</c:Animation>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
@@ -72,7 +72,7 @@
<Entity name="Idle">
<Components>
<c:Animation>
<AnimationName>IdleF</AnimationName>
<AnimationName>IdelF</AnimationName>
<Play>true</Play>
<Additive>true</Additive>
</c:Animation>
@@ -91,8 +91,8 @@
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0.118469834" Y="-0.231588811" Z="-0.181454763"/>
<Orientation X="0.0104042515" Y="-0.00268274755" Z="0.0428440832"/>
<Position X="0.120748274" Y="-0.228437141" Z="-0.181454718"/>
<Orientation X="0.0102804415" Y="-0.00312523148" Z="0.0428143665"/>
</c:Transform>
</Components>
<Children>
@@ -127,9 +127,9 @@
<InheritScale>true</InheritScale>
</c:BoneAttachment>
<c:Transform>
<Position X="0.0517482236" Y="-0.0985872298" Z="-0.255526245"/>
<Orientation X="0.000683688093" Y="0.0774232447" Z="0.0011862258"/>
<Scale X="0.25" Y="0.250000119" Z="0.500000238"/>
<Position X="0.0540266186" Y="-0.0954354703" Z="-0.255526125"/>
<Orientation X="0.000778362213" Y="0.0774229616" Z="0.00124316185"/>
<Scale X="0.25000003" Y="0.250000238" Z="0.500000417"/>
</c:Transform>
</Components>
<Children>
+1 -1
View File
@@ -3,7 +3,7 @@
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
const std::string EntityWrapper::Name()
const std::string EntityWrapper::Name() const
{
return World->GetName(ID);
}
+164 -38
View File
@@ -4,6 +4,8 @@ AnimationSystem::AnimationSystem(SystemParams params)
: System(params)
{
EVENT_SUBSCRIBE_MEMBER(m_EAutoAnimationBlend, &AnimationSystem::OnAutoAnimationBlend);
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &AnimationSystem::OnEntityDeleted);
EVENT_SUBSCRIBE_MEMBER(m_ESetBlendWeight, &AnimationSystem::OnSetBlendWeight);
}
void AnimationSystem::Update(double dt)
@@ -122,16 +124,16 @@ void AnimationSystem::UpdateAnimations(double dt)
}
}
void AnimationSystem::UpdateWeights(double dt)
{
for (auto& autoBlendQueue : m_AutoBlendQueues) {
if(autoBlendQueue.second.HasActiveBlendJob()) {
AutoBlendQueue::AutoBlendJob& blendJob = autoBlendQueue.second.GetActiveBlendJob();
std::shared_ptr<BlendTree> blendTree = autoBlendQueue.second.GetBlendTree();
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()) {
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
LOG_INFO("%s", blendJob.RootNode.Name().c_str());
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
if (blendTree != nullptr) {
if (blendJob.Duration != 0.0) {
blendJob.BlendInfo.progress = glm::clamp(blendJob.CurrentTime / blendJob.Duration, 0.0, 1.0);
@@ -140,10 +142,17 @@ void AnimationSystem::UpdateWeights(double dt)
}
blendJob.BlendInfo = blendTree->AutoBlendStep(blendJob.BlendInfo);
} else {
it = m_AutoBlendQueues.erase(it);
}
it++;
} else {
if (it->second.Empty()) {
it = m_AutoBlendQueues.erase(it);
} else {
it++;
}
}
}
}
@@ -177,46 +186,163 @@ bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e)
return false;
}
EntityWrapper subTreeRoot;
EntityWrapper subTreeRoot = blendTree->GetSubTreeRoot(e.NodeName);
if (e.SingleLevelBlend) {
subTreeRoot = blendTree->GetSubTreeRoot(e.NodeName);
if (!subTreeRoot.Valid()) {
return false;
}
if (!subTreeRoot.Valid()) {
return false;
}
AutoBlendQueue::AutoBlendJob abj;
abj.AnimationEntity = e.AnimationEntity;
abj.CurrentTime = 0.0;
abj.Delay = e.Delay;
abj.Duration = e.Duration;
abj.RootNode = e.RootNode;
AutoBlendQueue::AutoBlendJob abj;
abj.AnimationEntity = e.AnimationEntity;
abj.CurrentTime = 0.0;
abj.Delay = e.Delay;
abj.Duration = e.Duration;
abj.RootNode = e.RootNode;
abj.BlendInfo.NodeName = e.NodeName;
abj.BlendInfo.progress = 0.0;
abj.BlendInfo.Start = e.Start;
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
abj.BlendInfo.Weight = e.Weight;
abj.BlendInfo.NodeName = e.NodeName;
abj.BlendInfo.progress = 0.0;
abj.BlendInfo.Start = e.Start;
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
abj.BlendInfo.Weight = e.Weight;
EntityWrapper nodeEntity = subTreeRoot.FirstChildByName(e.NodeName); // more than one
if (nodeEntity.Valid()) {
if (nodeEntity.HasComponent("Animation")) {
const Skeleton::Animation* animation = skeleton->GetAnimation(nodeEntity["Animation"]["AnimationName"]);
(bool&)nodeEntity["Animation"]["Reverse"] = e.Reverse;
std::vector<EntityWrapper> animationEntities = blendTree->GetEntitesByName(e.NodeName); // more than one
for(auto entity : animationEntities)
if (entity.Valid()) {
if (entity.HasComponent("Animation")) {
const Skeleton::Animation* animation = skeleton->GetAnimation(entity["Animation"]["AnimationName"]);
(bool&)entity["Animation"]["Reverse"] = e.Reverse;
if (e.Restart) {
if (animation != nullptr) {
if (e.Restart) {
if (e.Reverse) {
(double&)nodeEntity["Animation"]["Time"] = animation->Duration;
} else {
(double&)nodeEntity["Animation"]["Time"] = 0.0;
if (e.Restart) {
if (animation != nullptr) {
if (e.Restart) {
if (e.Reverse) {
(double&)entity["Animation"]["Time"] = animation->Duration;
} else {
(double&)entity["Animation"]["Time"] = 0.0;
}
}
}
}
}
}
m_AutoBlendQueues[subTreeRoot].Insert(abj);
} else {
std::vector<EntityWrapper> subtreeroots = blendTree->GetSingleLevelRoots(e.NodeName);
for(auto entity : subtreeroots) {
subTreeRoot = entity;
if (!subTreeRoot.Valid()) {
return false;
}
AutoBlendQueue::AutoBlendJob abj;
abj.AnimationEntity = e.AnimationEntity;
abj.CurrentTime = 0.0;
abj.Delay = e.Delay;
abj.Duration = e.Duration;
abj.RootNode = e.RootNode;
abj.BlendInfo.NodeName = e.NodeName;
abj.BlendInfo.progress = 0.0;
abj.BlendInfo.Start = e.Start;
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
abj.BlendInfo.Weight = e.Weight;
m_AutoBlendQueues[subTreeRoot].Insert(abj);
}
std::vector<EntityWrapper> animationEntities = blendTree->GetEntitesByName(e.NodeName); // more than one
for (auto entity : animationEntities)
if (entity.Valid()) {
if (entity.HasComponent("Animation")) {
const Skeleton::Animation* animation = skeleton->GetAnimation(entity["Animation"]["AnimationName"]);
(bool&)entity["Animation"]["Reverse"] = e.Reverse;
if (e.Restart) {
if (animation != nullptr) {
if (e.Restart) {
if (e.Reverse) {
(double&)entity["Animation"]["Time"] = animation->Duration;
} else {
(double&)entity["Animation"]["Time"] = 0.0;
}
}
}
}
}
}
}
m_AutoBlendQueues[subTreeRoot].Insert(abj);
return true;
}
bool AnimationSystem::OnEntityDeleted(Events::EntityDeleted& e)
{
EntityWrapper entity = EntityWrapper(m_World, e.DeletedEntity);
if (entity.HasComponent("Model")) {
Model* model;
try {
model = ResourceManager::Load<::Model, true>(entity["Model"]["Resource"]);
} catch (const std::exception&) {
return false;
}
Skeleton* skeleton = model->m_RawModel->m_Skeleton;
if (skeleton == nullptr) {
return false;
}
if (skeleton->BlendTrees.find(entity) != skeleton->BlendTrees.end()) {
skeleton->BlendTrees.erase(entity);
}
}
}
bool AnimationSystem::OnSetBlendWeight(Events::SetBlendWeight& e)
{
if (!e.RootNode.Valid()) {
return false;
}
if (!e.RootNode.HasComponent("Model")) {
return false;
}
Model* model;
try {
model = ResourceManager::Load<::Model, true>((std::string)e.RootNode["Model"]["Resource"]);
} catch (const std::exception&) {
return false;
}
Skeleton* skeleton = model->m_RawModel->m_Skeleton;
if (skeleton == nullptr) {
return false;
}
std::shared_ptr<BlendTree> blendTree;
if (skeleton->BlendTrees.find(e.RootNode) != skeleton->BlendTrees.end()) {
blendTree = skeleton->BlendTrees.at(e.RootNode);
} else {
return false;
}
if(e.Weight >= 0 && e.Weight <= 1) {
blendTree->SetWeightByName(e.NodeName, e.Weight);
return true;
} else {
return false;
}
}
+8 -6
View File
@@ -38,11 +38,14 @@ void AutoBlendQueue::Insert(AutoBlendJob autoBlendJob)
double animationSpeed = (double)autoBlendJob.AnimationEntity["Animation"]["Speed"];
double animationTime = (double)autoBlendJob.AnimationEntity["Animation"]["Time"];
if ((bool)autoBlendJob.AnimationEntity["Animation"]["Reverse"]) {
AnimationDuration = (animation->Duration * animationSpeed) - (animation->Duration - animationTime);
if (animationSpeed != 0) {
if ((bool)autoBlendJob.AnimationEntity["Animation"]["Reverse"]) {
AnimationDuration = (animation->Duration / animationSpeed) - (animation->Duration - animationTime);
} else {
AnimationDuration = (animation->Duration / animationSpeed) - animationTime;
}
} else {
AnimationDuration = (animation->Duration * animationSpeed) - animationTime;
return;
}
blendNode.StartTime += AnimationDuration;
@@ -75,7 +78,6 @@ void AutoBlendQueue::Insert(AutoBlendJob autoBlendJob)
}
}
m_BlendQueue.clear();
m_BlendQueue.push_back(blendNode);
}
@@ -124,7 +126,7 @@ bool AutoBlendQueue::HasActiveBlendJob()
try {
model = ResourceManager::Load<::Model, true>(blendJob.RootNode["Model"]["Resource"]);
} catch (const std::exception&) {
m_BlendQueue.pop_front();
//m_BlendQueue.pop_front();
return HasActiveBlendJob();
}
+53 -6
View File
@@ -2,11 +2,8 @@
BlendTree::BlendTree(EntityWrapper ModelEntity, Skeleton* skeleton)
{
m_Skeleton = skeleton;
if (ModelEntity.HasComponent("Animation")) {
const Skeleton::Animation* animation = skeleton->GetAnimation(ModelEntity["Animation"]["AnimationName"]);
if (animation == nullptr) {
@@ -217,7 +214,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
}
}
}
return blendInfo;
}
@@ -270,7 +266,7 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
currentNode = currentNode->Parent;
if (blendInfo.SingleBlend) {
break;
return blendInfo;;
}
}
} else if(goalNodes.size() >= 2) {
@@ -331,9 +327,11 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
lastNode = currentNode;
currentNode = currentNode->Parent;
if (blendInfo.SingleBlend) {
return blendInfo;
}
}
}
}
return blendInfo;
@@ -427,6 +425,55 @@ EntityWrapper BlendTree::GetSubTreeRoot(std::string nodeName)
return subTreeRoots.front()->Entity;
}
std::vector<EntityWrapper> BlendTree::GetSingleLevelRoots(std::string name)
{
std::vector<Node*> nodes = FindNodesByName(name);
std::vector<EntityWrapper> entities;
for (auto it = nodes.begin(); it != nodes.end(); it++) {
Node* currentNode = (*it)->Parent;
if(currentNode->Entity.Valid()) {
entities.push_back(currentNode->Entity);
}
}
return entities;
}
std::vector<EntityWrapper> BlendTree::GetEntitesByName(std::string name)
{
std::vector<Node*> nodes = FindNodesByName(name);
std::vector<EntityWrapper> entities;
for (auto it = nodes.begin(); it != nodes.end(); it++) {
Node* currentNode = (*it);
if (currentNode->Entity.Valid()) {
entities.push_back(currentNode->Entity);
}
}
return entities;
}
void BlendTree::SetWeightByName(std::string name, double weight)
{
std::vector<Node*> nodes = FindNodesByName(name);
for (auto node : nodes) {
EntityWrapper entity = node->Entity;
if(entity.HasComponent("Blend")) {
entity["Blend"]["Weight"] = weight;
node->Weight = weight;
}
}
}
void BlendTree::Blend(std::map<int, Skeleton::PoseData>& pose)
{
Node* currentNode;
+2
View File
@@ -321,6 +321,8 @@ Skeleton::~Skeleton()
for (auto &kv : Bones) {
delete kv.second;
}
BlendTrees.clear();
}
const Skeleton::Animation* Skeleton::GetAnimation(std::string name)
+45 -48
View File
@@ -81,27 +81,18 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
cameraOrientation.x += controller->Rotation().x;
// Limit camera pitch so we don't break our necks
cameraOrientation.x = glm::clamp(cameraOrientation.x, -glm::half_pi<float>(), glm::half_pi<float>());
// Set third person model aim pitch
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
//Third-person aim
if (playerModel.Valid()) {
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("AimPrimary");
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("Aim");
if(aimPrimaryEntity.Valid()){
if(aimPrimaryEntity.HasComponent("Animation")) {
float pitch = cameraOrientation.x + 0.2f;
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
float pitch = cameraOrientation.x;
double time = ((pitch + glm::half_pi<float>()) / glm::pi<float>());
(double&)aimPrimaryEntity["Animation"]["Time"] = time;
}
}
EntityWrapper aimSecondaryEntity = playerModel.FirstChildByName("AimSecondary");
if (aimSecondaryEntity.Valid()) {
if (aimSecondaryEntity.HasComponent("Animation")) {
float pitch = cameraOrientation.x + 0.2f;
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
(double&)aimSecondaryEntity["Animation"]["Time"] = time;
}
}
}
}
@@ -213,7 +204,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.25;
aeb.NodeName = "StandCrouchBlend";
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Start = true;
aeb.Restart = false;
@@ -244,11 +235,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.25;
aeb.NodeName = "StandCrouchBlend";
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Start = true;
aeb.Restart = false;
aeb.AnimationEntity = playerModel.FirstChildByName("Jump");
aeb.AnimationEntity = playerModel.FirstChildByName("BlendTreeLower").FirstChildByName("Jump");
m_EventBroker->Publish(aeb);
}
}
@@ -377,12 +368,12 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target)
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
{
EntityWrapper player(m_World, e.Player);
if (!player.Valid() || !IsClient){// || player.ID == LocalPlayer.ID) {
if (!player.Valid()){// || !IsClient || player.ID == LocalPlayer.ID) {
return false;
}
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
EntityWrapper dashEffect = entityFile->MergeInto(m_World);
// auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
// EntityWrapper dashEffect = entityFile->MergeInto(m_World);
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
for (auto& kv : m_PlayerInputControllers) {
@@ -400,7 +391,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
if (controller->Movement().x > 0) {
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.Duration = 0.1;
aeb.NodeName = "DashRight";
aeb.RootNode = playerModel;
aeb.Restart = true;
@@ -409,19 +400,18 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
}
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.NodeName = "StandCrouchBlend";
aeb.Duration = 0.2;
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Delay = -0.3;
aeb.Start = true;
aeb.Restart = false;
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
aeb.AnimationEntity = playerModel.FirstChildByName("DashRight");
m_EventBroker->Publish(aeb);
}
} else {
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.Duration = 0.1;
aeb.NodeName = "DashLeft";
aeb.RootNode = playerModel;
aeb.Restart = true;
@@ -430,13 +420,12 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
}
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.NodeName = "StandCrouchBlend";
aeb.Duration = 0.2;
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Delay = -0.3;
aeb.Start = true;
aeb.Restart = false;
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
aeb.AnimationEntity = playerModel.FirstChildByName("DashLeft");
m_EventBroker->Publish(aeb);
}
}
@@ -444,7 +433,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
if (controller->Movement().z < 0) {
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.Duration = 0.1;
aeb.NodeName = "DashForward";
aeb.RootNode = playerModel;
aeb.Restart = true;
@@ -453,10 +442,9 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
}
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.NodeName = "StandCrouchBlend";
aeb.Duration = 0.2;
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Delay = -0.3;
aeb.Start = true;
aeb.Restart = false;
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
@@ -465,7 +453,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
} else {
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.Duration = 0.1;
aeb.NodeName = "DashBackward";
aeb.RootNode = playerModel;
aeb.Restart = true;
@@ -474,32 +462,41 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
}
{
Events::AutoAnimationBlend aeb;
aeb.Duration = 0.3;
aeb.NodeName = "StandCrouchBlend";
aeb.Duration = 0.2;
aeb.NodeName = "MovementBlend";
aeb.RootNode = playerModel;
aeb.Delay = -0.3;
aeb.Start = true;
aeb.Restart = false;
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
aeb.AnimationEntity = playerModel.FirstChildByName("DashBackward");
m_EventBroker->Publish(aeb);
}
}
}
}
}
}
/*
auto playerEntityAnimation = playerModel["Animation"];
playerEntityModel.Copy(dashEffect["Model"]);
playerEntityAnimation.Copy(dashEffect["Animation"]);
dashEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"];
((glm::vec4&)dashEffect["ExplosionEffect"]["EndColor"]).w = 0.f;
*/
EntityWrapper dashEffectModel;
dashEffectModel = playerModel.Clone();
player["Transform"].Copy(dashEffectModel["Transform"]);
dashEffectModel.AttachComponent("ExplosionEffect");
dashEffectModel["ExplosionEffect"]["EndColor"] = (glm::vec4)playerModel["Model"]["Color"];
((glm::vec4&)dashEffectModel["ExplosionEffect"]["EndColor"]).w = 0.f;
(double&)dashEffectModel["ExplosionEffect"]["ExplosionDuration"] = dashEffect["Lifetime"]["Lifetime"];
(glm::vec3&)dashEffectModel["ExplosionEffect"]["ExplosionOrigin"] = glm::vec3(0, 1, 0) + (0.2f * controller->Movement());
auto animationChildren = dashEffectModel.ChildrenWithComponent("Animation");
for (auto animationEntity : animationChildren) {
(bool&)animationEntity["Animation"]["Play"] = false;
}
*/
}
}
}
return true;
}
@@ -242,6 +242,7 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
// Play animation
playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Fire");
// Third person anim
Events::AutoAnimationBlend b1;
b1.RootNode = wi.ThirdPersonPlayerModel;