diff --git a/assets b/assets index d7685a31..d48c77c8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit d7685a31afeb4ede0a1a50799ad43c85f3efd104 +Subproject commit d48c77c854317333e38917a2be76069df969426d diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h index a21ed6d5..3f3b6559 100644 --- a/include/Game/Systems/Weapon/WeaponBehaviour.h +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -60,7 +60,9 @@ protected: EntityWrapper Player; EntityWrapper WeaponEntity; EntityWrapper FirstPersonEntity; + EntityWrapper FirstPersonPlayerModel; EntityWrapper ThirdPersonEntity; + EntityWrapper ThirdPersonPlayerModel; }; IRenderer* m_Renderer; @@ -301,7 +303,9 @@ private: wi.Player = player; wi.WeaponEntity = player; wi.FirstPersonEntity = firstPersonWeapon; + wi.FirstPersonPlayerModel = firstPersonWeapon; wi.ThirdPersonEntity = thirdPersonWeapon; + wi.ThirdPersonPlayerModel = thirdPersonWeapon.FirstParentWithComponent("Model"); OnEquip(cWeapon, wi); } diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml index 8bceb701..5f245a53 100644 --- a/resources/Schema/Entities/PlayerAssaultBlue.xml +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -6,9 +6,7 @@ - - 0.5 - + @@ -550,10 +548,10 @@ - - BlendTreeAim - BlendTreeAssault - + + BlendTreeUpper + BlendTreeLower + @@ -577,8 +575,8 @@ Schema/Entities/WeaponAssaultBlueWorld.xml - - + + @@ -598,142 +596,80 @@ Schema/Entities/SidearmWeaponWorld.xml - - + + - + - AimPrimary - AimSecondary - 0 + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 true - - - - AimSecWepA - - false - true - - - - - - - - - AimRifleA - - false - true - - - - - - - - - - - ReloadSwitchBlend - FinalMovementBlend - - - - - + - StandCrouchBlend - JumpDashBlend - 2.5146881298480398e-63 + StandMovement + CrouchMovement + 0 true - + - StandMovement - CrouchMovement - 0 - true + MovementBlend + Idle + 1 - + - MovementBlend - Idle - 1 + Walk + StrafeLRBlend + 0 - + - Walk - StrafeLRBlend - 0 + Left + Right + 0.033793529385008014 - - - - Left - Right - 0.033793529385008014 - - - - - - - - CrouchStrafeLeftF - - 1 - true - - - - - - - - - CrouchStrafeRightF - - 1 - true - - - - - - - - + - CrouchWalkF - - 1 + CrouchStrafeLeftF + + true + + + + + + + + + CrouchStrafeRightF + true @@ -742,119 +678,11 @@ - + - CrouchF - - 1 - - - - - - - - - - - MovementBlend - Idle - 1 - - - - - - - - RunWalkBlend - StrafeLRBlend - 2.4565650245976452e-16 - - - - - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - - - - - IdleF - - 1 + CrouchWalkF + true @@ -863,70 +691,65 @@ - - - - - - Jump - DashBlend - 1 - true - - - - - + - JumpF - - 1 - false + CrouchF + - + + + + + + MovementBlend + Idle + 1 + + + + + - DashFBBlend - DashLRBlend - 0.014621149736541383 + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 - + - DashForward - DashBackward - 0.014363533804961248 + Walk + Run + 1.2938206818383024e-24 - + - DashForwardF - - 2 - false + WalkF + + true - + - DashBackwardF - - 2 - false + RunF + + true @@ -934,35 +757,33 @@ - + - DashLeft - DashRight - 4.3244885367500671e-16 + Left + Right + 0.033793529385008014 - + - DashLeftF - - 2 - false + StrafeLeftF + + true - + - DashRightF - - 2 - false + StrafeRightF + + true @@ -972,71 +793,186 @@ + + + + IdleF + + true + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + false + + + + + + + + + DashFBBlend + DashLRBlend + 0.014621149736541383 + + + + + + + + DashForward + DashBackward + 0.014363533804961248 + + + + + + + + DashForwardF + + 2 + false + + + + + + + + + DashBackwardF + + 2 + false + + + + + + + + + + + DashLeft + DashRight + 4.3244885367500671e-16 + + + + + + + + DashLeftF + + 2 + false + + + + + + + + + DashRightF + + 2 + false + + + + + + + - + + + + + + AssaultWeaponBlend + SidearmWeapon + 0 + true + + + + + - - ReloadSwitch - WeaponActionBlend - 1 - true - + + Aim + WeaponBlend + - + - - ReloadSwitchU - - 1 - - - - - - - - - IdleBlend - ShootBlend - 0 - + + MovementBlend + ActionBlend + - + - IdlePrimary - IdleSecondary - 0 + Fire + Reload + 1 - + - IdleAssaultRifleU - - 1 - true + ReloadSwitchU + 0.5 + false - + - IdleSecWepU - - 1 - true + ShootFastRifleU + false @@ -1044,31 +980,33 @@ - + - ShootPrimary - ShootSecondary + Idle + Run 0 - + - ShootFastRifleU - - 1 + IdleAssaultRifleU + true + true - + - ShootSecWepFastU + IdleAssaultRifleU + true + true @@ -1078,6 +1016,19 @@ + + + + AimRifleA + + 0.10000000149011612 + false + true + + + + + diff --git a/resources/Schema/Entities/WeaponAssaultBlueView.xml b/resources/Schema/Entities/WeaponAssaultBlueView.xml index 235a9480..05b65bbb 100644 --- a/resources/Schema/Entities/WeaponAssaultBlueView.xml +++ b/resources/Schema/Entities/WeaponAssaultBlueView.xml @@ -4,7 +4,7 @@ MovementBlend - FinalBlend + ActionBlend Models/Characters/Assault/FirstPersonAssaultBlue.mesh @@ -13,54 +13,34 @@ - + - BlendTreeAssaultWeapon - BlendTreeSecondaryWeapon + Fire + Reload 0 true - + - - Fire - Reload - 0 - true - + + ReloadSwitchF + 0.5 + false + - - - - - ReloadSwitchF - 0.5 - false - - - - - - - - - ShootRifleF - 1 - false - - - - - - + - + + + ShootRifleF + false + @@ -78,11 +58,10 @@ - + - IdleF - 1 + RunF true true @@ -90,11 +69,10 @@ - + - RunF - 1 + IdleF true true @@ -113,8 +91,8 @@ Models/Weapons/Blue/AssaultWeaponBlue.mesh - - + + @@ -149,9 +127,9 @@ true - - - + + + diff --git a/resources/Schema/Entities/WeaponDefenderBlueView.xml b/resources/Schema/Entities/WeaponDefenderBlueView.xml index 493c7243..c22e7200 100644 --- a/resources/Schema/Entities/WeaponDefenderBlueView.xml +++ b/resources/Schema/Entities/WeaponDefenderBlueView.xml @@ -27,9 +27,7 @@ - ActivateDeactiveShieldF - - 1 + ActivateDeactivateShieldF false @@ -50,7 +48,6 @@ ShootShotgunF - 1 false @@ -71,7 +68,6 @@ ShotgunReloadTwoF - 1 @@ -91,7 +87,6 @@ ShotgunReloadOneF - 1 false @@ -102,7 +97,6 @@ ShotgunReloadThreeF - 1 false @@ -132,7 +126,6 @@ IdleF - 1 true true @@ -144,7 +137,6 @@ RunF - 1 true true @@ -163,8 +155,8 @@ Models/Weapons/Blue/DefenderWeaponBlue.mesh - - + + @@ -197,9 +189,9 @@ true - - - + + + diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 13c3d8a3..dddf5fdd 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -72,7 +72,7 @@ void AssaultWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& const float& movementSpeed = cPlayer["MovementSpeed"]; float speed = glm::length((const glm::vec3&)cPhysics["Velocity"]); float animationWeight = glm::min(speed, movementSpeed) / movementSpeed; - EntityWrapper rootNode = wi.FirstPersonEntity.FirstParentWithComponent("Model"); + EntityWrapper rootNode = wi.FirstPersonEntity; if (rootNode.Valid()) { EntityWrapper blend = rootNode.FirstChildByName("MovementBlend"); if (blend.Valid()) { @@ -125,7 +125,20 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) reloadTimer = reloadTime; // Play animation - playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Reload"); + playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Reload"); + // Third person anim + Events::AutoAnimationBlend b1; + b1.RootNode = wi.ThirdPersonPlayerModel; + b1.NodeName = "Reload"; + b1.Restart = true; + b1.Start = true; + 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 if (wi.FirstPersonEntity.Valid()) { if (IsClient) { @@ -233,7 +246,19 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi } // Play animation - playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Fire"); + playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Fire"); + // Third person anim + Events::AutoAnimationBlend b1; + b1.RootNode = wi.ThirdPersonPlayerModel; + b1.NodeName = "Fire"; + b1.Restart = true; + b1.Start = true; + 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 Events::PlaySoundOnEntity e; diff --git a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp index c18f9397..835b5378 100644 --- a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp @@ -139,17 +139,14 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf if (IsClient) { EntityWrapper root = wi.FirstPersonEntity; if (root.Valid()) { - EntityWrapper subTree = root.FirstChildByName("FinalBlend"); - if (subTree.Valid()) { - EntityWrapper animationNode = subTree.FirstChildByName("Shield"); - if (animationNode.Valid()) { - Events::AutoAnimationBlend eFireBlend; - eFireBlend.RootNode = root; - eFireBlend.NodeName = "Shield"; - eFireBlend.Restart = true; - eFireBlend.Start = true; - m_EventBroker->Publish(eFireBlend); - } + EntityWrapper animationNode = root.FirstChildByName("Shield"); + if (animationNode.Valid()) { + Events::AutoAnimationBlend eFireBlend; + eFireBlend.RootNode = root; + eFireBlend.NodeName = "Shield"; + eFireBlend.Restart = true; + eFireBlend.Start = true; + m_EventBroker->Publish(eFireBlend); } } } @@ -159,17 +156,14 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf if (IsClient) { EntityWrapper root = wi.FirstPersonEntity; if (root.Valid()) { - EntityWrapper subTree = root.FirstChildByName("FinalBlend"); - if (subTree.Valid()) { - EntityWrapper animationNode = subTree.FirstChildByName("ActionBlend"); - if (animationNode.Valid()) { - Events::AutoAnimationBlend eFireBlend; - eFireBlend.RootNode = root; - eFireBlend.NodeName = "ActionBlend"; - eFireBlend.Restart = true; - eFireBlend.Start = true; - m_EventBroker->Publish(eFireBlend); - } + EntityWrapper animationNode = root.FirstChildByName("ActionBlend"); + if (animationNode.Valid()) { + Events::AutoAnimationBlend eFireBlend; + eFireBlend.RootNode = root; + eFireBlend.NodeName = "ActionBlend"; + eFireBlend.Restart = true; + eFireBlend.Start = true; + m_EventBroker->Publish(eFireBlend); } } }