diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 117084542..bc18364e1 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -38,6 +38,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; + float2 vDelay; }; @@ -79,6 +80,17 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + particleValue.vDelay.x += fTimeDelta; + + if (particleValue.vDelay.x < particleValue.vDelay.y) + { + + g_VBInstanceOutput[iIndex] = particle; + g_ParticleValueOutput[iIndex] = particleValue; + + return; + } + // 라이프타임 움직임 particle.vLifeTime.x += fTimeDelta; @@ -97,7 +109,7 @@ void CS_MAIN( particle.vLifeTime.x = 0.f; particleValue.vAniIndex.x = 0.f; - + particleValue.vDelay.x = 0.f; g_VBInstanceOutput[iIndex] = particle; g_ParticleValueOutput[iIndex] = particleValue; diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index e614342ce..fd32c126f 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -23,9 +23,11 @@ float g_fOwnerAlpha; float g_fCanvasAlpha; float g_fAngle; float g_fCoolTime; +float g_fHp; float2 g_fOrigin_Size; float2 g_fCurrent_Size; +float2 g_fHpBG; float4 g_fNine_Slice; @@ -461,7 +463,7 @@ PS_OUT PS_SpellAnim(PS_IN In) } } - if (uv.y <= CoolTime) + if (uv.y <= CoolTime) { color.a = 0.f; } @@ -472,6 +474,79 @@ PS_OUT PS_SpellAnim(PS_IN In) return Out; } +PS_OUT PS_HpBar(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); + Color = tex1; + + float2 reversuv = In.vTexcoord; + + reversuv.x = 1.0f - Finaluv; + + float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); + + if (reversuv.x >= g_fHp) + { + tex2.rgb = float3(0.f, 0.f, 0.f); + } + + tex2.rgb *= float3(112.f, 241.f, 31.f) / 255.f; + + if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f))) + Color = tex2; + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -603,4 +678,13 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_SpellAnim(); } + pass HpBar + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_HpBar(); + } } diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp index 1b01ea2c4..0dfea5d85 100644 --- a/Jusin154_Team3D/Client/Default/Client.cpp +++ b/Jusin154_Team3D/Client/Default/Client.cpp @@ -11,7 +11,7 @@ HWND g_hWnd; WCHAR szTitle[MAX_LOADSTRING]; WCHAR szWindowClass[MAX_LOADSTRING]; -// 이 코드 모듈에 포함된 함수의 선언을 전달합니다: + ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 9c88f7596..3f3bd6c8f 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -157,6 +157,7 @@ + @@ -168,16 +169,19 @@ - + + + - - true - true - + + + + + @@ -192,21 +196,14 @@ - - - - - - - - + @@ -214,6 +211,7 @@ + @@ -226,8 +224,16 @@ + + + + + + + + @@ -246,21 +252,14 @@ - - - - - - - - + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index d48707800..a94092e3b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -37,9 +37,6 @@ 01.Levels\02.GamePlay - - 99.Define - 03.InfoInstance @@ -64,69 +61,12 @@ 03.InfoInstance\02.MapInfo - - 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget - - - 02.GameObjects\UI\GamePlay_Canvas - - - 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel - - + 02.GameObjects\Player 02.GameObjects\Item\Wand - - 80.State - - - 80.State\State_Combat - - - 80.State\State_Combat\State_Cast - - - 80.State\State_Combat\State_LightAttack - - - 80.State\State_Combat\State_Skill - - - 80.State\State_Combat\State_Skill2 - - - 80.State\State_Move - - - 80.State\State_Move\State_Idle - - - 80.State\State_Move\State_Jog - - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint - - - 80.State\State_Move\State_Dodge - - - 80.State\State_Move\State_Idle_Turn - - - 80.State\State_Jump - - - 80.State\State_Land - - - 02.GameObjects\Cameras\CameraPosition\Player - 02.GameObjects\Cameras\CameraPosition\Arm @@ -166,6 +106,57 @@ 02.GameObjects\PhysX\CallBack\HitReport + + 04.Mechanic\State + + + 04.Mechanic\State\State_Combat + + + 04.Mechanic\State\Focus\Dodge + + + 04.Mechanic\State\Focus\Jump + + + 04.Mechanic\State\Focus\Land + + + 04.Mechanic\State\Movement\Idle + + + 04.Mechanic\State\Movement\Move + + + 02.GameObjects\Effect\Effect_Container + + + 02.GameObjects\Effect\EffectParts + + + 02.GameObjects\Effect\EffectObject + + + 02.GameObjects\Effect\TrailObject + + + 02.GameObjects\Effect\Effects\Bombard + + + 02.GameObjects\Effect\Effects\NomalJap + + + 02.GameObjects\PhysX\EffectHitBox + + + 02.GameObjects\Cameras\CameraPosition\Socket + + + 02.GameObjects\Cameras\CameraPosition\Player\Target + + + 02.GameObjects\Cameras\CameraPosition\Player\Shoulder + @@ -233,12 +224,6 @@ {1bfec6dc-f008-4d18-87d6-be38824b1272} - - {3eb21e8e-e01c-47fe-828e-800212456eb5} - - - {9f952e5a-835c-4de9-b7b5-9a731912774d} - {c5b61cb3-bc5f-4429-8715-b309dcf054b2} @@ -254,9 +239,6 @@ {8d89a59c-fbd2-4a4a-ab01-a70abb80cc49} - - {708bbc88-47fb-42c5-b060-14cec7d646f2} - {b24c78ef-dccc-41f0-a086-053ae6b7fbf4} @@ -316,51 +298,6 @@ {f7f22fc0-0e66-4e6e-a60a-0c612d58d802} - - - {be963729-ed65-4506-82f2-24213f5ecf5a} - - - {fb0a8b8b-5376-4606-8e6e-b020abf2d476} - - - {5e4bd8c2-9ace-4617-880b-9c7fa826dfd4} - - - {28b2cdcb-e307-4da5-a222-24a77480605c} - - - {8f9ce518-cd40-4a0c-ac4f-f77459a13cfd} - - - {68ec69bb-6697-42aa-abf4-cd6d148a1648} - - - {99f16910-04c8-44e2-84ff-17321d94d1f0} - - - {e2599ab3-3d02-420c-b29c-0f87b4263429} - - - {3110d3d0-422e-42eb-a045-c8c784528165} - - - {cd90a5f0-2428-4537-801f-a65b7273c3be} - - - {5f5abe29-f43a-4de7-8955-b21ca1c6fb94} - - - {03cf23a9-5c0f-4cb1-a32b-5807a612c039} - - - {b3fdd366-2689-49c9-b1c1-6843772e9661} - - - {309d0593-507f-484c-92aa-7c8fc483941b} - - - {a3ab0237-10b3-4699-a39d-63c625024f67} {f0da95a0-107f-42ff-9e77-3503bb48aa12} @@ -389,6 +326,66 @@ {dc05dfc9-22e5-4a2a-b016-c55b215c0c68} + + {0834c76d-83d8-4ef5-9d19-7277686d28c5} + + + {017fc692-bac0-4635-843c-02fb59009f5b} + + + {349939a0-8b9a-4a1a-8f0a-ca5014cd4e18} + + + {5fa1e5a9-acd8-499d-90ee-9cf17441b3a5} + + + {41d2e34e-5280-4b3c-961e-064484f1449d} + + + {1034dd61-dd17-456a-990b-628c45f74b51} + + + {2999d0c5-81e4-44d6-99b3-4801e6f84dd7} + + + {0a3f9629-27d1-411c-806e-b550af8f1ca1} + + + {23fc95c4-0db3-4569-bd37-4d9bc32938ba} + + + {a88b2e75-92f7-4bed-b12a-76fb8763f533} + + + {482050d0-23dc-4744-b0db-0673a84f40e7} + + + {129abdf3-e499-467e-aca8-917e66827890} + + + {b3077955-b37e-41f8-bb7a-7b1483fcecdc} + + + {6fc43376-8b17-4888-b347-9beef7bee2ba} + + + {3a613328-d01e-43e5-a095-9a6912cb3cf0} + + + {639cba10-a93e-465c-a921-4541fe317446} + + + {54169d8d-f771-4638-a71e-3aca3eeff9bb} + + + {1f9c16e8-b675-419f-b166-b79662407259} + + + {708bbc88-47fb-42c5-b060-14cec7d646f2} + + + {2e4f0394-e25c-4508-937a-7e73d005ae5f} + @@ -436,69 +433,12 @@ 03.InfoInstance\02.MapInfo - - 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget - - - 02.GameObjects\UI\GamePlay_Canvas - - - 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel - 02.GameObjects\Player 02.GameObjects\Item\Wand - - 80.State - - - 80.State\State_Combat - - - 80.State\State_Combat\State_Cast - - - 80.State\State_Combat\State_LightAttack - - - 80.State\State_Combat\State_Skill - - - 80.State\State_Combat\State_Skill2 - - - 80.State\State_Move - - - 80.State\State_Move\State_Idle - - - 80.State\State_Move\State_Jog - - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint - - - 80.State\State_Move\State_Dodge - - - 80.State\State_Move\State_Idle_Turn - - - 80.State\State_Jump - - - 80.State\State_Land - - - 02.GameObjects\Cameras\CameraPosition\Player - 02.GameObjects\Cameras\CameraPosition\Arm @@ -538,6 +478,57 @@ 02.GameObjects\PhysX\CallBack\HitReport + + 04.Mechanic\State + + + 04.Mechanic\State\State_Combat + + + 04.Mechanic\State\Focus\Dodge + + + 04.Mechanic\State\Focus\Jump + + + 04.Mechanic\State\Focus\Land + + + 04.Mechanic\State\Movement\Idle + + + 04.Mechanic\State\Movement\Move + + + 02.GameObjects\Effect\Effect_Container + + + 02.GameObjects\Effect\EffectParts + + + 02.GameObjects\Effect\EffectObject + + + 02.GameObjects\Effect\TrailObject + + + 02.GameObjects\Effect\Effects\Bombard + + + 02.GameObjects\Effect\Effects\NomalJap + + + 02.GameObjects\PhysX\EffectHitBox + + + 02.GameObjects\Cameras\CameraPosition\Socket + + + 02.GameObjects\Cameras\CameraPosition\Player\Target + + + 02.GameObjects\Cameras\CameraPosition\Player\Shoulder + diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp new file mode 100644 index 000000000..cf24bbdc2 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -0,0 +1,193 @@ +#include "pch.h" +#include "Bombard.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "PhysXEffectHitBox.h" + + +CBombard::CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CBombard::CBombard(const CBombard& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CBombard::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CBombard::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Ready_Child())) + return E_FAIL; + + if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Bombard/"))) + return E_FAIL; + + + m_wstrEffectName = L"Bombard"; + + CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); + m_pLight_Projectile = Get_PartObject("Bombard_Projectile"); + CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); + + pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + pCircle0->Set_Visible(true); + pShootPt->Set_Visible(true); + m_pLight_Projectile->Set_Visible(true); + + SAFE_ADDREF(m_pLight_Projectile); + m_fDuration = 2.5f; + + return S_OK; +} + +void CBombard::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CBombard::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + + m_pLight_Projectile->Get_Component()->Translation(vOwnerLook * 2.f); +} + +void CBombard::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CBombard::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CBombard::Ready_Child() +{ + CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; + + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = { 0.f, 0.f, 2.f }; + Desc.vLifeTime = { 0.f, 2.f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } + + return S_OK; +} + +CBombard* CBombard::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CBombard* pInstance = new CBombard(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CBombard"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner) +{ + CBombard* pInstance = new CBombard(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CBombard"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CBombard::OnCollision(CGameObject* pOther , void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + } + + + m_pLight_Projectile->Set_Visible(false); + Get_PartObject("Bombard_Shoot_Pt")->Set_Visible(false); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + Get_PartObject("Bombard_Smoke")->Get_Component()->Translation(vOwnerLook); + + Get_PartObject("Bombard_Circle0")->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); +} + +void CBombard::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pLight_Projectile); + +} + +void CBombard::Describe_Entity() +{ + +} + +HRESULT CBombard::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 346c77b83..705d3dbde 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -39,8 +39,6 @@ void CBroom::Priority_Update(_float fTimeDelta) void CBroom::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - - m_pModelCom->ComputeSkinning(); } void CBroom::Late_Update(_float fTimeDelta) @@ -61,6 +59,9 @@ HRESULT CBroom::Render() for (_uint i = 0; i < iNumMeshes; i++) { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; @@ -69,9 +70,6 @@ HRESULT CBroom::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; - if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp index 14c06801f..2f00ec9dc 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp @@ -6,12 +6,10 @@ CCamPosition_Arm::CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* p : CCamPosition(pDevice, pContext) { } - CCamPosition_Arm::CCamPosition_Arm(const CCamPosition_Arm& rhs) : CCamPosition(rhs) { } - HRESULT CCamPosition_Arm::Initialize_Prototype() { return S_OK; @@ -44,6 +42,7 @@ void CCamPosition_Arm::Priority_Update(_float fTimeDelta) void CCamPosition_Arm::Update(_float fTimeDelta) { + } void CCamPosition_Arm::Late_Update(_float fTimeDelta) @@ -96,12 +95,10 @@ CCamPosition_Arm* CCamPosition_Arm::Clone(void* pArg, class CGameObject* pOWner) return pInstance; } - void CCamPosition_Arm::Free() { __super::Free(); } - void CCamPosition_Arm::Describe_Entity() { } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp new file mode 100644 index 000000000..14d07c060 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -0,0 +1,213 @@ +#include "pch.h" +#include "CamPosition_Shoulder.h" +#include "CamPosition_Target.h" +#include "GameInstance.h" +#include "Camera_Gaze.h" + +CCamPosition_Shoulder::CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamPosition(pDevice, pContext) +{ +} +CCamPosition_Shoulder::CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs) + : CCamPosition(rhs) +{ +} +HRESULT CCamPosition_Shoulder::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition_Shoulder::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_SubParts())) { + return E_FAIL; + } + + CAMERA_SHOULDER_DESC* pDesc = static_cast(pArg); + { + m_fMouseSensor = pDesc->fMouseSensor; + m_vShoulderPosRatio = pDesc->vInitialLook; + m_fShoulderDistance = pDesc->fShoulderDistance; + m_vAccDegreeXY = { 0.f, 0.f }; + m_fCameraFocalLength = pDesc->fCameraFocalLength; + m_fBackFrontRatio = pDesc->fBackFrontRatio; + + m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio = pDesc->vInitialLook; + m_vShoulderStartRatio.x *= -1.f; + m_pTransformCom->Set_State(STATE::POSITION, + m_pParentTransformCom->Get_State(STATE::POSITION) + + XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)) * m_fShoulderDistance); + + _vector vShoulderPos = Get_WorldPostion(); + _vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f); + _vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq)); + + CTransform* pLookTransform = m_pTarget_LookPart->Get_Component(); + CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component(); + + pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio)); + pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio))); + } + + return S_OK; +} + +void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta) +{ + if (true == m_bMovable) { + m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor; + m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor; + } + + _vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)); + _vector vRotq = XMQuaternionRotationRollPitchYaw(0.f, XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vLook = XMVector3Normalize(XMVector3Rotate(vLook, vRotq)); + + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(vLook) * m_fShoulderDistance); + _vector vShoulderPos = Get_WorldPostion(); + _vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f); + _vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq)); + + CTransform* pLookTransform = m_pTarget_LookPart->Get_Component(); + CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component(); + + pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio)); + pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio))); +} + +void CCamPosition_Shoulder::Update(_float fTimeDelta) +{ + Describe_Entity(); + if (m_pGameInstance->Key_Up(DIK_GRAVE)) { + m_bMovable = !m_bMovable; + } + if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + m_pGameInstance->Toggle_MouseCenter(); + } + if (m_pGameInstance->Key_Up(DIK_P)) { + m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio; + m_vShoulderStartRatio.x *= -1.f; + m_bLerp = true; + m_vLerpTimer.x = 0.f; + } +} + +void CCamPosition_Shoulder::Late_Update(_float fTimeDelta) +{ + if (true == m_bLerp) { + m_vLerpTimer.x += fTimeDelta; + XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTimer.x / m_vLerpTimer.y)); + if (m_vLerpTimer.x > m_vLerpTimer.y) { + m_bLerp = false; + m_vLerpTimer.x = 0.f; + + m_vShoulderPosRatio = m_vShoulderOtherRatio; + } + } +} + +HRESULT CCamPosition_Shoulder::Render() +{ + return S_OK; +} + +_vector CCamPosition_Shoulder::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CCamPosition_Shoulder::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC DescTransfrom = {}; + DescTransfrom.fRadius = 30.f; + DescTransfrom.fRotationPerSec = 0.f; + DescTransfrom.fSpeedPerSec = 0.f; + if (FAILED(__super::Ready_Components(&DescTransfrom))) { + return E_FAIL; + } + return S_OK; +} +HRESULT CCamPosition_Shoulder::Ready_SubParts() +{ + { + CCamPosition_Target::CAMERAPOSITION_TARGET_DESC Desc{}; + Desc.pParentTransform = m_pTransformCom; + m_pTarget_LookPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc); + m_pTarget_FollowPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc); + } + + CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 300.f; + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + CameraDesc.pFollowTarget = m_pTarget_FollowPart; + CameraDesc.pLookTarget = m_pTarget_LookPart; + CameraDesc.iPriority = 51; + CameraDesc.pCameraKey = TEXT("CAM_SHOULDER"); + CameraDesc.bEnableTransitionLerp = true; + CameraDesc.bEnableFollowLerp = true; + CameraDesc.bEnableLookLerp = true; + CameraDesc.vTransitionTime = { 0.f, 1.f }; + CameraDesc.vFollowLerpTime = { 0.f, 0.16f }; + CameraDesc.vLookLerpTime = { 0.f, 0.16f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &m_pBinded_Camera))) + { + return E_FAIL; + } + m_pGameInstance->Add_Camera(NEXT_LEVEL, m_pBinded_Camera, TEXT("CAM_SHOULDER")); + + + return S_OK; +} +CCamPosition_Shoulder* CCamPosition_Shoulder::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Shoulder"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Shoulder* CCamPosition_Shoulder::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Shoulder"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +void CCamPosition_Shoulder::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pTarget_LookPart); + SAFE_RELEASE(m_pTarget_FollowPart); +} +void CCamPosition_Shoulder::Describe_Entity() +{ + GUI::Begin("Cam_Shoulder"); + m_pTransformCom->Describe_Entity(); + GUI::Text("fMouseSensor : %.1f", &m_fMouseSensor); + GUI::SliderFloat("ShoulderDistance", &m_fShoulderDistance, 0.f, 10.f, "%.1f"); + GUI::SliderFloat("BackFrontRatio", &m_fBackFrontRatio, 0.01f, 0.99f, "%.2f"); + GUI::Text("Pitch Yaw : %f %f", &m_vAccDegreeXY.x, &m_vAccDegreeXY.y); + GUI::SliderFloat3("ShoulderPosRatio", (_float*)&m_vShoulderPosRatio, -2.f, 2.f, "%.1f"); + GUI::End(); +} diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp similarity index 54% rename from Jusin154_Team3D/Client/Private/CamPosition_Player.cpp rename to Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp index 074fdc97e..a0e990a1f 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp @@ -1,18 +1,18 @@ #include "pch.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" -CCamPosition_Player::CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CCamPosition_Socket::CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CCamPosition(pDevice, pContext) { } -CCamPosition_Player::CCamPosition_Player(const CCamPosition_Player& rhs) +CCamPosition_Socket::CCamPosition_Socket(const CCamPosition_Socket& rhs) :CCamPosition(rhs) { } -void CCamPosition_Player::Priority_Update(_float fTimeDelta) +void CCamPosition_Socket::Priority_Update(_float fTimeDelta) { /*_matrix socketMatrix = {}; @@ -24,20 +24,20 @@ void CCamPosition_Player::Priority_Update(_float fTimeDelta) m_pTransformCom->Set_WorldMatrix(/*socketMatrix * */XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); } -void CCamPosition_Player::Update(_float fTimeDelta) +void CCamPosition_Socket::Update(_float fTimeDelta) { } -void CCamPosition_Player::Late_Update(_float fTimeDelta) +void CCamPosition_Socket::Late_Update(_float fTimeDelta) { } -HRESULT CCamPosition_Player::Initialize_Prototype() +HRESULT CCamPosition_Socket::Initialize_Prototype() { return S_OK; } -HRESULT CCamPosition_Player::Initialize(void* pArg) +HRESULT CCamPosition_Socket::Initialize(void* pArg) { CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast (pArg); //m_pSocketMatrices = pDesc->pSocketMatrices; @@ -54,7 +54,7 @@ HRESULT CCamPosition_Player::Initialize(void* pArg) return S_OK; } -HRESULT CCamPosition_Player::Ready_Components(void* pArg) +HRESULT CCamPosition_Socket::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -64,42 +64,42 @@ HRESULT CCamPosition_Player::Ready_Components(void* pArg) return S_OK; } -HRESULT CCamPosition_Player::Bind_ShaderResources() +HRESULT CCamPosition_Socket::Bind_ShaderResources() { return S_OK; } -CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CCamPosition_Socket* CCamPosition_Socket::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CCamPosition_Player* pInstance = new CCamPosition_Player(pDevice, pContext); + CCamPosition_Socket* pInstance = new CCamPosition_Socket(pDevice, pContext); if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CCamPosition_Player"); + MSG_BOX("Failed to Created : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } return pInstance; } -CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* pOWner) +CCamPosition_Socket* CCamPosition_Socket::Clone(void* pArg, class CGameObject* pOWner) { - CCamPosition_Player* pInstance = new CCamPosition_Player(*this); + CCamPosition_Socket* pInstance = new CCamPosition_Socket(*this); pInstance->m_pOwner = pOWner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CCamPosition_Player"); + MSG_BOX("Failed to Cloned : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } return pInstance; } -void CCamPosition_Player::Free() +void CCamPosition_Socket::Free() { __super::Free(); } -void CCamPosition_Player::Describe_Entity() +void CCamPosition_Socket::Describe_Entity() { } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp new file mode 100644 index 000000000..c3b561717 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp @@ -0,0 +1,94 @@ +#include "pch.h" + +#include "CamPosition_Target.h" + +CCamPosition_Target::CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCamPosition(pDevice, pContext) +{ +} +CCamPosition_Target::CCamPosition_Target(const CCamPosition_Target& rhs) + :CCamPosition(rhs) +{ +} + +void CCamPosition_Target::Priority_Update(_float fTimeDelta) +{ +} + +void CCamPosition_Target::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Target::Late_Update(_float fTimeDelta) +{ +} + +_vector CCamPosition_Target::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CCamPosition_Target::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition_Target::Initialize(void* pArg) +{ + CAMERAPOSITION_TARGET_DESC* pDesc = static_cast (pArg); + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Target::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Target::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Target* CCamPosition_Target::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Target* pInstance = new CCamPosition_Target(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Target"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Target* CCamPosition_Target::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Target* pInstance = new CCamPosition_Target(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Target"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +void CCamPosition_Target::Free() +{ + __super::Free(); +} +void CCamPosition_Target::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index c82a2a622..6e22265f5 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -21,11 +21,12 @@ void CCamera_Debug::Update(_float fTimeDelta) Transition(fTimeDelta); _float3 vCamPos = {}; XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); + GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); if (m_pGameInstance->Key_Up(DIK_GRAVE)) { m_bMovable = !m_bMovable; } - if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + if (m_pGameInstance->Key_Down(DIK_1)) { m_pGameInstance->Toggle_MouseCenter(); } if (m_bMovable) { diff --git a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp index a7eeb9049..af290c2af 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp @@ -14,8 +14,20 @@ CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs) void CCamera_Gaze::Priority_Update(_float fTimeDelta) { if (false == m_bIsCurrentTransition) { - m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component()->Get_State(STATE::POSITION)); - m_pTransformCom->LookAt(m_pLookTarget->Get_Component()->Get_State(STATE::POSITION)); + if (m_bEnable_FollowLerp) { + _vector vNewPos = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vFollowPos_Src), XMLoadFloat3(&m_vFollowPos_Dest), m_vFollowLerpTime.x / m_vFollowLerpTime.y), 1.f); + m_pTransformCom->Set_State(STATE::POSITION, vNewPos); + } + else { + m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component()->Get_State(STATE::POSITION)); + } + if (m_bEnable_LookLerp) { + _vector vNewLook = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vLookPos_Src), XMLoadFloat3(&m_vLookPos_Dest), m_vLookLerpTime.x / m_vLookLerpTime.y), 1.f); + m_pTransformCom->LookAt(vNewLook); + } + else { + m_pTransformCom->LookAt(m_pLookTarget->Get_Component()->Get_State(STATE::POSITION)); + } } m_bActive = true; __super::Bind_Matrices(); @@ -23,22 +35,59 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta) void CCamera_Gaze::Update(_float fTimeDelta) { + Update_LerpTimer(fTimeDelta); + + Describe_Entity(); +} + +void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta) +{ + if (true == m_bEnable_LookLerp) { + m_vLookLerpTime.x += fTimeDelta; + if (m_vLookLerpTime.y <= m_vLookLerpTime.x) { + m_vLookLerpTime.x = 0.f; + m_bEnable_LookLerp = false; + XMStoreFloat3(&m_vLookPos_Src, XMLoadFloat3(&m_vLookPos_Dest)); + XMStoreFloat3(&m_vLookPos_Dest, m_pLookTarget->Get_WorldPostion()); + } + } + + if (true == m_bEnable_FollowLerp) { + m_vFollowLerpTime.x += fTimeDelta; + if (m_vFollowLerpTime.y <= m_vFollowLerpTime.x) { + m_vFollowLerpTime.x = 0.f; + m_bEnable_FollowLerp = false; + XMStoreFloat3(&m_vFollowPos_Src, m_pTransformCom->Get_State(STATE::POSITION)); + XMStoreFloat3(&m_vFollowPos_Dest, m_pFollowTarget->Get_WorldPostion()); + } + } +} + +void CCamera_Gaze::Enable_FollowLerp() +{ + m_bEnable_FollowLerp = true; + m_vFollowLerpTime.x = 0.f; + XMStoreFloat3(&m_vFollowPos_Src, m_pFollowTarget->Get_WorldPostion()); +} + +void CCamera_Gaze::Enable_LookLerp() +{ + m_bEnable_LookLerp = true; + m_vLookLerpTime.x = 0.f; + XMStoreFloat3(&m_vLookPos_Src, m_pLookTarget->Get_WorldPostion()); } void CCamera_Gaze::Late_Update(_float fTimeDelta) { } - HRESULT CCamera_Gaze::Render() { return S_OK; } - HRESULT CCamera_Gaze::Initialize_Prototype() { return S_OK; } - HRESULT CCamera_Gaze::Initialize(void* pArg) { @@ -52,7 +101,6 @@ HRESULT CCamera_Gaze::Initialize(void* pArg) return S_OK; } - HRESULT CCamera_Gaze::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -61,12 +109,10 @@ HRESULT CCamera_Gaze::Ready_Components(void* pArg) return S_OK; } - HRESULT CCamera_Gaze::Bind_ShaderResources() { return S_OK; } - CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CCamera_Gaze* pInstance = new CCamera_Gaze(pDevice, pContext); @@ -78,7 +124,6 @@ CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p return pInstance; } - CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner) { CCamera_Gaze* pInstance = new CCamera_Gaze(*this); @@ -91,13 +136,35 @@ CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner) return pInstance; } - void CCamera_Gaze::Free() { __super::Free(); } - void CCamera_Gaze::Describe_Entity() { + GUI::Begin("Camera_Gaze_Describe"); + m_pTransformCom->Describe_Entity(); + GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z); + GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z); + GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z); + GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z); + GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp); + if (true == m_bEnable_TransitionLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y); + GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f"); + } + GUI::Checkbox("LookLerp", &m_bEnable_LookLerp); + if (true == m_bEnable_LookLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y); + GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f"); + } + + GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp); + if (true == m_bEnable_FollowLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y); + GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f"); + } + + GUI::End(); } diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp new file mode 100644 index 000000000..4d3561f29 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -0,0 +1,665 @@ +#include "pch.h" +#include "EffectObject.h" +#include "GameInstance.h" + +CEffectObject::CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPartObject(pDevice, pContext) +{ +} + +CEffectObject::CEffectObject(const CEffectObject& rhs) + :CPartObject(rhs) +{ +} + +void CEffectObject::Priority_Update(_float fTimeDelta) +{ +} + +void CEffectObject::Update(_float fTimeDelta) +{ + +} + +void CEffectObject::Late_Update(_float fTimeDelta) +{ + +} + +HRESULT CEffectObject::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + + for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) + { + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP)))) { + return E_FAIL; + } + + if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) + return E_FAIL; + + + + + if (FAILED(m_pInstance_ModelCom->Render(i))) + { + return E_FAIL; + } + } + + + return S_OK; +} + +HRESULT CEffectObject::Render_Blur() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_EffectInfo.fBlurIntensity, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_EffectInfo.iBlurWeight, sizeof(_int)))) { + return E_FAIL; + } + + + + for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) + { + + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLUR)))) { + return E_FAIL; + } + + if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) + return E_FAIL; + + + if (FAILED(m_pInstance_ModelCom->Render(i))) + { + return E_FAIL; + } + + } + + + + + return S_OK; +} + + + +HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) +{ + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pNoise_TextureCom); + SAFE_RELEASE(m_pMasking_TextureCom); + SAFE_RELEASE(m_pDissolve_TextureCom); + SAFE_RELEASE(m_pEmissive_TextureCom); + + SAFE_RELEASE(m_pInstance_ModelCom); + + if (m_pLightCom != nullptr) + SAFE_RELEASE(m_pLightCom); + + _string strPerfectFilePath = pFilePath; + + strPerfectFilePath += ".bin"; + + HANDLE hFile = CreateFileW( + CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름 + GENERIC_READ, // 읽기 모드 + FILE_SHARE_READ, // 다른 프로세스도 읽기 가능 + NULL, + OPEN_EXISTING, // 기존 파일 열기 + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK); + return E_FAIL; + } + + // 나중에 패키징할때 패스를 저장할거임 + + + DWORD dwByte(0); + + if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_EffectInfo.LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION); + m_EffectInfo.LightDesc.iLevel = ENUM_CLASS(eLevel); + + if (m_EffectInfo.LightDesc.eType != LIGHT::DIRECTIONAL) // 0이 아닐때만 생성 + { + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc))) + { + CloseHandle(hFile); + return E_FAIL; + } + } + + + if (m_EffectInfo.isDiffuse) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strDiffuseName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), + reinterpret_cast(&m_pDiffuse_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + + } + + + } + + if (m_EffectInfo.isNoise) + { + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strNoiseName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), + reinterpret_cast(&m_pNoise_TextureCom)))) + return E_FAIL; + } + + + } + + if (m_EffectInfo.isMasking) + { + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strMaskingName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), + reinterpret_cast(&m_pMasking_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + } + + + } + + if (m_EffectInfo.isDissolve) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strDissolveName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), + reinterpret_cast(&m_pDissolve_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + + + } + + + } + + if (m_EffectInfo.isEmissive) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strEmissiveName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), + reinterpret_cast(&m_pEmissive_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + } + + + } + + if (m_EffectInfo.isDistortion) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strDistortionName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName), + reinterpret_cast(&m_pDistortion_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + } + + + } + + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + m_strModelName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName), + reinterpret_cast(&m_pInstance_ModelCom)))) + { + CloseHandle(hFile); + return E_FAIL;; + } + } + + + + m_pInstance_ModelCom->Load_InstanceModel(hFile); + + CloseHandle(hFile); + + + + return S_OK; +} + + + +HRESULT CEffectObject::Bind_ShaderResources() +{ + + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + return E_FAIL; + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_EffectInfo.isDiffuse, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_EffectInfo.isMasking, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_EffectInfo.isDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_EffectInfo.isNoise, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissive", &m_EffectInfo.isEmissive, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_EffectInfo.isDistortion, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_EffectInfo.isDiffuseUVMove, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_EffectInfo.isMaskUVMove, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseUVMove", &m_EffectInfo.isNoiseUVMove, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isReverseDissolve", &m_EffectInfo.isReverseDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolve", &m_EffectInfo.isEmissiveDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskClampSample", &m_EffectInfo.isMaskClampSample, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_EffectInfo.isNoiseColor, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_EffectInfo.isNoiseAlpha, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNomalDissolve", &m_EffectInfo.isNomalDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_EffectInfo.vEmissive, sizeof(_float4)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_EffectInfo.fEmissiveStrength, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_EffectInfo.vDiffuseUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_EffectInfo.vMaskingUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vNoiseUVGainAmount", &m_EffectInfo.vNoiseUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_EffectInfo.vDiffuseDistortionUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_EffectInfo.vMaskDistortionUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_EffectInfo.vUVMaskCutting, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_EffectInfo.iMaskMoveLerpOption, sizeof(_int)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_EffectInfo.iDiffuseMoveLerpOption, sizeof(_int)))) { + return E_FAIL; + } + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskDistortionMoveLerpOption", &m_EffectInfo.iMaskDistortionMoveLerpOption, sizeof(_int)))) { + return E_FAIL; + } + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseDistortionMoveLerpOption", &m_EffectInfo.iDiffuseDistortionMoveLerpOption, sizeof(_int)))) { + return E_FAIL; + } + + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_EffectInfo.fDiffuseAlpha, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_EffectInfo.fSoftenExp, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_EffectInfo.fSoftStrength, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_EffectInfo.fCoreBoost, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_EffectInfo.fRadius, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_EffectInfo.fSoftMaskEdge, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_EffectInfo.fSoftMask, sizeof(_float)))) { + return E_FAIL; + } + + + if (m_pDiffuse_TextureCom != nullptr) + { + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) { + return E_FAIL; + } + } + + if (m_pNoise_TextureCom != nullptr) + { + if (FAILED(m_pNoise_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_NoiseTexture", 0))) { + return E_FAIL; + } + } + + if (m_pMasking_TextureCom != nullptr) + { + if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) { + return E_FAIL; + } + } + + if (m_pDissolve_TextureCom != nullptr) + { + if (FAILED(m_pDissolve_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DissolveTexture", 0))) { + return E_FAIL; + } + } + + if (m_pEmissive_TextureCom != nullptr) + { + if (FAILED(m_pEmissive_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_EmissiveTexture", 0))) { + return E_FAIL; + } + } + + if (m_pDistortion_TextureCom != nullptr) + { + if (FAILED(m_pDistortion_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) { + return E_FAIL; + } + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + + + + return S_OK; +} + +HRESULT CEffectObject::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC TransformDesc = {}; + + TransformDesc.fRadius = 20.f; + TransformDesc.fRotationPerSec = 10.f; + TransformDesc.fSpeedPerSec = 10.f; + + + if (FAILED(__super::Ready_Components(&TransformDesc))) { + return E_FAIL; + } + + + //나중에 로드할 때 라이트를 값을 입력받아서 생성 하자 + return S_OK; +} + +HRESULT CEffectObject::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffectObject::Initialize(void* pArg) +{ + + if (FAILED(__super::Initialize(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + + + +void CEffectObject::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pNoise_TextureCom); + SAFE_RELEASE(m_pMasking_TextureCom); + SAFE_RELEASE(m_pDissolve_TextureCom); + SAFE_RELEASE(m_pEmissive_TextureCom); + SAFE_RELEASE(m_pDistortion_TextureCom); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pInstance_ModelCom); + + if(m_pLightCom != nullptr) + SAFE_RELEASE(m_pLightCom); +} + + diff --git a/Jusin154_Team3D/Client/Private/EffectParts.cpp b/Jusin154_Team3D/Client/Private/EffectParts.cpp new file mode 100644 index 000000000..3000b31ab --- /dev/null +++ b/Jusin154_Team3D/Client/Private/EffectParts.cpp @@ -0,0 +1,130 @@ +#include "pch.h" +#include "EffectParts.h" + +#include "GameInstance.h" +#include "Instance_Model.h" + +CEffectParts::CEffectParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffectObject{ pDevice, pContext } +{ +} + +CEffectParts::CEffectParts(const CEffectParts& rhs) + : CEffectObject(rhs) +{ +} + +HRESULT CEffectParts::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffectParts::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + Set_Visible(false); + + return S_OK; +} + +void CEffectParts::Priority_Update(_float fTimeDelta) +{ + +} + +void CEffectParts::Update(_float fTimeDelta) +{ + + if (m_bVisible == false) + return; + + if (m_pInstance_ModelCom == nullptr) + return; + + m_pInstance_ModelCom->Drop(fTimeDelta); + + if (m_EffectInfo.isBillboard) + m_pGameInstance->BillBoard(m_pTransformCom); + + +} + +void CEffectParts::Late_Update(_float fTimeDelta) +{ + + if (m_bVisible == false) + return; + + if (m_pInstance_ModelCom == nullptr) + return; + + + if (m_EffectInfo.isBlur == true) + { + m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this); + } + + m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this); + +} + + +HRESULT CEffectParts::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_MODEL, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + + return S_OK; +} + + +CEffectParts* CEffectParts::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEffectParts* pInstance = new CEffectParts(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEffectParts"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEffectParts::Clone(void* pArg, CGameObject* pOwner) +{ + CEffectParts* pInstance = new CEffectParts(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEffectParts"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEffectParts::Free() +{ + __super::Free(); + +} + +void CEffectParts::Describe_Entity() +{ + +} diff --git a/Jusin154_Team3D/Client/Private/Effect_Container.cpp b/Jusin154_Team3D/Client/Private/Effect_Container.cpp new file mode 100644 index 000000000..7f7a5e905 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Effect_Container.cpp @@ -0,0 +1,192 @@ +#include "pch.h" +#include "Effect_Container.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "TrailObject.h" + + +#include + +CEffect_Container::CEffect_Container(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CContainerObject{ pDevice, pContext } +{ +} + +CEffect_Container::CEffect_Container(const CEffect_Container& rhs) + : CContainerObject(rhs) +{ + +} + +HRESULT CEffect_Container::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CEffect_Container::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Child())) + return E_FAIL; + + return S_OK; +} + +void CEffect_Container::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CEffect_Container::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); + +} + +void CEffect_Container::Late_Update(_float fTimeDelta) +{ + __super::Late_Update(fTimeDelta); +} + +void CEffect_Container::OnCollision(CGameObject* pOther, void* pDesc) +{ +} + +HRESULT CEffect_Container::Load_Directory(const _char* pPath) +{ + + for (const auto& file : filesystem::directory_iterator(pPath)) + { + if (file.is_directory()) + continue; + + string ext = file.path().extension().string(); + + if (strcmp(ext.c_str(), ".bin")) + continue; + + _char szFilePath[MAX_PATH] = {}; + + strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); + + + ///////////////////////////// + + CEffectParts* pEffectParts = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + + + + /*이펙트 껍데기 생성*/ + + _wstring wstrFileName = file.path().stem().wstring(); //이름 넣기 + + if (FAILED(Add_PartObject(CMyTools::ToString(wstrFileName), g_iStaticLevel, &pEffectParts, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + + /*이펙트 로드 로드*/ + size_t iPos = {}; + _string strFilePath = szFilePath; + + while ((iPos = strFilePath.find(".bin")) != std::string::npos) { + strFilePath.erase(iPos, 4); + }; + + + if (FAILED(pEffectParts->Load(strFilePath.c_str(),static_cast(NEXT_LEVEL)))) + { + Safe_Release(pEffectParts); + continue; + } + + Safe_Release(pEffectParts); + } + + return S_OK; +} + +HRESULT CEffect_Container::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC TransformDesc = {}; + + TransformDesc.fRadius = 20.f; + TransformDesc.fRotationPerSec = 10.f; + TransformDesc.fSpeedPerSec = 10.f; + + if (FAILED(__super::Ready_Components(&TransformDesc))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CEffect_Container::Ready_Child() +{ + + return S_OK; +} + +void CEffect_Container::Free() +{ + __super::Free(); + +} + +HRESULT CEffect_Container::Bind_ShaderResources() +{ + return S_OK; +} + +void CEffect_Container::Update_Event(_float fTimeDelta) +{ + + m_fPreAccTime = m_fAccTime; + m_fAccTime += fTimeDelta; + + if (m_fAccTime >= m_fDelay || m_isDelayed == false) // 아직 딜레이되지 않았고 딜레이를 넘어섰다면 + { + m_isDelayed = true; + } + else + { + return; + } + + + if (m_fAccTime >= m_fDuration) // 듀레이션을 넘어섰다면 + { + if (m_isLoop) + { + m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + m_isDelayed = false; + } + else + { + m_bVisible = false; + } + } + + + for (auto& pPair : m_Events) // 이벤트들을 비교하면서 실행함 + { + if (pPair.first >= m_fPreAccTime && pPair.first <= m_fAccTime) + { + pPair.second(); + } + } + + +} diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index 8101093b3..dc5946532 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -40,7 +40,7 @@ HRESULT CLevel_Field::Initialize() void CLevel_Field::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index a3201bcad..6146c0058 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -39,10 +39,14 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } - if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) { + if (FAILED(Ready_Layer_Camera())) { return E_FAIL; } + //if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) { + // return E_FAIL; + //} + return S_OK; } @@ -54,7 +58,7 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } @@ -94,7 +98,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Camera() { - /*CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{}; + CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{}; Camera_Desc.fFovy = XMConvertToRadians(60.0f); Camera_Desc.fNear = 0.1f; Camera_Desc.fFar = 200.f; @@ -114,7 +118,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera() } if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) { return E_FAIL; - }*/ + } return S_OK; } @@ -140,8 +144,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) return E_FAIL; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) - return E_FAIL; + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) + return E_FAIL;*/ return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 6c6b50201..b63de72ac 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -23,7 +23,7 @@ HRESULT CLevel_Logo::Initialize() void CLevel_Logo::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Level_Restart.cpp b/Jusin154_Team3D/Client/Private/Level_Restart.cpp index 91dc3500d..3e0d35041 100644 --- a/Jusin154_Team3D/Client/Private/Level_Restart.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Restart.cpp @@ -22,7 +22,7 @@ HRESULT CLevel_Restart::Initialize() void CLevel_Restart::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 35efbe1b8..6e6ee579a 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -10,13 +10,30 @@ #include "Player.h" #include "Camera_Gaze.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" +#include "CamPosition_Target.h" +#include "CamPosition_Shoulder.h" #include "CamPosition_Arm.h" #include "Wand.h" #include "SkyBox.h" #include "Broom.h" + +#pragma region PHYSX + #include "Dummy_PhysXWall.h" #include "Dummy_PhysXPlayable.h" +#include "PhysXEffectHitBox.h" + +#pragma endregion + +#pragma region EFFECT + +#include "EffectParts.h" +#include "Bombard.h" +#include "TrailObject.h" +#include "Instance_Model.h" + +#pragma endregion CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } @@ -126,6 +143,66 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Noises", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Diffuse", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Flipbooks", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Gradients", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_MESH, @@ -150,6 +227,12 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"), + VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) { + return E_FAIL; + } + // Heavy Wall CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; { @@ -166,6 +249,8 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.vAutoDamping = { 100.f, 100.f }; } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; } @@ -202,6 +287,57 @@ HRESULT CLoader::Loading_For_GamePlay() m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다."); + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEffectParts::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTrailObject::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBombard::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + + + m_strMessage = TEXT("Model Loading.."); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity())))) + return E_FAIL; + + Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) { + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0)))) + return E_FAIL; + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Models/Effect/Goo", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) { + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0)))) + return E_FAIL; + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Models/Effect/NomalMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) { + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, + CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0)))) + return E_FAIL; + + return S_OK; + + }); + m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { @@ -231,7 +367,15 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; /* For.Prototype_GameObject_CamPosition_Player */ - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext)))) + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Socket::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Shoulder */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Shoulder::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Target */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Target::Create(m_pDevice, m_pContext)))) return E_FAIL; /* For.Prototype_GameObject_CamPosition_Arm */ @@ -246,6 +390,7 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -254,6 +399,10 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPhysXEffectHitBox::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + m_strMessage = TEXT("정보를 불러오는 중입니다."); m_strMessage = TEXT("로딩이 완료되었습니다.."); @@ -305,6 +454,31 @@ HRESULT CLoader::Loading_For_Restart() return S_OK; } +HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent) +{ + for (const auto& file : filesystem::directory_iterator(pDirectoryPath)) + { + if (file.is_directory()) + continue; + + string ext = file.path().extension().string(); + + if (!strcmp(ext.c_str(), ".txt")) + continue; + + _char szFilePath[MAX_PATH] = {}; + + strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); + + wstring wstrFileName = pPreName + file.path().stem().wstring(); + + AddPrototypeEvent(wstrFileName, szFilePath); + + } + + return S_OK; +} + CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID) { CLoader* pInstance = new CLoader(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index e6c5d9540..c134df4dd 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -4,6 +4,10 @@ #include "Level_Loading.h" #include "InfoInstance.h" +NS_BEGIN(Engine) +class CGameInstance; +NS_END + #ifdef _DEBUG _float g_fTimeMult = 1.f; @@ -126,16 +130,21 @@ HRESULT CMainApp::Ready_IMGUI() ImGui_ImplWin32_Init(g_hWnd); ImGui_ImplDX11_Init(m_pDevice, m_pContext); - string strFontTag = "../Bin/Resources/Fonts/SHOWG.TTF"; - + //string strFontTag = "C:\\Windows\\Fonts\\malgun.ttf"; + string strFontTag = "../Bin/Resources/Fonts/malgunsl.TTF"; + ImFontConfig cfg; + cfg.OversampleH = 2; // 가독성 향상 + cfg.OversampleV = 2; + cfg.PixelSnapH = true; ifstream ifile; ifile.open(strFontTag); if (ifile) { - font = io.Fonts->AddFontFromFileTTF(strFontTag.c_str(), 10.f, NULL, io.Fonts->GetGlyphRangesKorean()); + font = io.Fonts->AddFontFromFileTTF(strFontTag.c_str(), 16.f, NULL, io.Fonts->GetGlyphRangesKorean()); } IM_ASSERT(font != NULL); + io.FontDefault = font; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp new file mode 100644 index 000000000..b1cc4b88a --- /dev/null +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -0,0 +1,164 @@ +#include "pch.h" +#include "NomalJap.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "PhysXEffectHitBox.h" + + +CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CNomalJap::CNomalJap(const CNomalJap& rhs) + : CEffect_Container(rhs) +{ + +} + +HRESULT CNomalJap::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CNomalJap::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Ready_Child())) + return E_FAIL; + + m_wstrEffectName = L"Nomal_Jap"; + + m_PartObjects.begin()->second->Set_Visible(true); + m_PartObjects.begin()->second->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + m_fDuration = 5.f; + + return S_OK; +} + +void CNomalJap::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CNomalJap::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); +} + +void CNomalJap::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); +} + +HRESULT CNomalJap::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CNomalJap::Ready_Child() +{ + CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; + + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = { 0.f, 0.f, 2.f }; + Desc.vLifeTime = { 0.f, 2.f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } + + return S_OK; +} + +CNomalJap* CNomalJap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CNomalJap* pInstance = new CNomalJap(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CNomalJap"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) +{ + CNomalJap* pInstance = new CNomalJap(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CNomalJap"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + } + + m_PartObjects.begin()->second->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); +} + +void CNomalJap::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + +} + +void CNomalJap::Describe_Entity() +{ + +} + +HRESULT CNomalJap::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp b/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp new file mode 100644 index 000000000..1904b1ea0 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp @@ -0,0 +1,199 @@ +#include "pch.h" +#include "PhysXEffectHitBox.h" +#include "GameInstance.h" + + +CPhysXEffectHitBox::CPhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CPhysXEffectHitBox::CPhysXEffectHitBox(const CPhysXEffectHitBox& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CPhysXEffectHitBox::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CPhysXEffectHitBox::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CPhysXEffectHitBox::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->RewindMomentum(); +} + +void CPhysXEffectHitBox::Update(_float fTimeDelta) +{ + m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos)); + m_vLifeTime.x += fTimeDelta; + if (m_vLifeTime.x > m_vLifeTime.y) { + m_bDead = true; + } +} + +void CPhysXEffectHitBox::Late_Update(_float fTimeDelta) +{ + if (true == m_pCharacter_Controller->IsActive()) { + m_pCharacter_Controller->Move(fTimeDelta); + } + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + } +} + +HRESULT CPhysXEffectHitBox::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Render(0))) { + // return E_FAIL; + //} +#ifdef _DEBUG + if (FAILED(m_pCharacter_Controller->Render())) { + return E_FAIL; + } +#endif // _DEBUG + + + return S_OK; +} + +HRESULT CPhysXEffectHitBox::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + PHYSXDUMMY_DESC* pDesc = static_cast(pArg); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f)); + m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z); + m_vDeltaPos = pDesc->vDeltaPos; + m_vLifeTime = pDesc->vLifeTime; + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = pDesc->iSubKind; + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::BOX; + Desc.fContactOffset = 0.1f; + Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.05f }; + Desc.fRadius = 0.5f; + Desc.fHeight = 1.0f; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_EffectHitBox_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_EffectHitBox_Behavior::Create(); + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + } + m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CPhysXEffectHitBox::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CPhysXEffectHitBox* CPhysXEffectHitBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CPhysXEffectHitBox* pInstance = new CPhysXEffectHitBox(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CPhysXEffectHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CPhysXEffectHitBox::Clone(void* pArg, CGameObject* pOwner) +{ + CPhysXEffectHitBox* pInstance = new CPhysXEffectHitBox(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CPhysXEffectHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CPhysXEffectHitBox::Free() +{ + if (nullptr == m_pGameInstance) { + m_pCharacter_Controller->SetActive(false); + PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); + PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); + m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); + m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor()); + + + } + __super::Free(); + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + SAFE_RELEASE(m_pCharacter_Controller); + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CPhysXEffectHitBox::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 1c099c8b4..150724cfd 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -2,34 +2,27 @@ #include "Player.h" #include "GameInstance.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" #include "Camera_Gaze.h" #include "CamPosition_Arm.h" #include "Wand.h" #include "Character_Controller.h" #include "CallBack_Playable_Behavior.h" +#include "CamPosition_Shoulder.h" #include "CallBack_Playable_HitReport.h" -#include "Character_Controller.h" #pragma region STATE -#include "State_Root.h" #include "State_Idle.h" -#include "State_Walk.h" -#include "State_Jog.h" -#include "State_Sprint.h" #include "State_Dodge.h" #include "State_Jump.h" -#include "State_Skill.h" -#include "State_Skill2.h" -#include "State_LightAttack.h" #include "State_Land.h" -#include "State_Cast.h" #include "State_Move.h" #include "State_Combat.h" -#include "State_Idle_Turn.h" #pragma endregion +#include "Bombard.h" + CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) { @@ -61,13 +54,16 @@ HRESULT CPlayer::Initialize(void* pArg) Add_FSM(); - Set_FSM(); - Set_Anim(); - Setup_InputConditions(); + { + CFSM::FSM_DESC FSMDesc{}; + FSMDesc.pStates = &m_States; + FSMDesc.pStateMask = &m_iStateMask; - m_pFSM->Change_State(FSMSTATE::ROOT); + m_pFSM->Bind_States(FSMDesc); + m_pFSM->Change_State(FSMSTATE::IDLE); + } m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); @@ -77,20 +73,22 @@ HRESULT CPlayer::Initialize(void* pArg) void CPlayer::Priority_Update(_float fTimeDelta) { m_pTransformCom->RewindMomentum(); - m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); + __super::Priority_Update(fTimeDelta); } void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); + IsSprint(); + IsWalk(); - Key_Input(fTimeDelta); + m_pFSM->Update_State(fTimeDelta); - m_pFSM->Update(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + __super::Update(fTimeDelta); Describe_Entity(); m_pCharacter_Controller->Move(fTimeDelta); @@ -98,6 +96,9 @@ void CPlayer::Update(_float fTimeDelta) void CPlayer::Late_Update(_float fTimeDelta) { + + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); __super::Late_Update(fTimeDelta); @@ -124,9 +125,6 @@ HRESULT CPlayer::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; - if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } @@ -148,7 +146,9 @@ HRESULT CPlayer::Ready_Components() Desc.fRotationPerSec = XMConvertToRadians(180.0f); Desc.fRadius = 10.f; - __super::Ready_Components(&Desc); + if (FAILED(__super::Ready_Components(&Desc))) { + return E_FAIL; + } m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model"); @@ -206,46 +206,62 @@ HRESULT CPlayer::Ready_Parts() return E_FAIL; } - CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{}; + //{ + // CCamPosition_Socket::CAMERAPOSITION_PLAYER_DESC Desc{}; - Desc.pParentTransform = m_pTransformCom; + // Desc.pParentTransform = m_pTransformCom; + + // if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) + // { + // return E_FAIL; + // } + + // CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; + // XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); + // CameraArmDesc.pParentTransform = m_pTransformCom; + // CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; + // CameraArmDesc.fMouseSensor = 0.4f; + // CameraArmDesc.fDistance = 4.f; + // CameraArmDesc.pParentTransform = m_pTransformCom; + + // if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { + // return E_FAIL; + // } + + // CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + // CameraDesc.fFovy = XMConvertToRadians(60.0f); + // CameraDesc.fNear = 0.1f; + // CameraDesc.fFar = 300.f; + // CameraDesc.fSpeedPerSec = 5.f; + // CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + // CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; + // CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; + // CameraDesc.iPriority = 51; + + // CCamera_Gaze* pCamera = { nullptr }; + + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) + // { + // return E_FAIL; + // } + + // m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); + //} - if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) { - return E_FAIL; + CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc; + Desc.pParentTransform = m_pTransformCom; + Desc.fMouseSensor = 0.5f; + Desc.fShoulderDistance = 2.f; + Desc.fBackFrontRatio = 0.9f; + Desc.fCameraFocalLength = 10.f; + Desc.vInitialLook = { 1.f, 2.f, -1.f }; + + if (FAILED(Add_PartObject("Cam_Shoulder_Part", g_iStaticLevel, &m_pCamPosition_ShoulderPart, &Desc))) { + return E_FAIL; + } } - CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; - XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); - CameraArmDesc.pParentTransform = m_pTransformCom; - CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; - CameraArmDesc.fMouseSensor = 0.4f; - CameraArmDesc.fDistance = 4.f; - CameraArmDesc.pParentTransform = m_pTransformCom; - - if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { - return E_FAIL; - } - - CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; - CameraDesc.fFovy = XMConvertToRadians(60.0f); - CameraDesc.fNear = 0.1f; - CameraDesc.fFar = 300.f; - CameraDesc.fSpeedPerSec = 5.f; - CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); - CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; - CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; - CameraDesc.iPriority = 51; - - CCamera_Gaze* pCamera = { nullptr }; - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) - { - return E_FAIL; - } - - m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); - return S_OK; } @@ -267,108 +283,389 @@ HRESULT CPlayer::Bind_ShaderResources() return S_OK; } -void CPlayer::Setup_InputConditions() +#pragma region STATE + +HRESULT CPlayer::InputSystem() { - m_InputConditions = + if (m_pGameInstance->Key_Down(DIK_1) + || m_pGameInstance->Key_Down(DIK_2) + || m_pGameInstance->Key_Down(DIK_3) + || m_pGameInstance->Key_Down(DIK_4) + || m_pGameInstance->Key_Down(DIK_5) + || m_pGameInstance->Key_Down(DIK_6)) { - { FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }}, - { FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || - Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }}, - - - - { FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP) - /*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }}, - { FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }}, - - { FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, - - { FSMSTATE::SPRINT, [&]() { return m_bSprintToggle - && m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }}, - - { FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }}, - { FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }}, - { FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }}, - { FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }}, - { FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }}, - - { FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } } - }; + return S_OK; + } + return E_FAIL; } -void CPlayer::Key_Input(_float fTimeDelta) +HRESULT CPlayer::InputSkill() { - if (m_pFSM->Get_CurrState() == FSMSTATE::WALK || - m_pFSM->Get_CurrState() == FSMSTATE::SPRINT|| - m_pFSM->Get_CurrState() == FSMSTATE::DODGE|| - m_pFSM->Get_CurrState() == FSMSTATE::JOG) + if ( + m_pGameInstance->Key_Down(DIK_SPACE) + || m_pGameInstance->Key_Down(DIK_LCONTROL) + || m_pGameInstance->Key_Down(DIK_E) + || m_pGameInstance->Key_Down(DIK_R) + || m_pGameInstance->Key_Down(DIK_Q) + || m_pGameInstance->Mouse_Up(DIM_LBUTTON) + || m_pGameInstance->Key_Down(DIK_1) + //|| m_pGameInstance->Key_Down(DIK_C) + //|| m_pGameInstance->Key_Down(DIK_V) + //|| m_pGameInstance->Key_Down(DIK_T) + //|| m_pGameInstance->Key_Down(DIK_G) + //|| m_pGameInstance->Key_Down(DIK_B) + ) { - if (m_pGameInstance->Key_Pressing(DIK_LEFT)) - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + return S_OK; + } + return E_FAIL; +} - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); +HRESULT CPlayer::InputMove() +{ + if (m_pGameInstance->Key_Pressing(DIK_W) + || m_pGameInstance->Key_Pressing(DIK_A) + || m_pGameInstance->Key_Pressing(DIK_S) + || m_pGameInstance->Key_Pressing(DIK_D)) + { + return S_OK; + } + return E_FAIL; +} + +void CPlayer::Behavior_IdleEnter() { + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + + if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { + pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) { + // pairAnimInfo = m_Animation[STATEANIM::spr] + } } - IsSprint(); - - IsWalk(); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } +HRESULT CPlayer::Behavior_IdleExitCheck() +{ + // S_OK -> 현 상태 유지 + // E_FAIL -> 현 상태 탈출 + if (SUCCEEDED(InputSystem())) { + //Event + return S_OK; + } + if (SUCCEEDED(InputSkill())) { + if (m_pGameInstance->Key_Down(DIK_SPACE)) { + m_pFSM->Change_State(FSMSTATE::JUMP); + } + else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { + m_pFSM->Change_State(FSMSTATE::DODGE); + } + else if (m_pGameInstance->Key_Down(DIK_E)) { + //m_pFSM->Change_State(FSMSTATE::AAA); + } + else if (m_pGameInstance->Key_Down(DIK_R)) { + //m_pFSM->Change_State(FSMSTATE::SKILL); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + //m_pFSM->Change_State(FSMSTATE::SKILL2); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + //m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + //m_pFSM->Change_State(FSMSTATE::CAST); + } + return E_FAIL; + } + if (SUCCEEDED(InputMove())) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_IdleExit() +{ + m_pFSM->Disable_State(FSMSTATE::IDLE); +} + +void CPlayer::Behavior_MoveEnter() +{ + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + _bool bFoward = m_pGameInstance->Key_Pressing(DIK_W); + _bool bLeft = m_pGameInstance->Key_Pressing(DIK_A); + _bool bRight = m_pGameInstance->Key_Pressing(DIK_D); + _bool bBackward = m_pGameInstance->Key_Pressing(DIK_S); + + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { + // Idle -> Move + if (true == m_bSprintToggle) { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else { + // ? + } + } + else if (true == m_bWalkToggle) { + m_pFSM->Enable_State(FSMSTATE::WALK); + + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else if (true == bBackward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + } + } + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) { + // OtherMove -> AnotherMove + + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) { + // Combat -> Move + + } + } + else { // While Moving + if (true == m_bSprintToggle) { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + + } + else if (true == m_bWalkToggle) { + m_pFSM->Enable_State(FSMSTATE::WALK); + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else if (true == bBackward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + } + //else if (true == bLeft){ + // pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; + //} + //else if (true == bRight){ + // pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + //} + } + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_MoveExitCheck() +{ + if (SUCCEEDED(InputSystem())) { + //Event + return S_OK; + } + if (SUCCEEDED(InputSkill())) { + if (m_pGameInstance->Key_Down(DIK_SPACE)) { + m_pFSM->Change_State(FSMSTATE::JUMP); + } + else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { + m_pFSM->Change_State(FSMSTATE::DODGE); + } + else if (m_pGameInstance->Key_Down(DIK_E)) { + //m_pFSM->Change_State(FSMSTATE::AAA); + } + else if (m_pGameInstance->Key_Down(DIK_R)) { + //m_pFSM->Change_State(FSMSTATE::SKILL); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + //m_pFSM->Change_State(FSMSTATE::SKILL2); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + //m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + //m_pFSM->Change_State(FSMSTATE::CAST); + } + return E_FAIL; + } + if (SUCCEEDED(InputMove())) { + + if (m_pGameInstance->Key_Pressing(DIK_W)){ + + } + if (m_pGameInstance->Key_Pressing(DIK_A)){ + + } + if (m_pGameInstance->Key_Pressing(DIK_S)){ + + } + if (m_pGameInstance->Key_Pressing(DIK_D)){ + + } + return S_OK; + } + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; +} + +void CPlayer::Behavior_MoveExit() +{ + m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK); +} + +void CPlayer::Behavior_JumpEnter() +{ + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT]; + m_pFSM->Enable_State(FSMSTATE::JUMP); + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::JOG | FSMSTATE::WALK)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { + // Idle -> Jump + // pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE); + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG]; + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { + + } + } + else { + // Drop? + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_JumpExitCheck() +{ + if (SUCCEEDED(InputSystem())) { + //Event + return S_OK; + } + if (IsCurrentKeyFrame("Jump")) { + m_pFSM->Change_State(FSMSTATE::LAND); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_JumpExit() +{ + m_pFSM->Disable_State(FSMSTATE::JUMP); +} + +void CPlayer::Behavior_LandEnter() +{ + pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_LandExitCheck() +{ + if (SUCCEEDED(InputSystem())) { + //Event + //return S_OK; + } + if (m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨 + return S_OK; +} + +void CPlayer::Behavior_LandExit() +{ + m_pFSM->Disable_State(FSMSTATE::LAND); +} + +void CPlayer::Behavior_DodgeEnter() +{ + // 혹시 @@ to Dodge 있으면 여기에 + pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_DodgeExitCheck() +{ + if (SUCCEEDED(InputSystem())) { + //Event + //return S_OK; + } + if (m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_DodgeExit() +{ + m_pFSM->Disable_State(FSMSTATE::DODGE); +} + + void CPlayer::Add_FSM() { -#pragma region MOVE - m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move()); - m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle()); - m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn()); - m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk()); - m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog()); - m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint()); - m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge()); +#pragma region Behavior_Movement_NotFocus + { + CState_Idle::STATE_IDLE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_IdleExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); + } + { + CState_Move::STATE_MOVE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); + } #pragma endregion - -#pragma region COMBAT - m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat()); - m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill()); - m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2()); - m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack()); - m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast()); +#pragma region Behavior_Movement_Focus + { + CState_Jump::STATE_JUMP_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_JumpExit(); }; + m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc)); + } + { + CState_Land::STATE_LAND_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_LandExit(); }; + m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc)); + } + { + CState_Dodge::STATE_DODGE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); + } #pragma endregion +#pragma region Behavior_Combat_NotFocus - m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump()); - m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land()); - - m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root()); - -} - -void CPlayer::Set_FSM() -{ -#pragma region ROOT - m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT); - m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT); +#pragma endregion +#pragma region Behavior_Combat_Focus #pragma endregion -#pragma region MOVE - m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE); -#pragma endregion - -#pragma region COMBAT - m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT); -#pragma endregion } void CPlayer::Set_Anim() @@ -401,6 +698,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::SPRINT] = { 599,true }; } +#pragma endregion STATE CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { @@ -442,6 +740,7 @@ void CPlayer::Free() Safe_Delete(m_pCallBack_HitReport); SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); + SAFE_RELEASE(m_pCamPosition_ShoulderPart); } void CPlayer::Describe_Entity() @@ -475,16 +774,6 @@ void CPlayer::Describe_Entity() } -_bool CPlayer::Check(FSMSTATE::ESTATE state) -{ - for (auto& cond : m_InputConditions) - { - if (cond.state == state) - return cond.checker(); - } - return false; -} - _bool CPlayer::IsSprint() { if (m_pGameInstance->Key_Down(DIK_LSHIFT)) diff --git a/Jusin154_Team3D/Client/Private/State_Cast.cpp b/Jusin154_Team3D/Client/Private/State_Cast.cpp deleted file mode 100644 index 42c192faa..000000000 --- a/Jusin154_Team3D/Client/Private/State_Cast.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "pch.h" -#include "State_Cast.h" -#include "Unit.h" - - -CState_Cast::CState_Cast() - :CState() -{ -} - -void CState_Cast::Enter() -{ - if (m_pFSM->Get_PrevState() == FSMSTATE::CAST) - return; - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Cast::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Cast::Exit() -{ -} - -_bool CState_Cast::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::CAST)) - { - _uint combo = m_pOwner->Next_LightCombo(); - m_pOwner->Set_LightCombo(combo); - if (combo >= 3) - { - m_pOwner->Reset_LightCombo(); - return true; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); - m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); - - m_pFSM->Change_State(FSMSTATE::CAST); - - return true; - } - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::SKILL2); - return true; - } - - return false; -} - -void CState_Cast::Free() -{ - __super::Free(); -} - -void CState_Cast::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Combat.cpp b/Jusin154_Team3D/Client/Private/State_Combat.cpp index bdff385da..1e8e15653 100644 --- a/Jusin154_Team3D/Client/Private/State_Combat.cpp +++ b/Jusin154_Team3D/Client/Private/State_Combat.cpp @@ -4,51 +4,55 @@ CState_Combat::CState_Combat() - :CState() + :CState_Root() { } void CState_Combat::Enter() { - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - + __super::Enter(); } -void CState_Combat::Update(_float fTimeDelta) +HRESULT CState_Combat::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Combat::Exit() { + __super::Exit(); } -_bool CState_Combat::CheckExitState() +HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) { - if (m_pOwner->IsCurrentKeyFrame("Jump")) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::MOVE); - return true; + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - return false; + return S_OK; } +CState_Combat* CState_Combat::Create(STATE_COMBAT_DESC* pDesc) +{ + CState_Combat* pInstance = new CState_Combat; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} void CState_Combat::Free() { diff --git a/Jusin154_Team3D/Client/Private/State_Dodge.cpp b/Jusin154_Team3D/Client/Private/State_Dodge.cpp index 3c4ce4151..b2c342f49 100644 --- a/Jusin154_Team3D/Client/Private/State_Dodge.cpp +++ b/Jusin154_Team3D/Client/Private/State_Dodge.cpp @@ -4,43 +4,54 @@ CState_Dodge::CState_Dodge() - :CState() + :CState_Root() { } void CState_Dodge::Enter() { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Dodge::Update(_float fTimeDelta) +HRESULT CState_Dodge::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (FAILED(__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Dodge::Exit() { + __super::Exit(); } -_bool CState_Dodge::CheckExitState() +HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc) { - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::SPRINT); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::JOG); - - - - return false; +CState_Dodge* CState_Dodge::Create(STATE_DODGE_DESC* pDesc) +{ + CState_Dodge* pInstance = new CState_Dodge; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Dodge::Free() diff --git a/Jusin154_Team3D/Client/Private/State_Idle.cpp b/Jusin154_Team3D/Client/Private/State_Idle.cpp index 5f4140c0c..a374fbdc1 100644 --- a/Jusin154_Team3D/Client/Private/State_Idle.cpp +++ b/Jusin154_Team3D/Client/Private/State_Idle.cpp @@ -1,64 +1,57 @@ #include "pch.h" #include "State_Idle.h" +#include "GameInstance.h" #include "Unit.h" CState_Idle::CState_Idle() - :CState() + :CState_Root() { } void CState_Idle::Enter() { - if (m_pFSM->Get_PrevState() == FSMSTATE::JOG) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - if (m_pFSM->Get_PrevState() == FSMSTATE::WALK) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - else - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } + __super::Enter(); } -void CState_Idle::Update(_float fTimeDelta) +HRESULT CState_Idle::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Idle::Exit() { + __super::Exit(); } -_bool CState_Idle::CheckExitState() +HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc) { - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; +CState_Idle* CState_Idle::Create(STATE_IDLE_DESC* pDesc) +{ + CState_Idle* pInstance = new CState_Idle; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Idle::Free() diff --git a/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp b/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp deleted file mode 100644 index d0b9f1712..000000000 --- a/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "pch.h" -#include "State_Idle_Turn.h" -#include "Unit.h" - -CState_Idle_Turn::CState_Idle_Turn() - :CState() -{ -} - -void CState_Idle_Turn::Enter() -{ - if (m_pGameInstance->Key_Down(DIK_LEFT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - if (m_pGameInstance->Key_Down(DIK_RIGHT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - if (m_pGameInstance->Key_Down(DIK_DOWN)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } -} - -void CState_Idle_Turn::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Idle_Turn::Exit() -{ -} - -_bool CState_Idle_Turn::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::MOVE)) - { - m_pFSM->Change_State(FSMSTATE::MOVE); - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - } - - if (m_pOwner->Check(FSMSTATE::COMBAT)) - { - m_pFSM->Change_State(FSMSTATE::COMBAT); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - } - - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Idle_Turn::Free() -{ - __super::Free(); -} - -void CState_Idle_Turn::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Jog.cpp b/Jusin154_Team3D/Client/Private/State_Jog.cpp deleted file mode 100644 index b895ed11e..000000000 --- a/Jusin154_Team3D/Client/Private/State_Jog.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "pch.h" -#include "State_Jog.h" -#include "Unit.h" - -CState_Jog::CState_Jog() - :CState() -{ -} - -void CState_Jog::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - - m_pOwner->Reset_Sprint(); - m_pOwner->Reset_Walk(); -} - -void CState_Jog::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Jog::Exit() -{ -} - -_bool CState_Jog::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - else if (!m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - - return false; -} - -void CState_Jog::Free() -{ - __super::Free(); -} - -void CState_Jog::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Jump.cpp b/Jusin154_Team3D/Client/Private/State_Jump.cpp index 051f93fb0..753110099 100644 --- a/Jusin154_Team3D/Client/Private/State_Jump.cpp +++ b/Jusin154_Team3D/Client/Private/State_Jump.cpp @@ -4,50 +4,51 @@ CState_Jump::CState_Jump() - :CState() + :CState_Root() { } void CState_Jump::Enter() { - if (m_pOwner->Check(FSMSTATE::SPRINT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - if (m_pOwner->Check(FSMSTATE::JOG)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Jump::Update(_float fTimeDelta) +HRESULT CState_Jump::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; } void CState_Jump::Exit() { + __super::Exit(); } -_bool CState_Jump::CheckExitState() +HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc) { - if (m_pOwner->IsCurrentKeyFrame("Jump")) - m_pFSM->Change_State(FSMSTATE::LAND); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - return false; + return S_OK; +} + +CState_Jump* CState_Jump::Create(STATE_JUMP_DESC* pDesc) +{ + CState_Jump* pInstance = new CState_Jump; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Jump::Free() { - __super::Free(); + __super::Free(); } void CState_Jump::Describe_Entity() diff --git a/Jusin154_Team3D/Client/Private/State_Land.cpp b/Jusin154_Team3D/Client/Private/State_Land.cpp index 7fda0cd37..f1b64c618 100644 --- a/Jusin154_Team3D/Client/Private/State_Land.cpp +++ b/Jusin154_Team3D/Client/Private/State_Land.cpp @@ -4,44 +4,51 @@ CState_Land::CState_Land() - :CState() + :CState_Root() { } void CState_Land::Enter() { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Land::Update(_float fTimeDelta) +HRESULT CState_Land::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; } void CState_Land::Exit() { + __super::Exit(); } -_bool CState_Land::CheckExitState() +HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc) { - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - return false; +CState_Land* CState_Land::Create(STATE_LAND_DESC* pDesc) +{ + CState_Land* pInstance = new CState_Land; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Land::Free() { - __super::Free(); + __super::Free(); } void CState_Land::Describe_Entity() diff --git a/Jusin154_Team3D/Client/Private/State_LightAttack.cpp b/Jusin154_Team3D/Client/Private/State_LightAttack.cpp deleted file mode 100644 index aa2375570..000000000 --- a/Jusin154_Team3D/Client/Private/State_LightAttack.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "pch.h" -#include "State_LightAttack.h" -#include "Unit.h" - - -CState_LightAttack::CState_LightAttack() - :CState() -{ -} - -void CState_LightAttack::Enter() -{ - if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK) - return; - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_LightAttack::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_LightAttack::Exit() -{ -} - -_bool CState_LightAttack::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - { - _uint combo = m_pOwner->Next_LightCombo(); - m_pOwner->Set_LightCombo(combo); - if (combo >= 4) - { - m_pOwner->Reset_LightCombo(); - return true; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); - m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); - - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - return true; - } - - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::SKILL2); - return true; - } - - return false; -} - - -void CState_LightAttack::Free() -{ - __super::Free(); -} - -void CState_LightAttack::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Move.cpp b/Jusin154_Team3D/Client/Private/State_Move.cpp index cce8c760f..71621a370 100644 --- a/Jusin154_Team3D/Client/Private/State_Move.cpp +++ b/Jusin154_Team3D/Client/Private/State_Move.cpp @@ -4,46 +4,56 @@ CState_Move::CState_Move() - :CState() + :CState_Root() { } void CState_Move::Enter() { - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - m_pFSM->Change_State(FSMSTATE::IDLE); + __super::Enter(); } -void CState_Move::Update(_float fTimeDelta) +HRESULT CState_Move::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Move::Exit() { + __super::Exit(); } -_bool CState_Move::CheckExitState() +HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc) { - return false; + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; } +CState_Move* CState_Move::Create(STATE_MOVE_DESC* pDesc) +{ + CState_Move* pInstance = new CState_Move; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} void CState_Move::Free() { diff --git a/Jusin154_Team3D/Client/Private/State_Root.cpp b/Jusin154_Team3D/Client/Private/State_Root.cpp index efef8727b..18349525b 100644 --- a/Jusin154_Team3D/Client/Private/State_Root.cpp +++ b/Jusin154_Team3D/Client/Private/State_Root.cpp @@ -2,7 +2,6 @@ #include "State_Root.h" #include "Unit.h" - CState_Root::CState_Root() :CState() { @@ -10,48 +9,38 @@ CState_Root::CState_Root() void CState_Root::Enter() { - if (m_pOwner->Check(FSMSTATE::COMBAT)) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - else - m_pFSM->Change_State(FSMSTATE::MOVE); + if (nullptr != m_funcEnterEvent) { + m_funcEnterEvent(); + } } -void CState_Root::Update(_float fTimeDelta) +HRESULT CState_Root::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + HRESULT hr = { S_OK }; + if (nullptr != m_funcExitCheck) { + hr = m_funcExitCheck(fTimeDelta); + } + return hr; } void CState_Root::Exit() { + if (nullptr != m_funcExitEvent) { + m_funcExitEvent(); + } } -_bool CState_Root::CheckExitState() +HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg) { - if (m_pOwner->Check(FSMSTATE::COMBAT)) - { - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - return true; - } - - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT) - return false; - - if (m_pOwner->Check(FSMSTATE::MOVE)) - { - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE) - m_pFSM->Change_State(FSMSTATE::MOVE); - - return true; - } - - return false; + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + m_funcExitCheck = pArg->funcExitCheck; + m_funcEnterEvent = pArg->funcEnterEvent; + m_funcExitEvent = pArg->funcExitEvent; + return S_OK; } - void CState_Root::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Client/Private/State_Skill.cpp b/Jusin154_Team3D/Client/Private/State_Skill.cpp deleted file mode 100644 index 277606272..000000000 --- a/Jusin154_Team3D/Client/Private/State_Skill.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "pch.h" -#include "State_Skill.h" -#include "Unit.h" - - -CState_Skill::CState_Skill() - :CState() -{ -} - -void CState_Skill::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Skill::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Skill::Exit() -{ -} - -_bool CState_Skill::CheckExitState() -{ - - return false; -} - -void CState_Skill::Free() -{ - __super::Free(); -} - -void CState_Skill::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Skill2.cpp b/Jusin154_Team3D/Client/Private/State_Skill2.cpp deleted file mode 100644 index 03704ac90..000000000 --- a/Jusin154_Team3D/Client/Private/State_Skill2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "pch.h" -#include "State_Skill2.h" -#include "Unit.h" - - -CState_Skill2::CState_Skill2() - :CState() -{ -} - -void CState_Skill2::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Skill2::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Skill2::Exit() -{ -} - -_bool CState_Skill2::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - return false; -} - -void CState_Skill2::Free() -{ - __super::Free(); -} - -void CState_Skill2::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Sprint.cpp b/Jusin154_Team3D/Client/Private/State_Sprint.cpp deleted file mode 100644 index 71efa2951..000000000 --- a/Jusin154_Team3D/Client/Private/State_Sprint.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "pch.h" -#include "State_Sprint.h" -#include "Unit.h" - -CState_Sprint::CState_Sprint() - :CState() -{ -} - -void CState_Sprint::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Sprint::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; - -} - -void CState_Sprint::Exit() -{ -} - -_bool CState_Sprint::CheckExitState() -{ - if (!m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::JOG); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Sprint::Free() -{ - __super::Free(); -} - -void CState_Sprint::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Walk.cpp b/Jusin154_Team3D/Client/Private/State_Walk.cpp deleted file mode 100644 index c49a5ee2b..000000000 --- a/Jusin154_Team3D/Client/Private/State_Walk.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "pch.h" -#include "State_Walk.h" -#include "Unit.h" - -CState_Walk::CState_Walk() - :CState() -{ -} - -void CState_Walk::Enter() -{ - if(m_pOwner->Check(FSMSTATE::FWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - - if (m_pOwner->Check(FSMSTATE::BWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } -} - -void CState_Walk::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Walk::Exit() -{ -} - -_bool CState_Walk::CheckExitState() -{ - if (!m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::IDLE); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - - return false; -} - -void CState_Walk::Free() -{ - __super::Free(); -} - -void CState_Walk::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/TrailObject.cpp b/Jusin154_Team3D/Client/Private/TrailObject.cpp new file mode 100644 index 000000000..5565c2e68 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/TrailObject.cpp @@ -0,0 +1,297 @@ +#include "pch.h" +#include "TrailObject.h" + +#include "GameInstance.h" +#include "Trail.h" + + +CTrailObject::CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject{ pDevice, pContext } +{ +} + +CTrailObject::CTrailObject(const CTrailObject& rhs) + : CPartObject(rhs) +{ +} + +HRESULT CTrailObject::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CTrailObject::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + return S_OK; +} + +void CTrailObject::Priority_Update(_float fTimeDelta) +{ + +} + +void CTrailObject::Update(_float fTimeDelta) +{ + m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix()); +} + +void CTrailObject::Late_Update(_float fTimeDelta) +{ + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this); + } + +} + +HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel) +{ + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pMasking_TextureCom); + SAFE_RELEASE(m_pNoise_TextureCom); + + _string strPerfectFilePath = pPath; + + strPerfectFilePath += ".bin"; + + DWORD dwByte(0); + + HANDLE hFile = CreateFileW( + CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름 + GENERIC_READ, // 읽기 모드 + FILE_SHARE_READ, // 다른 프로세스도 읽기 가능 + NULL, + OPEN_EXISTING, // 기존 파일 열기 + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + m_strPath = strPerfectFilePath; + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK); + return E_FAIL; + } + + + if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) { + return E_FAIL; + } + + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strTrailDiffuseName = szName; + + m_isDiffuse = true; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName), + reinterpret_cast(&m_pDiffuse_TextureCom)))) + return E_FAIL; + + + } + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strTrailNoiseName = szName; + + m_isNoise = true; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName), + reinterpret_cast(&m_pNoise_TextureCom)))) + return E_FAIL; + + } + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strTrailMaskingName = szName; + + m_isMask = true; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName), + reinterpret_cast(&m_pMasking_TextureCom)))) + return E_FAIL; + } + + m_pTrailCom->Load_Trail(hFile); + + CloseHandle(hFile); + + + MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK); + + return S_OK; +} + +HRESULT CTrailObject::Ready_Components(void* pArg) +{ + + if (FAILED(__super::Ready_Components(nullptr))) { + return E_FAIL; + } + + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + CTrail::TRAIL_DESC pTrailDesc; + + pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f); + pTrailDesc.vLow = _float3(0.f, -1.f, 0.f); + + if (FAILED(Add_Component(ENUM_CLASS(LEVEL::STATIC), &m_pTrailCom, &pTrailDesc))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CTrailObject::Render() +{ + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL)))) + return E_FAIL; + + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + if (FAILED(m_pTrailCom->Render())) + return E_FAIL; + + return S_OK; +} + + + + +CTrailObject* CTrailObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTrailObject* pInstance = new CTrailObject(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTrailObject"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CTrailObject::Clone(void* pArg, CGameObject* pOwner) +{ + CTrailObject* pInstance = new CTrailObject(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTrailObject"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTrailObject::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pMasking_TextureCom); + SAFE_RELEASE(m_pNoise_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pTrailCom); +} + +void CTrailObject::Describe_Entity() +{ +} + +HRESULT CTrailObject::Bind_ShaderResources() +{ + + if (FAILED(m_pTrailCom->Bind_Resources())) + return E_FAIL; + + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) { + return E_FAIL; + } + + if (m_pDiffuse_TextureCom != nullptr) + { + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) { + return E_FAIL; + } + } + + if (m_pNoise_TextureCom != nullptr) + { + if (FAILED(m_pNoise_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_NoiseTexture", 0))) { + return E_FAIL; + } + } + + if (m_pMasking_TextureCom != nullptr) + { + if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) { + return E_FAIL; + } + } + + return S_OK; +} diff --git a/Jusin154_Team3D/Client/Public/Bombard.h b/Jusin154_Team3D/Client/Public/Bombard.h new file mode 100644 index 000000000..c53c892e3 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Bombard.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CBombard final : public CEffect_Container +{ +private: + CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CBombard(const CBombard& rhs); + virtual ~CBombard() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + class CPhysXEffectHitBox* m_pPhysHitBox = {}; + class CPartObject* m_pLight_Projectile = {}; +public: + static CBombard* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Broom.h b/Jusin154_Team3D/Client/Public/Broom.h index 621cc498e..f9173cf0a 100644 --- a/Jusin154_Team3D/Client/Public/Broom.h +++ b/Jusin154_Team3D/Client/Public/Broom.h @@ -3,11 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CShader; -class CModel; -NS_END - NS_BEGIN(Client) class CBroom final : public CGameObject diff --git a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h index 3b4b4809e..3c8c10aa9 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h +++ b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_EffectHitBox_Behavior final : public PSX::PxControllerBehaviorCallback diff --git a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h index 83080178e..4ec92ffbc 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h +++ b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_EffectHitBox_HitReport final : public PSX::PxUserControllerHitReport diff --git a/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h index fe3285125..eaf953c2d 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h +++ b/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_Monster_Behavior final : public PSX::PxControllerBehaviorCallback diff --git a/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h index 32211f294..dc3783eff 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h +++ b/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_Monster_HitReport final : public PSX::PxUserControllerHitReport diff --git a/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h index 96c7a3715..2afe78d2a 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h +++ b/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback diff --git a/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h index f61ff974c..cc22f7e6a 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h +++ b/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CGameInstance; -NS_END - NS_BEGIN(Client) class CCallBack_Playable_HitReport final : public PSX::PxUserControllerHitReport diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h b/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h new file mode 100644 index 000000000..26b2a247d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h @@ -0,0 +1,64 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" +#include "CamPosition_Target.h" + +NS_BEGIN(Client) + +class CCamPosition_Shoulder final : public CCamPosition +{ +public: + typedef struct tagCameraShoulder_Desc : public CCamPosition::CAMERAPOSITION_DESC + { + _float fMouseSensor = { 0.5f }; + _float fShoulderDistance = { 2.f }; + _float fBackFrontRatio = { 0.9f }; + _float fCameraFocalLength = { 10.f }; + _float3 vInitialLook = { 1.f, 2.f, -1.f }; + }CAMERA_SHOULDER_DESC; +private: + CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs); + virtual ~CCamPosition_Shoulder() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Ready_SubParts(); + + _bool m_bMovable = { true }; + _float m_fMouseSensor = { 0.5f }; + _float m_fShoulderDistance = { 2.f }; + _float m_fCameraFocalLength = { 10.f }; + _float m_fBackFrontRatio = { 0.9f }; + _float2 m_vAccDegreeXY = {}; + _float3 m_vShoulderPosRatio = { 1.f, 2.f, -1.f }; + + _float3 m_vShoulderStartRatio = { 1.f, 2.f, -1.f }; + _float3 m_vShoulderOtherRatio = { 1.f, 2.f, -1.f }; + + _bool m_bLerp = { false }; + _float2 m_vLerpTimer = { 0.f, 1.f }; + + + CCamPosition_Target* m_pTarget_LookPart = { nullptr }; + CCamPosition_Target* m_pTarget_FollowPart = { nullptr }; + class CCamera_Gaze* m_pBinded_Camera = { nullptr }; + +public: + static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Shoulder* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Player.h b/Jusin154_Team3D/Client/Public/CamPosition_Socket.h similarity index 70% rename from Jusin154_Team3D/Client/Public/CamPosition_Player.h rename to Jusin154_Team3D/Client/Public/CamPosition_Socket.h index af5d2a68c..aaac3e749 100644 --- a/Jusin154_Team3D/Client/Public/CamPosition_Player.h +++ b/Jusin154_Team3D/Client/Public/CamPosition_Socket.h @@ -4,7 +4,7 @@ NS_BEGIN(Client) -class CCamPosition_Player final : public CCamPosition +class CCamPosition_Socket final : public CCamPosition { public: typedef struct tagCamPosition_Player : public CCamPosition::CAMERAPOSITION_DESC @@ -12,9 +12,9 @@ class CCamPosition_Player final : public CCamPosition const _float4x4* pSocketMatrices = { }; }CAMERAPOSITION_PLAYER_DESC; private: - CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CCamPosition_Player(const CCamPosition_Player& rhs); - virtual ~CCamPosition_Player() = default; + CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Socket(const CCamPosition_Socket& rhs); + virtual ~CCamPosition_Socket() = default; public: virtual void Priority_Update(_float fTimeDelta) override; @@ -30,8 +30,8 @@ class CCamPosition_Player final : public CCamPosition const _float4x4* m_pSocketMatrices = { }; public: - static CCamPosition_Player* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CCamPosition_Player* Clone(void* pArg, class CGameObject* pOWner) override; + static CCamPosition_Socket* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Socket* Clone(void* pArg, class CGameObject* pOWner) override; virtual void Free() override; void Describe_Entity() override; }; diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Target.h b/Jusin154_Team3D/Client/Public/CamPosition_Target.h new file mode 100644 index 000000000..ff9bd01bf --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Target.h @@ -0,0 +1,37 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Client) + +class CCamPosition_Target final : public CCamPosition +{ +public: + typedef struct tagCamPosition_Target : public CCamPosition::CAMERAPOSITION_DESC + { + }CAMERAPOSITION_TARGET_DESC; +private: + CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Target(const CCamPosition_Target& rhs); + virtual ~CCamPosition_Target() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; + +public: + static CCamPosition_Target* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Target* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Camera_Gaze.h b/Jusin154_Team3D/Client/Public/Camera_Gaze.h index 0fbc8b059..37fe722c6 100644 --- a/Jusin154_Team3D/Client/Public/Camera_Gaze.h +++ b/Jusin154_Team3D/Client/Public/Camera_Gaze.h @@ -19,6 +19,9 @@ class CCamera_Gaze final : public CCamera public: virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; + void Update_LerpTimer(Engine::_float fTimeDelta); + void Enable_FollowLerp(); + void Enable_LookLerp(); virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h deleted file mode 100644 index f1381cf4f..000000000 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -NS_BEGIN(Engine) -class CTransform; -NS_END -NS_BEGIN(Client) - - -NS_END diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h index 4a929a9c7..949275a8c 100644 --- a/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h +++ b/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h @@ -5,12 +5,6 @@ #include "CallBack_Playable_Behavior.h" #include "CallBack_Playable_HitReport.h" -NS_BEGIN(Engine) -class CModel; -class CShader; -class CRigidBody; -NS_END - NS_BEGIN(Client) class CDummy_PhysXPlayable final : public CGameObject diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h index 54ddd9a08..3a5e189f9 100644 --- a/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h +++ b/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h @@ -3,12 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CModel; -class CShader; -class CRigidBody; -NS_END - NS_BEGIN(Client) class CDummy_PhysXWall final : public CGameObject diff --git a/Jusin154_Team3D/Client/Public/EffectObject.h b/Jusin154_Team3D/Client/Public/EffectObject.h new file mode 100644 index 000000000..1ff1ea0c2 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/EffectObject.h @@ -0,0 +1,136 @@ +#pragma once + +#include "Client_Define.h" +#include "PartObject.h" + +NS_BEGIN(Engine) +class CInstance_Model; +class CShader; +class CTexture; +class CLight; +class CTrail; +NS_END + +NS_BEGIN(Client) + +class CEffectObject abstract : public CPartObject +{ +public: + typedef struct tagEffectInfo + { + _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; + + _float2 vDiffuseUVGainAmount = {}; + _float2 vMaskingUVGainAmount = {}; + _float2 vNoiseUVGainAmount = {}; + + _float2 vDiffuseDistortionUVGainAmount = {}; + _float2 vMaskDistortionUVGainAmount = {}; + + _float2 vUVCutting = { 1.f ,1.f }; + _float2 vUVMaskCutting = { 1.f ,1.f }; + + _int iMaskMoveLerpOption = { 0 }; + _int iDiffuseMoveLerpOption = { 0 }; + _int iNoiseMoveLerpOption = { 0 }; + + _int iMaskDistortionMoveLerpOption = { 0 }; + _int iDiffuseDistortionMoveLerpOption = { 0 }; + + _int iBlurWeight = { 0 }; + + + _bool isDiffuse = {}; + _bool isMasking = {}; + _bool isDissolve = {}; + _bool isNoise = {}; + _bool isEmissive = {}; + _bool isDistortion = {}; + _bool isDiffuseUVMove = {}; + _bool isNoiseUVMove = {}; + _bool isMaskUVMove = {}; + _bool isBlur = {}; + _bool isBillboard = {}; + + + _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; + _float fDiffuseAlpha = { 1.f }; + _float fBlurIntensity = {}; + _float fNoiseDistortionIntensity = {}; + _float fEmissiveStrength = { 0.f }; + + LIGHT_DESC LightDesc = {}; + RENDER eRenderOrder = { RENDER::EFFECT }; + + _bool isReverseDissolve = {}; + + EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; + + _bool isEmissiveDissolve = { false }; + + _bool isMaskClampSample = { false }; + _bool isNoiseColor = { false }; + _bool isNoiseAlpha = { false }; + _bool isNomalDissolve = {}; + + _float fSoftenExp = { 1.31429f }; + _float fSoftStrength = {}; + _float fCoreBoost = {}; + _float fRadius = {}; + + _float fSoftMaskEdge = {}; + _float fSoftMask = {}; + + + }EFFECT_INFO; + + +protected: + CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffectObject(const CEffectObject& rhs); + virtual ~CEffectObject() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual HRESULT Render_Blur() override; +public: + HRESULT Load(const _char* pFilePath, LEVEL eLevel); + +protected: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +protected: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pNoise_TextureCom = { nullptr }; + CTexture* m_pMasking_TextureCom = { nullptr }; + CTexture* m_pDissolve_TextureCom = { nullptr }; + CTexture* m_pEmissive_TextureCom = { nullptr }; + CTexture* m_pDistortion_TextureCom = { nullptr }; + + CShader* m_pShaderCom = { nullptr }; + CLight* m_pLightCom = { nullptr }; + + CInstance_Model* m_pInstance_ModelCom = { nullptr }; + + +protected: + EFFECT_INFO m_EffectInfo = {}; + _string m_strDiffuseName = {}; + _string m_strNoiseName = {}; + _string m_strMaskingName = {}; + _string m_strDissolveName = {}; + _string m_strModelName = {}; + _string m_strEmissiveName = {}; + _string m_strDistortionName = {}; + +public: + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/EffectParts.h b/Jusin154_Team3D/Client/Public/EffectParts.h new file mode 100644 index 000000000..6517ab292 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/EffectParts.h @@ -0,0 +1,37 @@ +#pragma once + +#include "Client_Define.h" +#include "EffectObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Client) + +class CEffectParts final : public CEffectObject +{ +private: + CEffectParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffectParts(const CEffectParts& rhs); + virtual ~CEffectParts() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + +public: + static CEffectParts* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Effect_Container.h b/Jusin154_Team3D/Client/Public/Effect_Container.h new file mode 100644 index 000000000..e0e067265 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Effect_Container.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Client_Define.h" +#include "ContainerObject.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CEffect_Container abstract : public CContainerObject +{ +protected: + CEffect_Container(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffect_Container(const CEffect_Container& rhs); + virtual ~CEffect_Container() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +public: + HRESULT Load_Directory(const _char* pPath); +protected: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + + void Update_Event(_float fTimeDelta); + +protected: + _wstring m_wstrEffectName = {}; + + _bool m_isLoop = {}; + + _float m_fAccTime = {}; + _float m_fPreAccTime = {}; + _float m_fDuration = {}; + _float m_fDelay = {}; + _bool m_isDelayed = { false }; + + map<_float, function> m_Events = {}; + +public: + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 6fe77ff71..4319cdc79 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -5,7 +5,6 @@ NS_BEGIN(Engine) class CGameInstance; -class CGameObject; NS_END NS_BEGIN(Client) diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index 58603e37f..891610638 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -2,8 +2,7 @@ #include "Client_Define.h" #include "Level.h" -NS_BEGIN(Engine) -NS_END + NS_BEGIN(Client) class CLevel_Field final : public CLevel diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index d6a8103cc..3c2f124c7 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -2,8 +2,7 @@ #include "Client_Define.h" #include "Level.h" -NS_BEGIN(Engine) -NS_END + NS_BEGIN(Client) class CLevel_GamePlay final : public CLevel diff --git a/Jusin154_Team3D/Client/Public/Level_Restart.h b/Jusin154_Team3D/Client/Public/Level_Restart.h index 2b996f08c..793136e29 100644 --- a/Jusin154_Team3D/Client/Public/Level_Restart.h +++ b/Jusin154_Team3D/Client/Public/Level_Restart.h @@ -2,8 +2,7 @@ #include "Client_Define.h" #include "Level.h" -NS_BEGIN(Engine) -NS_END + NS_BEGIN(Client) diff --git a/Jusin154_Team3D/Client/Public/Light_Main.h b/Jusin154_Team3D/Client/Public/Light_Main.h index 8b513af4d..b7dc0129e 100644 --- a/Jusin154_Team3D/Client/Public/Light_Main.h +++ b/Jusin154_Team3D/Client/Public/Light_Main.h @@ -3,10 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CLight; -NS_END - NS_BEGIN(Client) class CLight_Main final : public CGameObject diff --git a/Jusin154_Team3D/Client/Public/Loader.h b/Jusin154_Team3D/Client/Public/Loader.h index fe9223f44..3534ff9c8 100644 --- a/Jusin154_Team3D/Client/Public/Loader.h +++ b/Jusin154_Team3D/Client/Public/Loader.h @@ -36,7 +36,8 @@ class CLoader final : public CBase HRESULT Loading_For_GamePlay(); HRESULT Loading_For_Field(); HRESULT Loading_For_Restart(); - +private: + HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h index 51b82b9ff..23b4dc580 100644 --- a/Jusin154_Team3D/Client/Public/MapInfo.h +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -5,7 +5,6 @@ NS_BEGIN(Engine) class CGameInstance; -class CGameObject; NS_END NS_BEGIN(Client) diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h index ab05fbb8f..66828a8de 100644 --- a/Jusin154_Team3D/Client/Public/MonsterInfo.h +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -5,7 +5,6 @@ NS_BEGIN(Engine) class CGameInstance; -class CGameObject; NS_END NS_BEGIN(Client) diff --git a/Jusin154_Team3D/Client/Public/NomalJap.h b/Jusin154_Team3D/Client/Public/NomalJap.h new file mode 100644 index 000000000..3c99a2848 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/NomalJap.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CNomalJap final : public CEffect_Container +{ +private: + CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CNomalJap(const CNomalJap& rhs); + virtual ~CNomalJap() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + class CPhysXEffectHitBox* m_pPhysHitBox = {}; +public: + static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/PhysXEffectHitBox.h b/Jusin154_Team3D/Client/Public/PhysXEffectHitBox.h new file mode 100644 index 000000000..5c5f0d4de --- /dev/null +++ b/Jusin154_Team3D/Client/Public/PhysXEffectHitBox.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" +#include "CallBack_EffectHitBox_Behavior.h" +#include "CallBack_EffectHitBox_HitReport.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Client) + +class CPhysXEffectHitBox final : public CGameObject +{ +public: + typedef struct tagPhysXDummyDesc + { + _float3 vPos = {}; + _float3 vRotRPY = {}; + _uint iSubKind = {}; + _float3 vDeltaPos = {}; + _float2 vLifeTime = {}; + }PHYSXDUMMY_DESC; +private: + CPhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CPhysXEffectHitBox(const CPhysXEffectHitBox& rhs); + virtual ~CPhysXEffectHitBox() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CCallBack_EffectHitBox_Behavior* m_pCallBack_Behavior = { nullptr }; + CCallBack_EffectHitBox_HitReport* m_pCallBack_HitReport = { nullptr }; + _float3 m_vDeltaPos = {}; + _float2 m_vLifeTime = { }; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CPhysXEffectHitBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 9cab6a649..497fe5c7b 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -29,11 +29,17 @@ class CPlayer final : public CUnit _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } private: + unordered_map m_States = { }; + size_t m_iStateMask = { 0 }; + _float m_fDirectionRadian = 0.f; + vector m_InputConditions; _bool m_bSprintToggle = { false }; _bool m_bWalkToggle = { false }; - class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; + + class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; + class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; @@ -43,8 +49,6 @@ class CPlayer final : public CUnit HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); - void Setup_InputConditions(); - void Key_Input(_float fTimeDelta); public: static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -55,11 +59,35 @@ class CPlayer final : public CUnit #pragma region STATE private: virtual void Add_FSM(); - virtual void Set_FSM(); virtual void Set_Anim(); - _bool Check(FSMSTATE::ESTATE state); _bool IsSprint(); _bool IsWalk(); + + HRESULT InputSystem(); + HRESULT InputSkill(); + HRESULT InputMove(); + + void Behavior_IdleEnter(); + HRESULT Behavior_IdleExitCheck(); + void Behavior_IdleExit(); + + void Behavior_MoveEnter(); + HRESULT Behavior_MoveExitCheck(); + void Behavior_MoveExit(); + + void Behavior_JumpEnter(); + HRESULT Behavior_JumpExitCheck(); + void Behavior_JumpExit(); + + void Behavior_LandEnter(); + HRESULT Behavior_LandExitCheck(); + void Behavior_LandExit(); + + void Behavior_DodgeEnter(); + HRESULT Behavior_DodgeExitCheck(); + void Behavior_DodgeExit(); + + public: virtual void Reset_Sprint() { m_bSprintToggle = false; } virtual void Reset_Walk() { m_bWalkToggle = false; } diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h index c76b406f2..84027298e 100644 --- a/Jusin154_Team3D/Client/Public/PlayerInfo.h +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -5,7 +5,6 @@ NS_BEGIN(Engine) class CGameInstance; -class CGameObject; NS_END NS_BEGIN(Client) diff --git a/Jusin154_Team3D/Client/Public/SkyBox.h b/Jusin154_Team3D/Client/Public/SkyBox.h index 66fa6d6dd..6d4838289 100644 --- a/Jusin154_Team3D/Client/Public/SkyBox.h +++ b/Jusin154_Team3D/Client/Public/SkyBox.h @@ -3,11 +3,6 @@ #include "Client_Define.h" #include "GameObject.h" -NS_BEGIN(Engine) -class CModel; -class CShader; -NS_END - NS_BEGIN(Client) class CSkyBox final : public CGameObject diff --git a/Jusin154_Team3D/Client/Public/State_Cast.h b/Jusin154_Team3D/Client/Public/State_Cast.h deleted file mode 100644 index 7e7dcc85b..000000000 --- a/Jusin154_Team3D/Client/Public/State_Cast.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Cast final : public CState -{ -public: - CState_Cast(); - virtual ~CState_Cast() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Combat.h b/Jusin154_Team3D/Client/Public/State_Combat.h index b9359bf4b..edb8d29fc 100644 --- a/Jusin154_Team3D/Client/Public/State_Combat.h +++ b/Jusin154_Team3D/Client/Public/State_Combat.h @@ -1,19 +1,36 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Combat final : public CState +NS_BEGIN(Client) + +class CState_Combat final : public CState_Root { public: + typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_COMBAT_DESC; +private: CState_Combat(); virtual ~CState_Combat() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_COMBAT_DESC* pDesc); + public: + static CState_Combat* Create(STATE_COMBAT_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Dodge.h b/Jusin154_Team3D/Client/Public/State_Dodge.h index 4c171ee2f..110356625 100644 --- a/Jusin154_Team3D/Client/Public/State_Dodge.h +++ b/Jusin154_Team3D/Client/Public/State_Dodge.h @@ -1,19 +1,36 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Dodge final : public CState +NS_BEGIN(Client) + +class CState_Dodge final : public CState_Root { +public: + typedef struct tagDodge : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_DODGE_DESC; public: CState_Dodge(); virtual ~CState_Dodge() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_DODGE_DESC* pDesc); + public: + static CState_Dodge* Create(STATE_DODGE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Idle.h b/Jusin154_Team3D/Client/Public/State_Idle.h index 313baad80..de9da55a3 100644 --- a/Jusin154_Team3D/Client/Public/State_Idle.h +++ b/Jusin154_Team3D/Client/Public/State_Idle.h @@ -1,21 +1,36 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Idle final : public CState +NS_BEGIN(Client) + +class CState_Idle final : public CState_Root { +public: + typedef struct tagIdle : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_IDLE_DESC; public: CState_Idle(); virtual ~CState_Idle() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_IDLE_DESC* pDesc); public: + static CState_Idle* Create(STATE_IDLE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Idle_Turn.h b/Jusin154_Team3D/Client/Public/State_Idle_Turn.h deleted file mode 100644 index f06133aee..000000000 --- a/Jusin154_Team3D/Client/Public/State_Idle_Turn.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Idle_Turn final : public CState -{ -public: - CState_Idle_Turn(); - virtual ~CState_Idle_Turn() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; - diff --git a/Jusin154_Team3D/Client/Public/State_Jog.h b/Jusin154_Team3D/Client/Public/State_Jog.h deleted file mode 100644 index 66d093af5..000000000 --- a/Jusin154_Team3D/Client/Public/State_Jog.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - - -class CState_Jog final : public CState -{ -public: - CState_Jog(); - virtual ~CState_Jog() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Jump.h b/Jusin154_Team3D/Client/Public/State_Jump.h index be66d9c71..810613bcb 100644 --- a/Jusin154_Team3D/Client/Public/State_Jump.h +++ b/Jusin154_Team3D/Client/Public/State_Jump.h @@ -1,20 +1,31 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Jump final : public CState +NS_BEGIN(Client) + +class CState_Jump final : public CState_Root { public: + typedef struct tagJump : public CState_Root::STATE_ROOT_DESC { + + }STATE_JUMP_DESC; +private: CState_Jump(); virtual ~CState_Jump() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + HRESULT Initialize(STATE_JUMP_DESC* pDesc); public: + static CState_Jump* Create(STATE_JUMP_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Land.h b/Jusin154_Team3D/Client/Public/State_Land.h index df9c43b74..f6245554a 100644 --- a/Jusin154_Team3D/Client/Public/State_Land.h +++ b/Jusin154_Team3D/Client/Public/State_Land.h @@ -1,20 +1,31 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Land final : public CState +NS_BEGIN(Client) + +class CState_Land final : public CState_Root { public: + typedef struct tagLand : public CState_Root::STATE_ROOT_DESC { + + }STATE_LAND_DESC; +private: CState_Land(); virtual ~CState_Land() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + HRESULT Initialize(STATE_LAND_DESC* pDesc); public: + static CState_Land* Create(STATE_LAND_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_LightAttack.h b/Jusin154_Team3D/Client/Public/State_LightAttack.h deleted file mode 100644 index 38d74fc77..000000000 --- a/Jusin154_Team3D/Client/Public/State_LightAttack.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_LightAttack final : public CState -{ -public: - CState_LightAttack(); - virtual ~CState_LightAttack() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Move.h b/Jusin154_Team3D/Client/Public/State_Move.h index 51fb9dcc6..c1e608035 100644 --- a/Jusin154_Team3D/Client/Public/State_Move.h +++ b/Jusin154_Team3D/Client/Public/State_Move.h @@ -1,19 +1,36 @@ #pragma once #include "Client_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Move final : public CState +NS_BEGIN(Client) + +class CState_Move final : public CState_Root { public: + typedef struct tagMove : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_MOVE_DESC; +private: CState_Move(); virtual ~CState_Move() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_MOVE_DESC* pDesc); + public: + static CState_Move* Create(STATE_MOVE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Root.h b/Jusin154_Team3D/Client/Public/State_Root.h index 6ecdcff7a..5128a994d 100644 --- a/Jusin154_Team3D/Client/Public/State_Root.h +++ b/Jusin154_Team3D/Client/Public/State_Root.h @@ -2,18 +2,37 @@ #include "Client_Define.h" #include "State.h" -class CState_Root final : public CState +NS_BEGIN(Client) + +class CState_Root abstract : public CState { -public: +protected: + typedef struct tagStateRoot : public CState::STATEDESC { + function funcExitCheck = { nullptr }; + function funcEnterEvent = { nullptr }; + function funcExitEvent = { nullptr }; + }STATE_ROOT_DESC; + +protected: CState_Root(); virtual ~CState_Root() = default; -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: +protected: + virtual void Enter() override; + virtual HRESULT Update(_float fTimeDelta) override; + virtual void Exit() override; + +protected: + function m_funcExitCheck = { nullptr }; + function m_funcEnterEvent = { nullptr }; + function m_funcExitEvent = { nullptr }; + +protected: + HRESULT Initialize(STATE_ROOT_DESC* pArg); + +protected: virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Skill.h b/Jusin154_Team3D/Client/Public/State_Skill.h deleted file mode 100644 index 0e9f53019..000000000 --- a/Jusin154_Team3D/Client/Public/State_Skill.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Skill final : public CState -{ -public: - CState_Skill(); - virtual ~CState_Skill() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Skill2.h b/Jusin154_Team3D/Client/Public/State_Skill2.h deleted file mode 100644 index 5d9b8d738..000000000 --- a/Jusin154_Team3D/Client/Public/State_Skill2.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Skill2 final : public CState -{ -public: - CState_Skill2(); - virtual ~CState_Skill2() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Sprint.h b/Jusin154_Team3D/Client/Public/State_Sprint.h deleted file mode 100644 index 55e015dc9..000000000 --- a/Jusin154_Team3D/Client/Public/State_Sprint.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - - -class CState_Sprint final : public CState -{ -public: - CState_Sprint(); - virtual ~CState_Sprint() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/State_Walk.h b/Jusin154_Team3D/Client/Public/State_Walk.h deleted file mode 100644 index 784d42f74..000000000 --- a/Jusin154_Team3D/Client/Public/State_Walk.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - - -class CState_Walk final : public CState -{ -public: - CState_Walk(); - virtual ~CState_Walk() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Client/Public/TrailObject.h b/Jusin154_Team3D/Client/Public/TrailObject.h new file mode 100644 index 000000000..988ef6ea8 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/TrailObject.h @@ -0,0 +1,63 @@ +#pragma once + +#include "Client_Define.h" +#include "EffectObject.h" + +NS_BEGIN(Engine) +class CShader; +class CTexture; +class CTrail; +NS_END + +NS_BEGIN(Client) + +class CTrailObject final : public CPartObject +{ +private: + CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTrailObject(const CTrailObject& rhs); + virtual ~CTrailObject() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + HRESULT Load_Trail(const _char* pPath, LEVEL eLevel); +private: + HRESULT Bind_ShaderResources() override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Render() override; + +public: + static CTrailObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pNoise_TextureCom = { nullptr }; + CTexture* m_pMasking_TextureCom = { nullptr }; + + CShader* m_pShaderCom = { nullptr }; + CTrail* m_pTrailCom = { nullptr }; + + _string m_strTrailDiffuseName = {}; + _string m_strTrailNoiseName = {}; + _string m_strTrailMaskingName = {}; + + _string m_strPath = {}; + _string m_strName = {}; + + _bool m_isDiffuse = {}; + _bool m_isNoise = {}; + _bool m_isMask = {}; + + EFFECT_TYPE m_eEffectType = { EFFECT_TYPE::TRAIL }; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Wand.h b/Jusin154_Team3D/Client/Public/Wand.h index 88cd293f7..55a5a22a3 100644 --- a/Jusin154_Team3D/Client/Public/Wand.h +++ b/Jusin154_Team3D/Client/Public/Wand.h @@ -3,11 +3,6 @@ #include "Client_Define.h" #include "PartObject.h" -NS_BEGIN(Engine) -class CShader; -class CModel; -NS_END - NS_BEGIN(Client) class CWand final : public CPartObject diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Accio/Accio_Circle_S.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Accio/Accio_Circle_S.bin new file mode 100644 index 000000000..dd9540349 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Accio/Accio_Circle_S.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d134c8cb1ad572871031b8731afc595a46080ae2c10bb888aa1adda962c7b7c +size 811 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin index 8905548cc..ac6aa58f4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0bddaec7c43953cf48b607de04044f826d0b938d3a8febd4c3412e60cdc219d3 -size 754 +oid sha256:4919e0e868585d27f3175e2b1ae95f1bc2cf34e9114231e19a54469ef6fa0ca6 +size 762 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin index 68c274b11..9d42652d4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6527034abc9bec6aeb549613fe9005b652e5dc454b968fa814663439c2dc5cea -size 707 +oid sha256:4da051ec4d8760ce5cdb5eeb1b62d35d2cb732a84427c73c88b48edabaaf5820 +size 715 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle0.bin new file mode 100644 index 000000000..7c65c882d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:593da97d845239af6f8c60bd6fe6188564ca834291cba69623ba9aa789a22858 +size 807 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin new file mode 100644 index 000000000..b19f1f2a2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98c1aabafa6c9c8397a94e56e80159251eda4d449b40ed612a17b7c76f9b9ed8 +size 764 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Explosion.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Explosion.bin new file mode 100644 index 000000000..ae3113402 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Explosion.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43cf5bf0f9692bfca0f9dc049ad9290a60da09058403001a81767c6aca8cec3b +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin new file mode 100644 index 000000000..ce0af12bf --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4be9d23c9e5746dfe3be5ab71dbf8fc62ac187ebc75f2ae284678defa2f54a4 +size 762 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin new file mode 100644 index 000000000..61a654e8b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40d47864f42963f9aba8af3ee094187a08a53475ba09e014ee473b89cd315732 +size 766 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin new file mode 100644 index 000000000..088719d88 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb5a86b4dd6de00f3cbce4e6ec95e9b030a6907d596e33a1d9e176e3fab68d1a +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin new file mode 100644 index 000000000..ee6bb4fa9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:379f94d9deec6c0a0376c82208c27fdd2ce7d70a18f92150186b886324ce4b1c +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Projectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Projectile.bin new file mode 100644 index 000000000..06d3c7681 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Projectile.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1677b131af3603894b1382c1238bc86c9531d8c98b4df95bbf8030084e91ea40 +size 863 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Shoot_Pt.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Shoot_Pt.bin new file mode 100644 index 000000000..65f32c568 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Shoot_Pt.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f5cae6be738dfbed366df4b2feab895ea73cf7c0b38fcd0949e3307b61cba2b +size 754 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin new file mode 100644 index 000000000..be380dad1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be68ab7cbb5c751eb4df1cf178ac391f86f61175bc1203f1e9aa67acb4a7701c +size 713 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle0.bin deleted file mode 100644 index df3d71cf2..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00d283741ea12a585fbea22dce225faccd6387d835dcead66b2f5e3396ac5ef0 -size 807 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle1.bin deleted file mode 100644 index fe8911802..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Circle1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6be7b1f059c23cc86d6492b9adc0e23a486c914523114bef806c6740e0439ab8 -size 756 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Explosion.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Explosion.bin deleted file mode 100644 index 926ec86a8..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Explosion.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a805244677b5601cd024802b35b456a379c931285b6b4056231ebc1fcb511b40 -size 750 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_0.bin deleted file mode 100644 index 508558701..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a13f34f5fa1739da81aaa652d0aa0528c552b45739fd7a1688a3a677c26af3f -size 707 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_1.bin deleted file mode 100644 index eb63deff2..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8341c87c732cb69671bc7bcbc4e8d0d4173c8ab2115967144626e8b92f1650e1 -size 707 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_2.bin deleted file mode 100644 index b5bfbbb96..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79b814bffb0445f8cbddddcd299673df2c15bf469175a1e47f953a711dbf5142 -size 707 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_3.bin deleted file mode 100644 index e7117e0b0..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_PT_3.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:45b640a0bbb2ea7b5b63fc88d9995c916897f102446c28b06f534348bd1ca80f -size 707 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Projectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Projectile.bin deleted file mode 100644 index 1dc1e4f83..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Projectile.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d6a2393e330944b0ee49c639fe99ea6164989ceccc597e48e84551b1d64375d8 -size 788 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Smoke.bin deleted file mode 100644 index be3c2b23e..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard_Smoke.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65218dbabefd07543025bba00c4bee0617bee83b98de57c9844547781372bf19 -size 705 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin index 759f7f1d3..e75f4ffde 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6b892cfdd0a8aef117fb7a4afc7089653666870c2e1d23c520824963387f5bd -size 807 +oid sha256:32e55b25ea8269a7a4fc33173977213d7fc0adef4e0e7438d4944bb2c259ca38 +size 815 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin index 6e3ead7ee..8f2a7b7d5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3213bb3a0a08e1d868afc52ec304493e5111271f7661c8db56ce9eb641cde6c4 -size 752 +oid sha256:02d0b970957db4b839f69a8b31ed9372ab3e3ec59c266d47e0795aa89ec4b462 +size 760 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin index 458c4302c..433e13866 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90dc0962c1416a37debe58bc5b44d8697872f7e9a01fe4585565354517595f3f -size 700 +oid sha256:25e6939fd9ea31c481cc986c29c39b777adf39a26accbda51083571243bbcca6 +size 708 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin index 87689f225..b57256294 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5839f16366a626c1e4b91b7e49c71e28e0aad4cfdf649a2e54329aa0413f087 -size 790 +oid sha256:125761b44eb1740cbd69cf816ba9842655f3beb45ab478d240286711f85c5d5e +size 798 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin index 55326b2b2..4544d45d5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7f3086b12947b00771ddb624c4e89b20cec830c1ddb9eafa1e74de28a5058d0 -size 747 +oid sha256:d39015be44876db680d6b0e1884c4e68560653c39ec690c5b8f44428e887305f +size 755 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin index df6a48467..09f300105 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e447fb46c0fe49c8acc0061ee4b8cf68bdb59c63ee314c9b02a37d5309ac0406 -size 743 +oid sha256:91ce8fb795d36a82c8223f56c8e612fd684a52217337fe2aae2778087e48f925 +size 751 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin index 2fe8b6abc..dad2a6d5b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6c04308bbd7dfa71570413576d4f66de96fb6269307201396c9794923c68fb2 -size 753 +oid sha256:cc62cee26718e7c20b11b610a5607b0f6316172e086c4ac3f58611922cdb8321 +size 761 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin index 16f0fd880..b7e3b92cc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cfea59a237f53e73b02cb6623ab2cd0120f1f586aee6921f4bc570086fc065ef -size 698 +oid sha256:d49ec12307cb4d9073e9030fc60e99714605ee22274cef75f29d2e25f1e88832 +size 706 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin index c271186f7..db020210a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bf9deea4ae9b01a688785bedf0d08a1179a32af2f0ceaa7020cf7b71749b85e5 -size 755 +oid sha256:cb14da6c40cd2e3296a9c7bd245cd9a27b18334a0484c2730492a0f287c71a18 +size 763 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin index 34de99318..14775195c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea5f0901fe1f61804ff823cc87eca481d0c8572ef56dc3d0e33fa53316b3245d -size 236 +oid sha256:f6e731b6987906f2448658f99848e20631838757b20c6950a643f81136b47690 +size 502 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin index 6fe41b744..b28813ac9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb36372372bf2af8134a67602cbfcb12d59453bd9de39d84dd5f6ca28e14e684 -size 178 +oid sha256:79e33167c83a310664da5a9b9e606fc0ad4a8b1842ae20549aadf92690a7b70d +size 352 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin index 4bf1f68b3..905d91a18 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6091a75b6a0306f07a76699af2d033104315ec52205cdfdd3f633cd9a36ea77d -size 174 +oid sha256:1b6d8cd29ebd1ffea4e26cdbb65b8a67715def4288899a0e1e4ca20c179fe436 +size 352 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin index 20aafc905..6cde20e1d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58315360932a699e60721381028c74c9e28f29dd38e8ceaf0c501ee056d7bf0c -size 228 +oid sha256:9b1efe4c752d8a215f19adc218baba9872d7687684f56b0059ac14af146504f3 +size 352 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Light.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Light.bin index df0e49ab1..f1e2e3409 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Light.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Light.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e3610476d496d331ec27dd61739b2928f352629b4d904dcb1b79242dc8924f3a -size 201 +oid sha256:84d17ab11d560e988be1ad90a370d344435218dd79e33e6de5abcae334c98a3e +size 352 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin deleted file mode 100644 index cdf2e890b..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15e844a209069d289f4e267e6045fa6887257681163d5b146c97be76fa062db8 -size 752 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin index 38bf119a0..bcdcc68c7 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:efe9a30cc81959dd7133ce0bb6276ac5b92eb16e2f1e154832623b9bd5965b90 -size 747 +oid sha256:2a0e85af914bd239835cf11ddf9d5cc7e9a5eb8e10b3ca58d35671a80c17ef20 +size 755 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin deleted file mode 100644 index 668d54bb0..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92d5aa0adaad0ee75c2344d15eed70744786932153fb53f219efd2835764d29e -size 746 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin deleted file mode 100644 index 7d64ccea8..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9d4184e9553e467b77c5466e0cedd9f00168ffed4aea52c07053aa9a7ed03096 -size 699 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle0.bin index 7c5ef33f2..a755382ec 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5706ffe31f04c0bee3e089e4f239a76fb67bd1237fb22ba8cd01a6fc7e9d17e -size 799 +oid sha256:367f943b40ade0726986aa1bf3c0d67b29b535681ae6d6d10a7a6ef74bfb6b4f +size 807 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle1.bin new file mode 100644 index 000000000..d1e526981 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Circle1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c4926f2fc8de0565aeffcc27f993b21770f59435302231d1305e35f73a94e5b +size 764 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Explosion.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Explosion.bin index 3774f7ca0..a84bc4fcb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Explosion.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Explosion.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2893656232894ac1cc91992b9c97bbba75fcb21e69bc5de935141bc147df9b4e -size 742 +oid sha256:58e65c18ffa77da07af960c7c2206cc3b52c4c76862728263e68d4e802704961 +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_0.bin index a9904eb23..e184a87a0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e01d1835e23745c543e00f24fd199d7d89732682bcdddbb23c1ed221bd5bb9eb -size 699 +oid sha256:1df4432e91ffc3bf002e0df74d9452abc3c15a72d99889f8945b9bc37d333908 +size 762 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_1.bin index c01996bd6..04f1b87a8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8336e77446690682b872e84a9b60cdcea71bbd75b808e8d31c1b02483b561d01 -size 699 +oid sha256:965f49909fafbff69f2c8051229d6017d421e3a122bd0507dbf4d3c1235df6c5 +size 766 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_2.bin index 34596452d..564ee46e5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e81d31a047678292fe9d68aabd4cb75590a1816003a8f4cc29d85b6c3ec31a3 -size 699 +oid sha256:74aeb2cb30380db5a9f884b19cdba229ab5621c761d516c92c27c31f274163e5 +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_3.bin index 5a0b6a7f3..3926dbdee 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_3.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_PT_3.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76950f5acde485735c077385f894e217dcfc30dc97d7a21711f2ee149f49b2d3 -size 699 +oid sha256:ef29c7294e103dc613454ed272b1db897b0a1de1bfa03ff8dfb63bef0456461c +size 758 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Projectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Projectile.bin index cca1aabe7..b65e3d130 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Projectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Projectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d41b91c21d40d0c747bf7d7ced3bb1db8a4c6b6fc31893ee7111122170bc40ff -size 780 +oid sha256:20f6073f983564c9b03ce321adbd375080f4060b9514d2b4f32960bbe7f7d907 +size 863 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Shoot_Pt.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Shoot_Pt.bin new file mode 100644 index 000000000..a1223fd57 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Shoot_Pt.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2875c3a6331f86254d7fb8029a33fd68748d1375c445b98fc30912206ffa210 +size 754 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Smoke.bin index 1c843fca0..064799431 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Smoke.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Bombard_Smoke.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a00327d0f76135b565c06bbf73f38d8afc7b7469b9cf1e66dd3e3f05411f9a6e -size 697 +oid sha256:413a07275ca91d24fab10ab675a21f34958019fc747a01b363c45619636e1629 +size 713 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin deleted file mode 100644 index 56796e513..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7736584a24f1972257417aebda878d3464f37f0da0f27dad48cabd21ff6eca8 -size 799 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin deleted file mode 100644 index dc1165384..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40fd0d79f844262822104ed5e604e072258f29ce6f2be142198273d40d23aecf -size 744 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin deleted file mode 100644 index 4f9d56f76..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d115f65e6f5e4603e16248081717cf5b3aceb1112c6368dead4eeafc8b9a16d3 -size 692 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin deleted file mode 100644 index 737dcd279..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:297b79febe8f4107fc34192a3b7ace5f0646bc5049d5c763983bca1828359ce4 -size 782 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin deleted file mode 100644 index bbdae3a81..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:50ff8d62caafa01c666960e0b72737da4bfa8905cce9af90c93229a39adf1854 -size 739 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin deleted file mode 100644 index d6d424595..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b015bbe1091e4d524d7c7c637f5a42b931cc00e218d2307b637c6bd2103baf9 -size 735 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin deleted file mode 100644 index 9accc766d..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f1adb0b74c940aa6db942d9a71370cba3a9e095d34ea7b998c89a57e85af686e -size 745 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin deleted file mode 100644 index 834552570..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8646e5b9f972c65252ec77a97a97306cf484918ee3a41f451ef2e33c9a37fef -size 690 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin deleted file mode 100644 index 0847cebf5..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4b6c8694927adf82c81db8733687eea942c26557bad8b4c23cea43aa067c84d -size 747 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin deleted file mode 100644 index f13f07f59..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f303dd4a3616b41c4a2dc5838d28579af68dab52871503cb3f90bf03e81877d -size 744 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin deleted file mode 100644 index a2d043337..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ac035576a895f825fa0b0f35847cc45849d20accf2cdf7b40354da6761793b40 -size 739 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml index 8a7a58cf0..7ef8c42bd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml @@ -3608,158 +3608,4 @@ - - - - - - Prototype_GameObject_SM_HM_Streets_Hogshead - - - - - - Prototype_GameObject_SM_HM_Streets_A - - - - - - Prototype_GameObject_SM_HM_Streets_B - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A - Prototype_GameObject_SM_HM_Streets_SideStreet_A_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B - Prototype_GameObject_SM_HM_Streets_SideStreet_B_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C - Prototype_GameObject_SM_HM_Streets_SideStreet_C_Lod1 - - - - - - Prototype_GameObject_SM_HM_Stairwalls_3Broomsticks - - - - - - Prototype_GameObject_SM_HM_LowerHiStreet_Zonkos - - - - - - Prototype_GameObject_SM_HM_Streets_AA_COL - Prototype_GameObject_SM_HM_Streets_AA_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_BB_COL - Prototype_GameObject_SM_HM_Streets_BB_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_CC_COL - Prototype_GameObject_SM_HM_Streets_CC_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_DD_COL - Prototype_GameObject_SM_HM_Streets_DD_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_EE_COL - Prototype_GameObject_SM_HM_Streets_EE_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_FF_COL - Prototype_GameObject_SM_HM_Streets_FF_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_GG_COL - Prototype_GameObject_SM_HM_Streets_GG_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_HH_COL - Prototype_GameObject_SM_HM_Streets_HH_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL_Lod1 - - - - - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin new file mode 100644 index 000000000..42fda0dc6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e113d19eac33fe1a0dc66a5ce1d3c50ea75d9d8ade3ec9ac7b00ad858c992663 +size 67108864 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml index a6cde8f76..8ca7f52a6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml @@ -2010,21 +2010,6 @@ - - Prototype_GameObject_SM_HM_GEN_A_int_Floor - Prototype_GameObject_SM_HM_GEN_A_int_Floor_Lod1 - - - - - - Prototype_GameObject_SM_HM_GEN_A_int_Walls - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod1 - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod2 - - - - Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL_Lod1 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index df2e1e4bd..ba1161adb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -33,7 +33,9 @@ Texture2D g_ShadowTexture; Texture2D g_PreShadowTexture; Texture2D g_BlurTexture; Texture2D g_BlurXTexture; + Texture2D g_BlurWeightTexture; +Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; @@ -153,7 +155,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); @@ -313,12 +315,33 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } -float g_fWeights[32] = +//float g_fWeights[32] = +//{ +// 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, +// 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, +// 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, +// 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 +//}; + +float g_fWeights[128] = { - 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, - 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, - 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, - 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 + 0.000209902, 0.000241594, 0.000277451, 0.000317919, 0.000363477, 0.000414637, 0.000471944, 0.000535974, + 0.000607333, 0.000686659, 0.000774615, 0.000871889, 0.00097919, 0.00109725, 0.00122679, 0.00136858, + 0.00152334, 0.00169183, 0.00187477, 0.00207285, 0.00228675, 0.0025171, 0.00276448, 0.0030294, + 0.00331231, 0.00361356, 0.00393342, 0.00427205, 0.00462949, 0.00500564, 0.0054003, 0.00581308, + 0.00624346, 0.00669075, 0.00715411, 0.0076325, 0.00812472, 0.0086294, 0.009145, 0.0096698, + 0.0102019, 0.0107393, 0.0112798, 0.0118211, 0.0123608, 0.0128962, 0.0134249, 0.0139441, + 0.0144511, 0.0149431, 0.0154174, 0.0158713, 0.0163021, 0.0167073, 0.0170844, 0.0174311, + 0.0177452, 0.0180246, 0.0182676, 0.0184726, 0.0186383, 0.0187635, 0.0188474, 0.0188895, + + 0.0188895, 0.0188474, 0.0187635, 0.0186383, 0.0184726, 0.0182676, 0.0180246, 0.0177452, + 0.0174311, 0.0170844, 0.0167073, 0.0163021, 0.0158713, 0.0154174, 0.0149431, 0.0144511, + 0.0139441, 0.0134249, 0.0128962, 0.0123608, 0.0118211, 0.0112798, 0.0107393, 0.0102019, + 0.0096698, 0.009145, 0.0086294, 0.00812472, 0.0076325, 0.00715411, 0.00669076, 0.00624346, + 0.00581308, 0.0054003, 0.00500564, 0.00462948, 0.00427205, 0.00393342, 0.00361356, 0.00331231, + 0.0030294, 0.00276448, 0.0025171, 0.00228675, 0.00207285, 0.00187477, 0.00169183, 0.00152334, + 0.00136858, 0.00122679, 0.00109725, 0.000979191, 0.000871889, 0.000774615, 0.000686658, 0.000607333, + 0.000535973, 0.000471944, 0.000414637, 0.000363477, 0.000317919, 0.000277451, 0.000241594, 0.000209902 }; @@ -395,30 +418,25 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) //} float4 vColor = 0.f; - //int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f; - //int iBlurMin; - //int iBlurMax; - //if (iBlurWeight % 2 == 0) - //{ - // iBlurMin = -1 * iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2; - //} - //else - //{ - // iBlurMin = -iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2 + 1; - //} + int iBlurWeight = (int)(round(g_BlurWeightXTexture.Sample(ClampSampler, In.vTexcoord).r) * 128.f); - //[loop] // 변수로 루프돌리려면 반드시 필요함 + int iBlurMin; + int iBlurMax; - for (int i = -15; i < 16; ++i) + iBlurMin = -1 * (iBlurWeight / 2) + 1; + iBlurMax = iBlurWeight / 2; + + // // 변수로 루프돌리려면 반드시 필요함 + + + for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; @@ -429,6 +447,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) struct PS_OUT_BLUR_X { float4 vBlurX : SV_TARGET0; + float4 vBlurWeight : SV_TARGET1; }; @@ -439,35 +458,38 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) float2 vTexcoord; float4 vColor = 0.f; - //TODO 블러 조절 해보려햇는데 실패함.. + float fBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r; + int iBlurWeight = (int) (round(fBlurWeight) * 128.f); - //int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f; + - //int iBlurMin; - //int iBlurMax; + int iBlurMin; + int iBlurMax; - //if (iBlurWeight % 2 == 0) + iBlurMin = -1 * (iBlurWeight / 2) + 1; + iBlurMax = iBlurWeight / 2; + + //for (int i = -15; i < 16; ++i) //{ - // iBlurMin = -1 * iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2; - //} - //else - //{ - // iBlurMin = -iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2 + 1; + // vTexcoord.x = In.vTexcoord.x; + // vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; + + // vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); //} - //[loop] // 변수로 루프돌리려면 반드시 필요함 + //Out.vBackBuffer += vColor; - for (int i = -15; i < 16; ++i) + + for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; + Out.vBlurWeight = fBlurWeight; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index 31276135c..645fd6d0c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -1,64 +1,151 @@ float PI = 3.141592; -struct Mesh +struct KeyFrame { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; - - uint4 vBlendIndex; - float4 vBlendWeight; + float3 vScale; + float4 vRotation; + float3 vTranslation; + float fTrackPosition; }; -struct SkinngMesh +struct Channel { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; - + uint StartIndex; + uint KeyCount; + uint BoneIndex; }; -StructuredBuffer g_MeshBufferInput : register(t0); -RWStructuredBuffer gSkinngMeshOutput : register(u0); - -cbuffer g_ConstantBuffer : register(b0) +struct LocalPos { - row_major float4x4 BoneMatrix[512]; + float3 Scale; + float pad0; + + float4 Rotation; + + float3 Translation; + float pad1; }; -//[numthreads(256, 1, 1)] -[numthreads(256, 1, 1)] -void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) + +StructuredBuffer g_KeyFrameBuffer : register(t0); +StructuredBuffer g_ChannelBuffer : register(t1); + +RWStructuredBuffer g_LocalPosOutput : register(u0); + + +cbuffer AnimCB : register(b0) { - uint iIndex = DispatchThreadID.x; + float CurrentTime; + float Duration; + float Speed; + int BoneCount; + + row_major float4x4 PreTransformMatrix; +}; - Mesh mesh = g_MeshBufferInput[iIndex]; +float4 quatSlerp(float4 q1, float4 q2, float t) +{ + float cosTheta = dot(q1, q2); - float fWeightW = 1.f - - (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + if (cosTheta < 0.0f) + { + q2 = -q2; + cosTheta = -cosTheta; + } - matrix SkinMatrix = - BoneMatrix[mesh.vBlendIndex.x] * mesh.vBlendWeight.x + - BoneMatrix[mesh.vBlendIndex.y] * mesh.vBlendWeight.y + - BoneMatrix[mesh.vBlendIndex.z] * mesh.vBlendWeight.z + - BoneMatrix[mesh.vBlendIndex.w] * fWeightW; + if (cosTheta > 0.9995f) + return normalize(lerp(q1, q2, t)); - float4 vPosition = mul(float4(mesh.vPosition, 1), SkinMatrix); - float4 vNormal = mul(float4(mesh.vNormal, 0), SkinMatrix); - float4 vBinormal = mul(float4(mesh.vBinormal, 0), SkinMatrix); - float4 vTangent = mul(float4(mesh.vTangent, 0), SkinMatrix); + float theta = acos(cosTheta); + float sinTheta = sin(theta); + float w1 = sin((1.0f - t) * theta) / sinTheta; + float w2 = sin(t * theta) / sinTheta; - SkinngMesh outv; - outv.vPosition = vPosition.xyz; - outv.vNormal = vNormal.xyz; - outv.vTangent = vTangent.xyz; - outv.vBinormal = vBinormal.xyz; - outv.vTexcoord = mesh.vTexcoord; - - gSkinngMeshOutput[iIndex] = outv; + return q1 * w1 + q2 * w2; +} + + +[numthreads(256, 1, 1)] +void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID) +{ + uint boneIndex = DTID.x; + if (boneIndex >= (uint) BoneCount) + return; + + float time = CurrentTime; + if (Duration > 0) + time = min(time, Duration); + + Channel channel = g_ChannelBuffer[boneIndex]; + + LocalPos result; + + if (channel.KeyCount == 0) + { + result.Scale = float3(1, 1, 1); + result.Rotation = float4(0, 0, 0, 1); + result.Translation = float3(0, 0, 0); + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + uint firstIndex = channel.StartIndex; + uint lastIndex = channel.StartIndex + channel.KeyCount - 1; + + KeyFrame keyframe1 = g_KeyFrameBuffer[firstIndex]; + KeyFrame keyframe2 = g_KeyFrameBuffer[lastIndex]; + + if (time <= keyframe1.fTrackPosition) + { + result.Scale = keyframe1.vScale; + result.Rotation = keyframe1.vRotation; + result.Translation = keyframe1.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + if (time >= keyframe2.fTrackPosition) + { + result.Scale = keyframe2.vScale; + result.Rotation = keyframe2.vRotation; + result.Translation = keyframe2.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + for (uint i = 0; i < channel.KeyCount - 1; ++i) + { + uint A = channel.StartIndex + i; + uint B = channel.StartIndex + i + 1; + + KeyFrame ka = g_KeyFrameBuffer[A]; + KeyFrame kb = g_KeyFrameBuffer[B]; + + if (time >= ka.fTrackPosition && time <= kb.fTrackPosition) + { + float t = (time - ka.fTrackPosition) / (kb.fTrackPosition - ka.fTrackPosition); + + result.Scale = lerp(ka.vScale, kb.vScale, t); + result.Rotation = quatSlerp(ka.vRotation, kb.vRotation, t); + result.Translation = lerp(ka.vTranslation, kb.vTranslation, t); + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + } + + result.Scale = keyframe2.vScale; + result.Rotation = keyframe2.vRotation; + result.Translation = keyframe2.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 117084542..bc18364e1 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -38,6 +38,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; + float2 vDelay; }; @@ -79,6 +80,17 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + particleValue.vDelay.x += fTimeDelta; + + if (particleValue.vDelay.x < particleValue.vDelay.y) + { + + g_VBInstanceOutput[iIndex] = particle; + g_ParticleValueOutput[iIndex] = particleValue; + + return; + } + // 라이프타임 움직임 particle.vLifeTime.x += fTimeDelta; @@ -97,7 +109,7 @@ void CS_MAIN( particle.vLifeTime.x = 0.f; particleValue.vAniIndex.x = 0.f; - + particleValue.vDelay.x = 0.f; g_VBInstanceOutput[iIndex] = particle; g_ParticleValueOutput[iIndex] = particleValue; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index e0fd8e188..5b21faa0f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -1,16 +1,5 @@ -#include "Engine_Shader_Defines.hlsli" - -struct SkinngMesh -{ - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; -}; - - +#include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; @@ -25,13 +14,12 @@ float3 g_vRimColor; float4 g_TestColor; vector g_vCamPosition; -Texture2D g_DiffuseTexture : register(t0); -Texture2D g_NormalTexture : register(t1); -Texture2D g_DAOTexture : register(t2); -Texture2D g_THVTexture : register(t3); -Texture2D g_SurfaceParamsTexture : register(t4); +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_DAOTexture; +Texture2D g_THVTexture; +Texture2D g_SurfaceParamsTexture; -StructuredBuffer g_SkinngMesh : register(t5); float3 g_RootColor; float3 g_TipColor; @@ -67,31 +55,26 @@ struct VS_OUT float4 vWorldPos : TEXCOORD1; float4 vProjPos : TEXCOORD2; }; -VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID) + +VS_OUT VS_MAIN(VS_IN In) { VS_OUT Out; - //float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); - //matrix BoneMatrix = - // mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + - // mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + - // mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + - // mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); - //vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); - //vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); - //vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); - //vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); + vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); - matrix matWV, matWVP; - - vector vPosition = float4(g_SkinngMesh[vertexID].vPosition, 1.f); - vector vNormal = float4(g_SkinngMesh[vertexID].vNormal, 0.f); - vector vBinormal = float4(g_SkinngMesh[vertexID].vBinormal, 0.f); - vector vTangent = float4(g_SkinngMesh[vertexID].vTangent, 0.f); - + matrix matWV, matWVP; matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -99,8 +82,7 @@ VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID) Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; - Out.vTexcoord = g_SkinngMesh[vertexID].vTexcoord; - //In.vTexcoord; + Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; return Out; @@ -124,10 +106,10 @@ VS_OUT_CAPTUREDMODEL VS_CAPTUREDMODEL(VS_IN In) float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); - matrix BoneMatrix = - mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x ) + - mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y ) + - mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z ) + + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); @@ -219,10 +201,13 @@ struct PS_OUT PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.2f) { discard; } + if (vMtrlDiffuse.a < 0.2f) + { + discard; + } float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 8a0db6625..8223c063c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -28,8 +28,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; - - + float2 vDelay; }; @@ -81,7 +80,7 @@ float g_fBlurIntensity; //블러 세기 float g_fNoiseDistortionIntensity; // 디스토션 왜곡 세기 float4 g_vEmissive; -float g_fEmissiveStrength; +float g_fEmissiveStrength; float g_fSoftenExp; float g_fSoftStrength; @@ -104,13 +103,17 @@ bool g_isMaskUVMove; bool g_isNoiseUVMove; bool g_isReverseDissolve; + bool g_isEmissiveDissolve; +bool g_isEmissiveDissolveReverse; + bool g_isMaskClampSample; bool g_isNoiseColor; bool g_isNoiseAlpha; bool g_isNomalDissolve; + float g_fFar; float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption) @@ -310,6 +313,12 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime; + float2 vDelay = g_ParticleValue[In.iGPUIndex].vDelay; + + if (vDelay.x < vDelay.y) + { + discard; + } if (g_isDiffuse == true) { @@ -407,20 +416,23 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord); else vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); + + + float fSoftMask; + + if (g_fSoftMask > FLT_EPSILON5) + fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask); + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask); + } else { vMtrlMask.r = 1.f; } - - float fSoftMask; - - if (g_fSoftMask > FLT_EPSILON5) - fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask); - - vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask); - + + if (vMtrlDiffuse.a <= 0.f) discard; @@ -496,6 +508,13 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y); } + if (g_isEmissiveDissolveReverse == true) + { + fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y); + } + + + Out.vColorTarget = vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스 return Out; @@ -544,6 +563,7 @@ struct PS_BLUR_IN struct PS_BLUR_OUT { float4 vDiffuse : SV_TARGET0; + float4 vBlurWeight : SV_TARGET1; }; @@ -551,7 +571,6 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { PS_BLUR_OUT Out; - vector vMtrlDiffuse; vector vMtrlMask; vector vMtrlNoise; @@ -563,12 +582,18 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime; + float2 vDelay = g_ParticleValue[In.iGPUIndex].vDelay; + + if (vDelay.x < vDelay.y) + { + discard; + } if (g_isDiffuse == true) { float2 UV; // 이미지의 UV값 - UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex.x)); + UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex)); if (g_isDiffuseUVMove) { @@ -617,7 +642,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { float2 vNoiseUV = In.vTexcoord; - if(g_isNoiseUVMove == true) + if (g_isNoiseUVMove == true) vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); @@ -634,7 +659,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { float2 vMaskTexcoord = In.vTexcoord; - vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x)); + vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex)); // 마스크 디스토션 if (g_isDistortion == true) @@ -660,31 +685,29 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord); else vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); - + + + float fSoftMask; + + if (g_fSoftMask > FLT_EPSILON5) + fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask); + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask); + + if (vMtrlDiffuse.a <= 0.f) + discard; } else { vMtrlMask.r = 1.f; } - - - - float softMask = saturate((vMtrlMask.r - 0.1) * 1.0); - - vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * softMask); - - if (vMtrlDiffuse.a <= 0.f) - discard; - vMtrlDiffuse.a *= g_fDiffuseAlpha; if (g_isDissolve == true) { - vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - if (g_isNomalDissolve) { vMtrlDiffuse.a *= (0.95f - In.vLifeTime.x / In.vLifeTime.y); @@ -706,10 +729,12 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) } } + // 색깔 추가할 처리 (이미시브) + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); @@ -741,10 +766,9 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y); } - vEmissiveMtrl = vEmissiveMtrl * fEmissive * fEmissiveStrength; - Out.vDiffuse = vector(vMtrlDiffuse.rgb * g_fBlurIntensity + vEmissiveMtrl.rgb, vMtrlDiffuse.a); /** vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a);*/ + Out.vBlurWeight = g_iBlurWeight / 128.f; return Out; } @@ -766,7 +790,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); @@ -782,8 +806,6 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR(); } - - } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl index 261099f7f..bcdd26cb6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl @@ -9,9 +9,9 @@ float g_fUsingSurfaceParams; Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; Texture2D g_SurfaceParamsTexture; -Texture2D g_DiffuseTextures[2]; -Texture2D g_NormalTextures[2]; -Texture2D g_SurfaceParamsTextures[2]; +Texture2D g_DiffuseTextures[4]; +Texture2D g_NormalTextures[4]; +Texture2D g_SurfaceParamsTextures[4]; Texture2D g_MaskTexture; struct VS_IN @@ -69,24 +69,39 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - float2 tileUV = In.vWorldPos.xz / 64.f; + float2 tileUV = In.vWorldPos.xz / 16.f; vector vMask = g_MaskTexture.Sample(DefaultSampler, In.vTexcoord); vector vMtrlDiffuse_0 = g_DiffuseTextures[0].Sample(DefaultSampler, tileUV); vector vMtrlDiffuse_1 = g_DiffuseTextures[1].Sample(DefaultSampler, tileUV); + vector vMtrlDiffuse_2 = g_DiffuseTextures[2].Sample(DefaultSampler, tileUV); + vector vMtrlDiffuse_3 = g_DiffuseTextures[3].Sample(DefaultSampler, tileUV); - vector vMtrlDiffuse = lerp(vMtrlDiffuse_0, vMtrlDiffuse_1, vMask.r); + vector vMtrlDiffuse = float4(float3(vMtrlDiffuse_0.xyz * vMask.r + + vMtrlDiffuse_1.xyz * vMask.g + + vMtrlDiffuse_2.xyz * vMask.b + + vMtrlDiffuse_3.xyz * vMask.a), 1.f); vector vSurface_0 = g_SurfaceParamsTextures[0].Sample(DefaultSampler, tileUV); vector vSurface_1 = g_SurfaceParamsTextures[1].Sample(DefaultSampler, tileUV); + vector vSurface_2 = g_SurfaceParamsTextures[2].Sample(DefaultSampler, tileUV); + vector vSurface_3 = g_SurfaceParamsTextures[3].Sample(DefaultSampler, tileUV); - vector vSurface = lerp(vSurface_0, vSurface_1, vMask.r); + vector vSurface = (vSurface_0 * vMask.r + + vSurface_1 * vMask.g + + vSurface_2 * vMask.b + + vSurface_3 * vMask.a); float3 vNormalDecoded_0 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, tileUV); - float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, tileUV); + float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[1], DefaultSampler, tileUV); + float3 vNormalDecoded_2 = DecodeNormalFromRG(g_NormalTextures[2], DefaultSampler, tileUV); + float3 vNormalDecoded_3 = DecodeNormalFromRG(g_NormalTextures[3], DefaultSampler, tileUV); - float3 vNormalDecoded = normalize(lerp(vNormalDecoded_0, vNormalDecoded_1, vMask.r)); + float3 vNormalDecoded = normalize(vNormalDecoded_0.xyz * vMask.r + + vNormalDecoded_1.xyz * vMask.g + + vNormalDecoded_1.xyz * vMask.b + + vNormalDecoded_1.xyz * vMask.a); float3 vBinormal = cross(In.vNormal.xyz, float3(1.f, 0.f, 0.f)); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds index a38c801b9..c645b3637 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds index d674bd7a3..88834c5e7 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds new file mode 100644 index 000000000..2d3f6442e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds new file mode 100644 index 000000000..36017b3e1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds index b0c66ea01..568c2ac58 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds new file mode 100644 index 000000000..7eff9329b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds new file mode 100644 index 000000000..5a76d93a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds index 98fe8de42..43e598aa9 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds new file mode 100644 index 000000000..6165e524d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds new file mode 100644 index 000000000..e862b711c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 9f74c2419..ced8caa21 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -164,6 +164,7 @@ + @@ -205,6 +206,7 @@ + @@ -244,17 +246,10 @@ - - - - - - - @@ -300,6 +295,7 @@ + @@ -341,6 +337,7 @@ + @@ -380,17 +377,10 @@ - - - - - - - diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 08b3dd6c9..0b3ec628b 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -223,12 +223,6 @@ {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} - - {d5681f71-af29-4418-bf3a-a1486c6ba171} - - - {904a7ae5-33fe-49a1-9f31-27443acc9e1a} - {680910fd-aee2-4f69-b644-12b36b0f635b} @@ -274,36 +268,9 @@ {04d044a9-3cab-4425-9adf-8eea436e71d4} - - {0b8cac41-419f-48ce-87bc-805b8962b4df} - {26e2dcaa-d94a-4c3d-ba39-2916f2a27bac} - - {dac78c4e-b898-45dc-8740-794899de0c69} - - - {1cac1aa6-ea12-429e-8a84-ca2bf44c2be4} - - - {43bc0f97-0b7d-406b-900c-0fae023023ec} - - - {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} - - - {5f6e884b-3ab2-4354-b378-44e8221a4720} - - - {0aa8e406-d786-4e40-b825-54d5e3f691e2} - - - {eb7d24ee-d60e-4062-b974-264409436d81} - - - {b017e167-f48d-4417-a924-765ab802cff5} - {f5cd19e8-186b-418f-b7fa-af73046a80d1} @@ -313,15 +280,6 @@ {8882358e-c8eb-4222-a87e-01d902533b8f} - - {3614836d-9988-4ec0-95a8-f8ebc25a9a13} - - - {98f012a4-2f13-456f-85ba-6929b1535de6} - - - {3ad2f4c4-95e6-47fa-9f4c-b9fcdbd77277} - {a9862861-6eaa-4e04-b7f6-217a32db7db4} @@ -340,6 +298,9 @@ {0db597d8-c4e7-479a-9b7e-9014b79a5e03} + + {7e8b7123-11fb-4946-99fe-3265932d0536} + {072a4e85-ba07-4ffd-bdb1-ddac02558242} @@ -355,10 +316,40 @@ {92110a48-81d0-4e98-be06-05dd078d0488} + + {c81350c7-0edb-4e51-babf-09bf627414f1} + + + {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} + + + {8a70232d-f917-4ff6-b617-302e325996ae} + + + {dac78c4e-b898-45dc-8740-794899de0c69} + + + {d5681f71-af29-4418-bf3a-a1486c6ba171} + + + {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} + + + {b017e167-f48d-4417-a924-765ab802cff5} + + + {904a7ae5-33fe-49a1-9f31-27443acc9e1a} + + + {0b8cac41-419f-48ce-87bc-805b8962b4df} + {7e8b7123-11fb-4946-99fe-3265932d0536} - + + {54eef1b7-a5ee-444f-9577-44ffc8c3d8bc} + + {b4e1da25-c952-4ff4-92fd-7f1501d8c005} @@ -577,19 +568,13 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXWall - 80.State\State_Combat\State_Dodge + 80.State\Focus\State_Dodge - 80.State\State_Idle - - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint + 80.State\Movement\State_Idle - 80.State\State_Jump + 80.State\Focus\State_Jump 02.GameObjects\Player @@ -639,23 +624,14 @@ 02.GameObjects\Dummys\DummyGlobe - - 80.State\State_Combat\State_Skill - - - 80.State\State_Combat\State_LightAttack - - 80.State\State_Land + 80.State\Focus\State_Land 02.GameObjects\Monster\Goblin - - 80.State\State_Combat\State_Cast - - 80.State\State_Move + 80.State\Movement\State_Move 80.State\State_Combat @@ -669,15 +645,6 @@ 02.GameObjects\Layer_Effect\Effect\05.NomalJap - - 80.State\State_Combat\State_Skill2 - - - 80.State\State_Idle\State_Idle_Turn - - - 80.State\State_Move\State_Jog - 02.GameObjects\Broom @@ -711,12 +678,21 @@ 02.GameObjects\Camera + + 02.GameObjects\Wand + + + 02.GameObjects\Layer_Effect\Effect\06.Bombard + 80.State 02.GameObjects\Wand + + 02.GameObjects\Env\05.AlphaMap + 50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot_Preview @@ -941,22 +917,13 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame - 80.State\State_Combat\State_Dodge + 80.State\Focus\State_Dodge - 80.State\State_Idle - - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint + 80.State\Movement\State_Idle - 80.State\State_Jump - - - 02.GameObjects\Player + 80.State\Focus\State_Jump 02.GameObjects\Env\04.Land @@ -994,23 +961,14 @@ 02.GameObjects\Dummys\DummyGlobe - - 80.State\State_Combat\State_Skill - - - 80.State\State_Combat\State_LightAttack - - 80.State\State_Land + 80.State\Focus\State_Land 02.GameObjects\Monster\Goblin - - 80.State\State_Combat\State_Cast - - 80.State\State_Move + 80.State\Movement\State_Move 80.State\State_Combat @@ -1024,15 +982,6 @@ 02.GameObjects\Layer_Effect\Effect\05.NomalJap - - 80.State\State_Combat\State_Skill2 - - - 80.State\State_Idle\State_Idle_Turn - - - 80.State\State_Move\State_Jog - 02.GameObjects\Broom @@ -1066,11 +1015,20 @@ 02.GameObjects\Camera + + 02.GameObjects\Wand + 80.State - - 02.GameObjects\Wand + + 02.GameObjects\Player + + + 02.GameObjects\Layer_Effect\Effect\06.Bombard + + + 02.GameObjects\Env\05.AlphaMap 50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot_Preview diff --git a/Jusin154_Team3D/Editor/Private/AlphaMap.cpp b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp new file mode 100644 index 000000000..4f0c92ed5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp @@ -0,0 +1,194 @@ +#include "pch.h" +#include "AlphaMap.h" +#include "GameInstance.h" + +CAlphaMap::CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CBase{} + , m_pDevice{ pDevice } + , m_pContext{ pContext } + , m_pGameInstance{ Engine::CGameInstance::GetInstance() } +{ + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + SAFE_ADDREF(m_pGameInstance); +} + +void CAlphaMap::Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + _uint iPixelIndex = {}; + + _uint iStartX = (_uint)(vPosition.x / 0.25f) - (iRange / 2); + _uint iStartZ = (_uint)(vPosition.z / 0.25f) - (iRange / 2); + + for (_uint j = 0; j < iRange; ++j) + { + for (_uint i = 0; i < iRange; ++i) + { + _uint iCurrentX = iStartX + i; + _uint iCurrentZ = iStartZ + j; + + iPixelIndex = (iCurrentZ * m_iNumPixelW) + iCurrentX; + + if (m_iNumPixels <= iPixelIndex) + return; + + if (0 == iColorIndex) + { + m_pPixels[iPixelIndex].x += fValue; + } + else if (1 == iColorIndex) + { + m_pPixels[iPixelIndex].y += fValue; + } + else if (2 == iColorIndex) + { + m_pPixels[iPixelIndex].z += fValue; + } + else if (3 == iColorIndex) + { + m_pPixels[iPixelIndex].w += fValue; + } + else + return; + + _float fWeight = m_pPixels[iPixelIndex].x + m_pPixels[iPixelIndex].y + m_pPixels[iPixelIndex].z + m_pPixels[iPixelIndex].w; + + m_pPixels[iPixelIndex] = _float4(m_pPixels[iPixelIndex].x / fWeight, m_pPixels[iPixelIndex].y / fWeight, m_pPixels[iPixelIndex].z / fWeight, m_pPixels[iPixelIndex].w / fWeight); + } + } + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + +} + +void CAlphaMap::Save_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ofstream out(strFilePath, ios::binary); + + if (false == out.is_open()) + { + MSG_BOX("Failed to Save Binanry File"); + return; + } + for (_uint i = 0; i < m_iNumPixels; ++i) + { + out.write(reinterpret_cast(&m_pPixels[i]), sizeof(_float4)); + } + + out.close(); + + MSG_BOX("Success to Save Binanry File"); +} + +void CAlphaMap::Load_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ifstream in(strFilePath, ios::binary); + + if (false == in.is_open()) + { + MSG_BOX("Failed to Load Model Binanry File"); + return; + } + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + in.read(reinterpret_cast<_char*>(&m_pPixels[i]), sizeof(_float4)); + } + + + in.close(); + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + MSG_BOX("Success to Load Binanry File"); + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); +} + +HRESULT CAlphaMap::Initialize(_uint iSizeX, _uint iSizeY) +{ + D3D11_TEXTURE2D_DESC TextureDesc{}; + + TextureDesc.Width = iSizeX; + TextureDesc.Height = iSizeY; + TextureDesc.MipLevels = 1; + TextureDesc.ArraySize = 1; + TextureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + + TextureDesc.SampleDesc.Quality = 0; + TextureDesc.SampleDesc.Count = 1; + + + TextureDesc.Usage = D3D11_USAGE_DYNAMIC; + TextureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + TextureDesc.MiscFlags = 0; + + if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &m_pTexture2D))) + return E_FAIL; + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pTexture2D, nullptr, &m_pSRV))) + return E_FAIL; + + m_iNumPixels = iSizeX * iSizeY; + m_pPixels = new _float4[m_iNumPixels]; + ZeroMemory(m_pPixels, sizeof(_float4) * m_iNumPixels); + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + m_pPixels[i].x = 1.f; + } + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return E_FAIL; + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + + m_iNumPixelW = iSizeX; + m_iNumPixelH = iSizeY; + + return S_OK; +} + +CAlphaMap* CAlphaMap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY) +{ + CAlphaMap* pInstance = new CAlphaMap(pDevice, pContext); + + if (FAILED(pInstance->Initialize(iSizeX, iSizeY))) + { + MSG_BOX("Failed to Created : CAlphaMap"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CAlphaMap::Free() +{ + __super::Free(); + + Safe_Delete_Array(m_pPixels); + + SAFE_RELEASE(m_pSRV); + SAFE_RELEASE(m_pTexture2D); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Editor/Private/Bombard.cpp b/Jusin154_Team3D/Editor/Private/Bombard.cpp new file mode 100644 index 000000000..0e293e18f --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Bombard.cpp @@ -0,0 +1,193 @@ +#include "pch.h" +#include "Bombard.h" + +#include "GameInstance.h" +#include "EditEffect.h" +#include "Dummy_PhysXEffectHitBox.h" + + +CBombard::CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CBombard::CBombard(const CBombard& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CBombard::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CBombard::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Ready_Child())) + return E_FAIL; + + if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Bombard/"))) + return E_FAIL; + + + m_wstrEffectName = L"Bombard"; + + CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); + m_pLight_Projectile = Get_PartObject("Bombard_Projectile"); + CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); + + pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + pCircle0->Set_Visible(true); + pShootPt->Set_Visible(true); + m_pLight_Projectile->Set_Visible(true); + + SAFE_ADDREF(m_pLight_Projectile); + m_fDuration = 2.5f; + + return S_OK; +} + +void CBombard::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CBombard::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + + m_pLight_Projectile->Get_Component()->Translation(vOwnerLook * 2.f); +} + +void CBombard::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CBombard::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CBombard::Ready_Child() +{ + CDummy_PhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; + + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = { 0.f, 0.f, 2.f }; + Desc.vLifeTime = { 0.f, 2.f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } + + return S_OK; +} + +CBombard* CBombard::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CBombard* pInstance = new CBombard(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CBombard"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner) +{ + CBombard* pInstance = new CBombard(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CBombard"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CBombard::OnCollision(CGameObject* pOther , void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + } + + + m_pLight_Projectile->Set_Visible(false); + Get_PartObject("Bombard_Shoot_Pt")->Set_Visible(false); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + Get_PartObject("Bombard_Smoke")->Get_Component()->Translation(vOwnerLook); + + Get_PartObject("Bombard_Circle0")->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); +} + +void CBombard::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pLight_Projectile); + +} + +void CBombard::Describe_Entity() +{ + +} + +HRESULT CBombard::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Editor/Private/Broom.cpp b/Jusin154_Team3D/Editor/Private/Broom.cpp index d31202546..76e8578f3 100644 --- a/Jusin154_Team3D/Editor/Private/Broom.cpp +++ b/Jusin154_Team3D/Editor/Private/Broom.cpp @@ -66,9 +66,6 @@ HRESULT CBroom::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; - if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp index 074fdc97e..cf636702f 100644 --- a/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp @@ -75,7 +75,7 @@ CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11De if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CCamPosition_Player"); + MSG_BOX("Failed to Created : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } @@ -88,7 +88,7 @@ CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* p pInstance->m_pOwner = pOWner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CCamPosition_Player"); + MSG_BOX("Failed to Cloned : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 45d67b060..c186b6fef 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -3,12 +3,6 @@ #include "GameInstance.h" #include "DebugCamera.h" -#include "State_Idle.h" -#include "State_Walk.h" -#include "State_Dodge.h" -#include "State_Sprint.h" -#include "State_Jump.h" -#include "State_Skill.h" CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) @@ -50,11 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta) void CDummyObject::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); - m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); - - } void CDummyObject::Late_Update(_float fTimeDelta) @@ -83,9 +73,6 @@ HRESULT CDummyObject::Render() if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { return E_FAIL; } - - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp index e15b12953..32e8b87dc 100644 --- a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp +++ b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp @@ -42,12 +42,7 @@ void CDummySkyBox::Update(_float fTimeDelta) { #ifdef gimch m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); - -#else - m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); - -#endif // 기무리 - +#endif // !기무리 } void CDummySkyBox::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp index 9983ecb9b..a7c386903 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp @@ -2,7 +2,9 @@ #include "Dummy_PhysXPlayable.h" #include "Dummy_PhysXEffectHitBox.h" #include "GameInstance.h" + #include "NomalJap.h" +#include "Bombard.h" #include "TrailObject.h" @@ -54,7 +56,7 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta) } if (m_pGameInstance->Key_Up(DIK_O)) { { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { assert(false); return; } @@ -115,15 +117,6 @@ HRESULT CDummy_PhysXPlayable::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - CPartObject::PARTOBJECT_DESC PartsDesc{}; - - PartsDesc.pParentTransform = m_pTransformCom; - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, &PartsDesc, this))) { - assert(false); - return E_FAIL; - } - return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 1cd833c01..21b96d88e 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -41,8 +41,8 @@ void CEditEffect::Priority_Update(_float fTimeDelta) void CEditEffect::Update(_float fTimeDelta) { - //if (m_bVisible == false) - // return; + if (m_bVisible == false) + return; if (m_pInstance_ModelCom == nullptr) return; @@ -70,6 +70,9 @@ void CEditEffect::Late_Update(_float fTimeDelta) m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this); } + if (m_EffectInfo.isOnlyBlur == true) + return; + m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this); } @@ -383,14 +386,21 @@ void CEditEffect::Describe_Entity() const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" }; const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" }; + const char* pEffectType[] = { "EFFECT" , "TRAIL" }; _int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder); + _int iCurrentType = static_cast<_int>(m_EffectInfo.eEffectType); if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) { m_EffectInfo.eRenderOrder = static_cast(iCurrentItem); } - + + if (ImGui::Combo("Effect Type", &iCurrentType, pEffectType, ENUM_CLASS(EFFECT_TYPE::END))) + { + m_EffectInfo.eEffectType = static_cast(iCurrentType); + } + GUI::Checkbox("Visible", &m_bVisible); m_pTransformCom->Describe_Entity(); @@ -417,10 +427,11 @@ void CEditEffect::Describe_Entity() if (GUI::TreeNode("BLUR")) { GUI::Checkbox("Blur", &m_EffectInfo.isBlur); + GUI::Checkbox("OnlyBlur", &m_EffectInfo.isOnlyBlur); ImGui::PushItemWidth(80); GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f); - GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 1.f, 0, 32); + GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 2.f, 0, 128); ImGui::PopItemWidth(); @@ -733,19 +744,19 @@ void CEditEffect::Describe_Entity() GUI::TreePop(); } - ImGui::Begin("Simple Plot"); + //ImGui::Begin("Simple Plot"); - ImGui::PlotLines("Value", m_ValueVector.data(), (int)m_ValueVector.size(), 0, nullptr, FLT_MAX, FLT_MAX, ImVec2(0, 100)); + //ImGui::PlotLines("Value", m_ValueVector.data(), (int)m_ValueVector.size(), 0, nullptr, FLT_MAX, FLT_MAX, ImVec2(0, 100)); - GUI::InputFloat("InputValue", &m_fInputValue); + //GUI::InputFloat("InputValue", &m_fInputValue); - if (GUI::Button("AddValue")) - { - m_ValueVector.push_back(m_fInputValue); - } + //if (GUI::Button("AddValue")) + //{ + // m_ValueVector.push_back(m_fInputValue); + //} - ImGui::End(); + //ImGui::End(); } diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 060dcbd5f..51a97f3be 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -8,7 +8,8 @@ CEffectObject::CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContex } CEffectObject::CEffectObject(const CEffectObject& rhs) - :CPartObject(rhs) + :CPartObject(rhs), + m_strPath(rhs.m_strPath) { } @@ -117,7 +118,9 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) SAFE_RELEASE(m_pLightCom); _string strPerfectFilePath = pFilePath; - + + m_strPath = strPerfectFilePath; + strPerfectFilePath += ".bin"; HANDLE hFile = CreateFileW( @@ -137,7 +140,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) } // 나중에 패키징할때 패스를 저장할거임 - m_strPath = strPerfectFilePath; + DWORD dwByte(0); @@ -382,6 +385,17 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) + return S_OK; +} + +HRESULT CEffectObject::Load() +{ + + if (FAILED(Load(m_strPath.c_str(), static_cast(NEXT_LEVEL)))) + return E_FAIL; + + + return S_OK; } @@ -695,6 +709,12 @@ HRESULT CEffectObject::Bind_ShaderResources() return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolveReverse", &m_EffectInfo.isEmissiveDissolveReverse, sizeof(_bool)))) { + return E_FAIL; + } + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp index 1cb0fe226..858163a37 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp @@ -198,7 +198,11 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) return E_FAIL; } - pEditEffect->Load(strPath.c_str(), LEVEL::EFFECT); + if (FAILED(pEditEffect->Load(strPath.c_str(), LEVEL::EFFECT))) + { + CloseHandle(hFile); + return E_FAIL; + } SAFE_RELEASE(pEditEffect); @@ -235,6 +239,66 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) return S_OK; } +HRESULT CEffect_Container::Load_Directory(const _char* pPath) +{ + + for (const auto& file : filesystem::directory_iterator(pPath)) + { + if (file.is_directory()) + continue; + + string ext = file.path().extension().string(); + + if (strcmp(ext.c_str(), ".bin")) + continue; + + _char szFilePath[MAX_PATH] = {}; + + strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); + + + ///////////////////////////// + + CEditEffect* pEditEffect = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + + + + /*이펙트 껍데기 생성*/ + + _wstring wstrFileName = file.path().stem().wstring(); //이름 넣기 + + if (FAILED(Add_PartObject(CMyTools::ToString(wstrFileName), NEXT_LEVEL, &pEditEffect, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + + /*이펙트 로드 로드*/ + size_t iPos = {}; + _string strFilePath = szFilePath; + + while ((iPos = strFilePath.find(".bin")) != std::string::npos) { + strFilePath.erase(iPos, 4); + }; + + + if (FAILED(pEditEffect->Load(strFilePath.c_str(), LEVEL::EFFECT))) + { + Safe_Release(pEditEffect); + continue; + } + + Safe_Release(pEditEffect); + } + + return S_OK; +} + HRESULT CEffect_Container::Ready_Components(void* pArg) { CTransform::TRANSFORM_DESC TransformDesc = {}; diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 2d06336bb..c46d9ebf3 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -520,7 +520,7 @@ void CEffect_Editor::Describe_Entity() if( nullptr != dynamic_cast(pPartObject.second)) strName = "TrailObject" + to_string(iIndex); else - strName = "EffectObject" + to_string(iIndex); + strName = pPartObject.first; if (GUI::TreeNode(strName.c_str())) { @@ -632,12 +632,12 @@ void CEffect_Editor::Describe_Entity() GUI::SameLine(); - if (GUI::Button("LOAD PACKAGE")) + if (GUI::Button("LOAD DIRECTORY")) { - if (SUCCEEDED(Load_Package(m_strPackageSavePath.c_str()))) + if (SUCCEEDED(Load_Directory(m_strPackageSavePath.c_str()))) { - MessageBox(NULL, L"패키징 로드 성공", L"System Message", MB_OK); + MessageBox(NULL, L"파일 로드 성공", L"System Message", MB_OK); } } diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index 35a0f34eb..b7b8bb047 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -40,8 +40,6 @@ void CGoblin::Priority_Update(_float fTimeDelta) void CGoblin::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - - m_pModelCom->ComputeSkinning(); } void CGoblin::Late_Update(_float fTimeDelta) @@ -71,9 +69,6 @@ HRESULT CGoblin::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, 0))) - return E_FAIL; - if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 42781e230..7bf3f026a 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -30,10 +30,10 @@ HRESULT CLevel_ObjectViewer::Initialize() return E_FAIL; } - /*if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) - { - return E_FAIL; - }*/ + //if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) + //{ + // return E_FAIL; + //} if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) { @@ -58,7 +58,11 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) Find_Anim(); - m_Test->Describe_Entity(); + if (m_Test) + { + m_Test->Describe_Entity(); + } + } HRESULT CLevel_ObjectViewer::Render() @@ -702,8 +706,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) - return E_FAIL; + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) + // return E_FAIL; /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) return E_FAIL;*/ diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index d76e6075d..e5640b4af 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -87,6 +87,7 @@ #include "Dummy_Plane.h" #include "TrailObject.h" #include "NomalJap.h" +#include "Bombard.h" #pragma endregion @@ -780,7 +781,9 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDebugCamera::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CEditEffect::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CTestEffect::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -789,10 +792,6 @@ HRESULT CLoader::Loading_For_Effect() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CEditEffect::Create(m_pDevice, m_pContext)))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDummy_Plane::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -812,7 +811,9 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDummy_Cube::Create(m_pDevice, m_pContext)))) return E_FAIL; - + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CBombard::Create(m_pDevice, m_pContext)))) + return E_FAIL; + m_strMessage = TEXT("Loading Success!"); @@ -1259,124 +1260,157 @@ future CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _ch return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents); } +pair<_wstring, CModel*>* APIENTRY Deferred_ModelLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pDirectoryPath, const _tchar* pPrototypeTag, _fmatrix PreTransform) +{ + if (FAILED(CoInitializeEx(nullptr, 0))) { + assert(false); + return nullptr; + } + + CModel* pModel = CModel::Create(pDevice, pContext, eType, pDirectoryPath, PreTransform); + + CoUninitialize(); + pair<_wstring, CModel*>* Out = new pair<_wstring, CModel*>(pPrototypeTag, pModel); + return Out; +} + +future*> CLoader::Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag) { + return m_pGameInstance->EnqueueJob(&Deferred_ModelLoad_Main, m_pDevice, m_pContext, eType, pDirectoryPath, pPrototypeTag, PreTransform); +} + HRESULT CLoader::Loading_For_ObjectViewer() { m_strMessage = TEXT("Texture Loading.."); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) { + return E_FAIL; + } + m_strMessage = TEXT("Model Loading.."); + vector*>> futures = {}; + #pragma region BODY - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DADA_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DADA/M_DADA.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardSoldier_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardSoldier/M_DarkWizardSoldier.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardGrunt_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardGrunt/M_DarkWizardGrunt.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardTank_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardTank/M_DarkWizardTank.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_DarkWizardMage_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardMage/F_DarkWizardMage.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_DarkWizardSniper_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardSniper/F_DarkWizardSniper.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DADA/M_DADA.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_DADA_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardSoldier/M_DarkWizardSoldier.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_DarkWizardSoldier_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardGrunt/M_DarkWizardGrunt.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_DarkWizardGrunt_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardTank/M_DarkWizardTank.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_DarkWizardTank_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardMage/F_DarkWizardMage.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_F_DarkWizardMage_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardSniper/F_DarkWizardSniper.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_F_DarkWizardSniper_Model") + )); #pragma endregion #pragma region HEAD - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Young_M_Head_Ivory_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/Young_M_Head_Ivory.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_T_NPC_F_Head_Eye_Honey_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Head_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/F_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Head_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/M_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/Young_M_Head_Ivory.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Young_M_Head_Ivory_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_T_NPC_F_Head_Eye_Honey_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/F_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_F_Head_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/M_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Head_Model") + )); #pragma endregion #pragma region HAIR - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair1_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair1_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair2_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair3_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_F_Hair1_Model") + )); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair2_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair3_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Hair1_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; #pragma endregion #pragma region MONSTER - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Dragon_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Goblin_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_TombProtector_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Troll_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Dragon_Model") + )); #pragma endregion - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixIdentity())))) - return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity(), + TEXT("Prototype_Component_Npc_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Wand_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Broom_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity(), + TEXT("Prototype_Component_SkyboxModel") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity(), + TEXT("Desc_Box") + )); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) - return E_FAIL; - - /* For.Prototype_Component_SkyboxModel */ - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity())))) - return E_FAIL; - - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity())))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) { - return E_FAIL; + for (auto& job : futures) { + pair<_wstring, CModel*>* pResult = job.get(); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pResult->first, pResult->second))) { + assert(false); + return E_FAIL; + } + Safe_Delete(pResult); } m_strMessage = TEXT("Shader Loading.."); @@ -1482,17 +1516,17 @@ HRESULT CLoader::Loading_For_MapViewer() } /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_Normal */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Normal"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_MRO */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_MRO"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 4)))) { return E_FAIL; } @@ -1517,7 +1551,7 @@ HRESULT CLoader::Loading_For_MapViewer() vector ModelPrototypePath = {}; #pragma region HOGSMEADE - // + ///* Terrain*/ //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", // ".bin", true, ModelPrototypeTags, ModelPrototypePath))) @@ -1706,317 +1740,317 @@ HRESULT CLoader::Loading_For_MapViewer() #ifdef gimch -//vector> jobFutures; -// -//_uint iLoadCount = 46; -//vector*> Contents(iLoadCount); -// -//{ -// { /* Terrain */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* TScrolls */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* 3BroomStick*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Ollivanders*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Gatehouse*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_QuidditchShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_HogsheadInn */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Honeydukes */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_OwlPost */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_TeaShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Zonkos */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_DB_GR */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Potions */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Salon */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Hengist_Tree */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN A*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN B*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN C*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN E*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN F*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN G*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN H*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN J*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -//} -// -//for (auto& jobFuture : jobFutures) -//{ -// jobFuture.get(); -//} -// -//for (_uint i = 0; i < Contents.size(); ++i) { -// for (_uint j = 0; j < (Contents[i])->size(); ++j) { -// FOLDER_LOAD* pContents = (*Contents[i])[j]; -// if (true == pContents->bLoadTags) { -// ModelPrototypeTags.push_back(pContents->pModelTag); -// ModelPrototypePath.push_back(pContents->pathModel); -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { -// return E_FAIL; -// } -// -// for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { -// return E_FAIL; -// } -// } -// -// } -//} +vector> jobFutures; + +_uint iLoadCount = 46; +vector*> Contents(iLoadCount); + +{ + { /* Terrain */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* TScrolls */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* 3BroomStick*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Ollivanders*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Gatehouse*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_QuidditchShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_HogsheadInn */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Honeydukes */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_OwlPost */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_TeaShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Zonkos */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_DB_GR */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Potions */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Salon */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Hengist_Tree */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN A*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN B*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN C*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN E*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN F*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN G*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN H*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN J*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } +} + + for (auto& jobFuture : jobFutures) + { + jobFuture.get(); + } + + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + FOLDER_LOAD* pContents = (*Contents[i])[j]; + if (true == pContents->bLoadTags) { + ModelPrototypeTags.push_back(pContents->pModelTag); + ModelPrototypePath.push_back(pContents->pathModel); + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + return E_FAIL; + } + + for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { + return E_FAIL; + } + } + + } + } + -#endif // 기무리 m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -2079,13 +2113,13 @@ HRESULT CLoader::Loading_For_MapViewer() m_isFinished = true; - //for (_uint i = 0; i < Contents.size(); ++i) { - // for (_uint j = 0; j < (Contents[i])->size(); ++j) { - // Safe_Delete((*Contents[i])[j]); - // } - // Safe_Delete(Contents[i]); - //} - + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + Safe_Delete((*Contents[i])[j]); + } + Safe_Delete(Contents[i]); + } +#endif return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MainApp.cpp b/Jusin154_Team3D/Editor/Private/MainApp.cpp index 210675229..32f6f36d0 100644 --- a/Jusin154_Team3D/Editor/Private/MainApp.cpp +++ b/Jusin154_Team3D/Editor/Private/MainApp.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MainApp.h" #include "GameInstance.h" @@ -111,7 +111,7 @@ HRESULT CMainApp::Ready_IMGUI() //string strFontTag = "C:\\Windows\\Fonts\\malgun.ttf"; string strFontTag = "../Bin/Resources/Fonts/malgunsl.TTF"; ImFontConfig cfg; - cfg.OversampleH = 2; // °¡µ¶¼º Çâ»ó + cfg.OversampleH = 2; // 가독성 향상 cfg.OversampleV = 2; cfg.PixelSnapH = true; ifstream ifile; diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index feab5b2af..6d2c5fb53 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MainLight.h" #include "GameInstance.h" @@ -62,7 +62,7 @@ HRESULT CMainLight::Ready_Components() LightDesc.eType = LIGHT::DIRECTIONAL; LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp index 66e8e00e8..7a12417b6 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp @@ -219,6 +219,9 @@ void CMapObject_Collision::Free() for (auto& pModel : m_pModelComs) Safe_Release(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_Collision::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp index ecb9744ca..5611c81d2 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp @@ -60,7 +60,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg) - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + //m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); //m_pColliderCom->Update(ColliderMatrix); @@ -81,9 +81,9 @@ void CMapObject_LOD::Update(_float fTimeDelta) //if (0 == m_iLodIndex) // m_bSelected = true; - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); - m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + //m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + //m_pTransformCom->Set_Scale(m_vScale); + //m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); @@ -270,6 +270,9 @@ void CMapObject_LOD::Free() for(auto& pModel : m_pModelComs) SAFE_RELEASE(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_LOD::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index fe0ae3ece..233d42f30 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -8,22 +8,13 @@ #include "Wand.h" #pragma region STATE -#include "State_Root.h" #include "State_Idle.h" -#include "State_Walk.h" -#include "State_Jog.h" -#include "State_Sprint.h" #include "State_Dodge.h" #include "State_Jump.h" -#include "State_Skill.h" -#include "State_Skill2.h" -#include "State_LightAttack.h" #include "State_Land.h" -#include "State_Cast.h" #include "State_Move.h" #include "State_Combat.h" -#include "State_Idle_Turn.h" #pragma endregion CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -57,13 +48,16 @@ HRESULT CPlayer::Initialize(void* pArg) Add_FSM(); - Set_FSM(); - Set_Anim(); - Setup_InputConditions(); + { + CFSM::FSM_DESC FSMDesc{}; + FSMDesc.pStates = &m_States; + FSMDesc.pStateMask = &m_iStateMask; - m_pFSM->Change_State(FSMSTATE::ROOT); + m_pFSM->Bind_States(FSMDesc); + m_pFSM->Change_State(FSMSTATE::IDLE); + } return S_OK; } @@ -75,11 +69,7 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); - - Key_Input(fTimeDelta); - - m_pFSM->Update(fTimeDelta); + m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -114,8 +104,6 @@ HRESULT CPlayer::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; @@ -133,7 +121,10 @@ HRESULT CPlayer::Ready_Components() Desc.fRotationPerSec = XMConvertToRadians(180.0f); Desc.fRadius = 10.f; - __super::Ready_Components(&Desc); + if (FAILED(__super::Ready_Components(&Desc))) { + return E_FAIL; + } + m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model"); @@ -217,115 +208,503 @@ HRESULT CPlayer::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } return S_OK; } -void CPlayer::Setup_InputConditions() +HRESULT CPlayer::InputAction() { - m_InputConditions = + if ( + m_pGameInstance->Key_Down(DIK_SPACE) + || m_pGameInstance->Key_Down(DIK_LCONTROL) + || m_pGameInstance->Key_Down(DIK_E) + || m_pGameInstance->Key_Down(DIK_R) + || m_pGameInstance->Key_Down(DIK_Q) + || m_pGameInstance->Mouse_Up(DIM_LBUTTON) + || m_pGameInstance->Key_Down(DIK_1) + || m_pGameInstance->Key_Down(DIK_LSHIFT) + || m_pGameInstance->Key_Down(DIK_C) + || m_pGameInstance->Key_Down(DIK_V) + ) { - { FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }}, - { FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || - Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }}, - - - - { FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP) - /*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }}, - { FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }}, - - { FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, - - { FSMSTATE::SPRINT, [&]() { return m_bSprintToggle - && m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }}, - - { FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }}, - { FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }}, - { FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }}, - { FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }}, - { FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }}, - - { FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } } - }; + return S_OK; + } + return E_FAIL; } -void CPlayer::Key_Input(_float fTimeDelta) +HRESULT CPlayer::InputMove() { - if (m_pFSM->Get_CurrState() == FSMSTATE::WALK || - m_pFSM->Get_CurrState() == FSMSTATE::SPRINT|| - m_pFSM->Get_CurrState() == FSMSTATE::DODGE|| - m_pFSM->Get_CurrState() == FSMSTATE::JOG) + if (m_pGameInstance->Key_Pressing(DIK_W) + || m_pGameInstance->Key_Pressing(DIK_A) + || m_pGameInstance->Key_Pressing(DIK_S) + || m_pGameInstance->Key_Pressing(DIK_D)) { - if (m_pGameInstance->Key_Pressing(DIK_LEFT)) - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + return S_OK; + } + return E_FAIL; +} - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); +void CPlayer::Behavior_IdleEnter() { + m_pFSM->Enable_State(FSMSTATE::IDLE); + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + + if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG|FSMSTATE::WALK)) { + + if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { + pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) { + pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; + } + + else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; + } + } + m_bSprintToggle = false; + m_bWalkToggle = false; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_IdleExitCheck() +{ + // S_OK -> 현 상태 유지 + // E_FAIL -> 현 상태 탈출 + if (SUCCEEDED(InputAction())) { + if (m_pGameInstance->Key_Down(DIK_SPACE)) { + m_pFSM->Change_State(FSMSTATE::JUMP); + } + else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { + m_pFSM->Change_State(FSMSTATE::DODGE); + } + else if (m_pGameInstance->Key_Down(DIK_R)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + + return E_FAIL; + } + if (SUCCEEDED(InputMove())) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + return S_OK; +} + +void CPlayer::Behavior_IdleExit() +{ + m_pFSM->Disable_State(FSMSTATE::IDLE); +} + +void CPlayer::Behavior_MoveEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + _bool bFoward = m_pGameInstance->Key_Pressing(DIK_W); + _bool bLeft = m_pGameInstance->Key_Pressing(DIK_A); + _bool bRight = m_pGameInstance->Key_Pressing(DIK_D); + _bool bBackward = m_pGameInstance->Key_Pressing(DIK_S); + m_pFSM->Enable_State(FSMSTATE::MOVE); + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) { + if (true == m_bSprintToggle) { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + m_bWalkToggle = false; + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + } + else if (true == m_bWalkToggle) { + m_pFSM->Enable_State(FSMSTATE::WALK); + m_bSprintToggle = false; + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else if (true == bBackward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + } + } + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_bSprintToggle = false; + m_bWalkToggle = false; + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + else { // While Moving + if (true == m_bSprintToggle) { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + m_bWalkToggle = false; + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + + } + else if (true == m_bWalkToggle) { + m_pFSM->Enable_State(FSMSTATE::WALK); + m_bSprintToggle = false; + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else if (true == bBackward){ + pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + } + } + else { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_bSprintToggle = false; + m_bWalkToggle = false; + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } } - IsSprint(); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} - IsWalk(); +HRESULT CPlayer::Behavior_MoveExitCheck() +{ + pair<_uint, _bool> pairAnimInfo; + if (SUCCEEDED(InputAction())) { + if (m_pGameInstance->Key_Down(DIK_SPACE)) { + m_pFSM->Change_State(FSMSTATE::JUMP); + } + else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { + m_pFSM->Change_State(FSMSTATE::DODGE); + } + else if (m_pGameInstance->Key_Down(DIK_R)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) { + m_bSprintToggle = !m_bSprintToggle; + m_bWalkToggle = false; + if (m_bSprintToggle) + { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_pFSM->Disable_State(FSMSTATE::SPRINT); + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else if (m_pGameInstance->Key_Down(DIK_C)) { + m_bWalkToggle = !m_bWalkToggle; + m_bSprintToggle= false; + if (m_bWalkToggle) + { + m_pFSM->Enable_State(FSMSTATE::WALK); + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_pFSM->Disable_State(FSMSTATE::WALK); + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + return E_FAIL; + } + if (SUCCEEDED(InputMove())) { + return S_OK; + } + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; +} + +void CPlayer::Behavior_MoveExit() +{ + m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK); +} + +void CPlayer::Behavior_JumpEnter() +{ + pair<_uint, _bool> pairAnimInfo; + m_pFSM->Enable_State(FSMSTATE::JUMP); + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE|FSMSTATE::WALK|FSMSTATE::JOG|FSMSTATE::SPRINT)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP); + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) { + pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT]; + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP); + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG); + } + } + else { + // Drop? + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_JumpExitCheck() +{ + if (IsCurrentKeyFrame("Jump")) { + m_pFSM->Change_State(FSMSTATE::LAND); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_JumpExit() +{ + m_pFSM->Disable_State(FSMSTATE::JUMP); +} + +void CPlayer::Behavior_LandEnter() +{ + m_pFSM->Enable_State(FSMSTATE::LAND); + pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_LandExitCheck() +{ + if (m_pModelCom->IsFinishedAnim()){ + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨 + + if (SUCCEEDED(InputMove())) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_LandExit() +{ + m_pFSM->Disable_State(FSMSTATE::LAND); +} + +void CPlayer::Behavior_DodgeEnter() +{ + // 혹시 @@ to Dodge 있으면 여기에 + m_pFSM->Enable_State(FSMSTATE::DODGE); + pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_DodgeExitCheck() +{ + if (m_pModelCom->IsFinishedAnim()){ + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + if (IsCurrentKeyFrame("Dodge")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_DodgeExit() +{ + m_pFSM->Disable_State(FSMSTATE::DODGE); +} + +void CPlayer::Behavior_CombatEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::COMBAT); + + if (m_pGameInstance->Key_Down(DIK_R)) { + m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + m_pFSM->Enable_State(FSMSTATE::SKILL2); + pairAnimInfo = m_Animation[STATEANIM::SKILL2]; + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + m_pFSM->Enable_State(FSMSTATE::CAST); + pairAnimInfo = m_Animation[STATEANIM::CAST]; + + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Enable_State(FSMSTATE::MAPHELP); + pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; + + } + + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_CombatExitCheck() +{ + pair<_uint, _bool> pairAnimInfo; + if (SUCCEEDED(InputAction())) { + if (m_pGameInstance->Key_Down(DIK_R)) + { + m_pFSM->Enable_State(FSMSTATE::SKILL); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) + { + m_pFSM->Enable_State(FSMSTATE::SKILL2); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) + { + m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); + _uint iIndex = m_pModelCom->Get_AnimIndex(); + if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (fRatio >= 0.1f) { + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + } + } + else if (m_pGameInstance->Key_Down(DIK_1)) + { + m_pFSM->Enable_State(FSMSTATE::CAST); + _uint iIndex = m_pModelCom->Get_AnimIndex(); + if (m_Animation[STATEANIM::CAST].first <= iIndex && m_Animation[STATEANIM::CAST].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (fRatio >= 0.15f) { + pairAnimInfo = m_Animation[STATEANIM::CAST]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + } + } + else if (m_pGameInstance->Key_Down(DIK_V)) + { + m_pFSM->Enable_State(FSMSTATE::MAPHELP); + pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + return E_FAIL; + } + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + + return E_FAIL; +} + +void CPlayer::Behavior_CombatExit() +{ + m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::CAST | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP); } void CPlayer::Add_FSM() { -#pragma region MOVE - m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move()); - m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle()); - m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn()); - m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk()); - m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog()); - m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint()); - m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge()); +#pragma region Behavior_Movement_NotFocus + { + CState_Idle::STATE_IDLE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_IdleExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); + } + { + CState_Move::STATE_MOVE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_A)) {m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);} + if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);}; + }; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); + } #pragma endregion - -#pragma region COMBAT - m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat()); - m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill()); - m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2()); - m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack()); - m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast()); +#pragma region Behavior_Movement_Focus + { + CState_Jump::STATE_JUMP_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_JumpExit(); }; + m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc)); + } + { + CState_Land::STATE_LAND_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_LandExit(); }; + m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc)); + } + { + CState_Dodge::STATE_DODGE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); }; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } + if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; + }; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); + } #pragma endregion - - m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump()); - m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land()); - - m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root()); - -} - -void CPlayer::Set_FSM() -{ -#pragma region ROOT - m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT); - m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT); +#pragma region Behavior_Combat_NotFocus + { + CState_Combat::STATE_COMBAT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_CombatExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); + } +#pragma endregion +#pragma region Behavior_Combat_Focus #pragma endregion -#pragma region MOVE - m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE); -#pragma endregion - -#pragma region COMBAT - m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT); - m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT); -#pragma endregion } void CPlayer::Set_Anim() @@ -338,6 +717,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; m_Animation[STATEANIM::LAND] = { 259,false }; m_Animation[STATEANIM::CAST] = { 696,false }; + m_Animation[STATEANIM::MAPHELP] = { 122,false }; m_Animation[STATEANIM::IDLE] = { 266,true }; m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false }; @@ -415,33 +795,9 @@ void CPlayer::Describe_Entity() float Rot3[3] = { RotR, RotU,RotL }; GUI::DragFloat3("Rot", Rot3); + + + string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); + GUI::Text(AnimList.c_str()); } - -_bool CPlayer::Check(FSMSTATE::ESTATE state) -{ - for (auto& cond : m_InputConditions) - { - if (cond.state == state) - return cond.checker(); - } - return false; -} - -_bool CPlayer::IsSprint() -{ - if (m_pGameInstance->Key_Down(DIK_LSHIFT)) - { - return m_bSprintToggle = !m_bSprintToggle; - } - return false; -} - -_bool CPlayer::IsWalk() -{ - if (m_pGameInstance->Key_Down(DIK_C)) - { - return m_bWalkToggle = !m_bWalkToggle; - } - return false; -} diff --git a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp index a9fda49f4..61acedece 100644 --- a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp +++ b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp @@ -71,6 +71,7 @@ void CRootModelPart::Update_Anim(_float fTimeDelta) { pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim()); pModel->Set_AnimSpeed(m_pMainModel->Get_AnimSpeed()); + pModel->ComputeAnimation(); pModel->Play_Animation(fTimeDelta,m_pTransformCom); } } @@ -98,7 +99,8 @@ void CRootModelPart::Change_Model(_uint iIndex) CModel* pModel = m_ModelParts[iIndex]->Get_Component(); pModel->Set_AnimationIndex(m_iAnimIndex); - pModel->Set_CurrentTrackPosition(m_fTrackPosition); + pModel->Set_CurrentTrackPosition(m_fTrackPosition); + pModel->ComputeAnimation(); pModel->Play_Animation(0.f, m_pTransformCom); if (iIndex == ENUM_CLASS(PARTSTYPE::BODY)) @@ -112,6 +114,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex) { m_pMainModel->Set_AnimationIndex(iAnimIndex); m_pMainModel->Set_CurrentTrackPosition(0.f); + m_pMainModel->ComputeAnimation(); m_pMainModel->Play_Animation(0.f, m_pTransformCom); for (auto& PartObject : m_ModelParts) { @@ -120,6 +123,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex) { pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex()); pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition()); + pModel->ComputeAnimation(); pModel->Play_Animation(0.f, m_pTransformCom); } } diff --git a/Jusin154_Team3D/Editor/Private/State_Cast.cpp b/Jusin154_Team3D/Editor/Private/State_Cast.cpp deleted file mode 100644 index 42c192faa..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Cast.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "pch.h" -#include "State_Cast.h" -#include "Unit.h" - - -CState_Cast::CState_Cast() - :CState() -{ -} - -void CState_Cast::Enter() -{ - if (m_pFSM->Get_PrevState() == FSMSTATE::CAST) - return; - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Cast::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Cast::Exit() -{ -} - -_bool CState_Cast::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::CAST)) - { - _uint combo = m_pOwner->Next_LightCombo(); - m_pOwner->Set_LightCombo(combo); - if (combo >= 3) - { - m_pOwner->Reset_LightCombo(); - return true; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); - m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); - - m_pFSM->Change_State(FSMSTATE::CAST); - - return true; - } - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::SKILL2); - return true; - } - - return false; -} - -void CState_Cast::Free() -{ - __super::Free(); -} - -void CState_Cast::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Combat.cpp index bdff385da..1e8e15653 100644 --- a/Jusin154_Team3D/Editor/Private/State_Combat.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Combat.cpp @@ -4,51 +4,55 @@ CState_Combat::CState_Combat() - :CState() + :CState_Root() { } void CState_Combat::Enter() { - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - + __super::Enter(); } -void CState_Combat::Update(_float fTimeDelta) +HRESULT CState_Combat::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Combat::Exit() { + __super::Exit(); } -_bool CState_Combat::CheckExitState() +HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) { - if (m_pOwner->IsCurrentKeyFrame("Jump")) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::MOVE); - return true; + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - return false; + return S_OK; } +CState_Combat* CState_Combat::Create(STATE_COMBAT_DESC* pDesc) +{ + CState_Combat* pInstance = new CState_Combat; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} void CState_Combat::Free() { diff --git a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp index 3c4ce4151..b2c342f49 100644 --- a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp @@ -4,43 +4,54 @@ CState_Dodge::CState_Dodge() - :CState() + :CState_Root() { } void CState_Dodge::Enter() { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Dodge::Update(_float fTimeDelta) +HRESULT CState_Dodge::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (FAILED(__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Dodge::Exit() { + __super::Exit(); } -_bool CState_Dodge::CheckExitState() +HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc) { - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::SPRINT); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::JOG); - - - - return false; +CState_Dodge* CState_Dodge::Create(STATE_DODGE_DESC* pDesc) +{ + CState_Dodge* pInstance = new CState_Dodge; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Dodge::Free() diff --git a/Jusin154_Team3D/Editor/Private/State_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Idle.cpp index 5f4140c0c..63497dcb1 100644 --- a/Jusin154_Team3D/Editor/Private/State_Idle.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Idle.cpp @@ -3,62 +3,54 @@ #include "Unit.h" CState_Idle::CState_Idle() - :CState() + :CState_Root() { } void CState_Idle::Enter() { - if (m_pFSM->Get_PrevState() == FSMSTATE::JOG) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - if (m_pFSM->Get_PrevState() == FSMSTATE::WALK) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - else - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } + __super::Enter(); } -void CState_Idle::Update(_float fTimeDelta) +HRESULT CState_Idle::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Idle::Exit() { + __super::Exit(); } -_bool CState_Idle::CheckExitState() +HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc) { - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; +CState_Idle* CState_Idle::Create(STATE_IDLE_DESC* pDesc) +{ + CState_Idle* pInstance = new CState_Idle; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Idle::Free() diff --git a/Jusin154_Team3D/Editor/Private/State_Idle_Turn.cpp b/Jusin154_Team3D/Editor/Private/State_Idle_Turn.cpp deleted file mode 100644 index d0b9f1712..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Idle_Turn.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "pch.h" -#include "State_Idle_Turn.h" -#include "Unit.h" - -CState_Idle_Turn::CState_Idle_Turn() - :CState() -{ -} - -void CState_Idle_Turn::Enter() -{ - if (m_pGameInstance->Key_Down(DIK_LEFT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - if (m_pGameInstance->Key_Down(DIK_RIGHT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - if (m_pGameInstance->Key_Down(DIK_DOWN)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } -} - -void CState_Idle_Turn::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Idle_Turn::Exit() -{ -} - -_bool CState_Idle_Turn::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::MOVE)) - { - m_pFSM->Change_State(FSMSTATE::MOVE); - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - } - - if (m_pOwner->Check(FSMSTATE::COMBAT)) - { - m_pFSM->Change_State(FSMSTATE::COMBAT); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - } - - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Idle_Turn::Free() -{ - __super::Free(); -} - -void CState_Idle_Turn::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Jog.cpp b/Jusin154_Team3D/Editor/Private/State_Jog.cpp deleted file mode 100644 index b895ed11e..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Jog.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "pch.h" -#include "State_Jog.h" -#include "Unit.h" - -CState_Jog::CState_Jog() - :CState() -{ -} - -void CState_Jog::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - - m_pOwner->Reset_Sprint(); - m_pOwner->Reset_Walk(); -} - -void CState_Jog::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Jog::Exit() -{ -} - -_bool CState_Jog::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - else if (!m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - - return false; -} - -void CState_Jog::Free() -{ - __super::Free(); -} - -void CState_Jog::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Jump.cpp b/Jusin154_Team3D/Editor/Private/State_Jump.cpp index 051f93fb0..753110099 100644 --- a/Jusin154_Team3D/Editor/Private/State_Jump.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Jump.cpp @@ -4,50 +4,51 @@ CState_Jump::CState_Jump() - :CState() + :CState_Root() { } void CState_Jump::Enter() { - if (m_pOwner->Check(FSMSTATE::SPRINT)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - if (m_pOwner->Check(FSMSTATE::JOG)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - return; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Jump::Update(_float fTimeDelta) +HRESULT CState_Jump::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; } void CState_Jump::Exit() { + __super::Exit(); } -_bool CState_Jump::CheckExitState() +HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc) { - if (m_pOwner->IsCurrentKeyFrame("Jump")) - m_pFSM->Change_State(FSMSTATE::LAND); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); - return false; + return S_OK; +} + +CState_Jump* CState_Jump::Create(STATE_JUMP_DESC* pDesc) +{ + CState_Jump* pInstance = new CState_Jump; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Jump::Free() { - __super::Free(); + __super::Free(); } void CState_Jump::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/State_Land.cpp b/Jusin154_Team3D/Editor/Private/State_Land.cpp index 7fda0cd37..f1b64c618 100644 --- a/Jusin154_Team3D/Editor/Private/State_Land.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Land.cpp @@ -4,44 +4,51 @@ CState_Land::CState_Land() - :CState() + :CState_Root() { } void CState_Land::Enter() { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND); - m_pModel->Set_AnimationIndex(anim.first, anim.second); + __super::Enter(); } -void CState_Land::Update(_float fTimeDelta) +HRESULT CState_Land::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; } void CState_Land::Exit() { + __super::Exit(); } -_bool CState_Land::CheckExitState() +HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc) { - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + return S_OK; +} - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - return false; +CState_Land* CState_Land::Create(STATE_LAND_DESC* pDesc) +{ + CState_Land* pInstance = new CState_Land; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; } void CState_Land::Free() { - __super::Free(); + __super::Free(); } void CState_Land::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp b/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp deleted file mode 100644 index aa2375570..000000000 --- a/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "pch.h" -#include "State_LightAttack.h" -#include "Unit.h" - - -CState_LightAttack::CState_LightAttack() - :CState() -{ -} - -void CState_LightAttack::Enter() -{ - if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK) - return; - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_LightAttack::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_LightAttack::Exit() -{ -} - -_bool CState_LightAttack::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - { - _uint combo = m_pOwner->Next_LightCombo(); - m_pOwner->Set_LightCombo(combo); - if (combo >= 4) - { - m_pOwner->Reset_LightCombo(); - return true; - } - - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); - m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); - - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - return true; - } - - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::SKILL2); - return true; - } - - return false; -} - - -void CState_LightAttack::Free() -{ - __super::Free(); -} - -void CState_LightAttack::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Move.cpp b/Jusin154_Team3D/Editor/Private/State_Move.cpp index cce8c760f..71621a370 100644 --- a/Jusin154_Team3D/Editor/Private/State_Move.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Move.cpp @@ -4,46 +4,56 @@ CState_Move::CState_Move() - :CState() + :CState_Root() { } void CState_Move::Enter() { - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - m_pFSM->Change_State(FSMSTATE::IDLE); + __super::Enter(); } -void CState_Move::Update(_float fTimeDelta) +HRESULT CState_Move::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; } void CState_Move::Exit() { + __super::Exit(); } -_bool CState_Move::CheckExitState() +HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc) { - return false; + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; } +CState_Move* CState_Move::Create(STATE_MOVE_DESC* pDesc) +{ + CState_Move* pInstance = new CState_Move; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} void CState_Move::Free() { diff --git a/Jusin154_Team3D/Editor/Private/State_Root.cpp b/Jusin154_Team3D/Editor/Private/State_Root.cpp index efef8727b..18349525b 100644 --- a/Jusin154_Team3D/Editor/Private/State_Root.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Root.cpp @@ -2,7 +2,6 @@ #include "State_Root.h" #include "Unit.h" - CState_Root::CState_Root() :CState() { @@ -10,48 +9,38 @@ CState_Root::CState_Root() void CState_Root::Enter() { - if (m_pOwner->Check(FSMSTATE::COMBAT)) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - else - m_pFSM->Change_State(FSMSTATE::MOVE); + if (nullptr != m_funcEnterEvent) { + m_funcEnterEvent(); + } } -void CState_Root::Update(_float fTimeDelta) +HRESULT CState_Root::Update(_float fTimeDelta) { - if (CheckExitState()) - return; + HRESULT hr = { S_OK }; + if (nullptr != m_funcExitCheck) { + hr = m_funcExitCheck(fTimeDelta); + } + return hr; } void CState_Root::Exit() { + if (nullptr != m_funcExitEvent) { + m_funcExitEvent(); + } } -_bool CState_Root::CheckExitState() +HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg) { - if (m_pOwner->Check(FSMSTATE::COMBAT)) - { - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - return true; - } - - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT) - return false; - - if (m_pOwner->Check(FSMSTATE::MOVE)) - { - if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE) - m_pFSM->Change_State(FSMSTATE::MOVE); - - return true; - } - - return false; + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + m_funcExitCheck = pArg->funcExitCheck; + m_funcEnterEvent = pArg->funcEnterEvent; + m_funcExitEvent = pArg->funcExitEvent; + return S_OK; } - void CState_Root::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/State_Skill.cpp b/Jusin154_Team3D/Editor/Private/State_Skill.cpp deleted file mode 100644 index 277606272..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Skill.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "pch.h" -#include "State_Skill.h" -#include "Unit.h" - - -CState_Skill::CState_Skill() - :CState() -{ -} - -void CState_Skill::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Skill::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Skill::Exit() -{ -} - -_bool CState_Skill::CheckExitState() -{ - - return false; -} - -void CState_Skill::Free() -{ - __super::Free(); -} - -void CState_Skill::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Skill2.cpp b/Jusin154_Team3D/Editor/Private/State_Skill2.cpp deleted file mode 100644 index 03704ac90..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Skill2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "pch.h" -#include "State_Skill2.h" -#include "Unit.h" - - -CState_Skill2::CState_Skill2() - :CState() -{ -} - -void CState_Skill2::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Skill2::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Skill2::Exit() -{ -} - -_bool CState_Skill2::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - return false; -} - -void CState_Skill2::Free() -{ - __super::Free(); -} - -void CState_Skill2::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Sprint.cpp b/Jusin154_Team3D/Editor/Private/State_Sprint.cpp deleted file mode 100644 index 71efa2951..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Sprint.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "pch.h" -#include "State_Sprint.h" -#include "Unit.h" - -CState_Sprint::CState_Sprint() - :CState() -{ -} - -void CState_Sprint::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Sprint::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; - -} - -void CState_Sprint::Exit() -{ -} - -_bool CState_Sprint::CheckExitState() -{ - if (!m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::JOG); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Sprint::Free() -{ - __super::Free(); -} - -void CState_Sprint::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Walk.cpp b/Jusin154_Team3D/Editor/Private/State_Walk.cpp deleted file mode 100644 index c49a5ee2b..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Walk.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "pch.h" -#include "State_Walk.h" -#include "Unit.h" - -CState_Walk::CState_Walk() - :CState() -{ -} - -void CState_Walk::Enter() -{ - if(m_pOwner->Check(FSMSTATE::FWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } - - if (m_pOwner->Check(FSMSTATE::BWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } -} - -void CState_Walk::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Walk::Exit() -{ -} - -_bool CState_Walk::CheckExitState() -{ - if (!m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::IDLE); - - else if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - - - return false; -} - -void CState_Walk::Free() -{ - __super::Free(); -} - -void CState_Walk::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index 836219ae5..43f688ae1 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "DebugCamera.h" #include "VIBuffer_Terrain.h" +#include "AlphaMap.h" CTerrain::CTerrain(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) : CGameObject(pDevice, pContext) @@ -28,28 +29,60 @@ HRESULT CTerrain::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + if (FAILED(Ready_AlphaMap())) + return E_FAIL; + m_fUsingSurfaceParams = 15.f / 27.f; m_vRotation = _float3{ 0.f, 0.f, 0.f }; m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f)); //m_pVIBufferCom->Set_CullingRadius(0.04f); + m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + return S_OK; } void CTerrain::Priority_Update(_float fTimeDelta) { - GUI::Begin("Picking Position"); + GUI::Begin("Terrain"); + +#pragma region ALPHA_MAP + //GUI::InputInt("Color", &m_iColorIndex); + //m_iColorIndex = max(0, min(4, m_iColorIndex)); + + //GUI::InputInt("Rnage", (_int*)(&m_iMaskRange)); + //GUI::DragFloat("Value", &m_fMaskValue, 0.01f, -1.0f, 1.f); + //if (GUI::Button("Save", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Save_ToFile("Hogsmeade_AlphaMap.bin"); + //} + //if (GUI::Button("Load", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + //} + + + GUI::DragFloat("Up", &m_fUpValue, 0.01f, -1.0f, 1.f); if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) { - if (m_pVIBufferCom->Picking(m_pTransformCom->Get_XMWorldMatrix(), &m_vPickingPosition)) + if (m_pGameInstance->isPicking(&m_vPickingPosition)) { - if(m_pGameInstance->Key_Pressing(DIK_PERIOD)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), 0.01f); - if(m_pGameInstance->Key_Pressing(DIK_COMMA)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), -0.01f); + if (m_pGameInstance->Key_Pressing(DIK_PERIOD)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue); + if (m_pGameInstance->Key_Pressing(DIK_COMMA)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue * -1.f); + + + //XMStoreFloat3(&m_vPickingPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vPickingPosition), m_pTransformCom->Get_WorldMatrixInv())); + + //m_pAlphaMap->Update(m_vPickingPosition, m_iColorIndex, m_fMaskValue, m_iMaskRange); + } } +#pragma endregion + + /*GUI::InputFloat("Height Ratio", &m_fHeightRatio); max(0.01f, m_fHeightRatio); @@ -73,6 +106,7 @@ void CTerrain::Priority_Update(_float fTimeDelta) void CTerrain::Update(_float fTimeDelta) { //m_pVIBufferCom->Culling(XMMatrixIdentity()); + } @@ -164,7 +198,7 @@ HRESULT CTerrain::Bind_ShaderResources() if (FAILED(m_pMROTextureCom->Bind_ShaderResources(m_pShaderCom, "g_SurfaceParamsTextures", 0, m_pMROTextureCom->Get_Size()))){ return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pMaskTextureCom->Get_SRV(0)))) { + if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pAlphaMap->Get_SRV()))) { return E_FAIL; } @@ -174,6 +208,16 @@ HRESULT CTerrain::Bind_ShaderResources() return S_OK; } +HRESULT CTerrain::Ready_AlphaMap() +{ + m_pAlphaMap = CAlphaMap::Create(m_pDevice, m_pContext, 2048, 2048); + + if(nullptr == m_pAlphaMap) + return E_FAIL; + + return S_OK; +} + CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CTerrain* pInstance = new CTerrain(pDevice, pContext); @@ -204,6 +248,7 @@ void CTerrain::Free() { __super::Free(); + SAFE_RELEASE(m_pAlphaMap); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); SAFE_RELEASE(m_pDiffuseTextureCom); diff --git a/Jusin154_Team3D/Editor/Public/AlphaMap.h b/Jusin154_Team3D/Editor/Public/AlphaMap.h new file mode 100644 index 000000000..b172d45c2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/AlphaMap.h @@ -0,0 +1,43 @@ +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CAlphaMap final : public CBase +{ +private: + CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual ~CAlphaMap() = default; + +public: + void Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange); + ID3D11ShaderResourceView* Get_SRV() { return m_pSRV; } + + void Save_ToFile(const _char* pFilePath); + void Load_ToFile(const _char* pFilePath); +private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + ID3D11Texture2D* m_pTexture2D = { nullptr }; + ID3D11ShaderResourceView* m_pSRV = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + + _uint m_iNumPixels = {}; + _uint m_iNumPixelW = {}; + _uint m_iNumPixelH = {}; + + _float4* m_pPixels = { nullptr }; + +private: + HRESULT Initialize( _uint iSizeX, _uint iSizeY); + +public: + static CAlphaMap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY); + virtual void Free(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Bombard.h b/Jusin154_Team3D/Editor/Public/Bombard.h new file mode 100644 index 000000000..3f5f2e52a --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Bombard.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Editor_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Editor) + +class CBombard final : public CEffect_Container +{ +private: + CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CBombard(const CBombard& rhs); + virtual ~CBombard() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + class CDummy_PhysXEffectHitBox* m_pPhysHitBox = {}; + class CPartObject* m_pLight_Projectile = {}; +public: + static CBombard* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index d2f348617..7c6876a1d 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -78,10 +78,11 @@ class CEffectObject abstract : public CPartObject _float fCoreBoost = {}; _float fRadius = {}; - _float fSoftMaskEdge; - _float fSoftMask; - + _float fSoftMaskEdge = {}; + _float fSoftMask = {}; + _bool isEmissiveDissolveReverse = { false }; + _bool isOnlyBlur = { false }; }EFFECT_INFO; typedef struct tagPreEffectInfo @@ -141,6 +142,9 @@ class CEffectObject abstract : public CPartObject _float fCoreBoost = {}; _float fRadius = {}; + _float fSoftMaskEdge = {}; + _float fSoftMask = {}; + }PRE_EFFECT_INFO; protected: @@ -156,7 +160,7 @@ class CEffectObject abstract : public CPartObject virtual HRESULT Render_Blur() override; public: HRESULT Load(const _char* pFilePath, LEVEL eLevel); - + HRESULT Load(); public: #ifdef _DEBUG HRESULT LoadPre(const _char* pFilePath, LEVEL eLevel); diff --git a/Jusin154_Team3D/Editor/Public/Effect_Container.h b/Jusin154_Team3D/Editor/Public/Effect_Container.h index 2d635b102..0fe304473 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Container.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Container.h @@ -25,6 +25,7 @@ class CEffect_Container abstract : public CContainerObject HRESULT Save_Package(const _char* pPath); #endif HRESULT Load_Package(const _char* pPath); + HRESULT Load_Directory(const _char* pPath); protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Loader.h b/Jusin154_Team3D/Editor/Public/Loader.h index 107edcf2c..ee1e1ba89 100644 --- a/Jusin154_Team3D/Editor/Public/Loader.h +++ b/Jusin154_Team3D/Editor/Public/Loader.h @@ -51,6 +51,7 @@ class CLoader final : public CBase HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); HRESULT MapFolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<_wstring>& ModelPrototypeTags, vector& ModelPrototypePath); future Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents); + future*> Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 6e42215ed..65be8a156 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -29,18 +29,22 @@ class CPlayer final : public CUnit _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } private: + unordered_map m_States = { }; + size_t m_iStateMask = { 0 }; + _float m_fDirectionRadian = 0.f; + vector m_InputConditions; _bool m_bSprintToggle = { false }; _bool m_bWalkToggle = { false }; + + _int m_iCombo = { 0 }; + class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; private: HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); - void Setup_InputConditions(); - void Key_Input(_float fTimeDelta); - public: static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; @@ -50,11 +54,36 @@ class CPlayer final : public CUnit #pragma region STATE private: virtual void Add_FSM(); - virtual void Set_FSM(); virtual void Set_Anim(); - _bool Check(FSMSTATE::ESTATE state); - _bool IsSprint(); - _bool IsWalk(); + + HRESULT InputAction(); + HRESULT InputMove(); + + void Behavior_IdleEnter(); + HRESULT Behavior_IdleExitCheck(); + void Behavior_IdleExit(); + + void Behavior_MoveEnter(); + HRESULT Behavior_MoveExitCheck(); + void Behavior_MoveExit(); + + void Behavior_JumpEnter(); + HRESULT Behavior_JumpExitCheck(); + void Behavior_JumpExit(); + + void Behavior_LandEnter(); + HRESULT Behavior_LandExitCheck(); + void Behavior_LandExit(); + + void Behavior_DodgeEnter(); + HRESULT Behavior_DodgeExitCheck(); + void Behavior_DodgeExit(); + + void Behavior_CombatEnter(); + HRESULT Behavior_CombatExitCheck(); + void Behavior_CombatExit(); + + public: virtual void Reset_Sprint() { m_bSprintToggle = false; } virtual void Reset_Walk() { m_bWalkToggle = false; } diff --git a/Jusin154_Team3D/Editor/Public/State_Cast.h b/Jusin154_Team3D/Editor/Public/State_Cast.h deleted file mode 100644 index 6a64c3881..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Cast.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Cast final : public CState -{ -public: - CState_Cast(); - virtual ~CState_Cast() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Combat.h b/Jusin154_Team3D/Editor/Public/State_Combat.h index 7fe636c65..858dc260a 100644 --- a/Jusin154_Team3D/Editor/Public/State_Combat.h +++ b/Jusin154_Team3D/Editor/Public/State_Combat.h @@ -1,19 +1,36 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Combat final : public CState +NS_BEGIN(Editor) + +class CState_Combat final : public CState_Root { public: + typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_COMBAT_DESC; +private: CState_Combat(); virtual ~CState_Combat() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_COMBAT_DESC* pDesc); + public: + static CState_Combat* Create(STATE_COMBAT_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Dodge.h b/Jusin154_Team3D/Editor/Public/State_Dodge.h index 788056b67..ea28f476a 100644 --- a/Jusin154_Team3D/Editor/Public/State_Dodge.h +++ b/Jusin154_Team3D/Editor/Public/State_Dodge.h @@ -1,19 +1,32 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Dodge final : public CState +class CState_Dodge final : public CState_Root { +public: + typedef struct tagDodge : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_DODGE_DESC; public: CState_Dodge(); virtual ~CState_Dodge() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_DODGE_DESC* pDesc); + public: + static CState_Dodge* Create(STATE_DODGE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Idle.h b/Jusin154_Team3D/Editor/Public/State_Idle.h index 898162432..ef50909a4 100644 --- a/Jusin154_Team3D/Editor/Public/State_Idle.h +++ b/Jusin154_Team3D/Editor/Public/State_Idle.h @@ -1,20 +1,32 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Idle final : public CState +class CState_Idle final : public CState_Root { +public: + typedef struct tagIdle : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_IDLE_DESC; public: CState_Idle(); virtual ~CState_Idle() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_IDLE_DESC* pDesc); public: + static CState_Idle* Create(STATE_IDLE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Idle_Turn.h b/Jusin154_Team3D/Editor/Public/State_Idle_Turn.h deleted file mode 100644 index c39f90ee8..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Idle_Turn.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Idle_Turn final : public CState -{ -public: - CState_Idle_Turn(); - virtual ~CState_Idle_Turn() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; - diff --git a/Jusin154_Team3D/Editor/Public/State_Jog.h b/Jusin154_Team3D/Editor/Public/State_Jog.h deleted file mode 100644 index 5fa7c5008..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Jog.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - - -class CState_Jog final : public CState -{ -public: - CState_Jog(); - virtual ~CState_Jog() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Jump.h b/Jusin154_Team3D/Editor/Public/State_Jump.h index 1433dc4aa..02d35b154 100644 --- a/Jusin154_Team3D/Editor/Public/State_Jump.h +++ b/Jusin154_Team3D/Editor/Public/State_Jump.h @@ -1,20 +1,31 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Jump final : public CState +NS_BEGIN(Editor) + +class CState_Jump final : public CState_Root { public: + typedef struct tagJump : public CState_Root::STATE_ROOT_DESC { + + }STATE_JUMP_DESC; +private: CState_Jump(); virtual ~CState_Jump() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + HRESULT Initialize(STATE_JUMP_DESC* pDesc); public: + static CState_Jump* Create(STATE_JUMP_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Land.h b/Jusin154_Team3D/Editor/Public/State_Land.h index 6cc48272b..6ebd50f2b 100644 --- a/Jusin154_Team3D/Editor/Public/State_Land.h +++ b/Jusin154_Team3D/Editor/Public/State_Land.h @@ -1,20 +1,31 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Land final : public CState +NS_BEGIN(Editor) + +class CState_Land final : public CState_Root { public: + typedef struct tagLand : public CState_Root::STATE_ROOT_DESC { + + }STATE_LAND_DESC; +private: CState_Land(); virtual ~CState_Land() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + HRESULT Initialize(STATE_LAND_DESC* pDesc); public: + static CState_Land* Create(STATE_LAND_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_LightAttack.h b/Jusin154_Team3D/Editor/Public/State_LightAttack.h deleted file mode 100644 index b048d0feb..000000000 --- a/Jusin154_Team3D/Editor/Public/State_LightAttack.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_LightAttack final : public CState -{ -public: - CState_LightAttack(); - virtual ~CState_LightAttack() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Move.h b/Jusin154_Team3D/Editor/Public/State_Move.h index 18ef685af..87e0472fb 100644 --- a/Jusin154_Team3D/Editor/Public/State_Move.h +++ b/Jusin154_Team3D/Editor/Public/State_Move.h @@ -1,19 +1,36 @@ #pragma once #include "Editor_Define.h" -#include "State.h" +#include "State_Root.h" -class CState_Move final : public CState +NS_BEGIN(Editor) + +class CState_Move final : public CState_Root { public: + typedef struct tagMove : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_MOVE_DESC; +private: CState_Move(); virtual ~CState_Move() = default; public: virtual void Enter(); - virtual void Update(_float fTimeDelta); + virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); - virtual _bool CheckExitState(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_MOVE_DESC* pDesc); + public: + static CState_Move* Create(STATE_MOVE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Root.h b/Jusin154_Team3D/Editor/Public/State_Root.h index 9b02d4449..0c36d0db2 100644 --- a/Jusin154_Team3D/Editor/Public/State_Root.h +++ b/Jusin154_Team3D/Editor/Public/State_Root.h @@ -2,18 +2,37 @@ #include "Editor_Define.h" #include "State.h" -class CState_Root final : public CState +NS_BEGIN(Editor) + +class CState_Root abstract : public CState { -public: +protected: + typedef struct tagStateRoot : public CState::STATEDESC { + function funcExitCheck = { nullptr }; + function funcEnterEvent = { nullptr }; + function funcExitEvent = { nullptr }; + }STATE_ROOT_DESC; + +protected: CState_Root(); virtual ~CState_Root() = default; -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: +protected: + virtual void Enter() override; + virtual HRESULT Update(_float fTimeDelta) override; + virtual void Exit() override; + +protected: + function m_funcExitCheck = { nullptr }; + function m_funcEnterEvent = { nullptr }; + function m_funcExitEvent = { nullptr }; + +protected: + HRESULT Initialize(STATE_ROOT_DESC* pArg); + +protected: virtual void Free() override; virtual void Describe_Entity(); }; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Skill.h b/Jusin154_Team3D/Editor/Public/State_Skill.h deleted file mode 100644 index 5866e87bb..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Skill.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Skill final : public CState -{ -public: - CState_Skill(); - virtual ~CState_Skill() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Skill2.h b/Jusin154_Team3D/Editor/Public/State_Skill2.h deleted file mode 100644 index 652630d4b..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Skill2.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Skill2 final : public CState -{ -public: - CState_Skill2(); - virtual ~CState_Skill2() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Sprint.h b/Jusin154_Team3D/Editor/Public/State_Sprint.h deleted file mode 100644 index ae31033f4..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Sprint.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - - -class CState_Sprint final : public CState -{ -public: - CState_Sprint(); - virtual ~CState_Sprint() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/State_Walk.h b/Jusin154_Team3D/Editor/Public/State_Walk.h deleted file mode 100644 index 71ac52832..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Walk.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - - -class CState_Walk final : public CState -{ -public: - CState_Walk(); - virtual ~CState_Walk() = default; - -public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - -public: - virtual void Free() override; - virtual void Describe_Entity(); -}; diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index 95f49559c..63fbeb8e1 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -42,9 +42,18 @@ class CTerrain final : public CGameObject _uint m_iTextureIndex = {}; + + class CAlphaMap* m_pAlphaMap = { nullptr }; + _uint m_iMaskRange = {1}; + _int m_iColorIndex = {0}; + _float m_fMaskValue = {0.1f}; + + _float m_fUpValue = { 0.01f }; + private: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); + HRESULT Ready_AlphaMap(); public: static CTerrain* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index df2e1e4bd..ba1161adb 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -33,7 +33,9 @@ Texture2D g_ShadowTexture; Texture2D g_PreShadowTexture; Texture2D g_BlurTexture; Texture2D g_BlurXTexture; + Texture2D g_BlurWeightTexture; +Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; @@ -153,7 +155,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); @@ -313,12 +315,33 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } -float g_fWeights[32] = +//float g_fWeights[32] = +//{ +// 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, +// 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, +// 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, +// 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 +//}; + +float g_fWeights[128] = { - 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, - 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, - 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, - 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 + 0.000209902, 0.000241594, 0.000277451, 0.000317919, 0.000363477, 0.000414637, 0.000471944, 0.000535974, + 0.000607333, 0.000686659, 0.000774615, 0.000871889, 0.00097919, 0.00109725, 0.00122679, 0.00136858, + 0.00152334, 0.00169183, 0.00187477, 0.00207285, 0.00228675, 0.0025171, 0.00276448, 0.0030294, + 0.00331231, 0.00361356, 0.00393342, 0.00427205, 0.00462949, 0.00500564, 0.0054003, 0.00581308, + 0.00624346, 0.00669075, 0.00715411, 0.0076325, 0.00812472, 0.0086294, 0.009145, 0.0096698, + 0.0102019, 0.0107393, 0.0112798, 0.0118211, 0.0123608, 0.0128962, 0.0134249, 0.0139441, + 0.0144511, 0.0149431, 0.0154174, 0.0158713, 0.0163021, 0.0167073, 0.0170844, 0.0174311, + 0.0177452, 0.0180246, 0.0182676, 0.0184726, 0.0186383, 0.0187635, 0.0188474, 0.0188895, + + 0.0188895, 0.0188474, 0.0187635, 0.0186383, 0.0184726, 0.0182676, 0.0180246, 0.0177452, + 0.0174311, 0.0170844, 0.0167073, 0.0163021, 0.0158713, 0.0154174, 0.0149431, 0.0144511, + 0.0139441, 0.0134249, 0.0128962, 0.0123608, 0.0118211, 0.0112798, 0.0107393, 0.0102019, + 0.0096698, 0.009145, 0.0086294, 0.00812472, 0.0076325, 0.00715411, 0.00669076, 0.00624346, + 0.00581308, 0.0054003, 0.00500564, 0.00462948, 0.00427205, 0.00393342, 0.00361356, 0.00331231, + 0.0030294, 0.00276448, 0.0025171, 0.00228675, 0.00207285, 0.00187477, 0.00169183, 0.00152334, + 0.00136858, 0.00122679, 0.00109725, 0.000979191, 0.000871889, 0.000774615, 0.000686658, 0.000607333, + 0.000535973, 0.000471944, 0.000414637, 0.000363477, 0.000317919, 0.000277451, 0.000241594, 0.000209902 }; @@ -395,30 +418,25 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) //} float4 vColor = 0.f; - //int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f; - //int iBlurMin; - //int iBlurMax; - //if (iBlurWeight % 2 == 0) - //{ - // iBlurMin = -1 * iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2; - //} - //else - //{ - // iBlurMin = -iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2 + 1; - //} + int iBlurWeight = (int)(round(g_BlurWeightXTexture.Sample(ClampSampler, In.vTexcoord).r) * 128.f); - //[loop] // 변수로 루프돌리려면 반드시 필요함 + int iBlurMin; + int iBlurMax; - for (int i = -15; i < 16; ++i) + iBlurMin = -1 * (iBlurWeight / 2) + 1; + iBlurMax = iBlurWeight / 2; + + // // 변수로 루프돌리려면 반드시 필요함 + + + for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; @@ -429,6 +447,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) struct PS_OUT_BLUR_X { float4 vBlurX : SV_TARGET0; + float4 vBlurWeight : SV_TARGET1; }; @@ -439,35 +458,38 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) float2 vTexcoord; float4 vColor = 0.f; - //TODO 블러 조절 해보려햇는데 실패함.. + float fBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r; + int iBlurWeight = (int) (round(fBlurWeight) * 128.f); - //int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f; + - //int iBlurMin; - //int iBlurMax; + int iBlurMin; + int iBlurMax; - //if (iBlurWeight % 2 == 0) + iBlurMin = -1 * (iBlurWeight / 2) + 1; + iBlurMax = iBlurWeight / 2; + + //for (int i = -15; i < 16; ++i) //{ - // iBlurMin = -1 * iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2; - //} - //else - //{ - // iBlurMin = -iBlurWeight / 2; - // iBlurMax = iBlurWeight / 2 + 1; + // vTexcoord.x = In.vTexcoord.x; + // vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; + + // vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); //} - //[loop] // 변수로 루프돌리려면 반드시 필요함 + //Out.vBackBuffer += vColor; - for (int i = -15; i < 16; ++i) + + for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; + Out.vBlurWeight = fBlurWeight; return Out; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index 31276135c..645fd6d0c 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -1,64 +1,151 @@ float PI = 3.141592; -struct Mesh +struct KeyFrame { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; - - uint4 vBlendIndex; - float4 vBlendWeight; + float3 vScale; + float4 vRotation; + float3 vTranslation; + float fTrackPosition; }; -struct SkinngMesh +struct Channel { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; - + uint StartIndex; + uint KeyCount; + uint BoneIndex; }; -StructuredBuffer g_MeshBufferInput : register(t0); -RWStructuredBuffer gSkinngMeshOutput : register(u0); - -cbuffer g_ConstantBuffer : register(b0) +struct LocalPos { - row_major float4x4 BoneMatrix[512]; + float3 Scale; + float pad0; + + float4 Rotation; + + float3 Translation; + float pad1; }; -//[numthreads(256, 1, 1)] -[numthreads(256, 1, 1)] -void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) + +StructuredBuffer g_KeyFrameBuffer : register(t0); +StructuredBuffer g_ChannelBuffer : register(t1); + +RWStructuredBuffer g_LocalPosOutput : register(u0); + + +cbuffer AnimCB : register(b0) { - uint iIndex = DispatchThreadID.x; + float CurrentTime; + float Duration; + float Speed; + int BoneCount; + + row_major float4x4 PreTransformMatrix; +}; - Mesh mesh = g_MeshBufferInput[iIndex]; +float4 quatSlerp(float4 q1, float4 q2, float t) +{ + float cosTheta = dot(q1, q2); - float fWeightW = 1.f - - (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + if (cosTheta < 0.0f) + { + q2 = -q2; + cosTheta = -cosTheta; + } - matrix SkinMatrix = - BoneMatrix[mesh.vBlendIndex.x] * mesh.vBlendWeight.x + - BoneMatrix[mesh.vBlendIndex.y] * mesh.vBlendWeight.y + - BoneMatrix[mesh.vBlendIndex.z] * mesh.vBlendWeight.z + - BoneMatrix[mesh.vBlendIndex.w] * fWeightW; + if (cosTheta > 0.9995f) + return normalize(lerp(q1, q2, t)); - float4 vPosition = mul(float4(mesh.vPosition, 1), SkinMatrix); - float4 vNormal = mul(float4(mesh.vNormal, 0), SkinMatrix); - float4 vBinormal = mul(float4(mesh.vBinormal, 0), SkinMatrix); - float4 vTangent = mul(float4(mesh.vTangent, 0), SkinMatrix); + float theta = acos(cosTheta); + float sinTheta = sin(theta); + float w1 = sin((1.0f - t) * theta) / sinTheta; + float w2 = sin(t * theta) / sinTheta; - SkinngMesh outv; - outv.vPosition = vPosition.xyz; - outv.vNormal = vNormal.xyz; - outv.vTangent = vTangent.xyz; - outv.vBinormal = vBinormal.xyz; - outv.vTexcoord = mesh.vTexcoord; - - gSkinngMeshOutput[iIndex] = outv; + return q1 * w1 + q2 * w2; +} + + +[numthreads(256, 1, 1)] +void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID) +{ + uint boneIndex = DTID.x; + if (boneIndex >= (uint) BoneCount) + return; + + float time = CurrentTime; + if (Duration > 0) + time = min(time, Duration); + + Channel channel = g_ChannelBuffer[boneIndex]; + + LocalPos result; + + if (channel.KeyCount == 0) + { + result.Scale = float3(1, 1, 1); + result.Rotation = float4(0, 0, 0, 1); + result.Translation = float3(0, 0, 0); + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + uint firstIndex = channel.StartIndex; + uint lastIndex = channel.StartIndex + channel.KeyCount - 1; + + KeyFrame keyframe1 = g_KeyFrameBuffer[firstIndex]; + KeyFrame keyframe2 = g_KeyFrameBuffer[lastIndex]; + + if (time <= keyframe1.fTrackPosition) + { + result.Scale = keyframe1.vScale; + result.Rotation = keyframe1.vRotation; + result.Translation = keyframe1.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + if (time >= keyframe2.fTrackPosition) + { + result.Scale = keyframe2.vScale; + result.Rotation = keyframe2.vRotation; + result.Translation = keyframe2.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + + for (uint i = 0; i < channel.KeyCount - 1; ++i) + { + uint A = channel.StartIndex + i; + uint B = channel.StartIndex + i + 1; + + KeyFrame ka = g_KeyFrameBuffer[A]; + KeyFrame kb = g_KeyFrameBuffer[B]; + + if (time >= ka.fTrackPosition && time <= kb.fTrackPosition) + { + float t = (time - ka.fTrackPosition) / (kb.fTrackPosition - ka.fTrackPosition); + + result.Scale = lerp(ka.vScale, kb.vScale, t); + result.Rotation = quatSlerp(ka.vRotation, kb.vRotation, t); + result.Translation = lerp(ka.vTranslation, kb.vTranslation, t); + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; + return; + } + } + + result.Scale = keyframe2.vScale; + result.Rotation = keyframe2.vRotation; + result.Translation = keyframe2.vTranslation; + result.pad0 = result.pad1 = 0.0f; + + g_LocalPosOutput[boneIndex] = result; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 117084542..bc18364e1 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -38,6 +38,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; + float2 vDelay; }; @@ -79,6 +80,17 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + particleValue.vDelay.x += fTimeDelta; + + if (particleValue.vDelay.x < particleValue.vDelay.y) + { + + g_VBInstanceOutput[iIndex] = particle; + g_ParticleValueOutput[iIndex] = particleValue; + + return; + } + // 라이프타임 움직임 particle.vLifeTime.x += fTimeDelta; @@ -97,7 +109,7 @@ void CS_MAIN( particle.vLifeTime.x = 0.f; particleValue.vAniIndex.x = 0.f; - + particleValue.vDelay.x = 0.f; g_VBInstanceOutput[iIndex] = particle; g_ParticleValueOutput[iIndex] = particleValue; diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 91a1376ef..4ad2f858b 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -23,6 +23,7 @@ CAnimation::CAnimation(const CAnimation& rhs) , m_fTickPerSecond{ rhs.m_fTickPerSecond } , m_pSaveAnim{ rhs.m_pSaveAnim } , m_fAnimSpeed{rhs.m_fAnimSpeed } + ,m_iBoneCount{rhs.m_iBoneCount} { memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2); @@ -32,7 +33,7 @@ CAnimation::CAnimation(const CAnimation& rhs) SAFE_ADDREF(pChannel); } } -_bool CAnimation::Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform) +_bool CAnimation::Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform) { //m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta; m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta * m_fAnimSpeed; @@ -52,7 +53,7 @@ _bool CAnimation::Update_TransformationMatrices(const vector& Bone if (m_vBoneTransformationMatrix.size() > 0) m_vBoneTransformationMatrix.clear(); for (auto& pChannel : m_Channels) { - pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++],pTransform); + pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++],pTransform); m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix()); } @@ -184,9 +185,36 @@ void CAnimation::InterpAnim(CAnimation* pPreAnim, vector& Bones, float f } } +void CAnimation::CreateGPUData(ID3D11Device* pDevice) +{ + vector channels; + vector keyframes; + + channels.resize(m_iBoneCount); + + for (auto& pChannel : m_Channels) + { + CHANNEL_DESC desc = pChannel->Fill_GPU_ChannelDesc(); + desc.StartIndex = (_uint)keyframes.size(); + + pChannel->Fill_GPU_Keyframes(keyframes); + + channels[desc.BoneIndex] = desc; + } + + m_iChannelCount = (_uint)channels.size(); + m_iKeyframeCount = (_uint)keyframes.size(); + + CreateKeyFrameBuffer(pDevice, keyframes); + CreateChannelBuffer(pDevice, channels); + +} + #ifdef EDITOR_PROJECT + + HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { m_strName = pAIAnimation->mName.data; @@ -216,20 +244,8 @@ HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* p if (FAILED(Combined_Initialize())) { return E_FAIL; } - return S_OK; -} -HRESULT CAnimation::SaveAsBinary(HANDLE hFile, DWORD& dwByte) -{ - size_t iNameLength = m_strName.length(); - WriteFile(hFile, &iNameLength, sizeof(size_t), &dwByte, nullptr); - WriteFile(hFile, m_strName.data(), (DWORD)m_strName.length(), &dwByte, nullptr); - WriteFile(hFile, &m_fDuration, sizeof(_float), &dwByte, nullptr); - WriteFile(hFile, &m_TickPerSeconds, sizeof(_float) * 2, &dwByte, nullptr); - WriteFile(hFile, &m_iNumChannels, sizeof(_uint), &dwByte, nullptr); - for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels[i]->SaveAsBinary(hFile, dwByte); - } + return S_OK; } @@ -244,37 +260,7 @@ CAnimation* CAnimation::Create(const vector& Bones, const aiAnimation* p #endif -HRESULT CAnimation::Initialize(HANDLE hFile, DWORD& dwByte) -{ - size_t iNameLength = {}; - if (!ReadFile(hFile, &iNameLength, sizeof(size_t), &dwByte, nullptr)) { - return E_FAIL; - } - m_strName.resize(iNameLength); - if (!ReadFile(hFile, (void*)m_strName.data(), (DWORD)iNameLength, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_fDuration, sizeof(_float), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_TickPerSeconds, sizeof(_float) * 2, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumChannels, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - m_CurrentKeyFrameIndices.resize(m_iNumChannels); - m_Channels.reserve(m_iNumChannels); - for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels.push_back(CChannel::Create(hFile, dwByte)); - } - if (FAILED(Combined_Initialize())) { - return E_FAIL; - } - return S_OK; -} - -HRESULT CAnimation::Initialize(const CModel* pModel, SaveAnimation* pSaveAnimation) +HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation) { m_pSaveAnim = pSaveAnimation; @@ -286,6 +272,8 @@ HRESULT CAnimation::Initialize(const CModel* pModel, SaveAnimation* pSaveAnimati m_CurrentKeyFrameIndices.resize(m_iNumChannels); + m_iBoneCount = (_uint)Bones.size(); + for (size_t i = 0; i < m_iNumChannels; i++) { CChannel* pChannel = CChannel::Create(pModel, &pSaveAnimation->Channels[i]); @@ -313,24 +301,69 @@ _uint CAnimation::Get_BoneIndex(const char* pChannelName) return _uint(); } -CAnimation* CAnimation::Create(HANDLE hFile, DWORD& dwByte) +HRESULT CAnimation::CreateKeyFrameBuffer(ID3D11Device* pDevice,vector keyframe) { - CAnimation* pInstance = new CAnimation(); + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = (_int)sizeof(KEYFRAME_DESC) * m_iKeyframeCount; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = (_int)sizeof(KEYFRAME_DESC); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; - if (FAILED(pInstance->Initialize(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CAnimation"); - SAFE_RELEASE(pInstance); - } + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = keyframe.data(); - return pInstance; + pDevice->CreateBuffer(&desc, &init, &m_pKeyFrameBuffer); + + + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.Buffer.FirstElement = 0; + srvDesc.Buffer.NumElements = m_iKeyframeCount; + + if (FAILED(pDevice->CreateShaderResourceView(m_pKeyFrameBuffer, &srvDesc, &m_pKeyFrameSrv))) + return E_FAIL; + + + return S_OK; } -CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimation) +HRESULT CAnimation::CreateChannelBuffer(ID3D11Device* pDevice, vector channel) +{ + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = (_int)sizeof(CHANNEL_DESC) * m_iChannelCount; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = (_int)sizeof(CHANNEL_DESC); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = channel.data(); + + pDevice->CreateBuffer(&desc, &init, &m_pChannelBuffer); + + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.Buffer.FirstElement = 0; + srvDesc.Buffer.NumElements = m_iChannelCount; + + if (FAILED(pDevice->CreateShaderResourceView(m_pChannelBuffer, &srvDesc, &m_pChannelSrv))) + return E_FAIL; + + return S_OK; +} + +CAnimation* CAnimation::Create(const vector& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation) { CAnimation* pInstance = new CAnimation(); - if (FAILED(pInstance->Initialize(pModel, pSaveAnimation))) + if (FAILED(pInstance->Initialize(Bones,pModel, pSaveAnimation))) { MSG_BOX("Failed to Created : CAnimation"); SAFE_RELEASE(pInstance); @@ -354,6 +387,18 @@ void CAnimation::Free() m_Channels.clear(); m_CurrentKeyFrameIndices.clear(); + + m_KeyFrameDesc.clear(); + m_ChannelDesc.clear(); + + if (m_pKeyFrameSrv&& m_pChannelSrv) + { + SAFE_RELEASE(m_pKeyFrameBuffer); + SAFE_RELEASE(m_pChannelBuffer); + SAFE_RELEASE(m_pKeyFrameSrv); + SAFE_RELEASE(m_pChannelSrv); + } + } ; void CAnimation::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Camera.cpp b/Jusin154_Team3D/Engine/Private/Camera.cpp index e809ad4ec..d320b6f3f 100644 --- a/Jusin154_Team3D/Engine/Private/Camera.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera.cpp @@ -33,10 +33,20 @@ HRESULT CCamera::Initialize(void* pArg) m_bActive = false; m_iPriority = pDesc->iPriority; m_pCameraKey = pDesc->pCameraKey; + + m_pFollowTarget = pDesc->pFollowTarget; SAFE_ADDREF(m_pFollowTarget); m_pLookTarget = pDesc->pLookTarget; SAFE_ADDREF(m_pLookTarget); + m_bEnable_TransitionLerp = pDesc->bEnableTransitionLerp; + m_vTransitionTime = pDesc->vTransitionTime; + m_bEnable_FollowLerp = pDesc->bEnableFollowLerp; + m_vLookLerpTime = pDesc->vLookLerpTime; + m_bEnable_LookLerp = pDesc->bEnableLookLerp; + m_vFollowLerpTime = pDesc->vFollowLerpTime; + + return S_OK; } @@ -56,43 +66,41 @@ void CCamera::Transition(_float fTimeDelta) if (false == m_bIsCurrentTransition) { return; } - m_fTransitionCurrentTime += fTimeDelta; - _float fRatio = m_fTransitionCurrentTime / m_fTransitionMaxTime; + m_vTransitionTime.x += fTimeDelta; + _float fRatio = m_vTransitionTime.x / m_vTransitionTime.y; if (fRatio > 1.f) { fRatio = 1.f; m_bIsCurrentTransition = false; } - CTransform* pLookTransform = m_pLookTarget->Get_Component(); _vector vFollowTarget = m_pFollowTarget->Get_Component()->Get_State(STATE::POSITION); - _vector vLookTarget = pLookTransform->Get_State(STATE::POSITION); - _matrix matTarget = XMMatrixInverse(nullptr, XMMatrixLookAtLH(vFollowTarget, vLookTarget, XMVectorSet(0.f, 1.f, 0.f, 0.f))); + _vector vLookTarget = m_pLookTarget->Get_Component()->Get_State(STATE::POSITION); - _vector vTargetScale{}, vTargetRotq{}, vTargetTrans{}, vOriginScale{}, vOriginRotq{}, vOriginTrans{}; - XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, matTarget); - XMMatrixDecompose(&vOriginScale, &vOriginRotq, &vOriginTrans, m_pTransformCom->Get_XMWorldMatrix()); + _matrix xmMatTarget = XMMatrixInverse(nullptr, XMMatrixLookAtLH(vFollowTarget, vLookTarget, XMVectorSet(0.f, 1.f, 0.f, 0.f))); - vTargetScale = XMVectorLerp(vOriginScale, vTargetScale, fRatio); - vTargetRotq = XMQuaternionSlerp(vOriginRotq, vTargetRotq, fRatio); - vTargetTrans = XMVectorLerp(vOriginTrans, vTargetTrans, fRatio); + _float4x4 matOrigin = *m_pTransformCom->Get_WorldMatrixPtr(); + _float4x4 matTarget = {}; XMStoreFloat4x4(&matTarget, xmMatTarget); + _float4x4 matResult = {}; - m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(vTargetScale, XMVectorZero(), vTargetRotq, vTargetTrans)); + CMyTools::MatrixLerp(&matOrigin, &matTarget, matResult, fRatio); + + m_pTransformCom->Set_WorldMatrix(matResult); } void CCamera::Active_Camera(pair<_float4, _float3>& pairTransitionInfo) { - //if (true == m_bTransitionLerp) { - // m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), - // XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); - // m_fTransitionCurrentTime = 0.f; - // m_bIsCurrentTransition = true; - //} + if (true == m_bEnable_TransitionLerp) { + m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), + XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); + m_vTransitionTime.x = 0.f; + m_bIsCurrentTransition = true; + } m_bActive = true; } void CCamera::DeActive_Camera(pair<_float4, _float3>& pairTransition) { - m_bActive = false; + m_bActive = false; m_bIsCurrentTransition = false; _vector vScale{}, vRotq{}, vTrans{}; XMMatrixDecompose(&vScale, &vRotq, &vTrans, m_pTransformCom->Get_XMWorldMatrix()); diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index b60d9c6a1..c0b1f6b93 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -60,21 +60,33 @@ HRESULT CChannel::Initialize(const vector& Bones, const aiNodeAnim* pAIC return S_OK; } -HRESULT CChannel::SaveAsBinary(HANDLE hFile, DWORD& dwByte) +void CChannel::Fill_GPU_Keyframes(vector& outKeyframes) { - string strName = m_szName; - strName.shrink_to_fit(); - DWORD iLength = (DWORD)strName.length(); - WriteFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, strName.data(), iLength, &dwByte, nullptr); - WriteFile(hFile, &m_iBoneIndex, sizeof(_int), &dwByte, nullptr); - WriteFile(hFile, &m_iNumKeyFrames, sizeof(_uint), &dwByte, nullptr); - for (auto& keyFrame : m_KeyFrames) { - WriteFile(hFile, &keyFrame, sizeof(KEYFRAME), &dwByte, nullptr); + for (_uint i = 0; i < m_iNumKeyFrames; i++) + { + const KEYFRAME& src = m_KeyFrames[i]; + + KEYFRAME_DESC dst{}; + dst.vScale = src.vScale; + dst.vRotation = src.vRotation; + dst.vTranslation = src.vTranslation; + dst.fTrackPosition = src.fTrackPosition; + + outKeyframes.push_back(dst); } - return S_OK; } +CHANNEL_DESC CChannel::Fill_GPU_ChannelDesc() +{ + CHANNEL_DESC desc{}; + desc.StartIndex = 0; + desc.KeyCount = m_iNumKeyFrames; + desc.BoneIndex = m_iBoneIndex; + + return desc; +} + + CChannel* CChannel::Create(const vector& Bones, const aiNodeAnim* pAIChannel) { CChannel* pInstance = new CChannel(); @@ -100,84 +112,104 @@ HRESULT CChannel::Initialize(const vector& Bones, _uint iIndex) } -void CChannel::Update_TransformationMatirx(const vector& Bones, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, CTransform* pTransform) - +void CChannel::Update_TransformationMatirx(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, CTransform* pTransform) { - if (0.f == fCurrentTrackPosition) { - *pCurrentKeyFrameIndex = 0; - } - KEYFRAME LastKeyFrame = m_KeyFrames.back(); - - _vector vScale = {}; - _vector vRotation = {}; - _vector vTranslation = {}; - - if (fCurrentTrackPosition >= LastKeyFrame.fTrackPosition) - { - vScale = XMLoadFloat3(&LastKeyFrame.vScale); - vRotation = XMLoadFloat4(&LastKeyFrame.vRotation); - vTranslation = XMVectorSetW(XMLoadFloat3(&LastKeyFrame.vTranslation), 1.f); - } - else { - while (fCurrentTrackPosition >= m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition) { - ++*pCurrentKeyFrameIndex; - } - - _float3 vSrcScale = {}, vDstScale = {}; - _float4 vSrcRotation = {}, vDstRotation = {}; - _float3 vSrcTranslation = {}, vDstTranslation = {}; - - vSrcScale = m_KeyFrames[*pCurrentKeyFrameIndex].vScale; - vDstScale = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vScale; - - vSrcRotation = m_KeyFrames[*pCurrentKeyFrameIndex].vRotation; - vDstRotation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vRotation; - - vSrcTranslation = m_KeyFrames[*pCurrentKeyFrameIndex].vTranslation; - vDstTranslation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vTranslation; - - _float fRatio = (fCurrentTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition) / - (m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition); - - vScale = XMVectorLerp(XMLoadFloat3(&vSrcScale), XMLoadFloat3(&vDstScale), fRatio); - vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSrcRotation), XMLoadFloat4(&vDstRotation), fRatio); - vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSrcTranslation), XMLoadFloat3(&vDstTranslation), fRatio), 1.f); - } + //if (0.f == fCurrentTrackPosition) { + // *pCurrentKeyFrameIndex = 0; + //} + //KEYFRAME LastKeyFrame = m_KeyFrames.back(); + + //_vector vScale = {}; + //_vector vRotation = {}; + //_vector vTranslation = {}; + + //if (fCurrentTrackPosition >= LastKeyFrame.fTrackPosition) + //{ + // vScale = XMLoadFloat3(&LastKeyFrame.vScale); + // vRotation = XMLoadFloat4(&LastKeyFrame.vRotation); + // vTranslation = XMVectorSetW(XMLoadFloat3(&LastKeyFrame.vTranslation), 1.f); + //} + //else { + // while (fCurrentTrackPosition >= m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition) { + // ++*pCurrentKeyFrameIndex; + // } + + // _float3 vSrcScale = {}, vDstScale = {}; + // _float4 vSrcRotation = {}, vDstRotation = {}; + // _float3 vSrcTranslation = {}, vDstTranslation = {}; + + // vSrcScale = m_KeyFrames[*pCurrentKeyFrameIndex].vScale; + // vDstScale = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vScale; + + // vSrcRotation = m_KeyFrames[*pCurrentKeyFrameIndex].vRotation; + // vDstRotation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vRotation; + + // vSrcTranslation = m_KeyFrames[*pCurrentKeyFrameIndex].vTranslation; + // vDstTranslation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vTranslation; + + // _float fRatio = (fCurrentTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition) / + // (m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition); + + // vScale = XMVectorLerp(XMLoadFloat3(&vSrcScale), XMLoadFloat3(&vDstScale), fRatio); + // vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSrcRotation), XMLoadFloat4(&vDstRotation), fRatio); + // vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSrcTranslation), XMLoadFloat3(&vDstTranslation), fRatio), 1.f); + //} + + + + const LOCALPOS_DESC& LocalPos = pLocalPosArray[m_iBoneIndex]; + + _vector vScale = XMLoadFloat3(&LocalPos.Scale); + _vector vRotation = XMLoadFloat4(&LocalPos.Rotation); + _vector vTranslation = XMVectorSet( + LocalPos.Translation.x, + LocalPos.Translation.y, + LocalPos.Translation.z, + 1.f); + if (Bones[m_iBoneIndex]->Compare_Name("Reference") && pTransform != nullptr) { _float3 vCurRootPos; XMStoreFloat3(&vCurRootPos, vTranslation); - _vector vDeltaLocal = XMLoadFloat3(&vCurRootPos) - XMLoadFloat3(&m_vPrevRootPos); - - _vector vDeltaAdjusted = {}; - XMMATRIX pre = XMLoadFloat4x4(&m_PreTransformMatrix); - vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre); + /* + if (!m_bInitialRootPos) + { + m_bInitialRootPos = true; + vTranslation = XMVectorZero(); + } + else + {*/ + _vector vDeltaLocal = XMLoadFloat3(&vCurRootPos) - XMLoadFloat3(&m_vPrevRootPos); - _vector vRight = pTransform->Get_State(STATE::RIGHT); - _vector vUp = pTransform->Get_State(STATE::UP); - _vector vLook = pTransform->Get_State(STATE::LOOK); + _vector vDeltaAdjusted = {}; - _float dx = XMVectorGetX(vDeltaAdjusted); - _float dy = XMVectorGetY(vDeltaAdjusted); - _float dz = XMVectorGetZ(vDeltaAdjusted); + vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre); - _vector vDeltaWorld = vRight * dx + (-vUp * dz) + vLook * dy; + _vector vRight = pTransform->Get_State(STATE::RIGHT); + _vector vUp = pTransform->Get_State(STATE::UP); + _vector vLook = pTransform->Get_State(STATE::LOOK); - vDeltaWorld *= 0.01f; + _float dx = XMVectorGetX(vDeltaAdjusted); + _float dy = XMVectorGetY(vDeltaAdjusted); + _float dz = XMVectorGetZ(vDeltaAdjusted); - _vector vCurrentPos = pTransform->Get_State(STATE::POSITION); - _vector vTargetPos = vCurrentPos + vDeltaWorld; + _vector vDeltaWorld = vRight * dx + (-vUp * dz) + vLook * dy; - //pTransform->Set_State(STATE::POSITION, vTargetPos); - pTransform->AccumulateMomentum(vDeltaWorld); + vDeltaWorld *= 0.01f; - m_vPrevRootPos = vCurRootPos; - vTranslation = XMVectorZero(); + _vector vCurrentPos = pTransform->Get_State(STATE::POSITION); + _vector vTargetPos = vCurrentPos + vDeltaWorld; - ///////////////////////////////////// + pTransform->Set_State(STATE::POSITION, vTargetPos); + //pTransform->AccumulateMomentum(vDeltaWorld); + + m_vPrevRootPos = vCurRootPos; + vTranslation = XMVectorZero(); + //} + /////////////////////////////////// _float4 curRotF4; XMStoreFloat4(&curRotF4, vRotation); @@ -301,38 +333,13 @@ HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) KeyFrame.vRotation = vRotation; KeyFrame.vTranslation = vTranslation; + m_KeyFrames.push_back(KeyFrame); } return S_OK; } -CChannel* CChannel::Create(const vector& Bones, _uint iIndex) -{ - CChannel* pInstance = new CChannel(); - - if (FAILED(pInstance->Initialize(Bones, iIndex))) - { - MSG_BOX("Failed to Created : CChannel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CChannel* CChannel::Create(HANDLE hFile, DWORD& dwByte) -{ - CChannel* pInstance = new CChannel(); - - if (FAILED(pInstance->Initialize(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CChannel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - CChannel* CChannel::Create(const CModel* pModel, SaveChannel* pSaveChannel) { CChannel* pInstance = new CChannel(); @@ -351,4 +358,6 @@ void CChannel::Free() __super::Free(); m_KeyFrames.clear(); + + m_KeyFrameDesc.clear(); } diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index 7d46182a5..d4e668c26 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -83,9 +83,6 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, D3D11_MAP_READ, 0, &StagingSubResource))) { - - CInstance_Model::CS_PARTICLE_VALUE_DESC* pValueDesc = static_cast(StagingSubResource.pData); - StagingSubResources.push_back(StagingSubResource); m_pContext->Unmap(m_pOutputStagingBuffer[i], 0); @@ -113,15 +110,41 @@ void CComputeShader::Bind_UAV(_uint iIndex) void CComputeShader::Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex) { - //m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호 - // 1, // 버퍼 개수 - // &m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주소 + m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호 + 1, // 버퍼 개수 + &m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주 - ID3D11ShaderResourceView* pSRV = m_pOutputSRV[iBufferIndex]; +} - // VS에 바인딩 - m_pContext->VSSetShaderResources(iIndex, 1, &pSRV); +ID3D11UnorderedAccessView* CComputeShader::GetOutputUAV(_uint iIndex) const +{ + return m_pOutputUAV[iIndex]; +} +vector CComputeShader::ReadBackOutputs() +{ + std::vector StagingSubResources; + StagingSubResources.reserve(m_iNumOutputBuffer); + + for (_uint i = 0; i < m_iNumOutputBuffer; ++i) + { + if (m_pOutputStagingBuffer[i] == nullptr || m_pOutputBuffer[i] == nullptr) + continue; + + m_pContext->CopyResource(m_pOutputStagingBuffer[i], m_pOutputBuffer[i]); + + D3D11_MAPPED_SUBRESOURCE mapped = {}; + if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, + D3D11_MAP_READ, 0, &mapped))) + { + StagingSubResources.push_back(mapped); + + m_pContext->Unmap(m_pOutputStagingBuffer[i], 0); + } + } + + return StagingSubResources; + } void CComputeShader::Reset() diff --git a/Jusin154_Team3D/Engine/Private/FSM.cpp b/Jusin154_Team3D/Engine/Private/FSM.cpp index 193a4a8d8..8ab5ae9cd 100644 --- a/Jusin154_Team3D/Engine/Private/FSM.cpp +++ b/Jusin154_Team3D/Engine/Private/FSM.cpp @@ -5,15 +5,24 @@ CFSM::CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CComponent(pDevice, pContext) { - m_States.resize(FSMSTATE::END); } CFSM::CFSM(const CFSM& rhs) - : CComponent(rhs), - m_States(rhs.m_States) + : CComponent(rhs) { } +HRESULT CFSM::Bind_States(FSM_DESC& Desc) +{ + if (nullptr != m_pStateMask) { + return E_FAIL; + } + + m_pStateMask = Desc.pStateMask; + m_pStates = Desc.pStates; + return S_OK; +} + HRESULT CFSM::Initialize_Prototype() { return S_OK; @@ -24,62 +33,31 @@ HRESULT CFSM::Initialize(void* pArg) return S_OK; } -void CFSM::Add_State(_uint iIndex, CState* state) +void CFSM::Change_State(size_t iStateMask) { - m_States[iIndex] = state; - m_States[iIndex]->Set_State(iIndex); - m_States[iIndex]->Set_Owner(m_pOwner); - m_States[iIndex]->Set_Component(); + if (nullptr != m_pCurrentState) { // 현재 스테이트가 비워져 있으면 우회 + if (IsEnable(iStateMask)) { // 이미 활성화 된 스테이트면 리턴 + return; + } + m_iPreviousStateMask = *m_pStateMask; + + m_pCurrentState->Exit(); + SAFE_RELEASE(m_pPreviousState); // Prev State 를 지움 + m_pPreviousState = m_pCurrentState; + } + + m_pCurrentState = m_pStates->at(iStateMask); + SAFE_ADDREF(m_pCurrentState); + m_pCurrentState->Enter(); } -void CFSM::Change_State(_uint iIndex) +HRESULT CFSM::Update_State(_float fTimeDelta) { - m_pPrevious = m_pCurrent; - - if (m_pCurrent) - m_pCurrent->Exit(); - - m_pCurrent = m_States[iIndex]; - - if (m_pCurrent) - m_pCurrent->Enter(); -} - -void CFSM::Update(_float fTimeDelta) -{ - vector States; - - CState* pCurrent = m_pCurrent; - - while (pCurrent) + if (nullptr != m_pCurrentState) { - States.push_back(pCurrent); - pCurrent = pCurrent->Get_Parent(); + return m_pCurrentState->Update(fTimeDelta); } - - for (_int i = (_int)States.size() - 1; i >= 0; --i) { - States[i]->Update(fTimeDelta); - } -} - -_uint CFSM::Get_CurrState() -{ - return m_pCurrent->Get_State(); -} - -_uint CFSM::Get_PrevState() -{ - if (m_pPrevious) - return m_pPrevious->Get_State(); - return 0; -} - -void CFSM::Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent) -{ - CState* pChild = m_States[Child]; - CState* pParent = m_States[Parent]; - if (pChild && pParent) - pChild->Set_Parent(pParent); + return S_OK; } CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -95,7 +73,7 @@ CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) return pInstance; } -CComponent* CFSM::Clone(void* pArg, class CGameObject* pOwner) +CFSM* CFSM::Clone(void* pArg, class CGameObject* pOwner) { CFSM* pInstance = new CFSM(*this); pInstance->m_pOwner = pOwner; @@ -112,14 +90,16 @@ void CFSM::Free() { __super::Free(); - SAFE_RELEASE(m_pCurrent); - SAFE_RELEASE(m_pPrevious); + SAFE_RELEASE(m_pCurrentState); + SAFE_RELEASE(m_pPreviousState); - for (auto& states : m_States) - { - SAFE_RELEASE(states); + if (nullptr != m_pStates) { + unordered_map::iterator iter = m_pStates->begin(); + for (; iter != m_pStates->end(); ++iter) { + SAFE_RELEASE(iter->second); + } + m_pStates = nullptr; } - m_States.clear(); } void CFSM::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index c3f2ac1a2..e2387d636 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -109,7 +109,16 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pMouse_Manager->Update(); //m_pSound_Manager->Update(); +#ifdef 기무리 + static _bool bPicking = false; + GUI::Checkbox("Picking Enable", &bPicking); + if (bPicking) { + m_pPicking->Update(); + } +#endif // 기무리 +#ifndef 기무리 m_pPicking->Update(); +#endif // !기무리 m_pObject_Manager->Priority_Update(fTimeDelta); @@ -117,11 +126,13 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pObject_Manager->Update(fTimeDelta); + m_pPhysX_Manager->Update(fTimeDelta); + m_pObject_Manager->Late_Update(fTimeDelta); m_pLevel_Manager->Update(fTimeDelta); m_pObject_Manager->Clear_DeadObj(); - m_pPhysX_Manager->Update(fTimeDelta); + //m_pObstacle_Manager->Refresh_Region(); } diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 3d44b170e..c276489f8 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -451,8 +451,8 @@ void CInstance_Model::Instane_Buffer_ReStruct() pParticleValues[i].fGravity = m_pGameInstance->Random_Float(m_InstanceDesc.vGravity.x, m_InstanceDesc.vGravity.y); pParticleValues[i].fDrag = m_pGameInstance->Random_Float(m_InstanceDesc.vDrag.x, m_InstanceDesc.vDrag.y); pParticleValues[i].fSizeDrag = m_pGameInstance->Random_Float(m_InstanceDesc.vSizeDrag.x, m_InstanceDesc.vSizeDrag.y); - - + pParticleValues[i].vDelay = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vDelay.x, m_InstanceDesc.vDelay.y)); + memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginLook, SRMatrix.m[2], sizeof(_float4)); @@ -628,6 +628,11 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } + if (ImGui::DragFloat2("Delay", reinterpret_cast<_float*>(&m_InstanceDesc.vDelay))) + { + Instane_Buffer_ReStruct(); + } + if (ImGui::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime))) { Instane_Buffer_ReStruct(); diff --git a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp index e4b4aa8c3..1bbfe912f 100644 --- a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp +++ b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "LerpAnim.h" #include "Channel.h" #include "Bone.h" @@ -17,13 +17,13 @@ _bool CLerpAnim::Update_TransformationMatrices(const vector& Bones, _flo return false; } - _uint iIndex = {}; + /*_uint iIndex = {}; for (auto& pChannel : m_Channels) { if (true == m_Movable[iIndex]) { pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex]); } iIndex++; - } + }*/ return true; } @@ -36,23 +36,13 @@ HRESULT CLerpAnim::Initialize(_uint iNumBone, _float fTickPerSecond, const vecto m_InitialFrames.resize(m_iNumChannels); m_Channels.reserve(m_iNumChannels); - for (_uint i = 0; i < m_iNumChannels; ++i) { - CChannel* pChannel = CChannel::Create(Bones, i); - if (nullptr == pChannel) { - return E_FAIL; - } - m_Channels.push_back(pChannel); - Bones[i]->Get_KeyFrame(m_InitialFrames[i], false); - m_InitialFrames[i].fTrackPosition = m_fDuration; - pChannel->Set_Frame(1, m_InitialFrames[i]); - } return S_OK; } void CLerpAnim::Begin(const vector& Bones, vector& StartFrames, vector& EndFrames, _float fDuration, _uint iRootBoneIndex) { - { // Ãʱâȭ + { // 초기화 - //KEYFRAME kf = { // Ç׵îÇà·ÄÀÇ ŰÇÁ·¹ÀÓ + //KEYFRAME kf = { // 항등행렬의 키프레임 // { 1.f, 1.f, 1.f }, // { 0.f, 0.f, 0.f, 1.f }, // { 0.f, 0.f, 0.f}, @@ -61,19 +51,19 @@ void CLerpAnim::Begin(const vector& Bones, vector& Start m_fDuration = fDuration; m_fCurrentTrackPosition = 0.f; for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels[i]->Set_Frame(1, m_InitialFrames[i]); // ³¡ÇÁ·¹ÀÓÀ» Ãʱâ °ªÀ¸·Î ä¿ì±â + m_Channels[i]->Set_Frame(1, m_InitialFrames[i]); // 끝프레임을 초기 값으로 채우기 } fill(m_CurrentKeyFrameIndices.begin(), m_CurrentKeyFrameIndices.end(), 0); fill(m_Movable.begin(), m_Movable.end(), false); } - { // ½ÇÁ¦ °ª ä¿ì±â - for (LERPDESC& Desc : EndFrames) // ³¡ÇÁ·¹ÀÓÀ» ½ÇÁ¦ °ªÀ¸·Î ä¿ì±â + { // 실제 값 채우기 + for (LERPDESC& Desc : EndFrames) // 끝프레임을 실제 값으로 채우기 { _int iIndex = Desc.iSlot; Desc.tagKeyFrame.fTrackPosition = m_fDuration; m_Channels[iIndex]->Set_Frame(1, Desc.tagKeyFrame); } - for (_uint i = 0; i < StartFrames.size(); ++i) { // ½ÃÀÛ ÇÁ·¹ÀÓÀ» ÇöÀç º» »óÅ ŰÇÁ·¹ÀÓÀ¸·Î ä¿ì±â + for (_uint i = 0; i < StartFrames.size(); ++i) { // 시작 프레임을 현재 본 상태 키프레임으로 채우기 _int iIndex = StartFrames[i].iSlot; m_Movable[iIndex] = true; m_Channels[iIndex]->Set_Frame(0, StartFrames[i].tagKeyFrame); @@ -101,4 +91,4 @@ void CLerpAnim::Free() m_CurrentKeyFrameIndices.clear(); } -; \ No newline at end of file +; diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 5f1ade52e..a004650a9 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -533,6 +533,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ ID3D11ShaderResourceView* pSRV = nullptr; HRESULT hr = S_OK; + if (!m_SRVs[type].empty()) + continue; + const char* ext = strrchr(szFullPath, '.'); if (ext) { @@ -547,7 +550,6 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ if (FAILED(hr)){ return E_FAIL; } - m_SRVs[type].push_back(pSRV); } } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index d36182e10..1b30573ca 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -149,87 +149,6 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance) return S_OK; } - -HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte) -{ - { // 멤버변수 - if (!ReadFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iVertexStride, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumIndices, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iIndexStride, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumBones, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_eIndexFormat, sizeof(DXGI_FORMAT), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_ePrimitive, sizeof(D3D_PRIMITIVE_TOPOLOGY), &dwByte, nullptr)) { - return E_FAIL; - } - DWORD iSize = {}; - if (!ReadFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr)) { - return E_FAIL; - } - m_BoneIndices.resize(iSize / sizeof(_int)); - if (!ReadFile(hFile, m_BoneIndices.data(), iSize, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr)) { - return E_FAIL; - } - m_offsetMatrices.resize(iSize / sizeof(_float4x4)); - if (!ReadFile(hFile, m_offsetMatrices.data(), iSize, &dwByte, nullptr)) { - DWORD err = GetLastError(); - return E_FAIL; - } - - m_pBoneMatrices = new _float4x4[0 == m_iNumBones ? 1 : m_iNumBones]; - ZeroMemory(m_pBoneMatrices, sizeof(_float4x4) * m_iNumBones); - } - { // Vertex Buffer - HRESULT hr = (m_iVertexStride == sizeof(VTXMESH)) ? - Ready_VertexBuffer_For_NonAnim(hFile, dwByte) : - Ready_VertexBuffer_For_Anim(hFile, dwByte); - } - { // Index Buffer - D3D11_BUFFER_DESC IBDesc{}; - if (!ReadFile(hFile, &IBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - - _uint* pIndices = new _uint[m_iNumIndices]; - ZeroMemory(pIndices, sizeof(_uint) * m_iNumIndices); - - if (!ReadFile(hFile, pIndices, IBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - - D3D11_SUBRESOURCE_DATA InitialIBData{}; - InitialIBData.pSysMem = pIndices; - - if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB))) { - return E_FAIL; - } - - Safe_Delete_Array(pIndices); - } - return S_OK; -} - HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) { strcpy_s(m_szName, _SaveMesh->MeshName.c_str()); @@ -289,65 +208,7 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* #pragma endregion - Create_RawVB(m_RawVertices); - - return S_OK; -} - -HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte) -{ - D3D11_BUFFER_DESC VBDesc{}; - if (!ReadFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - VTXMESH* pVertices = new VTXMESH[m_iNumVertices]{}; - ZeroMemory(pVertices, sizeof(VTXMESH) * m_iNumVertices); - - m_pVertexPositions = new _float3[m_iNumVertices]; - ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); - if (!ReadFile(hFile, pVertices, VBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - for (_uint i = 0; i < m_iNumVertices; ++i) { - m_pVertexPositions[i] = pVertices[i].vPosition; - } - D3D11_SUBRESOURCE_DATA InitialVBData{}; - InitialVBData.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) { - return E_FAIL; - } - - Safe_Delete_Array(pVertices); - - return S_OK; -} - -HRESULT CMesh::Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte) -{ - D3D11_BUFFER_DESC VBDesc{}; - if (!ReadFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - VTXANIMMESH* pVertices = new VTXANIMMESH[m_iNumVertices]{}; - ZeroMemory(pVertices, sizeof(VTXANIMMESH) * m_iNumVertices); - - m_pVertexPositions = new _float3[m_iNumVertices]; - ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); - if (!ReadFile(hFile, pVertices, VBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - for (_uint i = 0; i < m_iNumVertices; ++i) { - m_pVertexPositions[i] = pVertices[i].vPosition; - } - D3D11_SUBRESOURCE_DATA InitialVBData{}; - InitialVBData.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) { - return E_FAIL; - } - - Safe_Delete_Array(pVertices); + //Create_RawVB(m_RawVertices); return S_OK; } @@ -507,20 +368,6 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) return E_FAIL; - - m_RawVertices.resize(m_iNumVertices); - - for (_uint i = 0; i < m_iNumVertices; i++) - { - m_RawVertices[i].vPosition = pVertices[i].vPosition; - m_RawVertices[i].vNormal = pVertices[i].vNormal; - m_RawVertices[i].vTangent = pVertices[i].vTangent; - m_RawVertices[i].vBinormal = pVertices[i].vBinormal; - m_RawVertices[i].vTexcoord = pVertices[i].vTexcoord; - - m_RawVertices[i].vBlendIndex = pVertices[i].vBlendIndex; - m_RawVertices[i].vBlendWeight = pVertices[i].vBlendWeight; - } Safe_Delete_Array(pVertices); @@ -528,61 +375,6 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save } -HRESULT CMesh::Create_RawVB(vector& RawVertices) -{ - m_iRawVertexStride = sizeof(MESH_DESC); - - D3D11_BUFFER_DESC desc{}; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.ByteWidth = m_iRawVertexStride *m_iNumVertices; - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = 0; - desc.StructureByteStride = m_iRawVertexStride; - desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; - - D3D11_SUBRESOURCE_DATA init{}; - init.pSysMem = RawVertices.data(); - - m_pDevice->CreateBuffer(&desc, &init, &m_pVBMesh); - - - return S_OK; -} - - -void CMesh::ComputSkinning(CComputeShader* ComputeShader, ID3D11Buffer* ConstantBuffer) -{ - if (ComputeShader == nullptr) - return; - - _uint iGroupCountX = (m_iNumVertices + 255) / 256; - - ID3D11Buffer* CSBuffers[] = { - m_pVBMesh - }; - - vector OutSubResources = {}; - D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {}; - - OutSubResources = ComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, ConstantBuffer); -} - -void CMesh::FillBoneDesc(const vector<_float4x4>& CombinedMatrices, BONE_DESC* pOut) -{ - for (size_t i = 0; i < m_iNumBones; ++i) - { - const _float4x4& offset = m_offsetMatrices[i]; - const _float4x4& combined = CombinedMatrices[m_BoneIndices[i]]; - - _matrix matOffset = XMLoadFloat4x4(&offset); - _matrix matCombined = XMLoadFloat4x4(&combined); - - XMStoreFloat4x4(&pOut->BoneMatrix[i], matOffset * matCombined); - } -} - - - HRESULT CMesh::Initialize(void* pArg) { return S_OK; @@ -602,80 +394,6 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL return pInstance; } -HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) -{ - { // 멤버변수 - WriteFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iVertexStride, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumIndices, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iIndexStride, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumBones, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_eIndexFormat, sizeof(DXGI_FORMAT), &dwByte, nullptr); - WriteFile(hFile, &m_ePrimitive, sizeof(D3D_PRIMITIVE_TOPOLOGY), &dwByte, nullptr); - - DWORD iSize = (DWORD)(sizeof(_int) * m_BoneIndices.size()); - WriteFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr); - WriteFile(hFile, m_BoneIndices.data(), iSize, &dwByte, nullptr); - - iSize = (DWORD)(sizeof(_float4x4) * m_offsetMatrices.size()); - WriteFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr); - WriteFile(hFile, m_offsetMatrices.data(), iSize, &dwByte, nullptr); - } - { // Vertex Buffer - D3D11_BUFFER_DESC VBDesc{}; - m_pVB->GetDesc(&VBDesc); // 버퍼 디스크립션 저장 - WriteFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr); - - D3D11_BUFFER_DESC StagingDesc{}; - StagingDesc.Usage = D3D11_USAGE_STAGING; - StagingDesc.ByteWidth = VBDesc.ByteWidth; - StagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - StagingDesc.BindFlags = 0; - StagingDesc.MiscFlags = 0; - - ID3D11Buffer* pStaging = nullptr; - if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) { - return E_FAIL; - } - m_pContext->CopyResource(pStaging, m_pVB); // 버퍼 복사 - - D3D11_MAPPED_SUBRESOURCE mapped{}; - m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped); - WriteFile(hFile, mapped.pData, VBDesc.ByteWidth, &dwByte, nullptr); - - m_pContext->Unmap(pStaging, 0); - pStaging->Release(); - } - { // Index Buffer - D3D11_BUFFER_DESC IBDesc{}; - m_pIB->GetDesc(&IBDesc); - WriteFile(hFile, &IBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr); - - D3D11_BUFFER_DESC StagingDesc{}; - StagingDesc.Usage = D3D11_USAGE_STAGING; - StagingDesc.ByteWidth = IBDesc.ByteWidth; - StagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - StagingDesc.BindFlags = 0; - StagingDesc.MiscFlags = 0; - - ID3D11Buffer* pStaging = nullptr; - if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) { - return E_FAIL; - } - m_pContext->CopyResource(pStaging, m_pIB); - - D3D11_MAPPED_SUBRESOURCE mapped{}; - m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped); - WriteFile(hFile, mapped.pData, IBDesc.ByteWidth, &dwByte, nullptr); - - m_pContext->Unmap(pStaging, 0); - pStaging->Release(); - } - return S_OK; -} - PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix) { PSX::PxTriangleMeshDesc tMeshDesc = {}; @@ -848,19 +566,6 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(vector& Bones, const ai } #endif -CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte) -{ - CMesh* pInstance = new CMesh(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CMesh"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) { CMesh* pInstance = new CMesh(pDevice, pContext); @@ -891,7 +596,6 @@ void CMesh::Free() __super::Free(); Safe_Delete_Array(m_pBoneMatrices); - SAFE_RELEASE(m_pVBMesh); } void CMesh::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 6995fb73e..6bd49333b 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -83,45 +83,6 @@ _int CModel::Get_BoneIndex(const _char* pBoneName) const return iBoneIndex; } -void CModel::Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex) -{ - if (false == bIgnoreCurrentIndex && m_iCurrentAnimIndex == iAnimationIndex) { return; } - m_iCurrentAnimIndex = iAnimationIndex; - m_bIsLoop = bIsLoop; - RefreshAnim(); - - m_PrevAnimationMatrix = Get_BoneMatrix(m_iRootBoneIndex); - - - m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); // 애니메이션 종료 이벤트 ( 럴프애님은 자체적으로 불림 ) - vector<_int>* BeforeAnimIndex = m_Animations[m_iCurrentAnimIndex]->Capture_Bones(); // 영향을 받는 본 인덱스 추출 1 - vector<_int>* AfterAnimIndex = m_Animations[iAnimationIndex]->Capture_Bones(); // 영향을 받는 본 인덱스 추출 2 - unordered_set<_int> UnionAnimIndex = {}; - - vector LerpStartFrames; - for (_int i : *BeforeAnimIndex) { - UnionAnimIndex.insert(i); - } - for (_int i : *AfterAnimIndex) { - UnionAnimIndex.insert(i); - } - LerpStartFrames.reserve(UnionAnimIndex.size()); // 영향을 받는 모든 현재 본을 가져옴 - - // 스타팅 키프레임 채우기 pair < 본 인덱스, 키프레임 > - for (auto iter = UnionAnimIndex.begin(); iter != UnionAnimIndex.end(); ++iter) { - LERPDESC desc = {}; - desc.iSlot = *iter; - m_Bones[desc.iSlot]->Get_KeyFrame(desc.tagKeyFrame, true); // 스타팅 키프레임 채우기 - LerpStartFrames.emplace_back(desc); - } - - // 엔딩 키프레임 채우기 pair < 본인덱스, 키프레임 > - vector LerpEndFrames = m_Animations[iAnimationIndex]->Get_StartFrameInformations(); - - // 럴프 애니메이션 시작 - m_pLerpAnim->Begin(m_Bones, LerpStartFrames, LerpEndFrames, fLerpDuration, m_iRootBoneIndex); - -} HRESULT CModel::Bind_Material(_uint iMeshIndex, CShader* pShader) { if (iMeshIndex >= m_iNumMeshes) { @@ -154,13 +115,15 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) return false; // 잘못된 초기화 } + ComputeAnimation(); + if (m_iPreAnimIndex != m_iCurrentAnimIndex && m_iPreAnimIndex != 0) { m_fBlendTime += fTimeDelta; _float fRatio = m_fBlendTime / m_fBlendDuration; fRatio = min(fRatio, 1.f); - m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, pTransform); + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform); m_Animations[m_iCurrentAnimIndex]->InterpAnim(m_Animations[m_iPreAnimIndex], m_Bones, fRatio); if (fRatio >= 1.f) @@ -171,38 +134,20 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) } else { - m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, pTransform); + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform); m_iPreAnimIndex = m_iCurrentAnimIndex; } - for (_int i = 0; i < m_Bones.size(); ++i) + for (auto& pBone : m_Bones) { - m_Bones[i]->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix)); - - if (i == m_iRootBoneIndex) { // 루트본의 매트릭스를 갱신했다면 애니메이션에 맞게 이동량을 루트본에서 트랜스폼으로 보정시킴 - if (true == m_pLerpAnim->IsLerping()) { // 럴프중이었으면 이동량 반영 x - _matrix currAnimMatrix = Get_BoneMatrix(m_iRootBoneIndex); - currAnimMatrix.r[3] = XMVectorSet(0.f, 0.f, 0.f, 1.f); - m_Bones[i]->Set_CombinedTransformationMatrixPtr(currAnimMatrix); - } - else { - _matrix currAnimMatrix = Get_BoneMatrix(m_iRootBoneIndex); // 현재 루트본의 컴바인드 트랜스폼을 꺼내오고 - _matrix deltaAnimMatrix = XMMatrixMultiply(XMMatrixInverse(nullptr, m_PrevAnimationMatrix), currAnimMatrix); // 이전 트랜스폼이랑 비교해서 델타매트릭스를 꺼냄 - _vector momentum = XMMatrixMultiply(deltaAnimMatrix, XMMatrixRotationQuaternion(m_pTransform->Get_QuarternionVector())).r[3]; - deltaAnimMatrix.r[3] = XMVectorSetW(momentum, 0.f); - - m_pTransform->AccumulateMomentum(deltaAnimMatrix.r[3]); // 모체 트랜스폼에 이동량 반영 - //m_pTransform->Set_State(STATE::POSITION, m_pTransform->Get_State(STATE::POSITION) + deltaAnimMatrix.r[3]); - - m_PrevAnimationMatrix = currAnimMatrix; - currAnimMatrix.r[3] = XMVectorSet(0.f, 0.f, 0.f, 1.f); - m_Bones[i]->Set_CombinedTransformationMatrixPtr(currAnimMatrix); // 루트본의 이동량 소거 - } - } + pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix)); } - if(m_bIsFinishedAnim) + if (m_bIsFinishedAnim) + { m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); + m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); + } return m_bIsFinishedAnim; } @@ -222,55 +167,6 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop) m_iCurrentAnimIndex = -1; } -void CModel::Stop_Animation() -{ - if (-1 == m_iCurrentAnimIndex // 정지 혹은 시작을 안시켜준 애님 - || m_iCurrentAnimIndex >= (_int)m_iNumAnimations) // 애님 인덱스 초과됨 - { - return; // 잘못된 초기화 - } - - m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); // 애님이 퇴근할 때 불리는 함수를 부르면서 초기상태로 되돌림 -} - -void CModel::RefreshAnim() -{ - m_bIsFinishedAnim = false; - m_bIsFinishedLerp = false; -} -_float CModel::Get_AnimProgressRatio() -{ - return m_Animations[m_iCurrentAnimIndex]->Get_AnimProgressRatio(); -} -_int CModel::Get_AnimProgressPostion(const _char* pAnimChannelName) -{ - return m_Animations[m_iCurrentAnimIndex]->Get_AnimProgressPostion(pAnimChannelName); -} -_float CModel::Get_AnimEstimatedDuration() -{ - if (MODEL::ANIM == m_eType) { - return m_Animations[m_iCurrentAnimIndex]->Get_AnimEstimatedDuration(); - } - else { - return 0.f; - } - -} -void CModel::Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition) -{ - return m_Animations[m_iCurrentAnimIndex]->Set_AnimProgressPostion(pChannelName, iPosition); -} -void CModel::Set_AnimPauseState(_bool bValue) { - m_Animations[m_iCurrentAnimIndex]->Set_AnimPause(bValue); -} - -void CModel::ReallocateResources(CTransform* pTransform) -{ - SAFE_RELEASE(m_pTransform); - m_pTransform = pTransform; - SAFE_ADDREF(m_pTransform); -} - const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) const { vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool @@ -296,15 +192,6 @@ _matrix CModel::Get_BoneMatrix(_uint iBoneIndex) return m_Bones[iBoneIndex]->Get_CombinedTransformationMatrix(); } -void CModel::Get_BoneMatrices(_float4x4* pOut) -{ - if (0 == m_Bones.size()) { - return; - } - for (_uint i = 0; i < m_Bones.size(); ++i) { - pOut[i] = *m_Bones[i]->Get_CombinedTransformationMatrixPtr(); - } -} void CModel::Set_CurrentTrackPosition(_float TrackPosition) { @@ -321,6 +208,11 @@ _float CModel::Get_CurrentTrackPosition() return m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackPosition(); } +_float CModel::Get_CurrentTrackProgressRatio() +{ + return m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackProgressRatio(); +} + _float CModel::Get_AnimSpeed() { return m_Animations[m_iCurrentAnimIndex]->Get_AnimSpeed(); @@ -331,16 +223,6 @@ void CModel::Set_AnimSpeed(_float fSpeed) m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed); } -void CModel::Set_Anim(CModel* Source) -{ - for (auto& Animations : Source->m_Animations) - { - m_Animations.push_back(Animations); - } - - m_iNumAnimations += (_uint)Source->m_Animations.size(); -} - HRESULT CModel::Render(_uint iMeshIndex) { @@ -902,94 +784,127 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma HRESULT CModel::Create_CS() { - _uint vertexCount = 0; - _uint MaxvertexCount = 0; - for (_uint i = 0; i < m_Meshes.size(); ++i) - { - vertexCount = m_Meshes[i]->Get_Vertex(); - if (MaxvertexCount < vertexCount) - MaxvertexCount = vertexCount; - } - - _uint CS_InputStrides[] = { - sizeof(MESH_DESC) + _uint CS1_InputStrides[] = { + sizeof(KEYFRAME_DESC), + sizeof(CHANNEL_DESC), }; - size_t meshCount = m_Meshes.size(); - - _uint* CS_OutputStrides = new _uint[meshCount]; - - for (size_t i = 0; i < meshCount; i++) - { - CS_OutputStrides[i] = sizeof(SKINNG_MESH_DESC)*(_uint)meshCount; - } + _uint CS1_OutputStrides[] = { + sizeof(LOCALPOS_DESC), + }; - m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, - L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", "CS_MAIN", MaxvertexCount, 1, (_uint)meshCount, CS_InputStrides,CS_OutputStrides); + m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", + "CS_LocalSRT", (_uint)m_Bones.size(), 0, 1, nullptr, CS1_OutputStrides + ); - if (m_pComputeShader == nullptr) + if (!m_pComputeShader) return E_FAIL; - Safe_Delete_Array(CS_OutputStrides); - return S_OK; } -void CModel::ComputeSkinning() +void CModel::Create_Temp() { - Get_BoneMatrix(); - for (_uint i = 0; i < m_iNumMeshes; ++i) + for (auto& anim : m_Animations) { - D3D11_MAPPED_SUBRESOURCE ConstantSubResource{}; - if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, - D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) - { - CMesh::BONE_DESC* pDesc = - static_cast(ConstantSubResource.pData); - - m_Meshes[i]->FillBoneDesc(m_BoneMatrix,pDesc); - - m_pContext->Unmap(m_pConstantBuffer, 0); - } - - m_Meshes[i]->ComputSkinning(m_pComputeShader, m_pConstantBuffer); + anim->CreateGPUData(m_pDevice); } } +void CModel::Create_LocalPosVB() +{ + _uint iCount = (_uint)m_Bones.size(); + _uint iStride = sizeof(LOCALPOS_DESC); + + D3D11_BUFFER_DESC desc = {}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = iStride * iCount; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = iStride; + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + HRESULT hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pLocalPosBuffer); + + return; +} + + void CModel::Create_Con() { D3D11_BUFFER_DESC cbDesc = {}; cbDesc.Usage = D3D11_USAGE_DYNAMIC; cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - cbDesc.ByteWidth = sizeof(BONE_DESC); + cbDesc.ByteWidth = sizeof(ANIMSTATE_DESC); if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) return; } -HRESULT CModel::Bind_CS_Output(_uint Index, _uint iBufferIndex) + +void CModel::UpdateAnimationCS() { - if (m_pComputeShader == nullptr) - return E_FAIL; - - m_pComputeShader->Bind_OutPut_SRV(Index, iBufferIndex); - - return S_OK; -} - -void CModel::Get_BoneMatrix() -{ - m_BoneMatrix.resize(m_Bones.size()); - for (size_t i =0; i < m_Bones.size(); i++) + D3D11_MAPPED_SUBRESOURCE sub{}; + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &sub))) { - m_BoneMatrix[i] = (*m_Bones[i]->Get_CombinedTransformationMatrixPtr()); + ANIMSTATE_DESC* pDesc = (ANIMSTATE_DESC*)sub.pData; + + CAnimation* pAnim = m_Animations[m_iCurrentAnimIndex]; + pDesc->CurrentTime = pAnim->Get_CurrentTrackPosition(); + pDesc->Duration = pAnim->Get_Duration(); + pDesc->Speed = pAnim->Get_AnimSpeed(); + pDesc->BoneCount = (_uint)m_Bones.size(); + pDesc->PreTransformMatrix = m_PreTransformMatrix; + m_pContext->Unmap(m_pConstantBuffer, 0); } } +void CModel::ComputeAnimation() +{ + UpdateAnimationCS(); + + _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; + + CAnimation* pAnim = m_Animations[m_iCurrentAnimIndex]; + ID3D11ShaderResourceView* srvs[2] = { + pAnim->Get_KeyFrameSrv(), + pAnim->Get_ChannelSrv(), + }; + + m_pContext->CSSetShader(m_pComputeShader->Get_Compute(), nullptr, 0); + m_pContext->CSSetConstantBuffers(0, 1, &m_pConstantBuffer); + m_pContext->CSSetShaderResources(0, 2, srvs); + + ID3D11UnorderedAccessView* uavs[1] = { m_pComputeShader->GetOutputUAV(0) }; + m_pContext->CSSetUnorderedAccessViews(0, 1, uavs, nullptr); + + m_pContext->Dispatch(iGroupCountX, 1, 1); + + auto outSubs = m_pComputeShader->ReadBackOutputs(); + m_pLocalPos = static_cast(outSubs[0].pData); +} +HRESULT CModel::Create_ParentVB() +{ + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = (_int)sizeof(PARENT_DESC) * (_uint)m_Bones.size(); + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = (_int)sizeof(PARENT_DESC); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = m_Parent.data(); + + m_pDevice->CreateBuffer(&desc, &init, &m_pParentBuffer); + + + return S_OK; +} HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { m_eType = eType; @@ -1032,7 +947,7 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ return E_FAIL; } - if (FAILED(Ready_Animations())) { + if (FAILED(Ready_Animations(m_Bones))) { return E_FAIL; } return S_OK; @@ -1317,12 +1232,25 @@ HRESULT CModel::Initialize(void* pArg) m_pTransform = m_pOwner->Get_Component(); SAFE_ADDREF(m_pTransform); - /*Create_Con(); + + if (m_eType == MODEL::ANIM) + { + Create_Temp(); + m_Parent.resize(m_Bones.size()); + for (size_t i = 0; i < (_uint)m_Bones.size(); i++) + { + m_Parent[i].ParentIndex = m_Bones[i]->Get_ParentBoneIndex(); + } - if (FAILED(Create_CS())) - return E_FAIL;*/ + if (FAILED(Create_CS())) + return E_FAIL; + Create_Con(); + Create_LocalPosVB(); + Create_ParentVB(); + } + return S_OK; } @@ -1378,13 +1306,13 @@ HRESULT CModel::Ready_Bones(const std::vector& allNodes, _int currentI return S_OK; } -HRESULT CModel::Ready_Animations() +HRESULT CModel::Ready_Animations(const vector& Bones) { m_iNumAnimations = m_pSaveModel->AnimationCount; for (size_t i = 0; i < m_iNumAnimations; i++) { - CAnimation* pAnimation = CAnimation::Create(this, &m_pSaveModel->Animations[i]); + CAnimation* pAnimation = CAnimation::Create(Bones,this, &m_pSaveModel->Animations[i]); if (nullptr == pAnimation) return E_FAIL; @@ -1425,6 +1353,11 @@ void CModel::Free() { __super::Free(); + + SAFE_RELEASE(m_pComputeShader); + SAFE_RELEASE(m_pConstantBuffer); + SAFE_RELEASE(m_pParentBuffer); + SAFE_RELEASE(m_pLocalPosBuffer); for (auto& pAnimation : m_Animations) { SAFE_RELEASE(pAnimation); } @@ -1448,8 +1381,8 @@ void CModel::Free() m_SaveModel.clear(); - SAFE_RELEASE(m_pComputeShader); - SAFE_RELEASE(m_pConstantBuffer); + m_Parent.clear(); + m_AnimRanges.clear(); } void CModel::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 07f23ed5d..b6893b462 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -264,6 +264,9 @@ void CRenderer::Render_Combined() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurXTexture"))) { return; } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X_Weight"), m_pShader, "g_BlurWeightXTexture"))) { + return; + } } @@ -368,13 +371,18 @@ void CRenderer::Render_Blur() return; } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_Weight"), m_pShader, "g_BlurWeightTexture"))) { + return; + } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::BLUR)); m_pVIBuffer->Bind_Resources(); m_pVIBuffer->Render(); - if (FAILED(m_pGameInstance->End_MRT())) { + if (FAILED(m_pGameInstance->End_MRT())) + { return; } @@ -566,23 +574,30 @@ HRESULT CRenderer::Initialize() } /* Target_Blur */ - - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur_Weight"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 1.0f)))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur"), (_uint)Viewport.Width, (_uint)Viewport.Height, DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur_Weight"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 1.0f)))) { + return E_FAIL; + } + + /* Target_Blur_X */ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur_X"), (_uint)Viewport.Width, (_uint)Viewport.Height, DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur_X_Weight"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 1.0f)))) { + return E_FAIL; + } + + + /* Target_Color*/ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Color"), (_uint)Viewport.Width, (_uint)Viewport.Height, DXGI_FORMAT_R32G32B32A32_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { @@ -649,11 +664,20 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur"), TEXT("Target_Blur_Weight")))) { + return E_FAIL; + } + /* MRT_Blur_X */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur_X"), TEXT("Target_Blur_X")))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur_X"), TEXT("Target_Blur_X_Weight")))) { + return E_FAIL; + } + + /* MRT_Color */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Color"), TEXT("Target_Color")))) { return E_FAIL; diff --git a/Jusin154_Team3D/Engine/Private/State.cpp b/Jusin154_Team3D/Engine/Private/State.cpp index 6c1963261..cf51b1604 100644 --- a/Jusin154_Team3D/Engine/Private/State.cpp +++ b/Jusin154_Team3D/Engine/Private/State.cpp @@ -9,32 +9,10 @@ CState::CState() SAFE_ADDREF(m_pGameInstance); } -void CState::Enter() +HRESULT CState::Initialize(STATEDESC* pArg) { -} - -void CState::Update(_float fTimeDelta) -{ -} - -void CState::Exit() -{ -} - -_bool CState::CheckExitState() -{ - return true; -} - -void CState::Set_Owner(CGameObject* pOwner) -{ - m_pOwner = dynamic_cast(pOwner); -}; - -void CState::Set_Component() -{ - m_pModel = m_pOwner->Get_Component(); - m_pFSM = m_pOwner->Get_Component(); + m_pOwner = pArg->pOwner; + return S_OK; } void CState::Free() @@ -42,7 +20,6 @@ void CState::Free() __super::Free(); SAFE_RELEASE(m_pGameInstance); - SAFE_RELEASE(m_pParent); } void CState::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Texture.cpp b/Jusin154_Team3D/Engine/Private/Texture.cpp index 70dfb754f..eb24d45a6 100644 --- a/Jusin154_Team3D/Engine/Private/Texture.cpp +++ b/Jusin154_Team3D/Engine/Private/Texture.cpp @@ -120,6 +120,7 @@ HRESULT CTexture::Load_SRV(const _char* szPath, ID3D11ShaderResourceView** ppSRV hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, ppSRV); } } + return hr; } @@ -142,7 +143,6 @@ HRESULT CTexture::ParseTextureIncrementalToSRVs(_uint iNumTextures, const _tchar if (FAILED(hr)) { return E_FAIL; } - m_SRVs.push_back(pSRV); } return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 34519931f..3c60e0f66 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -112,11 +112,14 @@ _bool CUnit::IsCurrentKeyFrame(_string FrameName) HRESULT CUnit::Ready_Components(void *pArg) { - __super::Ready_Components(pArg); + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } /* Com_FSM */ - if (FAILED(Add_Component(g_iStaticLevel, &m_pFSM))) + if (FAILED(Add_Component(g_iStaticLevel, &m_pFSM))){ return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 5d86dbdad..d96ba3570 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -11,7 +11,7 @@ class ENGINE_DLL CAnimation : public CBase CAnimation(const CAnimation& rhs); virtual ~CAnimation() = default; public: - _bool Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr); + _bool Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr); void ResetRootMotion(); void Depart_Animation(); void Set_AnimPause(_bool bValue) { m_bPause = bValue; } @@ -21,30 +21,43 @@ class ENGINE_DLL CAnimation : public CBase void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition); vector<_int>* Capture_Bones(); void InterpAnim(CAnimation* pPreAnim, vector& Bones, float fRatio); + void CreateGPUData(ID3D11Device* pDevice); vector Get_StartFrameInformations() { return m_StartKeyFrames; } const _string& Get_Name() const { return m_strName; } const _char* Get_SZName() const { return m_szName; } - void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition =TrackPosition; } + void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition = TrackPosition; } _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } + _float Get_CurrentTrackProgressRatio() { return m_fCurrentTrackPosition / m_fDuration; } void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; } _float Get_AnimSpeed() { return m_fAnimSpeed; } + + _uint Get_ChannelCount() { return m_iNumChannels; } + _float Get_Duration() { return m_fDuration; } + + ID3D11Buffer* Get_KeyFrameBuffer() { return m_pKeyFrameBuffer; } + ID3D11Buffer* Get_ChannelBuffer() { return m_pChannelBuffer; } + ID3D11ShaderResourceView* Get_KeyFrameSrv() { return m_pKeyFrameSrv; } + ID3D11ShaderResourceView* Get_ChannelSrv() { return m_pChannelSrv; } #ifdef EDITOR_PROJECT private: HRESULT Initialize(const vector& Bones, const aiAnimation* pAIAnimation); public: - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); static CAnimation* Create(const vector& Bones, const aiAnimation* pAnimation); #endif // EDITOR_PROJECT private: - HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 - HRESULT Initialize(const class CModel* pModel,SaveAnimation* pSaveAnimation); + HRESULT Initialize(const vector& Bones, const class CModel* pModel,SaveAnimation* pSaveAnimation); // HRESULT Combined_Initialize(); _uint Get_BoneIndex(const char* pChannelName); + HRESULT CreateKeyFrameBuffer(ID3D11Device* pDevice, vector keyframe); + HRESULT CreateChannelBuffer(ID3D11Device* pDevice, vector channel); + + + private: SaveAnimation* m_pSaveAnim = { nullptr }; _char m_szName[MAX_PATH] = {}; @@ -63,11 +76,21 @@ class ENGINE_DLL CAnimation : public CBase vector<_int> m_DestBones; // 이 애니메이션에서 영향을 받는 본들의 집합 vector m_StartKeyFrames; // 이 애니메이션의 영향을 받는 본들의 초기값 - vector<_matrix> m_vBoneTransformationMatrix = {}; + vector<_matrix> m_vBoneTransformationMatrix = {}; + + _uint m_iChannelCount; + _uint m_iKeyframeCount; + _uint m_iBoneCount; + vector m_KeyFrameDesc; + vector m_ChannelDesc; + + ID3D11Buffer* m_pKeyFrameBuffer; + ID3D11Buffer* m_pChannelBuffer; + ID3D11ShaderResourceView* m_pKeyFrameSrv = {}; + ID3D11ShaderResourceView* m_pChannelSrv = {}; public: - static CAnimation* Create(HANDLE hFile, DWORD& dwByte); // 바이너리 - static CAnimation* Create(const class CModel* pModel, SaveAnimation* pSaveAnimation); + static CAnimation* Create(const vector& Bones, const class CModel* pModel, SaveAnimation* pSaveAnimation); // CAnimation* Clone(); virtual void Free() override; diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 8543693b8..6343c5043 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -28,14 +28,13 @@ class ENGINE_DLL CBone final : public CBase _float3 Get_LocalPosition(); void Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix); void Set_TransformationMatrix(_fmatrix TransformationMatrix); // 애니메이션에서 현재 로컬 매트릭스를 변경할 때 사용된다 - + _int Get_ParentBoneIndex() { return m_iParentBoneIndex; } private: _char m_szName[MAX_PATH] = {}; // 본의 이름 _float4x4 m_TransformationMatrix = {}; // 본의 현재 로컬 매트릭스 _float4x4 m_CombinedTransformationMatrix = {}; // 본의 루트노드로부터 상대적인 복합매트릭스 ( 부모노드는 PreTranformMatrix와 월드좌표로부터 상대적임 ) _int m_iParentBoneIndex = { -1 }; // 부모본의 인덱스 ( 모델에 있는 본벡터의 인덱스 ) ( 부모는 인덱스 -1 고정 ) _float4x4 m_matInitial = {}; - private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/Camera.h b/Jusin154_Team3D/Engine/Public/Camera.h index 595ab25f9..a055af9ce 100644 --- a/Jusin154_Team3D/Engine/Public/Camera.h +++ b/Jusin154_Team3D/Engine/Public/Camera.h @@ -12,8 +12,19 @@ class ENGINE_DLL CCamera abstract : public CGameObject _float fFovy{}, fNear{}, fFar{}; _uint iPriority = { UINT_MAX }; const _wchar* pCameraKey = { }; - CGameObject* pFollowTarget = { nullptr }; - CGameObject* pLookTarget = { nullptr }; + + // Lerping + CGameObject* pFollowTarget = { nullptr }; + CGameObject* pLookTarget = { nullptr }; + + _bool bEnableTransitionLerp = { false }; + _float2 vTransitionTime = { 0.f, 1.f }; + + _bool bEnableLookLerp = { false }; + _float2 vLookLerpTime = { 0.f, 0.16f }; + + _bool bEnableFollowLerp = { false }; + _float2 vFollowLerpTime = { 0.f, 0.16f }; }CAMERA_DESC; protected: @@ -40,12 +51,21 @@ class ENGINE_DLL CCamera abstract : public CGameObject _float m_fNear = {}; _float m_fFar = {}; - _float m_fTransitionMaxTime = { 1.f }; - _float m_fTransitionCurrentTime = { 0.f }; - + _float2 m_vTransitionTime = { 0.f, 1.f }; + _float2 m_vLookLerpTime = { 0.f, 0.16f }; + _float3 m_vLookPos_Src = { 0.f, 0.f, 1.f }; + _float3 m_vLookPos_Dest = { 0.f, 0.f, 1.f }; + _float2 m_vFollowLerpTime = { 0.f, 0.16f }; + _float3 m_vFollowPos_Src = { 0.f, 0.f, 0.f }; + _float3 m_vFollowPos_Dest = { 0.f, 0.f, 0.f }; _uint m_iPriority = { UINT_MAX }; _bool m_bIsCurrentTransition = { false }; + _bool m_bEnable_TransitionLerp = { false }; + _bool m_bEnable_LookLerp = { false }; + _bool m_bEnable_FollowLerp = { false }; + + _bool m_bActive = { false }; diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 745a95f1c..02626af9f 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -13,13 +13,15 @@ class ENGINE_DLL CChannel : public CBase #ifdef EDITOR_PROJECT private: HRESULT Initialize(const vector& Bones, const aiNodeAnim* pAIChannel); + public: - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); static CChannel* Create(const vector& Bones, const aiNodeAnim* pAIChannel); + void Fill_GPU_Keyframes(vector& outKeyframes); + CHANNEL_DESC Fill_GPU_ChannelDesc(); #endif // EDITOR_PROJECT public: - void Update_TransformationMatirx(const vector& Bones, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex,class CTransform* pTransform=nullptr); + void Update_TransformationMatirx(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex,class CTransform* pTransform=nullptr); _int Get_BoneIndex() { return { m_iBoneIndex }; } void Set_BoneIndex(_int iBoneIndex) { m_iBoneIndex = iBoneIndex; } void ResetRootMotion() { @@ -51,12 +53,11 @@ class ENGINE_DLL CChannel : public CBase _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; _matrix m_BoneTransformationMatrix = {}; - _float m_fPrevYaw = 0.f; - _bool m_bInitialRootRotSaved = {false}; -_float4 m_vInitialRootRot = {}; + _bool m_bInitialRootRotSaved = {false}; + _float4 m_vInitialRootRot = {}; + + vector m_KeyFrameDesc; public: - static CChannel* Create(const vector& Bones, _uint iIndex); // 럴프전용 - static CChannel* Create(HANDLE hFile, DWORD& dwByte); // 바이너리 static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel); // diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index 89980d890..69e66bcff 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -17,6 +17,8 @@ class ENGINE_DLL CComputeShader final : public CBase vector Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr); void Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex); ID3D11ComputeShader* Get_Compute() { return m_pComputeShader; } + ID3D11UnorderedAccessView* GetOutputUAV(_uint iIndex) const; + vector ReadBackOutputs(); private: void Bind_SRV(_uint iIndex); void Bind_UAV(_uint iIndex); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Define.h b/Jusin154_Team3D/Engine/Public/Engine_Define.h index 58bde9156..972d28f49 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Define.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Define.h @@ -17,4 +17,4 @@ static _uint g_iStaticLevel; NS_END -USING(Engine); \ No newline at end of file +USING(Engine); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index d1363daca..9ad49e3c9 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -362,4 +362,42 @@ typedef struct tagOnCollsionInfo }ON_COLLISION_INFO; +typedef struct tagKeyFrameDesc +{ + _float3 vScale; + _float4 vRotation; + _float3 vTranslation; + _float fTrackPosition; + +}KEYFRAME_DESC; + +typedef struct tagChannelDesc +{ + _uint StartIndex; + _uint KeyCount; + _uint BoneIndex; + //_uint Padding; +}CHANNEL_DESC; + + +typedef struct tagParentDesc +{ + _int ParentIndex; +}PARENT_DESC; + +typedef struct tagLocalPos +{ + _float3 Scale; + _float pad0; + _float4 Rotation; + _float3 Translation; + _float pad1; +}LOCALPOS_DESC; + +typedef struct tagBoneDesc +{ + _float4x4 Combined; +}BONE_DESC; + + NS_END diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 4ce544413..a233d1cbc 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -1,15 +1,23 @@ #include "Component.h" NS_BEGIN(FSMSTATE) -enum ESTATE +enum ESTATE : _u64Flag { - ROOT, - IDLE,IDLE_TURN, - MOVE, WALK, FWD, BWD, JOG, SPRINT, - JUMP, - LAND, - DODGE, - COMBAT, LIGHT_ATTACK, CAST, SKILL,SKILL2, + NOT_DEFINE = 0, + IDLE = 1ULL << 0, + MOVE = 1ULL << 1, + WALK = 1ULL << 2, + JOG = 1ULL << 3, + SPRINT = 1ULL << 4, + JUMP = 1ULL << 5, + LAND = 1ULL << 6, + DODGE = 1ULL << 7, + COMBAT = 1ULL << 8, + LIGHT_ATTACK = 1ULL << 9, + CAST = 1ULL << 10, + SKILL = 1ULL << 11, + SKILL2 = 1ULL << 12, + MAPHELP = 1ULL << 13, END }; NS_END @@ -20,33 +28,49 @@ class CState; class ENGINE_DLL CFSM final : public CComponent { +public: + typedef struct tagFSMDesc + { + unordered_map* pStates = { nullptr }; + size_t* pStateMask = { nullptr }; + }FSM_DESC; private: CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CFSM(const CFSM& rhs); virtual ~CFSM() = default; public: - void Add_State(_uint iIndex, CState* state); - void Change_State(_uint iIndex); - void Update(_float fTimeDelta); + void Change_State(size_t iStateMask); + HRESULT Update_State(_float fTimeDelta); - CState* Get_Current() { return m_pCurrent; } - _uint Get_CurrState(); - _uint Get_PrevState(); - void Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent); + CState* Get_PrevState() { return m_pPreviousState; } + size_t Get_PrevStateMask() { return m_iPreviousStateMask; } + + inline void Enable_State(size_t stateMask) { *m_pStateMask |= stateMask; } + inline void Set_State(size_t initialStateMask) { *m_pStateMask = initialStateMask; } + inline void Disable_State(size_t stateMask) { *m_pStateMask &= ~stateMask; } + + inline _bool IsEnable(size_t stateMask) const { return (*m_pStateMask & stateMask) != 0; } + inline _bool IsEnable_Previous(size_t stateMask) const { return (m_iPreviousStateMask & stateMask) != 0; } + + + HRESULT Bind_States(FSM_DESC& Desc); private: - vector m_States; - CState* m_pCurrent = { nullptr }; - CState* m_pPrevious = { nullptr }; + unordered_map* m_pStates = { nullptr }; + size_t* m_pStateMask = { nullptr }; + + size_t m_iPreviousStateMask = { 0 }; + + CState* m_pCurrentState = { nullptr }; + CState* m_pPreviousState = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; - public: static CFSM* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; + virtual CFSM* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; virtual void Free() override; virtual void Describe_Entity() override; }; diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 2a596ee8e..d8acd7623 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -68,7 +68,7 @@ class ENGINE_DLL CGameInstance final : public CBase } template - _string Asset_Description(_uint iLevel, const _char* pComponentName, Engine::CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"") + _string Asset_Description(_uint iLevel, const _char* pComponentName, CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"") { return m_pPrototype_Manager->CPrototype_Manager::Asset_Description(iLevel, pComponentName, ppOut, pDesc, pOwner, wstrGroupName); } diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index 8a9f222d9..cba913440 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -33,56 +33,6 @@ class ENGINE_DLL CInstance_Model final : public CComponent _bool isMoveForward = {}; _float2 vGravity = { 0.f , 9.8f }; - _bool isSinWave = {}; - _float3 vSinMinAmount = { 0.f , 0.f , 0.f}; - _float3 vSinMaxAmount = { 0.f , 0.f , 0.f }; - - _bool isTurn; - _float3 vDeltaAngleMin = {}; - _float3 vDeltaAngleMax = {}; - - _bool isAxisTurn; - _float3 vDeltaAxisAngleMin = {}; - _float3 vDeltaAxisAngleMax = {}; - - _bool isPivotMove = {}; - _float2 vDrag = {}; - _float3 vPivotMin = {}; - _float3 vPivotMax = {}; - - _bool isSizeLerp = {}; - _float3 vDeltaSize = {}; - _float2 vSizeDrag = {}; - - }INSTANCE_DESC; - - typedef struct tagPreInstanceDesc - { - _int iNumInstance = { 1 }; // 인스턴스 개수 - - _bool isLoop = { true }; - _bool isDrop = { false }; - - _float2 vLifeTime = { 1.f , 1.f }; // 라이프 타임 min , max - _float3 vSizeMin = { 1.f, 1.f ,1.f }; // 사이즈 min xyz - _float3 vSizeMax = { 1.f ,1.f ,1.f }; // 사이즈 max xyz - _float3 vRotationAngleMin = {}; // 로테이션 min x y z for angle - _float3 vRotationAngleMax = {};// 로테이션 max x y z for angle - _float2 vRotationSpeed = {}; // 로테이션 스피드 min , max - _float2 vSpeed = {}; // 스피드 min , max - _float3 vCenter = {}; // 센터 위치 - _float3 vRange = {}; // 위치 범위 - - _float2 vMaskingUVMoveTime = { 1.f, 1.f }; - _float2 vDiffuseUVMoveTime = { 1.f, 1.f }; - _float2 vDistortionUVMoveTime = { 1.f , 1.f }; - _float2 vNoiseUVMoveTime = { 1.f ,1.f }; - _float2 vAniTime = { 1.f , 1.f }; - _float2 vAniIndex = {}; - - _bool isMoveForward = {}; - _float2 vGravity = { 0.f , 9.8f }; - _bool isSinWave = {}; _float3 vSinMinAmount = { 0.f , 0.f , 0.f }; _float3 vSinMaxAmount = { 0.f , 0.f , 0.f }; @@ -100,6 +50,64 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float3 vPivotMin = {}; _float3 vPivotMax = {}; + _bool isSizeLerp = {}; + _float3 vDeltaSize = {}; + _float2 vSizeDrag = {}; + + _float2 vDelay = {}; + + }INSTANCE_DESC; + + typedef struct tagPreInstanceDesc + { + _int iNumInstance = { 1 }; // 인스턴스 개수 + + _bool isLoop = { true }; + _bool isDrop = { false }; + + _float2 vLifeTime = { 1.f , 1.f }; // 라이프 타임 min , max + _float3 vSizeMin = { 1.f, 1.f ,1.f }; // 사이즈 min xyz + _float3 vSizeMax = { 1.f ,1.f ,1.f }; // 사이즈 max xyz + _float3 vRotationAngleMin = {}; // 로테이션 min x y z for angle + _float3 vRotationAngleMax = {};// 로테이션 max x y z for angle + _float2 vRotationSpeed = {}; // 로테이션 스피드 min , max + _float2 vSpeed = {}; // 스피드 min , max + _float3 vCenter = {}; // 센터 위치 + _float3 vRange = {}; // 위치 범위 + + _float2 vMaskingUVMoveTime = { 1.f, 1.f }; + _float2 vDiffuseUVMoveTime = { 1.f, 1.f }; + _float2 vDistortionUVMoveTime = { 1.f , 1.f }; + _float2 vNoiseUVMoveTime = { 1.f ,1.f }; + _float2 vAniTime = { 1.f , 1.f }; + _float2 vAniIndex = {}; + + _bool isMoveForward = {}; + _float2 vGravity = { 0.f , 9.8f }; + + _bool isSinWave = {}; + _float3 vSinMinAmount = { 0.f , 0.f , 0.f }; + _float3 vSinMaxAmount = { 0.f , 0.f , 0.f }; + + _bool isTurn = {}; + _float3 vDeltaAngleMin = {}; + _float3 vDeltaAngleMax = {}; + + _bool isAxisTurn = {}; + _float3 vDeltaAxisAngleMin = {}; + _float3 vDeltaAxisAngleMax = {}; + + _bool isPivotMove = {}; + _float2 vDrag = {}; + _float3 vPivotMin = {}; + _float3 vPivotMax = {}; + + _bool isSizeLerp = {}; + _float3 vDeltaSize = {}; + _float2 vSizeDrag = {}; + + _float2 vDelay = {}; + }PRE_INSTANCE_DESC; typedef struct tagCSParticleDesc @@ -147,12 +155,13 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float3 vDeltaAngle = {}; _float3 vDeltaAxisAngle = {}; - _float fDrag; + _float fDrag = {}; _float3 vPivot = {}; _float fSizeDrag = {}; _float3 vDeltaSize = {}; + _float2 vDelay = {}; }CS_PARTICLE_VALUE_DESC; @@ -213,9 +222,9 @@ class ENGINE_DLL CInstance_Model final : public CComponent ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // 컴퓨트 쉐이드 두번째 버퍼 (스피드, 로테이션) public: -#ifdef EDITOR_PROJECT + //인스턴싱으로 바꾸기 static CInstance_Model* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); -#endif + virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr); virtual void Free() override; void Describe_Entity() override; diff --git a/Jusin154_Team3D/Engine/Public/Light.h b/Jusin154_Team3D/Engine/Public/Light.h index ea5877295..00cb49bb3 100644 --- a/Jusin154_Team3D/Engine/Public/Light.h +++ b/Jusin154_Team3D/Engine/Public/Light.h @@ -13,7 +13,7 @@ class ENGINE_DLL CLight final : public CComponent public: _bool operator==(const CLight& rhs) const; - _bool operator==(const Engine::LIGHT_DESC& rhs) const; + _bool operator==(const LIGHT_DESC& rhs) const; public: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 9c88c1dfb..a1c0a5b89 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -6,36 +6,6 @@ NS_BEGIN(Engine) class ENGINE_DLL CMesh final : public CVIBuffer { -public: - typedef struct tagMeshDesc - { - _float3 vPosition = {}; - _float3 vNormal = {}; - _float3 vTangent = {}; - _float3 vBinormal = {}; - _float2 vTexcoord = {}; - - XMUINT4 vBlendIndex = {}; - _float4 vBlendWeight = {}; - - }MESH_DESC; - - typedef struct tagSkinngMeshDesc - { - _float3 vPosition = {}; - _float3 vNormal = {}; - _float3 vTangent = {}; - _float3 vBinormal = {}; - _float2 vTexcoord = {}; - - }SKINNG_MESH_DESC; - - typedef struct tagBoneDesc - { - _float4x4 BoneMatrix[512]; - }BONE_DESC; - - private: CMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CMesh(const CMesh& rhs); @@ -50,6 +20,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Bind_BoneMatrices(const vector& Bones, class CShader* pShader, const _char* pConstantName); HRESULT Bind_BoneMatrices(_float4x4* pCombinedMatrices, class CShader* pShader, const _char* pConstantName); HRESULT Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); + #ifdef EDITOR_PROJECT private: virtual HRESULT Initialize_Prototype(MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); @@ -57,7 +28,6 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Ready_VertexBuffer_For_Anim(vector& Bones, const aiMesh* pAIMesh); public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix); #endif // EDITOR_PROJECT @@ -66,22 +36,15 @@ class ENGINE_DLL CMesh final : public CVIBuffer virtual HRESULT Bind_Resources_Instance(ID3D11Buffer* pVBInstance, _uint iInstanceStride, _uint iBufferCount); virtual HRESULT Render_Instance(_uint iNumInstance); - void ComputSkinning(class CComputeShader* ComputeShader, ID3D11Buffer* ConstantBuffer); - - void FillBoneDesc(const vector<_float4x4>& CombinedMatrices, BONE_DESC* pOut); - _uint Get_Vertex() { return m_iNumVertices; } private: - virtual HRESULT Initialize_Prototype(HANDLE hFile, DWORD& dwByte); virtual HRESULT Initialize(void* pArg) override; - HRESULT Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte); - HRESULT Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte); // 바이너리 virtual HRESULT Initialize_Prototype(MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, SaveMesh* _SaveMesh); - HRESULT Create_RawVB(vector& RawVertices); + // private: @@ -93,25 +56,18 @@ class ENGINE_DLL CMesh final : public CVIBuffer vector<_int> m_BoneIndices; _float4x4* m_pBoneMatrices = { nullptr }; vector<_float4x4> m_offsetMatrices; + // 바이너리 std::vector<_uint> m_Indices; std::vector<_float3> m_Vertices; // private: - MESH_DESC m_MeshDesc = {}; - BONE_DESC m_BoneDesc = {}; _uint m_iNumBuffer = {}; _uint m_iNumMeshes = {}; _int m_iRootBoneIndex = { -1 }; - _int m_iRawVertexStride = {}; - - vector m_RawVertices; - - ID3D11Buffer* m_pVBMesh = { nullptr }; public: - static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte); // 바이너리 static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); // diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 1bfe26d31..11b773bc0 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -7,32 +7,15 @@ NS_BEGIN(Engine) class ENGINE_DLL CModel final : public CComponent { public: - typedef struct tagMeshDesc + typedef struct tagAnimStateDesc { - _float3 vPosition = {}; - _float3 vNormal = {}; - _float3 vTangent = {}; - _float3 vBinormal = {}; - _float2 vTexcoord = {}; + _float CurrentTime; + _float Duration; + _float Speed; + _int BoneCount; + _float4x4 PreTransformMatrix; - XMUINT4 vBlendIndex = {}; - _float4 vBlendWeight = {}; - }MESH_DESC; - - typedef struct tagSkinngMeshDesc - { - _float3 vPosition = {}; - _float3 vNormal = {}; - _float3 vTangent = {}; - _float3 vBinormal = {}; - _float2 vTexcoord = {}; - - }SKINNG_MESH_DESC; - - typedef struct tagBoneDesc - { - _float4x4 BoneMatrix[512]; - }BONE_DESC; + }ANIMSTATE_DESC; private: CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -41,7 +24,6 @@ class ENGINE_DLL CModel final : public CComponent public: #pragma region Model - MODEL Get_Type() const { return m_eType; } _float Get_Radius() const { return m_fRadius; } _float3& Get_RadiusOffset() { return m_vRadiusOffset; } _float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; } @@ -50,24 +32,15 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); #pragma endregion #pragma region Animation - void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // 애니메이션을 다른 인덱스로 변경함 _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 - void RefreshAnim(); // 애님을 현재 애님의 초기상태로 되돌림 void Set_AnimationIndex(_uint iIndex, _bool isLoop = true); - void Stop_Animation(); // 애니메이션을 정지 (초기상태로) - void Set_Anim(CModel* Source); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } - _bool IsFinishedLerp() const { return m_bIsFinishedLerp; } - _float Get_AnimProgressRatio(); - _int Get_AnimProgressPostion(const _char* pAnimChannelName); - _float Get_AnimEstimatedDuration(); - void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition); - void Set_AnimPauseState(_bool bValue);// 애님을 현재상태로 정지 - void ReallocateResources(class CTransform* pTransform = nullptr); // 애님 이동의 대상 트랜스폼(이동시켜야할 트랜스폼)을 재지정함 - void Set_CurrentTrackPosition(_float TrackPosition); + void Set_CurrentTrackPosition(_float TrackPosition); const _char* Get_AnimList(_uint iIndex); - size_t Get_AnimSize() { return m_Animations.size(); } _float Get_CurrentTrackPosition(); + _float Get_CurrentTrackProgressRatio(); + + size_t Get_AnimSize() { return m_Animations.size(); } void Set_PlayAnim(_bool bPlayAnim) { m_bPlayAnim = bPlayAnim; } _bool Get_PlayAnim() const { return m_bPlayAnim; } _int Get_AnimIndex() const { return m_iCurrentAnimIndex; } @@ -80,11 +53,7 @@ class ENGINE_DLL CModel final : public CComponent #pragma endregion #pragma region Bone HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); - void Get_BoneMatrices(_float4x4* pOut); - _uint Get_BonesNum() const { return (_uint)m_Bones.size(); } const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; - _int Get_RootBoneIndex() const { return m_iRootBoneIndex; } - void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; } static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); @@ -94,10 +63,8 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader); #pragma endregion - void ComputeSkinning(); - void Create_Con(); - HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); - void Get_BoneMatrix(); + + void ComputeAnimation(); public: #ifdef EDITOR_PROJECT @@ -166,16 +133,30 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / vector<_float4x4> m_BoneMatrix; + +#pragma region Compute + private: - HRESULT Create_CS(); + HRESULT Create_ParentVB(); + HRESULT Create_CS(); + void Create_Temp(); + void Create_LocalPosVB(); + void Create_Con(); + void UpdateAnimationCS(); + _uint m_iNumBuffer = {}; - MESH_DESC m_MeshDesc = {}; - BONE_DESC m_BoneDesc = {}; - _uint m_iNumBuffer = {}; + vector m_Parent = {}; + vector m_AnimRanges; - class CComputeShader* m_pComputeShader = {}; - ID3D11Buffer* m_pConstantBuffer = { nullptr }; - _uint AccumulatedVertexCount = {}; + LOCALPOS_DESC* m_pLocalPos = { nullptr }; + + class CComputeShader* m_pComputeShader = nullptr; + + ID3D11Buffer* m_pConstantBuffer = { nullptr }; + + ID3D11Buffer* m_pParentBuffer = { nullptr }; + ID3D11Buffer* m_pLocalPosBuffer = { nullptr }; +#pragma endregion private: // 바이너리 @@ -191,7 +172,7 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / HRESULT Ready_Meshes(); HRESULT Ready_Materials(const _char* pModelFilePath); HRESULT Ready_Bones(const std::vector& allNodes, _int currentIndex, _int parentIndex); - HRESULT Ready_Animations(); + HRESULT Ready_Animations(const vector& Bones); // public: diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index 50ad36e03..250c0ada6 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -37,7 +37,7 @@ class CMyTools { return XMVectorSet(r, g, b, a); } #pragma endregion - +#pragma region String // wstring --> string 변환 static _string ToString(const _wstring& var) { @@ -64,6 +64,16 @@ class CMyTools { return wstrTo; } + // source에 keyword가 있는지 검사 + static _bool ContainsString(const char* source, const char* keyword) { + if (!source || !keyword || *keyword == '\0') { + return false; + } + return (strstr(source, keyword) != nullptr); + } + +#pragma endregion +#pragma region Mathematics // ratio로 현재 value 가져오기 static _float Lerp_f1D(_float fA, _float fB, _float fRatio) { @@ -76,7 +86,6 @@ class CMyTools { if (fA == fB) return 0.0f; return (fValue - fA) / (fB - fA); } - // A -> B, A- >C의 외적이 업벡터 방향으로 외적되도록 B C를 교정 static void CorrectTriangleToUpHead(_float3& dotA, _float3& dotB, _float3& dotC) { @@ -89,7 +98,7 @@ class CMyTools { } } - // dx9에 있던 그거 + // dx9에 있던 IntersectTri static _bool IntersectTri( const _fvector& vPos, const _fvector& vDir, const _fvector& vertexA, const _gvector& vertexB, const _hvector& vertexC, @@ -116,24 +125,12 @@ class CMyTools { return t >= 0.f; } - // source에 keyword가 있는지 검사 - static _bool ContainsString(const char* source, const char* keyword) { - if (!source || !keyword || *keyword == '\0') { - return false; - } - return (strstr(source, keyword) != nullptr); - } - // 매트릭스 럴프 static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0 _In_ _float4x4* pMatTarget, // Target -> 1 _Out_ _float4x4& matOut, _float fRatio) { - if (0.f > fRatio) { - fRatio = 0.f; - } - if (1.f < fRatio) { - fRatio = 1.f; - } + fRatio = Saturate(fRatio); + _vector vTargetScale{}, vTargetRotq{}, vTargetTrans{}; _vector vOriginScale{}, vOriginRotq{}, vOriginTrans{}; XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, XMLoadFloat4x4(pMatTarget)); @@ -154,7 +151,7 @@ class CMyTools { return XMVectorGetX(XMVector3Dot(vNormalA, vNormalB)); } - // hlsl에 있는 Saturate 그거임 + // hlsl에 있는 Saturate static _float Saturate(_float fValue) { if (fValue > 1.f) { fValue = 1.f; @@ -178,9 +175,10 @@ class CMyTools { return fRadian; } + // 입력라디안에서 출력라디안까지 로테이션 스피드만큼 돌려주고 보정해서 SrcRadian에 넣어줌 inline static void RotateRadianTowards(_float& fSrcRadian, const _float& fDstRadian, _float fRotateSpeed) { - _float fDiffRadian = fmodf(fSrcRadian - fDstRadian, 2 * XM_PI); - if (fDiffRadian < 0) fDiffRadian += 2 * XM_PI; + _float fDiffRadian = fmodf(fSrcRadian - fDstRadian, XM_2PI); + if (fDiffRadian < 0) fDiffRadian += XM_2PI; if (fDiffRadian < (fRotateSpeed * XM_PI) / 180.f) { fSrcRadian = fDstRadian; @@ -194,6 +192,16 @@ class CMyTools { } } + inline static _float Get_Direction2D(_float2 fOrigianlDir, _float2 fInputDir) { + _vector vOriginal = XMVector2Normalize(XMLoadFloat2(&fOrigianlDir)); + _vector vInput = XMVector2Normalize(XMLoadFloat2(&fInputDir)); + + _float fDiffAngle = XMVectorGetX(XMVector2AngleBetweenNormals(vOriginal, vInput)); + _float fCross = XMVectorGetZ(XMVector2Cross(vOriginal, vInput)); + + return fDiffAngle * (fCross < 0 ? -1.f : 1.f); + } +#pragma endregion #pragma region FileSystem //static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive, // /* 탐색할 폴더 경로 */ _In_ const _wstring& TargetPath, diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h index f08a7ef67..cd512f1aa 100644 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h +++ b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h @@ -1,10 +1,7 @@ #pragma once #include "Base.h" -NS_BEGIN(PSX) -class PxControllerBehaviorCallback; -class PxUserControllerHitReport; -NS_END + class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback { diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h index 198023d22..4d3031fb7 100644 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h +++ b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h @@ -1,10 +1,7 @@ #pragma once #include "Base.h" -NS_BEGIN(PSX) -class PxControllerBehaviorCallback; -class PxUserControllerHitReport; -NS_END + class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport { diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index 9b2949287..fb03c9f6d 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -77,7 +77,7 @@ class CPrototype_Manager final : public CBase //만들고 선택할 시에 내 ppOut에 클론하는 기능을 담당 template - _string Asset_Description(_uint iLevel, const _char* pComponentName, Engine::CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"") + _string Asset_Description(_uint iLevel, const _char* pComponentName, CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"") { vector pComponentNames = {}; vector<_string> strNames = {}; diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index b7007ca27..c0f6390d2 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -1,11 +1,6 @@ #pragma once #include "Component.h" -NS_BEGIN(PSX) -class PxActor; -class PxMaterial; -NS_END - NS_BEGIN(Engine) class CTransform; class CMesh; diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 477012e87..246971a8d 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -13,6 +13,7 @@ enum ESTATE LAND, DODGE, COMBAT, LIGHT_ATTACK, CAST, SKILL, SKILL2, + MAPHELP, END }; NS_END @@ -22,35 +23,33 @@ class CUnit; class CModel; class CFSM; class CGameInstance; + class ENGINE_DLL CState abstract : public CBase { +protected: + typedef struct tagStateDesc { + class CUnit* pOwner = { nullptr }; + }STATEDESC; + protected: CState(); virtual ~CState() = default; public: - virtual void Enter(); - virtual void Update(_float fTimeDelta); - virtual void Exit(); - virtual _bool CheckExitState(); - void Set_Owner(class CGameObject* pOwner); - virtual void Set_Component(); + virtual void Enter()PURE; + virtual HRESULT Update(_float fTimeDelta)PURE; + virtual void Exit()PURE; - void Set_State(_uint State) { m_eState = State; } - _uint Get_State() { return m_eState; } - void Set_Parent(CState* State) { m_pParent = State; } - CState* Get_Parent() { return m_pParent; } protected: - CUnit* m_pOwner = { nullptr }; + class CUnit* m_pOwner = { nullptr }; CModel* m_pModel = { nullptr }; CFSM* m_pFSM = { nullptr }; - CState* m_pParent = { nullptr }; CGameInstance* m_pGameInstance = { nullptr }; - _uint m_eState = {}; +protected: + HRESULT Initialize(STATEDESC* pArg); - -public: +protected: virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index ed63ed5b1..23e920805 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -4,9 +4,6 @@ #include "ContainerObject.h" NS_BEGIN(Engine) -class CShader; -class CModel; -class CFSM; class ENGINE_DLL CUnit abstract : public CContainerObject { diff --git a/Jusin154_Team3D/Update_Shaders.bat b/Jusin154_Team3D/Update_Shaders.bat index 78631b8bb..3549957f7 100644 --- a/Jusin154_Team3D/Update_Shaders.bat +++ b/Jusin154_Team3D/Update_Shaders.bat @@ -1,4 +1,4 @@  -robocopy ".\Editor\Bin\Resources\ShaderFiles\" ".\Client\Bin\Resources\ShaderFiles\" /MIR /FFT /NDL /NFL /R:0 /W:0 /ETA +robocopy ".\Editor\Bin\Resources\ShaderFiles" ".\Client\Bin\Resources\ShaderFiles" /MIR /FFT /NDL /NFL /R:0 /W:0 /ETA IF %ERRORLEVEL% LEQ 4 EXIT /B 0 -pause \ No newline at end of file +pause