From 9e38662cb672f6c968d21f11212285f8991874fc Mon Sep 17 00:00:00 2001 From: hyunbin14 Date: Fri, 21 Nov 2025 22:04:00 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=EC=9E=84=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShaderFiles/Shader_VtxAnimMesh.hlsl | 72 +++---- Jusin154_Team3D/Client/Private/Broom.cpp | 8 +- Jusin154_Team3D/Client/Private/Player.cpp | 5 - .../ShaderFiles/Shader_Mesh_Compute.hlsl | 150 +++++++++++---- .../ShaderFiles/Shader_VtxAnimMesh.hlsl | 74 +++----- Jusin154_Team3D/Editor/Private/Goblin.cpp | 5 - Jusin154_Team3D/Editor/Private/Player.cpp | 4 - .../ShaderFiles/Shader_Mesh_Compute.hlsl | 150 +++++++++++---- Jusin154_Team3D/Engine/Private/Animation.cpp | 20 ++ Jusin154_Team3D/Engine/Private/Channel.cpp | 11 ++ Jusin154_Team3D/Engine/Private/Mesh.cpp | 72 +------ Jusin154_Team3D/Engine/Private/Model.cpp | 179 +++++++++++------- Jusin154_Team3D/Engine/Public/Animation.h | 11 ++ Jusin154_Team3D/Engine/Public/Bone.h | 5 +- Jusin154_Team3D/Engine/Public/Channel.h | 6 +- Jusin154_Team3D/Engine/Public/Engine_Struct.h | 23 +++ Jusin154_Team3D/Engine/Public/Mesh.h | 43 +---- Jusin154_Team3D/Engine/Public/Model.h | 45 ++--- 18 files changed, 478 insertions(+), 405 deletions(-) diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index e0fd8e188..75d469253 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -1,17 +1,6 @@ #include "Engine_Shader_Defines.hlsli" -struct SkinngMesh -{ - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; -}; - - - matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; bool g_bRimLight; @@ -25,13 +14,11 @@ 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); - -StructuredBuffer g_SkinngMesh : register(t5); +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_DAOTexture; +Texture2D g_THVTexture; +Texture2D g_SurfaceParamsTexture; float3 g_RootColor; float3 g_TipColor; @@ -67,31 +54,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 +81,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 +105,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 +200,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/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/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 1c099c8b4..15822f9ac 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -83,8 +83,6 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); - Key_Input(fTimeDelta); m_pFSM->Update(fTimeDelta); @@ -124,9 +122,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; } 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..271d90fd9 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,134 @@ 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 BoneInfo { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; + int ParentIndex; +}; + +struct BoneMatrix +{ + row_major float4x4 LocalMatrix; + row_major float4x4 CombinedMatrix; }; -StructuredBuffer g_MeshBufferInput : register(t0); -RWStructuredBuffer gSkinngMeshOutput : register(u0); +StructuredBuffer g_KeyFrameBufferInput : register(t0); +StructuredBuffer g_BoneInoBufferInput : register(t1); + +RWStructuredBuffer gBoneMatrixOutput : register(u0); cbuffer g_ConstantBuffer : register(b0) { - row_major float4x4 BoneMatrix[512]; + float CurrentTime; + float Duration; + float Speed; + int BoneCount; + + float4x4 PreTransformMatrix; + }; -//[numthreads(256, 1, 1)] +float4x4 QuatToMatrix(float4 q) +{ + float x = q.x; + float y = q.y; + float z = q.z; + float w = q.w; + + float xx = x * x; + float yy = y * y; + float zz = z * z; + + float xy = x * y; + float xz = x * z; + float yz = y * z; + float wx = w * x; + float wy = w * y; + float wz = w * z; + + float4x4 m; + + m[0][0] = 1.0 - 2.0 * (yy + zz); + m[0][1] = 2.0 * (xy + wz); + m[0][2] = 2.0 * (xz - wy); + m[0][3] = 0.0; + + m[1][0] = 2.0 * (xy - wz); + m[1][1] = 1.0 - 2.0 * (xx + zz); + m[1][2] = 2.0 * (yz + wx); + m[1][3] = 0.0; + + m[2][0] = 2.0 * (xz + wy); + m[2][1] = 2.0 * (yz - wx); + m[2][2] = 1.0 - 2.0 * (xx + yy); + m[2][3] = 0.0; + + m[3][0] = 0.0; + m[3][1] = 0.0; + m[3][2] = 0.0; + m[3][3] = 1.0; + + return m; +} + +float4x4 MakeTRS(float3 scale, float4 rot, float3 trans) +{ + float4x4 S = + { + scale.x, 0, 0, 0, + 0, scale.y, 0, 0, + 0, 0, scale.z, 0, + 0, 0, 0, 1 + }; + + float4x4 R = QuatToMatrix(normalize(rot)); + + float4x4 T = + { + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + trans.x, trans.y, trans.z, 1 + }; + + return mul(S, mul(R, T)); +} + [numthreads(256, 1, 1)] void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) { - uint iIndex = DispatchThreadID.x; + uint boneIndex = DispatchThreadID.x; + if (boneIndex >= BoneCount) + return; - Mesh mesh = g_MeshBufferInput[iIndex]; + KeyFrame k = g_KeyFrameBufferInput[boneIndex]; + BoneInfo bi = g_BoneInoBufferInput[boneIndex]; - float fWeightW = 1.f - - (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + float3 s = k.vScale; + float4 r = k.vRotation; + float3 t = k.vTranslation; - 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; + float4x4 local = MakeTRS(s, r, 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); + float4x4 combined; + if (bi.ParentIndex < 0) + { + combined = mul(local, PreTransformMatrix); + } + else + { + combined = mul(local, gBoneMatrixOutput[bi.ParentIndex].CombinedMatrix); + } - 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; + gBoneMatrixOutput[boneIndex].LocalMatrix = local; + gBoneMatrixOutput[boneIndex].CombinedMatrix = combined; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index e0fd8e188..9656a2d6d 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,11 @@ 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); - -StructuredBuffer g_SkinngMesh : register(t5); +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_DAOTexture; +Texture2D g_THVTexture; +Texture2D g_SurfaceParamsTexture; float3 g_RootColor; float3 g_TipColor; @@ -67,31 +54,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 +81,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 +105,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 +200,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/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/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index fe0ae3ece..c75a9a409 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -75,8 +75,6 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); - Key_Input(fTimeDelta); m_pFSM->Update(fTimeDelta); @@ -114,8 +112,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; 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..271d90fd9 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,134 @@ 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 BoneInfo { - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; + int ParentIndex; +}; + +struct BoneMatrix +{ + row_major float4x4 LocalMatrix; + row_major float4x4 CombinedMatrix; }; -StructuredBuffer g_MeshBufferInput : register(t0); -RWStructuredBuffer gSkinngMeshOutput : register(u0); +StructuredBuffer g_KeyFrameBufferInput : register(t0); +StructuredBuffer g_BoneInoBufferInput : register(t1); + +RWStructuredBuffer gBoneMatrixOutput : register(u0); cbuffer g_ConstantBuffer : register(b0) { - row_major float4x4 BoneMatrix[512]; + float CurrentTime; + float Duration; + float Speed; + int BoneCount; + + float4x4 PreTransformMatrix; + }; -//[numthreads(256, 1, 1)] +float4x4 QuatToMatrix(float4 q) +{ + float x = q.x; + float y = q.y; + float z = q.z; + float w = q.w; + + float xx = x * x; + float yy = y * y; + float zz = z * z; + + float xy = x * y; + float xz = x * z; + float yz = y * z; + float wx = w * x; + float wy = w * y; + float wz = w * z; + + float4x4 m; + + m[0][0] = 1.0 - 2.0 * (yy + zz); + m[0][1] = 2.0 * (xy + wz); + m[0][2] = 2.0 * (xz - wy); + m[0][3] = 0.0; + + m[1][0] = 2.0 * (xy - wz); + m[1][1] = 1.0 - 2.0 * (xx + zz); + m[1][2] = 2.0 * (yz + wx); + m[1][3] = 0.0; + + m[2][0] = 2.0 * (xz + wy); + m[2][1] = 2.0 * (yz - wx); + m[2][2] = 1.0 - 2.0 * (xx + yy); + m[2][3] = 0.0; + + m[3][0] = 0.0; + m[3][1] = 0.0; + m[3][2] = 0.0; + m[3][3] = 1.0; + + return m; +} + +float4x4 MakeTRS(float3 scale, float4 rot, float3 trans) +{ + float4x4 S = + { + scale.x, 0, 0, 0, + 0, scale.y, 0, 0, + 0, 0, scale.z, 0, + 0, 0, 0, 1 + }; + + float4x4 R = QuatToMatrix(normalize(rot)); + + float4x4 T = + { + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + trans.x, trans.y, trans.z, 1 + }; + + return mul(S, mul(R, T)); +} + [numthreads(256, 1, 1)] void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) { - uint iIndex = DispatchThreadID.x; + uint boneIndex = DispatchThreadID.x; + if (boneIndex >= BoneCount) + return; - Mesh mesh = g_MeshBufferInput[iIndex]; + KeyFrame k = g_KeyFrameBufferInput[boneIndex]; + BoneInfo bi = g_BoneInoBufferInput[boneIndex]; - float fWeightW = 1.f - - (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + float3 s = k.vScale; + float4 r = k.vRotation; + float3 t = k.vTranslation; - 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; + float4x4 local = MakeTRS(s, r, 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); + float4x4 combined; + if (bi.ParentIndex < 0) + { + combined = mul(local, PreTransformMatrix); + } + else + { + combined = mul(local, gBoneMatrixOutput[bi.ParentIndex].CombinedMatrix); + } - 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; + gBoneMatrixOutput[boneIndex].LocalMatrix = local; + gBoneMatrixOutput[boneIndex].CombinedMatrix = combined; } diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 91a1376ef..4d7d644fe 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -187,6 +187,24 @@ void CAnimation::InterpAnim(CAnimation* pPreAnim, vector& Bones, float f #ifdef EDITOR_PROJECT +void CAnimation::Set_KeyFrameDesc() +{ + for (auto& Channel : m_Channels) + { + m_KeyFrame.push_back(Channel->Get_KeyFrameDesc()); + } +} + +_uint CAnimation::Get_KeyFrameCount() +{ + for (auto& Channel : m_Channels) + { + m_KeyCount+=Channel->Get_KeyFrameCount(); + } + + return m_KeyCount; +} + HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { m_strName = pAIAnimation->mName.data; @@ -216,6 +234,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) diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index b60d9c6a1..92c014004 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -54,6 +54,12 @@ HRESULT CChannel::Initialize(const vector& Bones, const aiNodeAnim* pAIC KeyFrame.vRotation = vRotation; KeyFrame.vTranslation = vTranslation; + + m_KeyFrame.fTrackPosition = KeyFrame.fTrackPosition; + m_KeyFrame.vScale = vScale; + m_KeyFrame.vRotation = vRotation; + m_KeyFrame.vTranslation = vTranslation; + m_KeyFrames.push_back(KeyFrame); } @@ -301,6 +307,11 @@ HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) KeyFrame.vRotation = vRotation; KeyFrame.vTranslation = vTranslation; + m_KeyFrame.fTrackPosition = KeyFrame.fTrackPosition; + m_KeyFrame.vScale = vScale; + m_KeyFrame.vRotation = vRotation; + m_KeyFrame.vTranslation = vTranslation; + m_KeyFrames.push_back(KeyFrame); } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index d36182e10..4b950894a 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -289,7 +289,7 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* #pragma endregion - Create_RawVB(m_RawVertices); + //Create_RawVB(m_RawVertices); return S_OK; } @@ -507,20 +507,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 +514,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; @@ -891,7 +822,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 2d56dda70..98b99eab2 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -175,30 +175,9 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* 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) @@ -902,73 +881,39 @@ 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) + sizeof(KEYFRAME_DESC), + sizeof(BONEINFO_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 CS_OutputStrides[] = { + sizeof(BONE_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); + L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", "CS_MAIN",(_uint)m_Bones.size(), 2, 1, CS_InputStrides, CS_OutputStrides); if (m_pComputeShader == nullptr) return E_FAIL; - Safe_Delete_Array(CS_OutputStrides); - return S_OK; } -void CModel::ComputeSkinning() -{ - Get_BoneMatrix(); - for (_uint i = 0; i < m_iNumMeshes; ++i) - { - 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); - } -} - 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) { if (m_pComputeShader == nullptr) @@ -979,6 +924,92 @@ HRESULT CModel::Bind_CS_Output(_uint Index, _uint iBufferIndex) return S_OK; } +void CModel::UpdateAnimationCS() +{ + D3D11_MAPPED_SUBRESOURCE sub{}; + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &sub))) + { + 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; + + ID3D11Buffer* inputs[2] = { + m_pKeyFrameBuffer, + m_pBoneInfoBuffer + }; + + vector OutSubResources = {}; + D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {}; + + OutSubResources = m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), inputs, m_pConstantBuffer); +} + + +HRESULT CModel::Create_KeyFrameVB() +{ + for (_uint i = 0; i < (_uint)m_Animations[m_iCurrentAnimIndex]->Get_KeyCount(); i++) + { + m_KeyFrame.push_back(m_Animations[m_iCurrentAnimIndex]->Get_KeyFrameDesc(i)); + } + + + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = (_int)sizeof(KEYFRAME_DESC) * m_Animations[m_iCurrentAnimIndex]->Get_KeyFrameCount(); + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = (_int)sizeof(KEYFRAME_DESC); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = m_KeyFrame.data(); + + m_pDevice->CreateBuffer(&desc, &init, &m_pKeyFrameBuffer); + + + return S_OK; +} + +HRESULT CModel::Create_BoneInfoVB() +{ + for (size_t i = 0; i < m_Bones.size(); i++) + { + m_BoneInfo[i].ParentIndex = m_Bones[i]->Get_ParentBoneIndex(); + } + + + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = (_int)sizeof(BONEINFO_DESC) * (_uint)m_Bones.size(); + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = (_int)sizeof(BONEINFO_DESC); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = m_BoneInfo.data(); + + m_pDevice->CreateBuffer(&desc, &init, &m_pBoneInfoBuffer); + + + return S_OK; +} + void CModel::Get_BoneMatrix() { m_BoneMatrix.resize(m_Bones.size()); @@ -988,8 +1019,6 @@ void CModel::Get_BoneMatrix() } } - - HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { m_eType = eType; @@ -1327,12 +1356,18 @@ HRESULT CModel::Initialize(void* pArg) m_pTransform = m_pOwner->Get_Component(); SAFE_ADDREF(m_pTransform); - Create_Con(); - - if (FAILED(Create_CS())) - return E_FAIL; + + if (m_eType == MODEL::ANIM) + { + Create_Con(); + if (FAILED(Create_CS())) + return E_FAIL; + Create_KeyFrameVB(); + Create_BoneInfoVB(); + } + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 5d86dbdad..4456c6bff 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -29,6 +29,13 @@ class ENGINE_DLL CAnimation : public CBase _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } 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; } + void Set_KeyFrameDesc(); + KEYFRAME_DESC Get_KeyFrameDesc(_uint iIndex) { return m_KeyFrame[iIndex]; } + _uint Get_KeyCount() { return (_uint)m_KeyFrame.size(); } + _uint Get_KeyFrameCount(); #ifdef EDITOR_PROJECT private: HRESULT Initialize(const vector& Bones, const aiAnimation* pAIAnimation); @@ -64,6 +71,10 @@ class ENGINE_DLL CAnimation : public CBase vector<_int> m_DestBones; // 이 애니메이션에서 영향을 받는 본들의 집합 vector m_StartKeyFrames; // 이 애니메이션의 영향을 받는 본들의 초기값 vector<_matrix> m_vBoneTransformationMatrix = {}; + + _int m_iRawVertexStride = {}; + vector m_KeyFrame; + _int m_KeyCount = {}; public: static CAnimation* Create(HANDLE hFile, DWORD& dwByte); // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 12b408475..174b86a30 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -27,14 +27,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); // 바이너리 @@ -59,4 +58,4 @@ class ENGINE_DLL CBone final : public CBase }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 745a95f1c..f70a5a29e 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -35,6 +35,8 @@ class ENGINE_DLL CChannel : public CBase return !strcmp(pChannelname, m_szName); } _char* Get_Name() { return m_szName; } + KEYFRAME_DESC Get_KeyFrameDesc() { return m_KeyFrame; } + _int Get_KeyFrameCount() { return (_int)m_KeyFrames.size(); } private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 @@ -53,7 +55,9 @@ class ENGINE_DLL CChannel : public CBase _matrix m_BoneTransformationMatrix = {}; _float m_fPrevYaw = 0.f; _bool m_bInitialRootRotSaved = {false}; -_float4 m_vInitialRootRot = {}; + _float4 m_vInitialRootRot = {}; + + KEYFRAME_DESC m_KeyFrame; public: static CChannel* Create(const vector& Bones, _uint iIndex); // 럴프전용 static CChannel* Create(HANDLE hFile, DWORD& dwByte); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index f2cc2edd5..6e6e08e0b 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -358,4 +358,27 @@ typedef struct tagOnCollsionInfo }ON_COLLISION_INFO; +typedef struct tagKeyFrameDesc +{ + _float3 vScale; + _float4 vRotation; + _float3 vTranslation; + _float fTrackPosition; + +}KEYFRAME_DESC; + +typedef struct tagBoneInfo +{ + _int ParentIndex; + +}BONEINFO_DESC; + + +typedef struct tagBoneMatrix +{ + _float4x4 LocalMatrix; + _float4x4 CombinedMatrix; + +}BONE_DESC; + NS_END diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 9c88c1dfb..5fadd3e78 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); @@ -66,10 +36,6 @@ 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); @@ -81,7 +47,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer 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: @@ -99,16 +65,9 @@ class ENGINE_DLL CMesh final : public CVIBuffer // 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); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 1bfe26d31..cedd067e4 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); @@ -94,9 +77,13 @@ 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 UpdateAnimationCS(); + void ComputeAnimation(); + HRESULT Create_KeyFrameVB(); + HRESULT Create_BoneInfoVB(); void Get_BoneMatrix(); public: @@ -169,13 +156,15 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / private: HRESULT Create_CS(); - MESH_DESC m_MeshDesc = {}; - BONE_DESC m_BoneDesc = {}; _uint m_iNumBuffer = {}; + vector m_KeyFrame = {}; + vector m_BoneInfo = {}; class CComputeShader* m_pComputeShader = {}; ID3D11Buffer* m_pConstantBuffer = { nullptr }; - _uint AccumulatedVertexCount = {}; + + ID3D11Buffer* m_pKeyFrameBuffer = { nullptr }; + ID3D11Buffer* m_pBoneInfoBuffer = { nullptr }; private: // 바이너리 From b054078542fb2b3a197e3f7d95a87e646356236f Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sat, 22 Nov 2025 15:51:29 +0900 Subject: [PATCH 02/12] =?UTF-8?q?[add]=201=EC=B0=A8=20=EA=B2=80=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Editor/Default/Editor.vcxproj | 44 ++--- .../Editor/Default/Editor.vcxproj.filters | 179 ++++++------------ .../Editor/Private/DummyObject.cpp | 6 - Jusin154_Team3D/Editor/Private/Player.cpp | 104 ++++------ Jusin154_Team3D/Editor/Private/State_Cast.cpp | 67 ------- .../Editor/Private/State_Combat.cpp | 60 ------ .../Editor/Private/State_Dodge.cpp | 53 ------ Jusin154_Team3D/Editor/Private/State_Idle.cpp | 71 ------- .../Editor/Private/State_Idle_Turn.cpp | 88 --------- Jusin154_Team3D/Editor/Private/State_Jog.cpp | 57 ------ Jusin154_Team3D/Editor/Private/State_Jump.cpp | 55 ------ Jusin154_Team3D/Editor/Private/State_Land.cpp | 49 ----- .../Editor/Private/State_LightAttack.cpp | 69 ------- Jusin154_Team3D/Editor/Private/State_Move.cpp | 55 ------ .../Editor/Private/State_Player.cpp | 51 +++++ .../Editor/Private/State_Player_Combat.cpp | 57 ++++++ .../Editor/Private/State_Player_Dodge.cpp | 56 ++++++ .../Editor/Private/State_Player_Idle.cpp | 55 ++++++ .../Editor/Private/State_Player_Jump.cpp | 56 ++++++ .../Editor/Private/State_Player_Land.cpp | 56 ++++++ .../Editor/Private/State_Player_Move.cpp | 56 ++++++ Jusin154_Team3D/Editor/Private/State_Root.cpp | 62 ------ .../Editor/Private/State_Skill.cpp | 40 ---- .../Editor/Private/State_Skill2.cpp | 42 ---- .../Editor/Private/State_Sprint.cpp | 48 ----- Jusin154_Team3D/Editor/Private/State_Walk.cpp | 54 ------ Jusin154_Team3D/Editor/Public/Player.h | 5 +- Jusin154_Team3D/Editor/Public/State_Cast.h | 19 -- Jusin154_Team3D/Editor/Public/State_Combat.h | 19 -- Jusin154_Team3D/Editor/Public/State_Dodge.h | 19 -- Jusin154_Team3D/Editor/Public/State_Idle.h | 21 -- .../Editor/Public/State_Idle_Turn.h | 21 -- Jusin154_Team3D/Editor/Public/State_Jog.h | 21 -- Jusin154_Team3D/Editor/Public/State_Jump.h | 20 -- Jusin154_Team3D/Editor/Public/State_Land.h | 20 -- .../Editor/Public/State_LightAttack.h | 19 -- Jusin154_Team3D/Editor/Public/State_Move.h | 19 -- Jusin154_Team3D/Editor/Public/State_Player.h | 38 ++++ .../Editor/Public/State_Player_Combat.h | 31 +++ .../Editor/Public/State_Player_Dodge.h | 27 +++ .../Editor/Public/State_Player_Idle.h | 28 +++ .../Editor/Public/State_Player_Jump.h | 31 +++ .../Editor/Public/State_Player_Land.h | 31 +++ .../Editor/Public/State_Player_Move.h | 31 +++ Jusin154_Team3D/Editor/Public/State_Root.h | 19 -- Jusin154_Team3D/Editor/Public/State_Skill.h | 19 -- Jusin154_Team3D/Editor/Public/State_Skill2.h | 19 -- Jusin154_Team3D/Editor/Public/State_Sprint.h | 21 -- Jusin154_Team3D/Editor/Public/State_Walk.h | 21 -- Jusin154_Team3D/Engine/Private/FSM.cpp | 88 +++------ Jusin154_Team3D/Engine/Private/State.cpp | 29 +-- Jusin154_Team3D/Engine/Public/FSM.h | 38 ++-- Jusin154_Team3D/Engine/Public/State.h | 24 ++- 53 files changed, 786 insertions(+), 1502 deletions(-) delete mode 100644 Jusin154_Team3D/Editor/Private/State_Cast.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Combat.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Dodge.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Idle.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Idle_Turn.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Jog.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Jump.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Land.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_LightAttack.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Move.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Land.cpp create mode 100644 Jusin154_Team3D/Editor/Private/State_Player_Move.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Root.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Skill.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Skill2.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Sprint.cpp delete mode 100644 Jusin154_Team3D/Editor/Private/State_Walk.cpp delete mode 100644 Jusin154_Team3D/Editor/Public/State_Cast.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Combat.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Dodge.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Idle.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Idle_Turn.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Jog.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Jump.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Land.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_LightAttack.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Move.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Combat.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Dodge.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Idle.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Jump.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Land.h create mode 100644 Jusin154_Team3D/Editor/Public/State_Player_Move.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Root.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Skill.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Skill2.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Sprint.h delete mode 100644 Jusin154_Team3D/Editor/Public/State_Walk.h diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 8d2b7722f..3fff42202 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -236,21 +236,13 @@ - - - - - - - - - - - - - - - + + + + + + + @@ -368,21 +360,13 @@ - - - - - - - - - - - - - - - + + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 253f9506f..725a8e632 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} @@ -355,6 +313,33 @@ {92110a48-81d0-4e98-be06-05dd078d0488} + + {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} + + + {c1e05cd0-4551-487b-8e47-4119db646c60} + @@ -564,20 +549,14 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXWall - - 80.State\State_Combat\State_Dodge + + 80.State\Focus\State_Dodge - - 80.State\State_Idle + + 80.State\Movement\State_Idle - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint - - - 80.State\State_Jump + + 80.State\Focus\State_Jump 02.GameObjects\Player @@ -627,25 +606,16 @@ 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\Movement\State_Move - - 80.State\State_Move - - + 80.State\State_Combat @@ -657,15 +627,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 @@ -696,12 +657,12 @@ 02.GameObjects\Camera - - 80.State - 02.GameObjects\Wand + + 80.State + @@ -916,23 +877,14 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame - - 80.State\State_Combat\State_Dodge + + 80.State\Focus\State_Dodge - - 80.State\State_Idle + + 80.State\Movement\State_Idle - - 80.State\State_Move\State_Walk - - - 80.State\State_Move\State_Sprint - - - 80.State\State_Jump - - - 02.GameObjects\Player + + 80.State\Focus\State_Jump 02.GameObjects\Env\04.Land @@ -970,25 +922,16 @@ 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\Movement\State_Move - - 80.State\State_Move - - + 80.State\State_Combat @@ -1000,15 +943,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 @@ -1039,12 +973,15 @@ 02.GameObjects\Camera - - 80.State - 02.GameObjects\Wand + + 80.State + + + 02.GameObjects\Player + diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 45d67b060..006d8b704 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) diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index fe0ae3ece..46a4c3e19 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" +#include "State_Player_Idle.h" +#include "State_Player_Dodge.h" +#include "State_Player_Jump.h" +#include "State_Player_Land.h" +#include "State_Player_Move.h" +#include "State_Player_Combat.h" #pragma endregion CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -57,8 +48,6 @@ HRESULT CPlayer::Initialize(void* pArg) Add_FSM(); - Set_FSM(); - Set_Anim(); Setup_InputConditions(); @@ -79,7 +68,7 @@ void CPlayer::Update(_float fTimeDelta) Key_Input(fTimeDelta); - m_pFSM->Update(fTimeDelta); + m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -257,10 +246,7 @@ void CPlayer::Setup_InputConditions() void CPlayer::Key_Input(_float fTimeDelta) { - 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_pFSM->IsEnable(FSMSTATE::WALK|FSMSTATE::SPRINT |FSMSTATE::DODGE |FSMSTATE::JOG)) { if (m_pGameInstance->Key_Pressing(DIK_LEFT)) m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); @@ -276,56 +262,42 @@ void CPlayer::Key_Input(_float fTimeDelta) 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_Player_Idle::STATE_PLAYER_IDLE_DESC Desc{}; + Desc.pOwner = this; + m_States.emplace(FSMSTATE::MOVE, CState_Player_Idle::Create(&Desc)); + } + { + CState_Player_Move::STATE_PLAYER_MOVE_DESC Desc{}; + Desc.pOwner = this; + m_States.emplace(FSMSTATE::MOVE, CState_Player_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_Player_Jump::STATE_PLAYER_JUMP_DESC Desc{}; + Desc.pOwner = this; + m_States.emplace(FSMSTATE::LAND, CState_Player_Jump::Create(&Desc)); + } + { + CState_Player_Land::STATE_PLAYER_LAND_DESC Desc{}; + Desc.pOwner = this; + m_States.emplace(FSMSTATE::LAND, CState_Player_Land::Create(&Desc)); + } + { + CState_Player_Dodge::STATE_PLAYER_DODGE_DESC Desc{}; + Desc.pOwner = this; + m_States.emplace(FSMSTATE::LAND, CState_Player_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() 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 deleted file mode 100644 index bdff385da..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Combat.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "pch.h" -#include "State_Combat.h" -#include "Unit.h" - - -CState_Combat::CState_Combat() - :CState() -{ -} - -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); - -} - -void CState_Combat::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Combat::Exit() -{ -} - -_bool CState_Combat::CheckExitState() -{ - if (m_pOwner->IsCurrentKeyFrame("Jump")) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::MOVE); - return true; - } - - return false; -} - - -void CState_Combat::Free() -{ - __super::Free(); -} - -void CState_Combat::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp deleted file mode 100644 index 3c4ce4151..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "pch.h" -#include "State_Dodge.h" -#include "Unit.h" - - -CState_Dodge::CState_Dodge() - :CState() -{ -} - -void CState_Dodge::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Dodge::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Dodge::Exit() -{ -} - -_bool CState_Dodge::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - 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; -} - -void CState_Dodge::Free() -{ - __super::Free(); -} - -void CState_Dodge::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Idle.cpp deleted file mode 100644 index 5f4140c0c..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Idle.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "pch.h" -#include "State_Idle.h" -#include "Unit.h" - -CState_Idle::CState_Idle() - :CState() -{ -} - -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); - } -} - -void CState_Idle::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Idle::Exit() -{ -} - -_bool CState_Idle::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - 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::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Idle::Free() -{ - __super::Free(); -} - -void CState_Idle::Describe_Entity() -{ -} 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 deleted file mode 100644 index 051f93fb0..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Jump.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "pch.h" -#include "State_Jump.h" -#include "Unit.h" - - -CState_Jump::CState_Jump() - :CState() -{ -} - -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); -} - -void CState_Jump::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Jump::Exit() -{ -} - -_bool CState_Jump::CheckExitState() -{ - if (m_pOwner->IsCurrentKeyFrame("Jump")) - m_pFSM->Change_State(FSMSTATE::LAND); - - return false; -} - -void CState_Jump::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 deleted file mode 100644 index 7fda0cd37..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Land.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "pch.h" -#include "State_Land.h" -#include "Unit.h" - - -CState_Land::CState_Land() - :CState() -{ -} - -void CState_Land::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Land::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Land::Exit() -{ -} - -_bool CState_Land::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - - 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; -} - -void CState_Land::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 deleted file mode 100644 index cce8c760f..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Move.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "pch.h" -#include "State_Move.h" -#include "Unit.h" - - -CState_Move::CState_Move() - :CState() -{ -} - -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); -} - -void CState_Move::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Move::Exit() -{ -} - -_bool CState_Move::CheckExitState() -{ - return false; -} - - -void CState_Move::Free() -{ - __super::Free(); -} - -void CState_Move::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/State_Player.cpp b/Jusin154_Team3D/Editor/Private/State_Player.cpp new file mode 100644 index 000000000..c5510913e --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player.cpp @@ -0,0 +1,51 @@ +#include "pch.h" +#include "State_Player.h" +#include "Unit.h" + +CState_Player::CState_Player() + :CState() +{ +} + +void CState_Player::Enter() +{ + if (nullptr != m_funcEnterEvent) { + m_funcEnterEvent(); + } +} + +HRESULT CState_Player::Update(_float fTimeDelta) +{ + HRESULT hr = { S_OK }; + if (nullptr != m_funcExitCheck) { + hr = m_funcExitCheck(fTimeDelta); + } + return hr; +} + +void CState_Player::Exit() +{ + if (nullptr != m_funcExitEvent) { + m_funcExitEvent(); + } +} + +HRESULT CState_Player::Initialize(STATE_PLAYER_DESC* pArg) +{ + 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_Player::Free() +{ + __super::Free(); +} + +void CState_Player::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp new file mode 100644 index 000000000..535c8ae60 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp @@ -0,0 +1,57 @@ +#include "pch.h" +#include "State_Player_Combat.h" +#include "Unit.h" + + +CState_Player_Combat::CState_Player_Combat() + :CState_Player() +{ +} + +void CState_Player_Combat::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Combat::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Combat::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Combat::Initialize(STATE_PLAYER_COMBAT_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pOwner = pDesc->pOwner; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Combat* CState_Player_Combat::Create(STATE_PLAYER_COMBAT_DESC* pDesc) +{ + CState_Player_Combat* pInstance = new CState_Player_Combat; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Combat::Free() +{ + __super::Free(); +} + +void CState_Player_Combat::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp new file mode 100644 index 000000000..348c8c816 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Dodge.h" +#include "Unit.h" + + +CState_Player_Dodge::CState_Player_Dodge() + :CState_Player() +{ +} + +void CState_Player_Dodge::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Dodge::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Dodge::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Dodge::Initialize(STATE_PLAYER_DODGE_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Dodge* CState_Player_Dodge::Create(STATE_PLAYER_DODGE_DESC* pDesc) +{ + CState_Player_Dodge* pInstance = new CState_Player_Dodge; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Dodge::Free() +{ + __super::Free(); +} + +void CState_Player_Dodge::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp new file mode 100644 index 000000000..1b1259e60 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp @@ -0,0 +1,55 @@ +#include "pch.h" +#include "State_Player_Idle.h" +#include "Unit.h" + +CState_Player_Idle::CState_Player_Idle() + :CState_Player() +{ +} + +void CState_Player_Idle::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Idle::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Idle::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Idle::Initialize(STATE_PLAYER_IDLE_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Idle* CState_Player_Idle::Create(STATE_PLAYER_IDLE_DESC* pDesc) +{ + CState_Player_Idle* pInstance = new CState_Player_Idle; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Idle::Free() +{ + __super::Free(); +} + +void CState_Player_Idle::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp new file mode 100644 index 000000000..c7a16ed0f --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Jump.h" +#include "Unit.h" + + +CState_Player_Jump::CState_Player_Jump() + :CState_Player() +{ +} + +void CState_Player_Jump::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Jump::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Jump::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Jump::Initialize(STATE_PLAYER_JUMP_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Jump* CState_Player_Jump::Create(STATE_PLAYER_JUMP_DESC* pDesc) +{ + CState_Player_Jump* pInstance = new CState_Player_Jump; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Jump::Free() +{ + __super::Free(); +} + +void CState_Player_Jump::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp new file mode 100644 index 000000000..af536e870 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Land.h" +#include "Unit.h" + + +CState_Player_Land::CState_Player_Land() + :CState_Player() +{ +} + +void CState_Player_Land::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Land::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Land::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Land::Initialize(STATE_PLAYER_LAND_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Land* CState_Player_Land::Create(STATE_PLAYER_LAND_DESC* pDesc) +{ + CState_Player_Land* pInstance = new CState_Player_Land; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Land::Free() +{ + __super::Free(); +} + +void CState_Player_Land::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp new file mode 100644 index 000000000..4a2a06a90 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Move.h" +#include "Unit.h" + + +CState_Player_Move::CState_Player_Move() + :CState_Player() +{ +} + +void CState_Player_Move::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Player_Move::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Player_Move::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Player_Move::Initialize(STATE_PLAYER_MOVE_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Player_Move* CState_Player_Move::Create(STATE_PLAYER_MOVE_DESC* pDesc) +{ + CState_Player_Move* pInstance = new CState_Player_Move; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Player_Move::Free() +{ + __super::Free(); +} + +void CState_Player_Move::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Root.cpp b/Jusin154_Team3D/Editor/Private/State_Root.cpp deleted file mode 100644 index efef8727b..000000000 --- a/Jusin154_Team3D/Editor/Private/State_Root.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "pch.h" -#include "State_Root.h" -#include "Unit.h" - - -CState_Root::CState_Root() - :CState() -{ -} - -void CState_Root::Enter() -{ - if (m_pOwner->Check(FSMSTATE::COMBAT)) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - else - m_pFSM->Change_State(FSMSTATE::MOVE); -} - -void CState_Root::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Root::Exit() -{ -} - -_bool CState_Root::CheckExitState() -{ - 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; -} - - -void CState_Root::Free() -{ - __super::Free(); -} - -void CState_Root::Describe_Entity() -{ -} 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/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 6e42215ed..bf9e0f3fd 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -29,9 +29,13 @@ class CPlayer final : public CUnit _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } private: + unordered_map m_States = { }; + size_t m_iStateMask = { 0 }; + vector m_InputConditions; _bool m_bSprintToggle = { false }; _bool m_bWalkToggle = { false }; + class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; private: @@ -50,7 +54,6 @@ 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(); 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 deleted file mode 100644 index 7fe636c65..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Combat.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Combat final : public CState -{ -public: - CState_Combat(); - virtual ~CState_Combat() = 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_Dodge.h b/Jusin154_Team3D/Editor/Public/State_Dodge.h deleted file mode 100644 index 788056b67..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Dodge.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Dodge final : public CState -{ -public: - CState_Dodge(); - virtual ~CState_Dodge() = 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_Idle.h b/Jusin154_Team3D/Editor/Public/State_Idle.h deleted file mode 100644 index 898162432..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Idle.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Idle final : public CState -{ -public: - CState_Idle(); - virtual ~CState_Idle() = 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_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 deleted file mode 100644 index 1433dc4aa..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Jump.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Jump final : public CState -{ -public: - CState_Jump(); - virtual ~CState_Jump() = 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_Land.h b/Jusin154_Team3D/Editor/Public/State_Land.h deleted file mode 100644 index 6cc48272b..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Land.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Land final : public CState -{ -public: - CState_Land(); - virtual ~CState_Land() = 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_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 deleted file mode 100644 index 18ef685af..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Move.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Move final : public CState -{ -public: - CState_Move(); - virtual ~CState_Move() = 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_Player.h b/Jusin154_Team3D/Editor/Public/State_Player.h new file mode 100644 index 000000000..ca51e8ab9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player.h @@ -0,0 +1,38 @@ +#pragma once +#include "Editor_Define.h" +#include "State.h" + +NS_BEGIN(Editor) + +class CState_Player abstract : public CState +{ +protected: + typedef struct tagStatePlayer : public CState::STATEDESC { + function funcExitCheck = { nullptr }; + function funcEnterEvent = { nullptr }; + function funcExitEvent = { nullptr }; + }STATE_PLAYER_DESC; + +protected: + CState_Player(); + virtual ~CState_Player() = default; + +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_PLAYER_DESC* pArg); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Combat.h b/Jusin154_Team3D/Editor/Public/State_Player_Combat.h new file mode 100644 index 000000000..8ea945f99 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Combat.h @@ -0,0 +1,31 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +NS_BEGIN(Editor) + +class CState_Player_Combat final : public CState_Player +{ +public: + typedef struct tagCombat : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_COMBAT_DESC; +private: + CState_Player_Combat(); + virtual ~CState_Player_Combat() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_COMBAT_DESC* pDesc); + +public: + static CState_Player_Combat* Create(STATE_PLAYER_COMBAT_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h b/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h new file mode 100644 index 000000000..f5f57ecf4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h @@ -0,0 +1,27 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +class CState_Player_Dodge final : public CState_Player +{ +public: + typedef struct tagDodge : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_DODGE_DESC; +public: + CState_Player_Dodge(); + virtual ~CState_Player_Dodge() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_DODGE_DESC* pDesc); + +public: + static CState_Player_Dodge* Create(STATE_PLAYER_DODGE_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Idle.h b/Jusin154_Team3D/Editor/Public/State_Player_Idle.h new file mode 100644 index 000000000..4ef6c194e --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Idle.h @@ -0,0 +1,28 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +class CState_Player_Idle final : public CState_Player +{ +public: + typedef struct tagIdle : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_IDLE_DESC; +public: + CState_Player_Idle(); + virtual ~CState_Player_Idle() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_IDLE_DESC* pDesc); + +public: + static CState_Player_Idle* Create(STATE_PLAYER_IDLE_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Jump.h b/Jusin154_Team3D/Editor/Public/State_Player_Jump.h new file mode 100644 index 000000000..e6e50b6ec --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Jump.h @@ -0,0 +1,31 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +NS_BEGIN(Editor) + +class CState_Player_Jump final : public CState_Player +{ +public: + typedef struct tagJump : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_JUMP_DESC; +private: + CState_Player_Jump(); + virtual ~CState_Player_Jump() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_JUMP_DESC* pDesc); + +public: + static CState_Player_Jump* Create(STATE_PLAYER_JUMP_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Land.h b/Jusin154_Team3D/Editor/Public/State_Player_Land.h new file mode 100644 index 000000000..8c77b645d --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Land.h @@ -0,0 +1,31 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +NS_BEGIN(Editor) + +class CState_Player_Land final : public CState_Player +{ +public: + typedef struct tagLand : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_LAND_DESC; +private: + CState_Player_Land(); + virtual ~CState_Player_Land() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_LAND_DESC* pDesc); + +public: + static CState_Player_Land* Create(STATE_PLAYER_LAND_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Move.h b/Jusin154_Team3D/Editor/Public/State_Player_Move.h new file mode 100644 index 000000000..e11b26c39 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Player_Move.h @@ -0,0 +1,31 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Player.h" + +NS_BEGIN(Editor) + +class CState_Player_Move final : public CState_Player +{ +public: + typedef struct tagMove : public CState_Player::STATE_PLAYER_DESC { + + }STATE_PLAYER_MOVE_DESC; +private: + CState_Player_Move(); + virtual ~CState_Player_Move() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_PLAYER_MOVE_DESC* pDesc); + +public: + static CState_Player_Move* Create(STATE_PLAYER_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 deleted file mode 100644 index 9b02d4449..000000000 --- a/Jusin154_Team3D/Editor/Public/State_Root.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Editor_Define.h" -#include "State.h" - -class CState_Root final : public CState -{ -public: - CState_Root(); - virtual ~CState_Root() = 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_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/Engine/Private/FSM.cpp b/Jusin154_Team3D/Engine/Private/FSM.cpp index 193a4a8d8..5312974af 100644 --- a/Jusin154_Team3D/Engine/Private/FSM.cpp +++ b/Jusin154_Team3D/Engine/Private/FSM.cpp @@ -5,12 +5,10 @@ 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) { } @@ -24,62 +22,30 @@ 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) +void 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(); + 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); } CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -95,7 +61,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 +78,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/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/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 4ce544413..219bd03c7 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -20,33 +20,47 @@ 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); + void Update_State(_float fTimeDelta); + + 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; } - CState* Get_Current() { return m_pCurrent; } - _uint Get_CurrState(); - _uint Get_PrevState(); - void Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent); 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/State.h b/Jusin154_Team3D/Engine/Public/State.h index 477012e87..27f5f9c52 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -22,33 +22,31 @@ 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 }; 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: virtual void Free() override; From 4af93e7abb55f7c6780fa85e1900f7bc0d57b3f4 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sat, 22 Nov 2025 18:49:59 +0900 Subject: [PATCH 03/12] =?UTF-8?q?[add]=202=EC=B0=A8=20=EA=B2=80=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Editor/Default/Editor.vcxproj | 4 +- .../Editor/Default/Editor.vcxproj.filters | 7 +- Jusin154_Team3D/Editor/Private/Player.cpp | 253 ++++++++++++++++-- .../Editor/Private/State_Player_Combat.cpp | 20 +- .../Editor/Private/State_Player_Dodge.cpp | 30 ++- .../Editor/Private/State_Player_Idle.cpp | 28 +- .../Editor/Private/State_Player_Jump.cpp | 20 +- .../Editor/Private/State_Player_Land.cpp | 20 +- .../Editor/Private/State_Player_Move.cpp | 29 +- .../{State_Player.cpp => State_Root.cpp} | 16 +- Jusin154_Team3D/Editor/Public/Player.h | 21 ++ .../Editor/Public/State_Player_Combat.h | 16 +- .../Editor/Public/State_Player_Dodge.h | 23 +- .../Editor/Public/State_Player_Idle.h | 23 +- .../Editor/Public/State_Player_Jump.h | 16 +- .../Editor/Public/State_Player_Land.h | 16 +- .../Editor/Public/State_Player_Move.h | 23 +- .../Public/{State_Player.h => State_Root.h} | 14 +- Jusin154_Team3D/Engine/Private/FSM.cpp | 4 +- Jusin154_Team3D/Engine/Public/FSM.h | 2 +- Jusin154_Team3D/Engine/Public/State.h | 2 +- 21 files changed, 433 insertions(+), 154 deletions(-) rename Jusin154_Team3D/Editor/Private/{State_Player.cpp => State_Root.cpp} (65%) rename Jusin154_Team3D/Editor/Public/{State_Player.h => State_Root.h} (73%) diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 3fff42202..0c05ac559 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -242,7 +242,7 @@ - + @@ -366,7 +366,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 725a8e632..e3cc82cf8 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -337,9 +337,6 @@ {0b8cac41-419f-48ce-87bc-805b8962b4df} - - {c1e05cd0-4551-487b-8e47-4119db646c60} - @@ -660,7 +657,7 @@ 02.GameObjects\Wand - + 80.State @@ -976,7 +973,7 @@ 02.GameObjects\Wand - + 80.State diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 46a4c3e19..7b230a1e2 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -218,8 +218,7 @@ void CPlayer::Setup_InputConditions() m_InputConditions = { { 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::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }}, @@ -230,8 +229,7 @@ void CPlayer::Setup_InputConditions() { FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::SPRINT, [&]() { return m_bSprintToggle - && 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); }}, @@ -248,11 +246,13 @@ void CPlayer::Key_Input(_float fTimeDelta) { if (m_pFSM->IsEnable(FSMSTATE::WALK|FSMSTATE::SPRINT |FSMSTATE::DODGE |FSMSTATE::JOG)) { - if (m_pGameInstance->Key_Pressing(DIK_LEFT)) + if (m_pGameInstance->Key_Pressing(DIK_LEFT)){ m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) + if (m_pGameInstance->Key_Pressing(DIK_RIGHT)){ m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } } IsSprint(); @@ -260,35 +260,256 @@ void CPlayer::Key_Input(_float fTimeDelta) IsWalk(); } +HRESULT CPlayer::InputSystem() +{ + 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)) + { + return S_OK; + } + return E_FAIL; +} + +HRESULT CPlayer::InputSkill() +{ + if (m_pGameInstance->Key_Down(DIK_SPACE) + || m_pGameInstance->Key_Down(DIK_Q) + || m_pGameInstance->Key_Down(DIK_E) + || m_pGameInstance->Key_Down(DIK_R) + || m_pGameInstance->Key_Down(DIK_F) + || m_pGameInstance->Key_Down(DIK_Z) + || m_pGameInstance->Key_Down(DIK_X) + || 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)) + { + return S_OK; + } + return E_FAIL; +} + +HRESULT CPlayer::InputRun() +{ + if (m_pGameInstance->Mouse_Pressing(DIK_UP) + || m_pGameInstance->Mouse_Pressing(DIK_LEFT) + || m_pGameInstance->Mouse_Pressing(DIK_DOWN) + || m_pGameInstance->Mouse_Pressing(DIK_RIGHT)) + { + 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]; + } + } + + 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())) { + // Action + return E_FAIL; + } + if (SUCCEEDED(InputRun())) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + return S_OK; +} + +void CPlayer::Behavior_MoveEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { + // Idle -> Move + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) { + // OtherMove -> AnotherMove + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) { + // Combat -> Move + } + else { + if (true == m_bSprintToggle) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (true == m_bWalkToggle) { + if (true == m_pGameInstance->Key_Pressing(DIK_UP)) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + 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())) { + // Action + return E_FAIL; + } + if (SUCCEEDED(InputRun())) { + return S_OK; + } + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; +} + +void CPlayer::Behavior_JumpEnter() +{ + pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_SPRINT); + 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 = Get_AnimInfo(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_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_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::Add_FSM() { #pragma region Behavior_Movement_NotFocus { - CState_Player_Idle::STATE_PLAYER_IDLE_DESC Desc{}; + CState_Idle::STATE_IDLE_DESC Desc{}; Desc.pOwner = this; - m_States.emplace(FSMSTATE::MOVE, CState_Player_Idle::Create(&Desc)); + Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; + Desc.funcExitEvent = nullptr; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); } { - CState_Player_Move::STATE_PLAYER_MOVE_DESC Desc{}; + CState_Move::STATE_MOVE_DESC Desc{}; Desc.pOwner = this; - m_States.emplace(FSMSTATE::MOVE, CState_Player_Move::Create(&Desc)); + Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; + Desc.funcExitEvent = nullptr; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } #pragma endregion #pragma region Behavior_Movement_Focus { - CState_Player_Jump::STATE_PLAYER_JUMP_DESC Desc{}; + CState_Jump::STATE_JUMP_DESC Desc{}; Desc.pOwner = this; - m_States.emplace(FSMSTATE::LAND, CState_Player_Jump::Create(&Desc)); + Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); }; + Desc.funcExitEvent = nullptr; + m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc)); } { - CState_Player_Land::STATE_PLAYER_LAND_DESC Desc{}; + CState_Land::STATE_LAND_DESC Desc{}; Desc.pOwner = this; - m_States.emplace(FSMSTATE::LAND, CState_Player_Land::Create(&Desc)); + Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); }; + Desc.funcExitEvent = nullptr; + m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc)); } { - CState_Player_Dodge::STATE_PLAYER_DODGE_DESC Desc{}; + CState_Dodge::STATE_DODGE_DESC Desc{}; Desc.pOwner = this; - m_States.emplace(FSMSTATE::LAND, CState_Player_Dodge::Create(&Desc)); + Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); }; + Desc.funcExitEvent = nullptr; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); } #pragma endregion #pragma region Behavior_Combat_NotFocus diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp index 535c8ae60..17674a15c 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp @@ -3,17 +3,17 @@ #include "Unit.h" -CState_Player_Combat::CState_Player_Combat() - :CState_Player() +CState_Combat::CState_Combat() + :CState_Root() { } -void CState_Player_Combat::Enter() +void CState_Combat::Enter() { __super::Enter(); } -HRESULT CState_Player_Combat::Update(_float fTimeDelta) +HRESULT CState_Combat::Update(_float fTimeDelta) { if (E_FAIL == (__super::Update(fTimeDelta))) { return E_FAIL; @@ -21,12 +21,12 @@ HRESULT CState_Player_Combat::Update(_float fTimeDelta) return S_OK; } -void CState_Player_Combat::Exit() +void CState_Combat::Exit() { __super::Exit(); } -HRESULT CState_Player_Combat::Initialize(STATE_PLAYER_COMBAT_DESC* pDesc) +HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) { if (FAILED(__super::Initialize(pDesc))) { return E_FAIL; @@ -38,20 +38,20 @@ HRESULT CState_Player_Combat::Initialize(STATE_PLAYER_COMBAT_DESC* pDesc) return S_OK; } -CState_Player_Combat* CState_Player_Combat::Create(STATE_PLAYER_COMBAT_DESC* pDesc) +CState_Combat* CState_Combat::Create(STATE_COMBAT_DESC* pDesc) { - CState_Player_Combat* pInstance = new CState_Player_Combat; + CState_Combat* pInstance = new CState_Combat; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Combat::Free() +void CState_Combat::Free() { __super::Free(); } -void CState_Player_Combat::Describe_Entity() +void CState_Combat::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp index 348c8c816..f93785351 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp @@ -3,54 +3,62 @@ #include "Unit.h" -CState_Player_Dodge::CState_Player_Dodge() - :CState_Player() +CState_Dodge::CState_Dodge() + :CState_Root() { } -void CState_Player_Dodge::Enter() +void CState_Dodge::Enter() { __super::Enter(); } -HRESULT CState_Player_Dodge::Update(_float fTimeDelta) +HRESULT CState_Dodge::Update(_float fTimeDelta) { - if (E_FAIL == (__super::Update(fTimeDelta))) { + 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_Player_Dodge::Exit() +void CState_Dodge::Exit() { __super::Exit(); } -HRESULT CState_Player_Dodge::Initialize(STATE_PLAYER_DODGE_DESC* pDesc) +HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc) { 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_Player_Dodge* CState_Player_Dodge::Create(STATE_PLAYER_DODGE_DESC* pDesc) +CState_Dodge* CState_Dodge::Create(STATE_DODGE_DESC* pDesc) { - CState_Player_Dodge* pInstance = new CState_Player_Dodge; + CState_Dodge* pInstance = new CState_Dodge; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Dodge::Free() +void CState_Dodge::Free() { __super::Free(); } -void CState_Player_Dodge::Describe_Entity() +void CState_Dodge::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp index 1b1259e60..c11f1425d 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp @@ -2,54 +2,62 @@ #include "State_Player_Idle.h" #include "Unit.h" -CState_Player_Idle::CState_Player_Idle() - :CState_Player() +CState_Idle::CState_Idle() + :CState_Root() { } -void CState_Player_Idle::Enter() +void CState_Idle::Enter() { __super::Enter(); } -HRESULT CState_Player_Idle::Update(_float fTimeDelta) +HRESULT CState_Idle::Update(_float fTimeDelta) { + 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_Player_Idle::Exit() +void CState_Idle::Exit() { __super::Exit(); } -HRESULT CState_Player_Idle::Initialize(STATE_PLAYER_IDLE_DESC* pDesc) +HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc) { 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_Player_Idle* CState_Player_Idle::Create(STATE_PLAYER_IDLE_DESC* pDesc) +CState_Idle* CState_Idle::Create(STATE_IDLE_DESC* pDesc) { - CState_Player_Idle* pInstance = new CState_Player_Idle; + CState_Idle* pInstance = new CState_Idle; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Idle::Free() +void CState_Idle::Free() { __super::Free(); } -void CState_Player_Idle::Describe_Entity() +void CState_Idle::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp index c7a16ed0f..ed972391b 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp @@ -3,17 +3,17 @@ #include "Unit.h" -CState_Player_Jump::CState_Player_Jump() - :CState_Player() +CState_Jump::CState_Jump() + :CState_Root() { } -void CState_Player_Jump::Enter() +void CState_Jump::Enter() { __super::Enter(); } -HRESULT CState_Player_Jump::Update(_float fTimeDelta) +HRESULT CState_Jump::Update(_float fTimeDelta) { if (E_FAIL == (__super::Update(fTimeDelta))) { return E_FAIL; @@ -21,12 +21,12 @@ HRESULT CState_Player_Jump::Update(_float fTimeDelta) return S_OK; } -void CState_Player_Jump::Exit() +void CState_Jump::Exit() { __super::Exit(); } -HRESULT CState_Player_Jump::Initialize(STATE_PLAYER_JUMP_DESC* pDesc) +HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc) { if (FAILED(__super::Initialize(pDesc))) { return E_FAIL; @@ -37,20 +37,20 @@ HRESULT CState_Player_Jump::Initialize(STATE_PLAYER_JUMP_DESC* pDesc) return S_OK; } -CState_Player_Jump* CState_Player_Jump::Create(STATE_PLAYER_JUMP_DESC* pDesc) +CState_Jump* CState_Jump::Create(STATE_JUMP_DESC* pDesc) { - CState_Player_Jump* pInstance = new CState_Player_Jump; + CState_Jump* pInstance = new CState_Jump; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Jump::Free() +void CState_Jump::Free() { __super::Free(); } -void CState_Player_Jump::Describe_Entity() +void CState_Jump::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp index af536e870..61ffcaba0 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp @@ -3,17 +3,17 @@ #include "Unit.h" -CState_Player_Land::CState_Player_Land() - :CState_Player() +CState_Land::CState_Land() + :CState_Root() { } -void CState_Player_Land::Enter() +void CState_Land::Enter() { __super::Enter(); } -HRESULT CState_Player_Land::Update(_float fTimeDelta) +HRESULT CState_Land::Update(_float fTimeDelta) { if (E_FAIL == (__super::Update(fTimeDelta))) { return E_FAIL; @@ -21,12 +21,12 @@ HRESULT CState_Player_Land::Update(_float fTimeDelta) return S_OK; } -void CState_Player_Land::Exit() +void CState_Land::Exit() { __super::Exit(); } -HRESULT CState_Player_Land::Initialize(STATE_PLAYER_LAND_DESC* pDesc) +HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc) { if (FAILED(__super::Initialize(pDesc))) { return E_FAIL; @@ -37,20 +37,20 @@ HRESULT CState_Player_Land::Initialize(STATE_PLAYER_LAND_DESC* pDesc) return S_OK; } -CState_Player_Land* CState_Player_Land::Create(STATE_PLAYER_LAND_DESC* pDesc) +CState_Land* CState_Land::Create(STATE_LAND_DESC* pDesc) { - CState_Player_Land* pInstance = new CState_Player_Land; + CState_Land* pInstance = new CState_Land; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Land::Free() +void CState_Land::Free() { __super::Free(); } -void CState_Player_Land::Describe_Entity() +void CState_Land::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp b/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp index 4a2a06a90..856c62bfc 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp @@ -3,54 +3,63 @@ #include "Unit.h" -CState_Player_Move::CState_Player_Move() - :CState_Player() +CState_Move::CState_Move() + :CState_Root() { } -void CState_Player_Move::Enter() +void CState_Move::Enter() { __super::Enter(); } -HRESULT CState_Player_Move::Update(_float fTimeDelta) +HRESULT CState_Move::Update(_float fTimeDelta) { + 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_Player_Move::Exit() +void CState_Move::Exit() { __super::Exit(); } -HRESULT CState_Player_Move::Initialize(STATE_PLAYER_MOVE_DESC* pDesc) +HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc) { 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_Player_Move* CState_Player_Move::Create(STATE_PLAYER_MOVE_DESC* pDesc) +CState_Move* CState_Move::Create(STATE_MOVE_DESC* pDesc) { - CState_Player_Move* pInstance = new CState_Player_Move; + CState_Move* pInstance = new CState_Move; if (FAILED(pInstance->Initialize(pDesc))) { SAFE_RELEASE(pInstance); } return pInstance; } -void CState_Player_Move::Free() +void CState_Move::Free() { __super::Free(); } -void CState_Player_Move::Describe_Entity() +void CState_Move::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Private/State_Player.cpp b/Jusin154_Team3D/Editor/Private/State_Root.cpp similarity index 65% rename from Jusin154_Team3D/Editor/Private/State_Player.cpp rename to Jusin154_Team3D/Editor/Private/State_Root.cpp index c5510913e..18349525b 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Root.cpp @@ -1,20 +1,20 @@ #include "pch.h" -#include "State_Player.h" +#include "State_Root.h" #include "Unit.h" -CState_Player::CState_Player() +CState_Root::CState_Root() :CState() { } -void CState_Player::Enter() +void CState_Root::Enter() { if (nullptr != m_funcEnterEvent) { m_funcEnterEvent(); } } -HRESULT CState_Player::Update(_float fTimeDelta) +HRESULT CState_Root::Update(_float fTimeDelta) { HRESULT hr = { S_OK }; if (nullptr != m_funcExitCheck) { @@ -23,14 +23,14 @@ HRESULT CState_Player::Update(_float fTimeDelta) return hr; } -void CState_Player::Exit() +void CState_Root::Exit() { if (nullptr != m_funcExitEvent) { m_funcExitEvent(); } } -HRESULT CState_Player::Initialize(STATE_PLAYER_DESC* pArg) +HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg) { if (FAILED(__super::Initialize(pArg))) { return E_FAIL; @@ -41,11 +41,11 @@ HRESULT CState_Player::Initialize(STATE_PLAYER_DESC* pArg) return S_OK; } -void CState_Player::Free() +void CState_Root::Free() { __super::Free(); } -void CState_Player::Describe_Entity() +void CState_Root::Describe_Entity() { } diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index bf9e0f3fd..e5a08d552 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -45,6 +45,27 @@ class CPlayer final : public CUnit void Setup_InputConditions(); void Key_Input(_float fTimeDelta); + + HRESULT InputSystem(); + HRESULT InputSkill(); + HRESULT InputRun(); + + void Behavior_IdleEnter(); + HRESULT Behavior_IdleExitCheck(); + + void Behavior_MoveEnter(); + HRESULT Behavior_MoveExitCheck(); + + void Behavior_JumpEnter(); + HRESULT Behavior_JumpExitCheck(); + + void Behavior_LandEnter(); + HRESULT Behavior_LandExitCheck(); + + void Behavior_DodgeEnter(); + HRESULT Behavior_DodgeExitCheck(); + + public: static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Combat.h b/Jusin154_Team3D/Editor/Public/State_Player_Combat.h index 8ea945f99..8c7685ea0 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Combat.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Combat.h @@ -1,18 +1,18 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" NS_BEGIN(Editor) -class CState_Player_Combat final : public CState_Player +class CState_Combat final : public CState_Root { public: - typedef struct tagCombat : public CState_Player::STATE_PLAYER_DESC { + typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { - }STATE_PLAYER_COMBAT_DESC; + }STATE_COMBAT_DESC; private: - CState_Player_Combat(); - virtual ~CState_Player_Combat() = default; + CState_Combat(); + virtual ~CState_Combat() = default; public: virtual void Enter(); @@ -20,10 +20,10 @@ class CState_Player_Combat final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_COMBAT_DESC* pDesc); + HRESULT Initialize(STATE_COMBAT_DESC* pDesc); public: - static CState_Player_Combat* Create(STATE_PLAYER_COMBAT_DESC* pDesc); + static CState_Combat* Create(STATE_COMBAT_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h b/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h index f5f57ecf4..ea28f476a 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h @@ -1,16 +1,17 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" -class CState_Player_Dodge final : public CState_Player +class CState_Dodge final : public CState_Root { public: - typedef struct tagDodge : public CState_Player::STATE_PLAYER_DESC { - - }STATE_PLAYER_DODGE_DESC; + typedef struct tagDodge : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_DODGE_DESC; public: - CState_Player_Dodge(); - virtual ~CState_Player_Dodge() = default; + CState_Dodge(); + virtual ~CState_Dodge() = default; public: virtual void Enter(); @@ -18,10 +19,14 @@ class CState_Player_Dodge final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_DODGE_DESC* pDesc); + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_DODGE_DESC* pDesc); public: - static CState_Player_Dodge* Create(STATE_PLAYER_DODGE_DESC* pDesc); + static CState_Dodge* Create(STATE_DODGE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Idle.h b/Jusin154_Team3D/Editor/Public/State_Player_Idle.h index 4ef6c194e..ef50909a4 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Idle.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Idle.h @@ -1,16 +1,17 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" -class CState_Player_Idle final : public CState_Player +class CState_Idle final : public CState_Root { public: - typedef struct tagIdle : public CState_Player::STATE_PLAYER_DESC { - - }STATE_PLAYER_IDLE_DESC; + typedef struct tagIdle : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_IDLE_DESC; public: - CState_Player_Idle(); - virtual ~CState_Player_Idle() = default; + CState_Idle(); + virtual ~CState_Idle() = default; public: virtual void Enter(); @@ -18,10 +19,14 @@ class CState_Player_Idle final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_IDLE_DESC* pDesc); + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_IDLE_DESC* pDesc); public: - static CState_Player_Idle* Create(STATE_PLAYER_IDLE_DESC* pDesc); + static CState_Idle* Create(STATE_IDLE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Jump.h b/Jusin154_Team3D/Editor/Public/State_Player_Jump.h index e6e50b6ec..02d35b154 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Jump.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Jump.h @@ -1,18 +1,18 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" NS_BEGIN(Editor) -class CState_Player_Jump final : public CState_Player +class CState_Jump final : public CState_Root { public: - typedef struct tagJump : public CState_Player::STATE_PLAYER_DESC { + typedef struct tagJump : public CState_Root::STATE_ROOT_DESC { - }STATE_PLAYER_JUMP_DESC; + }STATE_JUMP_DESC; private: - CState_Player_Jump(); - virtual ~CState_Player_Jump() = default; + CState_Jump(); + virtual ~CState_Jump() = default; public: virtual void Enter(); @@ -20,10 +20,10 @@ class CState_Player_Jump final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_JUMP_DESC* pDesc); + HRESULT Initialize(STATE_JUMP_DESC* pDesc); public: - static CState_Player_Jump* Create(STATE_PLAYER_JUMP_DESC* pDesc); + static CState_Jump* Create(STATE_JUMP_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Land.h b/Jusin154_Team3D/Editor/Public/State_Player_Land.h index 8c77b645d..6ebd50f2b 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Land.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Land.h @@ -1,18 +1,18 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" NS_BEGIN(Editor) -class CState_Player_Land final : public CState_Player +class CState_Land final : public CState_Root { public: - typedef struct tagLand : public CState_Player::STATE_PLAYER_DESC { + typedef struct tagLand : public CState_Root::STATE_ROOT_DESC { - }STATE_PLAYER_LAND_DESC; + }STATE_LAND_DESC; private: - CState_Player_Land(); - virtual ~CState_Player_Land() = default; + CState_Land(); + virtual ~CState_Land() = default; public: virtual void Enter(); @@ -20,10 +20,10 @@ class CState_Player_Land final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_LAND_DESC* pDesc); + HRESULT Initialize(STATE_LAND_DESC* pDesc); public: - static CState_Player_Land* Create(STATE_PLAYER_LAND_DESC* pDesc); + static CState_Land* Create(STATE_LAND_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Move.h b/Jusin154_Team3D/Editor/Public/State_Player_Move.h index e11b26c39..87e0472fb 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player_Move.h +++ b/Jusin154_Team3D/Editor/Public/State_Player_Move.h @@ -1,18 +1,19 @@ #pragma once #include "Editor_Define.h" -#include "State_Player.h" +#include "State_Root.h" NS_BEGIN(Editor) -class CState_Player_Move final : public CState_Player +class CState_Move final : public CState_Root { public: - typedef struct tagMove : public CState_Player::STATE_PLAYER_DESC { - - }STATE_PLAYER_MOVE_DESC; + typedef struct tagMove : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_MOVE_DESC; private: - CState_Player_Move(); - virtual ~CState_Player_Move() = default; + CState_Move(); + virtual ~CState_Move() = default; public: virtual void Enter(); @@ -20,10 +21,14 @@ class CState_Player_Move final : public CState_Player virtual void Exit(); private: - HRESULT Initialize(STATE_PLAYER_MOVE_DESC* pDesc); + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_MOVE_DESC* pDesc); public: - static CState_Player_Move* Create(STATE_PLAYER_MOVE_DESC* pDesc); + static CState_Move* Create(STATE_MOVE_DESC* pDesc); virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Editor/Public/State_Player.h b/Jusin154_Team3D/Editor/Public/State_Root.h similarity index 73% rename from Jusin154_Team3D/Editor/Public/State_Player.h rename to Jusin154_Team3D/Editor/Public/State_Root.h index ca51e8ab9..0c36d0db2 100644 --- a/Jusin154_Team3D/Editor/Public/State_Player.h +++ b/Jusin154_Team3D/Editor/Public/State_Root.h @@ -4,18 +4,18 @@ NS_BEGIN(Editor) -class CState_Player abstract : public CState +class CState_Root abstract : public CState { protected: - typedef struct tagStatePlayer : public CState::STATEDESC { + typedef struct tagStateRoot : public CState::STATEDESC { function funcExitCheck = { nullptr }; function funcEnterEvent = { nullptr }; function funcExitEvent = { nullptr }; - }STATE_PLAYER_DESC; + }STATE_ROOT_DESC; protected: - CState_Player(); - virtual ~CState_Player() = default; + CState_Root(); + virtual ~CState_Root() = default; protected: virtual void Enter() override; @@ -28,9 +28,9 @@ class CState_Player abstract : public CState function m_funcExitEvent = { nullptr }; protected: - HRESULT Initialize(STATE_PLAYER_DESC* pArg); + HRESULT Initialize(STATE_ROOT_DESC* pArg); -public: +protected: virtual void Free() override; virtual void Describe_Entity(); }; diff --git a/Jusin154_Team3D/Engine/Private/FSM.cpp b/Jusin154_Team3D/Engine/Private/FSM.cpp index 5312974af..2c074a38c 100644 --- a/Jusin154_Team3D/Engine/Private/FSM.cpp +++ b/Jusin154_Team3D/Engine/Private/FSM.cpp @@ -40,11 +40,11 @@ void CFSM::Change_State(size_t iStateMask) m_pCurrentState->Enter(); } -void CFSM::Update_State(_float fTimeDelta) +HRESULT CFSM::Update_State(_float fTimeDelta) { if (nullptr != m_pCurrentState) { - m_pCurrentState->Update(fTimeDelta); + return m_pCurrentState->Update(fTimeDelta); } } diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 219bd03c7..8aac91a8f 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -33,7 +33,7 @@ class ENGINE_DLL CFSM final : public CComponent public: void Change_State(size_t iStateMask); - void Update_State(_float fTimeDelta); + HRESULT Update_State(_float fTimeDelta); CState* Get_PrevState() { return m_pPreviousState; } size_t Get_PrevStateMask() { return m_iPreviousStateMask; } diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 27f5f9c52..355ea8a5b 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -48,7 +48,7 @@ class ENGINE_DLL CState abstract : public CBase protected: HRESULT Initialize(STATEDESC* pArg); -public: +protected: virtual void Free() override; virtual void Describe_Entity(); }; From 829775224778f23293edd93452f8440578a0facd Mon Sep 17 00:00:00 2001 From: qordlsgur <127704460+qordlsgur@users.noreply.github.com> Date: Sat, 22 Nov 2025 22:50:41 +0900 Subject: [PATCH 04/12] =?UTF-8?q?[Add]=20=EC=B2=B4=EB=A0=A5=EB=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShaderFiles/Shader_UIEditor.hlsl | 18 +++-- .../Bin/Resources/Textures/Action/HpBarBG.png | Bin 17367 -> 16545 bytes .../Resources/Textures/Action/HpBarBG1.png | Bin 0 -> 17367 bytes .../Editor/Default/Editor.vcxproj.filters | 14 ++-- Jusin154_Team3D/Editor/Private/HpBarBG.cpp | 67 +++++++++++++++--- Jusin154_Team3D/Editor/Public/HpBarBG.h | 20 ++++-- 6 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG1.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index d3a887b6b..fd32c126f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/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; @@ -522,14 +524,22 @@ PS_OUT PS_HpBar(PS_IN In) } 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); - - Color = tex1; - + 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(Color.r >= 0.01f) + if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f))) Color = tex2; Color.a *= Alpha; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png index 0275521bedb42900b66f27850f861f65d6a445c2..217244033f77e55b58b20af0b46528eda65a13bf 100644 GIT binary patch literal 16545 zcmZ|1Wk4K3(>1y{!5xy|5Zv7@c+lYP9^7pgcL_;=V2cI!kVS$!L4!MsyDzSH^Ssaf zYP;00016Nm2GA0Duqz-^0AS+(+Ymt3W-0I+q8+sLz4TR8M66t$ zIV`MQEp0gbo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8$V0z067+>6OVr2zrdAzHEH1}P)Uth7mFT+vaMxSPX5k847#=+HK*-WC9_(|@U zugInT4#x_IgX1Bsk3z39C8{p1(oDNZnuolPXnDMq2pIT1SW4C`8k`?YKF@P_megWc z%;bTDBoCS4fSs1G@^~YMA<5^N_{ozT*|f90Hhh{O6vg964}e} z(zoAVFF;!Ez_ptc4txHf;y57;6~&Z=O&khL;76h`#>%_&%+2=*;_LMMy@vR$uZFlT zt0%5CkvDq9fY$YpM-R`27sG<11$kW zKV1YSXB%A4g1-}h^5v3ix{^0t#hWsKtC_K`1{P(IK?c97aIN+xo31aUQ{z)%8w4DL zyE*V4&(rl)Dg85(-zi-b)ZeAyvftn63?PNUEm#p&Za;A?Qv9_tkPI@&;Qb5NDga(@ z6Y|Q1vtUrEkCf>0^iEEYAtl)l(ns@3-@jiNz?A@%z7__MnSe6LAcOY {0db597d8-c4e7-479a-9b7e-9014b79a5e03} - - {7e8b7123-11fb-4946-99fe-3265932d0536} - {072a4e85-ba07-4ffd-bdb1-ddac02558242} @@ -358,6 +355,9 @@ {92110a48-81d0-4e98-be06-05dd078d0488} + + {7e8b7123-11fb-4946-99fe-3265932d0536} + @@ -688,8 +688,8 @@ 50.UI\GamePlay_Canvas\Action_Panel\Slot_Number - 50.UI\GamePlay_Canvas\Action_Panel\HPBarBG - + 50.UI\GamePlay_Canvas\Action_Panel\HpBarBG + 02.GameObjects\Camera\Camera_Gaze @@ -1034,8 +1034,8 @@ 50.UI\GamePlay_Canvas\Action_Panel\Slot_Number - 50.UI\GamePlay_Canvas\Action_Panel\HPBarBG - + 50.UI\GamePlay_Canvas\Action_Panel\HpBarBG + 02.GameObjects\Camera\Camera_Gaze diff --git a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp index 1f9b5b178..453d3da78 100644 --- a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp +++ b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp @@ -21,10 +21,10 @@ HRESULT CHpBarBG::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = 0.f; - Desc.fSizeX = 194.f; - Desc.fSizeY = 32.f; + Desc.fX = 220.f; + Desc.fY = 180.f; + Desc.fSizeX = 144.f; + Desc.fSizeY = 24.f; m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; @@ -40,7 +40,11 @@ HRESULT CHpBarBG::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 1.f; - m_vNine_Slice = _float4(27.f, 165.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f); + m_vNine_Slice = _float4(27.f, 125.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f); + m_fMaxHp = 20.f; + m_fCurrentHp = m_fMaxHp; + m_fMoveSpeed = 5.f; + m_fHpBG = _float2(0, m_fSizeX); return S_OK; } @@ -82,9 +86,27 @@ void CHpBarBG::Update(_float fTimeDelta) m_bFadeOut = false; m_fAlpha = 0.f; } - } + } + + if (m_pGameInstance->Key_Down(DIK_2)) + Lerp_PosX(10.f); + if (m_pGameInstance->Key_Down(DIK_3)) + Lerp_PosX(-10.f); + + if (m_fCurrentHp < 0.f) + m_fCurrentHp = 0.f; + if (m_fDamage <= 0.f) + m_fDamage = 0.f; + TargetHp = m_fMaxHp - m_fDamage; + + if (TargetHp > m_fCurrentHp) + Heal(fTimeDelta); + else if(TargetHp < m_fCurrentHp) + Hit(fTimeDelta); + m_fHpBar = m_fCurrentHp / m_fMaxHp; m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); } @@ -123,6 +145,27 @@ _vector CHpBarBG::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } +void CHpBarBG::Lerp_PosX(_float X) +{ + m_fDamage += X; +} + +void CHpBarBG::Heal(_float fTimeDelta) +{ + m_fCurrentHp = CMyTools::Lerp_f1D(TargetHp, m_fCurrentHp, fTimeDelta * m_fMoveSpeed); +} + +void CHpBarBG::Hit(_float fTimeDelta) +{ + m_fCurrentHp = CMyTools::Lerp_f1D(m_fCurrentHp, TargetHp, fTimeDelta * m_fMoveSpeed); +} + +void CHpBarBG::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_fX -= (fSizeX - m_vScale.x) * 0.5f; +} + HRESULT CHpBarBG::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -172,11 +215,19 @@ HRESULT CHpBarBG::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) { return E_FAIL; - } + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fHp", &m_fHpBar, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fHpBG", &m_fHpBG, sizeof(_float2)))) + { + return E_FAIL; + } return S_OK; } @@ -186,7 +237,7 @@ HRESULT CHpBarBG::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_HealthMeter_Middle_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_HpBarBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Public/HpBarBG.h b/Jusin154_Team3D/Editor/Public/HpBarBG.h index 59c7aa186..4fdd682c2 100644 --- a/Jusin154_Team3D/Editor/Public/HpBarBG.h +++ b/Jusin154_Team3D/Editor/Public/HpBarBG.h @@ -18,8 +18,12 @@ class CHpBarBG final : public CElementObject virtual void Late_Update(_float fTimeDelta); virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; + virtual void Lerp_PosX(_float X) override; - +public: + void Heal(_float fTimeDelta); + void Hit(_float fTimeDelta); + virtual void SizeUpX(_float SizeX) override; private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -27,11 +31,17 @@ class CHpBarBG final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; - CTexture* m_pDiffuse_TextureCom1 = { nullptr }; - CShader* m_pShaderCom = { nullptr }; - CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _float m_fMaxHp{}; + _float m_fCurrentHp{}; + _float m_fHpBar{}; + _float m_fDamage{}; + _float TargetHp{}; + _float2 m_fHpBG{}; public: static CHpBarBG* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; From 232a929818afac7fc64996a8dc88dbd2d1c605b2 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 10:17:19 +0900 Subject: [PATCH 05/12] [add] FSM --- .../Editor/Default/Editor.vcxproj.filters | 3 + .../Editor/Private/DummySkyBox.cpp | 5 + Jusin154_Team3D/Editor/Private/Loader.cpp | 215 ++++++++++-------- Jusin154_Team3D/Editor/Private/Player.cpp | 137 +++++------ Jusin154_Team3D/Editor/Public/Loader.h | 1 + Jusin154_Team3D/Editor/Public/Player.h | 7 +- Jusin154_Team3D/Engine/Private/FSM.cpp | 12 + .../Engine/Private/GameInstance.cpp | 9 + Jusin154_Team3D/Engine/Private/Unit.cpp | 7 +- Jusin154_Team3D/Engine/Public/FSM.h | 19 +- Jusin154_Team3D/Engine/Public/MyTools.h | 22 +- 11 files changed, 242 insertions(+), 195 deletions(-) diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index e3cc82cf8..47cd55432 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -337,6 +337,9 @@ {0b8cac41-419f-48ce-87bc-805b8962b4df} + + {37f63815-c3b1-4e85-8b38-a502635d43e6} + diff --git a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp index 1ee99e584..f2457673e 100644 --- a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp +++ b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp @@ -40,7 +40,12 @@ void CDummySkyBox::Priority_Update(_float fTimeDelta) void CDummySkyBox::Update(_float fTimeDelta) { +#ifdef 기무리 + m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); +#endif // 기무리 +#ifndef 기무리 m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); +#endif // !기무리 } void CDummySkyBox::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 1cca3dfba..f452d2323 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1211,124 +1211,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.."); diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 7b230a1e2..a37223681 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -50,9 +50,14 @@ HRESULT CPlayer::Initialize(void* pArg) 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; } @@ -66,7 +71,8 @@ void CPlayer::Update(_float fTimeDelta) { m_pModelCom->ComputeSkinning(); - Key_Input(fTimeDelta); + IsSprint(); + IsWalk(); m_pFSM->Update_State(fTimeDelta); @@ -122,7 +128,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"); @@ -206,60 +215,12 @@ 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() -{ - m_InputConditions = - { - { 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); } } - }; -} - -void CPlayer::Key_Input(_float fTimeDelta) -{ - if (m_pFSM->IsEnable(FSMSTATE::WALK|FSMSTATE::SPRINT |FSMSTATE::DODGE |FSMSTATE::JOG)) - { - if (m_pGameInstance->Key_Pressing(DIK_LEFT)){ - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); - } - - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)){ - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); - } - } - - IsSprint(); - - IsWalk(); -} - HRESULT CPlayer::InputSystem() { if (m_pGameInstance->Key_Down(DIK_1) @@ -294,12 +255,12 @@ HRESULT CPlayer::InputSkill() return E_FAIL; } -HRESULT CPlayer::InputRun() +HRESULT CPlayer::InputMove() { - if (m_pGameInstance->Mouse_Pressing(DIK_UP) - || m_pGameInstance->Mouse_Pressing(DIK_LEFT) - || m_pGameInstance->Mouse_Pressing(DIK_DOWN) - || m_pGameInstance->Mouse_Pressing(DIK_RIGHT)) + if (m_pGameInstance->Key_Pressing(DIK_UP) + || m_pGameInstance->Key_Pressing(DIK_LEFT) + || m_pGameInstance->Key_Pressing(DIK_DOWN) + || m_pGameInstance->Key_Pressing(DIK_RIGHT)) { return S_OK; } @@ -333,7 +294,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck() // Action return E_FAIL; } - if (SUCCEEDED(InputRun())) { + if (SUCCEEDED(InputMove())) { m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } @@ -342,23 +303,45 @@ HRESULT CPlayer::Behavior_IdleExitCheck() void CPlayer::Behavior_MoveEnter() { - pair<_uint, _bool> pairAnimInfo = {}; + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + _bool bFoward = m_pGameInstance->Key_Pressing(DIK_UP); + _bool bLeft = m_pGameInstance->Key_Pressing(DIK_LEFT); + _bool bRight = m_pGameInstance->Key_Pressing(DIK_RIGHT); + _bool bBackward = m_pGameInstance->Key_Pressing(DIK_DOWN); - if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { - // Idle -> Move - } - else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) { - // OtherMove -> AnotherMove + 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) { + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + } + else if (true == m_bWalkToggle) { + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + 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 if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) { - // Combat -> Move - } - else { + else { // While Moving if (true == m_bSprintToggle) { pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } else if (true == m_bWalkToggle) { - if (true == m_pGameInstance->Key_Pressing(DIK_UP)) { + if (true == bFoward) { pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; } else { @@ -380,7 +363,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck() // Action return E_FAIL; } - if (SUCCEEDED(InputRun())) { + if (SUCCEEDED(InputMove())) { return S_OK; } m_pFSM->Change_State(FSMSTATE::IDLE); @@ -389,14 +372,14 @@ HRESULT CPlayer::Behavior_MoveExitCheck() void CPlayer::Behavior_JumpEnter() { - pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_SPRINT); + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT]; 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 = Get_AnimInfo(STATEANIM::JUMP_JOG); + pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG]; } else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { @@ -611,16 +594,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/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 e5a08d552..90f3abed9 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -31,6 +31,7 @@ class CPlayer final : public CUnit private: unordered_map m_States = { }; size_t m_iStateMask = { 0 }; + _float m_fDirectionRadian = 0.f; vector m_InputConditions; _bool m_bSprintToggle = { false }; @@ -42,13 +43,10 @@ class CPlayer final : public CUnit HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); - void Setup_InputConditions(); - void Key_Input(_float fTimeDelta); - HRESULT InputSystem(); HRESULT InputSkill(); - HRESULT InputRun(); + HRESULT InputMove(); void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); @@ -76,7 +74,6 @@ class CPlayer final : public CUnit private: virtual void Add_FSM(); virtual void Set_Anim(); - _bool Check(FSMSTATE::ESTATE state); _bool IsSprint(); _bool IsWalk(); public: diff --git a/Jusin154_Team3D/Engine/Private/FSM.cpp b/Jusin154_Team3D/Engine/Private/FSM.cpp index 2c074a38c..8ab5ae9cd 100644 --- a/Jusin154_Team3D/Engine/Private/FSM.cpp +++ b/Jusin154_Team3D/Engine/Private/FSM.cpp @@ -12,6 +12,17 @@ CFSM::CFSM(const CFSM& 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; @@ -46,6 +57,7 @@ HRESULT CFSM::Update_State(_float fTimeDelta) { return m_pCurrentState->Update(fTimeDelta); } + return S_OK; } CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index c3f2ac1a2..52fc982e6 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); 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/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 8aac91a8f..99e902385 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -1,14 +1,17 @@ #include "Component.h" NS_BEGIN(FSMSTATE) -enum ESTATE +enum ESTATE : Engine::_u64Flag { - ROOT, - IDLE,IDLE_TURN, - MOVE, WALK, FWD, BWD, JOG, SPRINT, - JUMP, - LAND, - DODGE, + 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, LIGHT_ATTACK, CAST, SKILL,SKILL2, END }; @@ -45,6 +48,8 @@ class ENGINE_DLL CFSM final : public CComponent 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: unordered_map* m_pStates = { nullptr }; size_t* m_pStateMask = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index 50ad36e03..d54c145d8 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -128,12 +128,8 @@ class CMyTools { 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)); @@ -179,8 +175,8 @@ class CMyTools { } 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 +190,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 region FileSystem //static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive, // /* 탐색할 폴더 경로 */ _In_ const _wstring& TargetPath, From 258bef56a928aefaee17c98fb07389c1eaf6d8ea Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 11:18:51 +0900 Subject: [PATCH 06/12] =?UTF-8?q?[add]=20=EC=9B=80=EC=A7=81=EC=9E=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShaderFiles/Shader_VtxAnimMesh.hlsl | 42 ++--- .../Editor/Default/Editor.vcxproj.filters | 9 +- Jusin154_Team3D/Editor/Private/Goblin.cpp | 6 +- Jusin154_Team3D/Editor/Private/Player.cpp | 149 ++++++++++++++---- Jusin154_Team3D/Editor/Public/Player.h | 5 + Jusin154_Team3D/Engine/Public/FSM.h | 6 +- 6 files changed, 144 insertions(+), 73 deletions(-) diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index e0fd8e188..06f94131b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -1,15 +1,6 @@ #include "Engine_Shader_Defines.hlsli" -struct SkinngMesh -{ - float3 vPosition; - float3 vNormal; - float3 vTangent; - float3 vBinormal; - float2 vTexcoord; -}; - matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; @@ -31,7 +22,6 @@ Texture2D g_DAOTexture : register(t2); Texture2D g_THVTexture : register(t3); Texture2D g_SurfaceParamsTexture : register(t4); -StructuredBuffer g_SkinngMesh : register(t5); float3 g_RootColor; float3 g_TipColor; @@ -67,31 +57,23 @@ 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); - - //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); + 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); + 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); - matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -99,7 +81,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; + Out.vTexcoord = In.vTexcoord; //In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index ac7982b2b..196e7b62e 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -300,7 +300,7 @@ {7e8b7123-11fb-4946-99fe-3265932d0536} - + {072a4e85-ba07-4ffd-bdb1-ddac02558242} @@ -340,9 +340,6 @@ {0b8cac41-419f-48ce-87bc-805b8962b4df} - - {37f63815-c3b1-4e85-8b38-a502635d43e6} - @@ -650,7 +647,7 @@ 50.UI\GamePlay_Canvas\Action_Panel\HPBarBG - + 02.GameObjects\Camera\Camera_Gaze @@ -969,7 +966,7 @@ 50.UI\GamePlay_Canvas\Action_Panel\HPBarBG - + 02.GameObjects\Camera\Camera_Gaze diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index 35a0f34eb..5756bd09d 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -41,7 +41,7 @@ void CGoblin::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - m_pModelCom->ComputeSkinning(); + //m_pModelCom->ComputeSkinning(); } void CGoblin::Late_Update(_float fTimeDelta) @@ -71,8 +71,8 @@ HRESULT CGoblin::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, 0))) - 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/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index a37223681..09f1428d1 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -69,7 +69,7 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); + //m_pModelCom->ComputeSkinning(); IsSprint(); IsWalk(); @@ -109,8 +109,8 @@ HRESULT CPlayer::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; + //if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + // return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; @@ -237,18 +237,20 @@ HRESULT CPlayer::InputSystem() HRESULT CPlayer::InputSkill() { - if (m_pGameInstance->Key_Down(DIK_SPACE) - || m_pGameInstance->Key_Down(DIK_Q) + 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_F) - || m_pGameInstance->Key_Down(DIK_Z) - || m_pGameInstance->Key_Down(DIK_X) - || 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)) + || 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) + ) { return S_OK; } @@ -257,10 +259,10 @@ HRESULT CPlayer::InputSkill() HRESULT CPlayer::InputMove() { - if (m_pGameInstance->Key_Pressing(DIK_UP) - || m_pGameInstance->Key_Pressing(DIK_LEFT) - || m_pGameInstance->Key_Pressing(DIK_DOWN) - || m_pGameInstance->Key_Pressing(DIK_RIGHT)) + 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; } @@ -277,6 +279,9 @@ void CPlayer::Behavior_IdleEnter() { 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] + } } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); @@ -291,7 +296,27 @@ HRESULT CPlayer::Behavior_IdleExitCheck() return S_OK; } if (SUCCEEDED(InputSkill())) { - // Action + 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())) { @@ -301,27 +326,39 @@ HRESULT CPlayer::Behavior_IdleExitCheck() 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_UP); - _bool bLeft = m_pGameInstance->Key_Pressing(DIK_LEFT); - _bool bRight = m_pGameInstance->Key_Pressing(DIK_RIGHT); - _bool bBackward = m_pGameInstance->Key_Pressing(DIK_DOWN); + _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 { + else if (true == bBackward) { pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; } } @@ -337,16 +374,24 @@ void CPlayer::Behavior_MoveEnter() } 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 { + } + 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]; + //} } } @@ -360,7 +405,27 @@ HRESULT CPlayer::Behavior_MoveExitCheck() return S_OK; } if (SUCCEEDED(InputSkill())) { - // Action + 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())) { @@ -370,9 +435,15 @@ HRESULT CPlayer::Behavior_MoveExitCheck() 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 @@ -404,6 +475,11 @@ HRESULT CPlayer::Behavior_JumpExitCheck() 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); @@ -423,6 +499,11 @@ HRESULT CPlayer::Behavior_LandExitCheck() return S_OK; } +void CPlayer::Behavior_LandExit() +{ + m_pFSM->Disable_State(FSMSTATE::LAND); +} + void CPlayer::Behavior_DodgeEnter() { // 혹시 @@ to Dodge 있으면 여기에 @@ -443,6 +524,11 @@ HRESULT CPlayer::Behavior_DodgeExitCheck() return S_OK; } +void CPlayer::Behavior_DodgeExit() +{ + m_pFSM->Disable_State(FSMSTATE::DODGE); +} + void CPlayer::Add_FSM() { #pragma region Behavior_Movement_NotFocus @@ -451,7 +537,7 @@ void CPlayer::Add_FSM() Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; - Desc.funcExitEvent = nullptr; + Desc.funcExitEvent = [this]() { Behavior_IdleExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); @@ -461,7 +547,7 @@ void CPlayer::Add_FSM() Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; - Desc.funcExitEvent = nullptr; + Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); @@ -473,7 +559,7 @@ void CPlayer::Add_FSM() Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); }; Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); }; - Desc.funcExitEvent = nullptr; + Desc.funcExitEvent = [this]() { Behavior_JumpExit(); }; m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc)); } { @@ -481,7 +567,7 @@ void CPlayer::Add_FSM() Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); }; Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); }; - Desc.funcExitEvent = nullptr; + Desc.funcExitEvent = [this]() { Behavior_LandExit(); }; m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc)); } { @@ -489,7 +575,7 @@ void CPlayer::Add_FSM() Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); }; Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); }; - Desc.funcExitEvent = nullptr; + Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); @@ -611,3 +697,4 @@ _bool CPlayer::IsWalk() } return false; } +//////////////////// diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 90f3abed9..1358244b0 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -50,18 +50,23 @@ class CPlayer final : public CUnit 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: diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 99e902385..1b3dea2a4 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -41,9 +41,9 @@ class ENGINE_DLL CFSM final : public CComponent 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 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; } From 9f559a127e44dad6f001a349b3237bf2f2edbc10 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 11:33:36 +0900 Subject: [PATCH 07/12] [delete] client States --- Jusin154_Team3D/Client/Default/Client.vcxproj | 30 ---- .../Client/Default/Client.vcxproj.filters | 161 +----------------- Jusin154_Team3D/Client/Private/State_Cast.cpp | 67 -------- .../Client/Private/State_Combat.cpp | 60 ------- .../Client/Private/State_Dodge.cpp | 53 ------ Jusin154_Team3D/Client/Private/State_Idle.cpp | 71 -------- .../Client/Private/State_Idle_Turn.cpp | 88 ---------- Jusin154_Team3D/Client/Private/State_Jog.cpp | 57 ------- Jusin154_Team3D/Client/Private/State_Jump.cpp | 55 ------ Jusin154_Team3D/Client/Private/State_Land.cpp | 49 ------ .../Client/Private/State_LightAttack.cpp | 69 -------- Jusin154_Team3D/Client/Private/State_Move.cpp | 55 ------ Jusin154_Team3D/Client/Private/State_Root.cpp | 62 ------- .../Client/Private/State_Skill.cpp | 40 ----- .../Client/Private/State_Skill2.cpp | 42 ----- .../Client/Private/State_Sprint.cpp | 48 ------ Jusin154_Team3D/Client/Private/State_Walk.cpp | 54 ------ Jusin154_Team3D/Client/Public/State_Cast.h | 19 --- Jusin154_Team3D/Client/Public/State_Combat.h | 19 --- Jusin154_Team3D/Client/Public/State_Dodge.h | 19 --- Jusin154_Team3D/Client/Public/State_Idle.h | 21 --- .../Client/Public/State_Idle_Turn.h | 21 --- Jusin154_Team3D/Client/Public/State_Jog.h | 21 --- Jusin154_Team3D/Client/Public/State_Jump.h | 20 --- Jusin154_Team3D/Client/Public/State_Land.h | 20 --- .../Client/Public/State_LightAttack.h | 19 --- Jusin154_Team3D/Client/Public/State_Move.h | 19 --- Jusin154_Team3D/Client/Public/State_Root.h | 19 --- Jusin154_Team3D/Client/Public/State_Skill.h | 19 --- Jusin154_Team3D/Client/Public/State_Skill2.h | 19 --- Jusin154_Team3D/Client/Public/State_Sprint.h | 21 --- Jusin154_Team3D/Client/Public/State_Walk.h | 21 --- 32 files changed, 1 insertion(+), 1357 deletions(-) delete mode 100644 Jusin154_Team3D/Client/Private/State_Cast.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Combat.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Dodge.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Idle.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Jog.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Jump.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Land.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_LightAttack.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Move.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Root.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Skill.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Skill2.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Sprint.cpp delete mode 100644 Jusin154_Team3D/Client/Private/State_Walk.cpp delete mode 100644 Jusin154_Team3D/Client/Public/State_Cast.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Combat.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Dodge.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Idle.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Idle_Turn.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Jog.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Jump.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Land.h delete mode 100644 Jusin154_Team3D/Client/Public/State_LightAttack.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Move.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Root.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Skill.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Skill2.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Sprint.h delete mode 100644 Jusin154_Team3D/Client/Public/State_Walk.h diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 9c88f7596..09a7a54f8 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -192,21 +192,6 @@ - - - - - - - - - - - - - - - @@ -246,21 +231,6 @@ - - - - - - - - - - - - - - - diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index d48707800..d44a2df9b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -64,66 +64,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 @@ -233,12 +179,6 @@ {1bfec6dc-f008-4d18-87d6-be38824b1272} - - {3eb21e8e-e01c-47fe-828e-800212456eb5} - - - {9f952e5a-835c-4de9-b7b5-9a731912774d} - {c5b61cb3-bc5f-4429-8715-b309dcf054b2} @@ -316,51 +256,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} @@ -436,66 +331,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 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 deleted file mode 100644 index bdff385da..000000000 --- a/Jusin154_Team3D/Client/Private/State_Combat.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "pch.h" -#include "State_Combat.h" -#include "Unit.h" - - -CState_Combat::CState_Combat() - :CState() -{ -} - -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); - -} - -void CState_Combat::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Combat::Exit() -{ -} - -_bool CState_Combat::CheckExitState() -{ - if (m_pOwner->IsCurrentKeyFrame("Jump")) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::MOVE); - return true; - } - - return false; -} - - -void CState_Combat::Free() -{ - __super::Free(); -} - -void CState_Combat::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Dodge.cpp b/Jusin154_Team3D/Client/Private/State_Dodge.cpp deleted file mode 100644 index 3c4ce4151..000000000 --- a/Jusin154_Team3D/Client/Private/State_Dodge.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "pch.h" -#include "State_Dodge.h" -#include "Unit.h" - - -CState_Dodge::CState_Dodge() - :CState() -{ -} - -void CState_Dodge::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Dodge::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Dodge::Exit() -{ -} - -_bool CState_Dodge::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - 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; -} - -void CState_Dodge::Free() -{ - __super::Free(); -} - -void CState_Dodge::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Idle.cpp b/Jusin154_Team3D/Client/Private/State_Idle.cpp deleted file mode 100644 index 5f4140c0c..000000000 --- a/Jusin154_Team3D/Client/Private/State_Idle.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "pch.h" -#include "State_Idle.h" -#include "Unit.h" - -CState_Idle::CState_Idle() - :CState() -{ -} - -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); - } -} - -void CState_Idle::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Idle::Exit() -{ -} - -_bool CState_Idle::CheckExitState() -{ - if (m_pOwner->Check(FSMSTATE::JOG)) - m_pFSM->Change_State(FSMSTATE::JOG); - - 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::IDLE_TURN)) - m_pFSM->Change_State(FSMSTATE::IDLE_TURN); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); - - return false; -} - -void CState_Idle::Free() -{ - __super::Free(); -} - -void CState_Idle::Describe_Entity() -{ -} 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 deleted file mode 100644 index 051f93fb0..000000000 --- a/Jusin154_Team3D/Client/Private/State_Jump.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "pch.h" -#include "State_Jump.h" -#include "Unit.h" - - -CState_Jump::CState_Jump() - :CState() -{ -} - -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); -} - -void CState_Jump::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Jump::Exit() -{ -} - -_bool CState_Jump::CheckExitState() -{ - if (m_pOwner->IsCurrentKeyFrame("Jump")) - m_pFSM->Change_State(FSMSTATE::LAND); - - return false; -} - -void CState_Jump::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 deleted file mode 100644 index 7fda0cd37..000000000 --- a/Jusin154_Team3D/Client/Private/State_Land.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "pch.h" -#include "State_Land.h" -#include "Unit.h" - - -CState_Land::CState_Land() - :CState() -{ -} - -void CState_Land::Enter() -{ - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND); - m_pModel->Set_AnimationIndex(anim.first, anim.second); -} - -void CState_Land::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Land::Exit() -{ -} - -_bool CState_Land::CheckExitState() -{ - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); - - - 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; -} - -void CState_Land::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 deleted file mode 100644 index cce8c760f..000000000 --- a/Jusin154_Team3D/Client/Private/State_Move.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "pch.h" -#include "State_Move.h" -#include "Unit.h" - - -CState_Move::CState_Move() - :CState() -{ -} - -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); -} - -void CState_Move::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Move::Exit() -{ -} - -_bool CState_Move::CheckExitState() -{ - return false; -} - - -void CState_Move::Free() -{ - __super::Free(); -} - -void CState_Move::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Client/Private/State_Root.cpp b/Jusin154_Team3D/Client/Private/State_Root.cpp deleted file mode 100644 index efef8727b..000000000 --- a/Jusin154_Team3D/Client/Private/State_Root.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "pch.h" -#include "State_Root.h" -#include "Unit.h" - - -CState_Root::CState_Root() - :CState() -{ -} - -void CState_Root::Enter() -{ - if (m_pOwner->Check(FSMSTATE::COMBAT)) - m_pFSM->Change_State(FSMSTATE::COMBAT); - - else - m_pFSM->Change_State(FSMSTATE::MOVE); -} - -void CState_Root::Update(_float fTimeDelta) -{ - if (CheckExitState()) - return; -} - -void CState_Root::Exit() -{ -} - -_bool CState_Root::CheckExitState() -{ - 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; -} - - -void CState_Root::Free() -{ - __super::Free(); -} - -void CState_Root::Describe_Entity() -{ -} 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/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 deleted file mode 100644 index b9359bf4b..000000000 --- a/Jusin154_Team3D/Client/Public/State_Combat.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Combat final : public CState -{ -public: - CState_Combat(); - virtual ~CState_Combat() = 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_Dodge.h b/Jusin154_Team3D/Client/Public/State_Dodge.h deleted file mode 100644 index 4c171ee2f..000000000 --- a/Jusin154_Team3D/Client/Public/State_Dodge.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Dodge final : public CState -{ -public: - CState_Dodge(); - virtual ~CState_Dodge() = 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_Idle.h b/Jusin154_Team3D/Client/Public/State_Idle.h deleted file mode 100644 index 313baad80..000000000 --- a/Jusin154_Team3D/Client/Public/State_Idle.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Idle final : public CState -{ -public: - CState_Idle(); - virtual ~CState_Idle() = 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_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 deleted file mode 100644 index be66d9c71..000000000 --- a/Jusin154_Team3D/Client/Public/State_Jump.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Jump final : public CState -{ -public: - CState_Jump(); - virtual ~CState_Jump() = 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_Land.h b/Jusin154_Team3D/Client/Public/State_Land.h deleted file mode 100644 index df9c43b74..000000000 --- a/Jusin154_Team3D/Client/Public/State_Land.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Land final : public CState -{ -public: - CState_Land(); - virtual ~CState_Land() = 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_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 deleted file mode 100644 index 51fb9dcc6..000000000 --- a/Jusin154_Team3D/Client/Public/State_Move.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Move final : public CState -{ -public: - CState_Move(); - virtual ~CState_Move() = 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_Root.h b/Jusin154_Team3D/Client/Public/State_Root.h deleted file mode 100644 index 6ecdcff7a..000000000 --- a/Jusin154_Team3D/Client/Public/State_Root.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "State.h" - -class CState_Root final : public CState -{ -public: - CState_Root(); - virtual ~CState_Root() = 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_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(); -}; From 526de8377ae171d0adc21596a2e086eee2eeed20 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 11:37:54 +0900 Subject: [PATCH 08/12] [fix] player --- Jusin154_Team3D/Client/Private/Player.cpp | 136 ++-------------------- Jusin154_Team3D/Client/Public/Player.h | 9 +- 2 files changed, 16 insertions(+), 129 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 1c099c8b4..b44ed6eb8 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -12,22 +12,7 @@ #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 CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -61,13 +46,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); @@ -85,9 +73,11 @@ void CPlayer::Update(_float fTimeDelta) { m_pModelCom->ComputeSkinning(); - Key_Input(fTimeDelta); + IsSprint(); + IsWalk(); + + m_pFSM->Update_State(fTimeDelta); - m_pFSM->Update(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -267,110 +257,16 @@ HRESULT CPlayer::Bind_ShaderResources() return S_OK; } -void CPlayer::Setup_InputConditions() -{ - m_InputConditions = - { - { 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); } } - }; -} - -void CPlayer::Key_Input(_float fTimeDelta) -{ - 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_LEFT)) - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); - - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); - } - - IsSprint(); - - IsWalk(); -} - 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 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 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 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() { @@ -475,16 +371,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/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 9cab6a649..eb9f7b93e 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -29,9 +29,14 @@ 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_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; @@ -43,8 +48,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,9 +58,7 @@ 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(); public: From 6076666825b7e4fb0f21eb2f4cfbb2742d4ca855 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 13:06:27 +0900 Subject: [PATCH 09/12] [add] Client_States --- .../ShaderFiles/Shader_UIEditor.hlsl | 86 ++++++++++++++++++- Jusin154_Team3D/Client/Default/Client.cpp | 2 +- Jusin154_Team3D/Client/Default/Client.vcxproj | 18 +++- .../Client/Default/Client.vcxproj.filters | 69 ++++++++++++++- .../Client/Private/State_Player_Combat.cpp | 57 ++++++++++++ .../Client/Private/State_Player_Dodge.cpp | 64 ++++++++++++++ .../Client/Private/State_Player_Idle.cpp | 63 ++++++++++++++ .../Client/Private/State_Player_Jump.cpp | 56 ++++++++++++ .../Client/Private/State_Player_Land.cpp | 56 ++++++++++++ .../Client/Private/State_Player_Move.cpp | 65 ++++++++++++++ Jusin154_Team3D/Client/Private/State_Root.cpp | 51 +++++++++++ Jusin154_Team3D/Client/Public/Client_Struct.h | 9 -- .../Client/Public/State_Player_Combat.h | 31 +++++++ .../Client/Public/State_Player_Dodge.h | 36 ++++++++ .../Client/Public/State_Player_Idle.h | 35 ++++++++ .../Client/Public/State_Player_Jump.h | 31 +++++++ .../Client/Public/State_Player_Land.h | 31 +++++++ .../Client/Public/State_Player_Move.h | 36 ++++++++ Jusin154_Team3D/Client/Public/State_Root.h | 38 ++++++++ .../ShaderFiles/Shader_Deferred.hlsl | 2 +- .../ShaderFiles/Shader_Deferred.hlsl | 2 +- Jusin154_Team3D/Update_Shaders.bat | 4 +- 22 files changed, 820 insertions(+), 22 deletions(-) create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Combat.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Idle.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Jump.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Land.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Player_Move.cpp create mode 100644 Jusin154_Team3D/Client/Private/State_Root.cpp delete mode 100644 Jusin154_Team3D/Client/Public/Client_Struct.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Combat.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Dodge.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Idle.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Jump.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Land.h create mode 100644 Jusin154_Team3D/Client/Public/State_Player_Move.h create mode 100644 Jusin154_Team3D/Client/Public/State_Root.h 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 09a7a54f8..e6ac7ae5a 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -172,10 +172,6 @@ - - true - true - @@ -192,6 +188,13 @@ + + + + + + + @@ -231,6 +234,13 @@ + + + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index d44a2df9b..e5e146bf3 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 @@ -112,6 +109,27 @@ 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 + @@ -284,6 +302,30 @@ {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} + @@ -379,6 +421,27 @@ 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 + diff --git a/Jusin154_Team3D/Client/Private/State_Player_Combat.cpp b/Jusin154_Team3D/Client/Private/State_Player_Combat.cpp new file mode 100644 index 000000000..17674a15c --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Combat.cpp @@ -0,0 +1,57 @@ +#include "pch.h" +#include "State_Player_Combat.h" +#include "Unit.h" + + +CState_Combat::CState_Combat() + :CState_Root() +{ +} + +void CState_Combat::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Combat::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Combat::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pOwner = pDesc->pOwner; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + 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() +{ + __super::Free(); +} + +void CState_Combat::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp b/Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp new file mode 100644 index 000000000..f93785351 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Player_Dodge.h" +#include "Unit.h" + + +CState_Dodge::CState_Dodge() + :CState_Root() +{ +} + +void CState_Dodge::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Dodge::Update(_float fTimeDelta) +{ + 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(); +} + +HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc) +{ + 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_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() +{ + __super::Free(); +} + +void CState_Dodge::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Player_Idle.cpp b/Jusin154_Team3D/Client/Private/State_Player_Idle.cpp new file mode 100644 index 000000000..c11f1425d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Idle.cpp @@ -0,0 +1,63 @@ +#include "pch.h" +#include "State_Player_Idle.h" +#include "Unit.h" + +CState_Idle::CState_Idle() + :CState_Root() +{ +} + +void CState_Idle::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Idle::Update(_float fTimeDelta) +{ + 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(); +} + +HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc) +{ + 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_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() +{ + __super::Free(); +} + +void CState_Idle::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Player_Jump.cpp b/Jusin154_Team3D/Client/Private/State_Player_Jump.cpp new file mode 100644 index 000000000..ed972391b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Jump.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Jump.h" +#include "Unit.h" + + +CState_Jump::CState_Jump() + :CState_Root() +{ +} + +void CState_Jump::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Jump::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Jump::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + 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(); +} + +void CState_Jump::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Player_Land.cpp b/Jusin154_Team3D/Client/Private/State_Player_Land.cpp new file mode 100644 index 000000000..61ffcaba0 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Land.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Player_Land.h" +#include "Unit.h" + + +CState_Land::CState_Land() + :CState_Root() +{ +} + +void CState_Land::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Land::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Land::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +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(); +} + +void CState_Land::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Player_Move.cpp b/Jusin154_Team3D/Client/Private/State_Player_Move.cpp new file mode 100644 index 000000000..856c62bfc --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Player_Move.cpp @@ -0,0 +1,65 @@ +#include "pch.h" +#include "State_Player_Move.h" +#include "Unit.h" + + +CState_Move::CState_Move() + :CState_Root() +{ +} + +void CState_Move::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Move::Update(_float fTimeDelta) +{ + 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(); +} + +HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc) +{ + 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() +{ + __super::Free(); +} + +void CState_Move::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Root.cpp b/Jusin154_Team3D/Client/Private/State_Root.cpp new file mode 100644 index 000000000..18349525b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Root.cpp @@ -0,0 +1,51 @@ +#include "pch.h" +#include "State_Root.h" +#include "Unit.h" + +CState_Root::CState_Root() + :CState() +{ +} + +void CState_Root::Enter() +{ + if (nullptr != m_funcEnterEvent) { + m_funcEnterEvent(); + } +} + +HRESULT CState_Root::Update(_float fTimeDelta) +{ + HRESULT hr = { S_OK }; + if (nullptr != m_funcExitCheck) { + hr = m_funcExitCheck(fTimeDelta); + } + return hr; +} + +void CState_Root::Exit() +{ + if (nullptr != m_funcExitEvent) { + m_funcExitEvent(); + } +} + +HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg) +{ + 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(); +} + +void CState_Root::Describe_Entity() +{ +} 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/State_Player_Combat.h b/Jusin154_Team3D/Client/Public/State_Player_Combat.h new file mode 100644 index 000000000..df71f9f51 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Combat.h @@ -0,0 +1,31 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Combat final : public CState_Root +{ +public: + typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { + + }STATE_COMBAT_DESC; +private: + CState_Combat(); + virtual ~CState_Combat() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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_Player_Dodge.h b/Jusin154_Team3D/Client/Public/State_Player_Dodge.h new file mode 100644 index 000000000..110356625 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Dodge.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +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 HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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_Player_Idle.h b/Jusin154_Team3D/Client/Public/State_Player_Idle.h new file mode 100644 index 000000000..608255a26 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Idle.h @@ -0,0 +1,35 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +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 HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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/Client/Public/State_Player_Jump.h b/Jusin154_Team3D/Client/Public/State_Player_Jump.h new file mode 100644 index 000000000..810613bcb --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Jump.h @@ -0,0 +1,31 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +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 HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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_Player_Land.h b/Jusin154_Team3D/Client/Public/State_Player_Land.h new file mode 100644 index 000000000..f6245554a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Land.h @@ -0,0 +1,31 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +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 HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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_Player_Move.h b/Jusin154_Team3D/Client/Public/State_Player_Move.h new file mode 100644 index 000000000..c1e608035 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Player_Move.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +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 HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +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 new file mode 100644 index 000000000..5128a994d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Root.h @@ -0,0 +1,38 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +NS_BEGIN(Client) + +class CState_Root abstract : public CState +{ +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; + +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/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index df2e1e4bd..9413bf7ce 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -153,7 +153,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index df2e1e4bd..9413bf7ce 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -153,7 +153,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); 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 From 5570639f3d2fafcb998461466229b40e5d72dfaf Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 14:06:23 +0900 Subject: [PATCH 10/12] =?UTF-8?q?[fix]=20=EB=84=A4=EC=9E=84=EC=8A=A4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EC=98=A4=EB=A5=98=EC=88=98?= =?UTF-8?q?=EC=A0=95=20[add]=20=EC=8A=A4=ED=85=8C=EC=9D=B4=ED=8A=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD=20[add]=20=ED=81=B4?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EC=96=B8=ED=8A=B8=20Player=20FSM=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Default/Client.vcxproj | 24 +- .../Client/Default/Client.vcxproj.filters | 24 +- Jusin154_Team3D/Client/Private/Broom.cpp | 6 +- Jusin154_Team3D/Client/Private/MainApp.cpp | 4 + Jusin154_Team3D/Client/Private/Player.cpp | 383 +++++++++++++++++- ...ate_Player_Combat.cpp => State_Combat.cpp} | 2 +- .../Private/State_Dodge.cpp} | 2 +- .../Private/State_Idle.cpp} | 3 +- .../Private/State_Jump.cpp} | 2 +- .../Private/State_Land.cpp} | 2 +- .../Private/State_Move.cpp} | 2 +- Jusin154_Team3D/Client/Public/Broom.h | 5 - .../Public/CallBack_EffectHitBox_Behavior.h | 4 - .../Public/CallBack_EffectHitBox_HitReport.h | 4 - .../Client/Public/CallBack_Monster_Behavior.h | 4 - .../Public/CallBack_Monster_HitReport.h | 4 - .../Public/CallBack_Playable_Behavior.h | 4 - .../Public/CallBack_Playable_HitReport.h | 4 - .../Client/Public/Dummy_PhysXPlayable.h | 6 - .../Client/Public/Dummy_PhysXWall.h | 6 - Jusin154_Team3D/Client/Public/InfoInstance.h | 1 - Jusin154_Team3D/Client/Public/Level_Field.h | 3 +- .../Client/Public/Level_GamePlay.h | 3 +- Jusin154_Team3D/Client/Public/Level_Restart.h | 3 +- Jusin154_Team3D/Client/Public/Light_Main.h | 4 - Jusin154_Team3D/Client/Public/MapInfo.h | 1 - Jusin154_Team3D/Client/Public/MonsterInfo.h | 1 - Jusin154_Team3D/Client/Public/Player.h | 26 ++ Jusin154_Team3D/Client/Public/PlayerInfo.h | 1 - Jusin154_Team3D/Client/Public/SkyBox.h | 5 - .../{State_Player_Combat.h => State_Combat.h} | 0 .../{State_Player_Dodge.h => State_Dodge.h} | 0 .../{State_Player_Idle.h => State_Idle.h} | 1 + .../{State_Player_Jump.h => State_Jump.h} | 0 .../{State_Player_Land.h => State_Land.h} | 0 .../{State_Player_Move.h => State_Move.h} | 0 Jusin154_Team3D/Client/Public/Wand.h | 5 - Jusin154_Team3D/Editor/Default/Editor.vcxproj | 24 +- .../Editor/Default/Editor.vcxproj.filters | 24 +- Jusin154_Team3D/Editor/Private/Player.cpp | 12 +- ...ate_Player_Combat.cpp => State_Combat.cpp} | 2 +- .../Private/State_Dodge.cpp} | 2 +- .../Private/State_Idle.cpp} | 2 +- .../Private/State_Jump.cpp} | 2 +- .../Private/State_Land.cpp} | 2 +- .../Private/State_Move.cpp} | 2 +- Jusin154_Team3D/Editor/Public/Player.h | 24 +- .../{State_Player_Combat.h => State_Combat.h} | 0 .../{State_Player_Dodge.h => State_Dodge.h} | 0 .../{State_Player_Idle.h => State_Idle.h} | 0 .../{State_Player_Jump.h => State_Jump.h} | 0 .../{State_Player_Land.h => State_Land.h} | 0 .../{State_Player_Move.h => State_Move.h} | 0 Jusin154_Team3D/Engine/Public/Engine_Define.h | 2 +- Jusin154_Team3D/Engine/Public/FSM.h | 2 +- Jusin154_Team3D/Engine/Public/GameInstance.h | 2 +- Jusin154_Team3D/Engine/Public/Light.h | 2 +- .../Public/NCallBack_Playable_Behavior.h | 5 +- .../Public/NCallBack_Playable_HitRepot.h | 5 +- .../Engine/Public/Prototype_Manager.h | 2 +- Jusin154_Team3D/Engine/Public/RigidBody.h | 5 - Jusin154_Team3D/Engine/Public/State.h | 2 +- Jusin154_Team3D/Engine/Public/Unit.h | 3 - 63 files changed, 499 insertions(+), 176 deletions(-) rename Jusin154_Team3D/Client/Private/{State_Player_Combat.cpp => State_Combat.cpp} (96%) rename Jusin154_Team3D/{Editor/Private/State_Player_Dodge.cpp => Client/Private/State_Dodge.cpp} (97%) rename Jusin154_Team3D/{Editor/Private/State_Player_Idle.cpp => Client/Private/State_Idle.cpp} (95%) rename Jusin154_Team3D/{Editor/Private/State_Player_Jump.cpp => Client/Private/State_Jump.cpp} (96%) rename Jusin154_Team3D/{Editor/Private/State_Player_Land.cpp => Client/Private/State_Land.cpp} (96%) rename Jusin154_Team3D/{Editor/Private/State_Player_Move.cpp => Client/Private/State_Move.cpp} (97%) rename Jusin154_Team3D/Client/Public/{State_Player_Combat.h => State_Combat.h} (100%) rename Jusin154_Team3D/Client/Public/{State_Player_Dodge.h => State_Dodge.h} (100%) rename Jusin154_Team3D/Client/Public/{State_Player_Idle.h => State_Idle.h} (99%) rename Jusin154_Team3D/Client/Public/{State_Player_Jump.h => State_Jump.h} (100%) rename Jusin154_Team3D/Client/Public/{State_Player_Land.h => State_Land.h} (100%) rename Jusin154_Team3D/Client/Public/{State_Player_Move.h => State_Move.h} (100%) rename Jusin154_Team3D/Editor/Private/{State_Player_Combat.cpp => State_Combat.cpp} (96%) rename Jusin154_Team3D/{Client/Private/State_Player_Dodge.cpp => Editor/Private/State_Dodge.cpp} (97%) rename Jusin154_Team3D/{Client/Private/State_Player_Idle.cpp => Editor/Private/State_Idle.cpp} (97%) rename Jusin154_Team3D/{Client/Private/State_Player_Jump.cpp => Editor/Private/State_Jump.cpp} (96%) rename Jusin154_Team3D/{Client/Private/State_Player_Land.cpp => Editor/Private/State_Land.cpp} (96%) rename Jusin154_Team3D/{Client/Private/State_Player_Move.cpp => Editor/Private/State_Move.cpp} (97%) rename Jusin154_Team3D/Editor/Public/{State_Player_Combat.h => State_Combat.h} (100%) rename Jusin154_Team3D/Editor/Public/{State_Player_Dodge.h => State_Dodge.h} (100%) rename Jusin154_Team3D/Editor/Public/{State_Player_Idle.h => State_Idle.h} (100%) rename Jusin154_Team3D/Editor/Public/{State_Player_Jump.h => State_Jump.h} (100%) rename Jusin154_Team3D/Editor/Public/{State_Player_Land.h => State_Land.h} (100%) rename Jusin154_Team3D/Editor/Public/{State_Player_Move.h => State_Move.h} (100%) diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index e6ac7ae5a..0df3216a4 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -188,12 +188,12 @@ - - - - - - + + + + + + @@ -234,12 +234,12 @@ - - - - - - + + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index e5e146bf3..abd8daef0 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -112,22 +112,22 @@ 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 @@ -424,22 +424,22 @@ 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 diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 346c77b83..c33467dbe 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -40,7 +40,7 @@ void CBroom::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - m_pModelCom->ComputeSkinning(); + //m_pModelCom->ComputeSkinning(); } void CBroom::Late_Update(_float fTimeDelta) @@ -69,8 +69,8 @@ HRESULT CBroom::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; + //if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + // return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index e6c5d9540..122b4f2f3 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; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index b44ed6eb8..458fd59ef 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -13,6 +13,12 @@ #pragma region STATE +#include "State_Idle.h" +#include "State_Dodge.h" +#include "State_Jump.h" +#include "State_Land.h" +#include "State_Move.h" +#include "State_Combat.h" #pragma endregion CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -71,7 +77,7 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); + //m_pModelCom->ComputeSkinning(); IsSprint(); IsWalk(); @@ -114,8 +120,8 @@ HRESULT CPlayer::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) - return E_FAIL; + //if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + // return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; @@ -138,7 +144,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"); @@ -257,14 +265,373 @@ HRESULT CPlayer::Bind_ShaderResources() return S_OK; } +HRESULT CPlayer::InputSystem() +{ + 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)) + { + return S_OK; + } + return E_FAIL; +} + +HRESULT CPlayer::InputSkill() +{ + 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) + ) + { + return S_OK; + } + return E_FAIL; +} + +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] + } + } + + 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())) { + 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 +#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 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 + +#pragma endregion +#pragma region Behavior_Combat_Focus + #pragma endregion -#pragma region COMBAT -#pragma endregion - } void CPlayer::Set_Anim() diff --git a/Jusin154_Team3D/Client/Private/State_Player_Combat.cpp b/Jusin154_Team3D/Client/Private/State_Combat.cpp similarity index 96% rename from Jusin154_Team3D/Client/Private/State_Player_Combat.cpp rename to Jusin154_Team3D/Client/Private/State_Combat.cpp index 17674a15c..35b611131 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Combat.cpp +++ b/Jusin154_Team3D/Client/Private/State_Combat.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Combat.h" +#include "State_Combat.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp b/Jusin154_Team3D/Client/Private/State_Dodge.cpp similarity index 97% rename from Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp rename to Jusin154_Team3D/Client/Private/State_Dodge.cpp index f93785351..b2c342f49 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Dodge.cpp +++ b/Jusin154_Team3D/Client/Private/State_Dodge.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Dodge.h" +#include "State_Dodge.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp b/Jusin154_Team3D/Client/Private/State_Idle.cpp similarity index 95% rename from Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp rename to Jusin154_Team3D/Client/Private/State_Idle.cpp index c11f1425d..a374fbdc1 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Idle.cpp +++ b/Jusin154_Team3D/Client/Private/State_Idle.cpp @@ -1,5 +1,6 @@ #include "pch.h" -#include "State_Player_Idle.h" +#include "State_Idle.h" +#include "GameInstance.h" #include "Unit.h" CState_Idle::CState_Idle() diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp b/Jusin154_Team3D/Client/Private/State_Jump.cpp similarity index 96% rename from Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp rename to Jusin154_Team3D/Client/Private/State_Jump.cpp index ed972391b..753110099 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Jump.cpp +++ b/Jusin154_Team3D/Client/Private/State_Jump.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Jump.h" +#include "State_Jump.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp b/Jusin154_Team3D/Client/Private/State_Land.cpp similarity index 96% rename from Jusin154_Team3D/Editor/Private/State_Player_Land.cpp rename to Jusin154_Team3D/Client/Private/State_Land.cpp index 61ffcaba0..f1b64c618 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Land.cpp +++ b/Jusin154_Team3D/Client/Private/State_Land.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Land.h" +#include "State_Land.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp b/Jusin154_Team3D/Client/Private/State_Move.cpp similarity index 97% rename from Jusin154_Team3D/Editor/Private/State_Player_Move.cpp rename to Jusin154_Team3D/Client/Private/State_Move.cpp index 856c62bfc..71621a370 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Move.cpp +++ b/Jusin154_Team3D/Client/Private/State_Move.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Move.h" +#include "State_Move.h" #include "Unit.h" 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/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/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/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/Player.h b/Jusin154_Team3D/Client/Public/Player.h index eb9f7b93e..e2ef42d09 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -61,6 +61,32 @@ class CPlayer final : public CUnit virtual void Set_Anim(); _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_Player_Combat.h b/Jusin154_Team3D/Client/Public/State_Combat.h similarity index 100% rename from Jusin154_Team3D/Client/Public/State_Player_Combat.h rename to Jusin154_Team3D/Client/Public/State_Combat.h diff --git a/Jusin154_Team3D/Client/Public/State_Player_Dodge.h b/Jusin154_Team3D/Client/Public/State_Dodge.h similarity index 100% rename from Jusin154_Team3D/Client/Public/State_Player_Dodge.h rename to Jusin154_Team3D/Client/Public/State_Dodge.h diff --git a/Jusin154_Team3D/Client/Public/State_Player_Idle.h b/Jusin154_Team3D/Client/Public/State_Idle.h similarity index 99% rename from Jusin154_Team3D/Client/Public/State_Player_Idle.h rename to Jusin154_Team3D/Client/Public/State_Idle.h index 608255a26..de9da55a3 100644 --- a/Jusin154_Team3D/Client/Public/State_Player_Idle.h +++ b/Jusin154_Team3D/Client/Public/State_Idle.h @@ -33,3 +33,4 @@ class CState_Idle final : public CState_Root virtual void Describe_Entity(); }; +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Player_Jump.h b/Jusin154_Team3D/Client/Public/State_Jump.h similarity index 100% rename from Jusin154_Team3D/Client/Public/State_Player_Jump.h rename to Jusin154_Team3D/Client/Public/State_Jump.h diff --git a/Jusin154_Team3D/Client/Public/State_Player_Land.h b/Jusin154_Team3D/Client/Public/State_Land.h similarity index 100% rename from Jusin154_Team3D/Client/Public/State_Player_Land.h rename to Jusin154_Team3D/Client/Public/State_Land.h diff --git a/Jusin154_Team3D/Client/Public/State_Player_Move.h b/Jusin154_Team3D/Client/Public/State_Move.h similarity index 100% rename from Jusin154_Team3D/Client/Public/State_Player_Move.h rename to Jusin154_Team3D/Client/Public/State_Move.h 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/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index c67fb6059..6304f1a99 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -237,12 +237,12 @@ - - - - - - + + + + + + @@ -362,12 +362,12 @@ - - - - - - + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index b5c4db784..574c2f895 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -549,13 +549,13 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXWall - + 80.State\Focus\State_Dodge - + 80.State\Movement\State_Idle - + 80.State\Focus\State_Jump @@ -606,16 +606,16 @@ 02.GameObjects\Dummys\DummyGlobe - + 80.State\Focus\State_Land 02.GameObjects\Monster\Goblin - + 80.State\Movement\State_Move - + 80.State\State_Combat @@ -880,13 +880,13 @@ 02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame - + 80.State\Focus\State_Dodge - + 80.State\Movement\State_Idle - + 80.State\Focus\State_Jump @@ -925,16 +925,16 @@ 02.GameObjects\Dummys\DummyGlobe - + 80.State\Focus\State_Land 02.GameObjects\Monster\Goblin - + 80.State\Movement\State_Move - + 80.State\State_Combat diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 09f1428d1..eb4cb6166 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -9,12 +9,12 @@ #pragma region STATE -#include "State_Player_Idle.h" -#include "State_Player_Dodge.h" -#include "State_Player_Jump.h" -#include "State_Player_Land.h" -#include "State_Player_Move.h" -#include "State_Player_Combat.h" +#include "State_Idle.h" +#include "State_Dodge.h" +#include "State_Jump.h" +#include "State_Land.h" +#include "State_Move.h" +#include "State_Combat.h" #pragma endregion CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Combat.cpp similarity index 96% rename from Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp rename to Jusin154_Team3D/Editor/Private/State_Combat.cpp index 17674a15c..35b611131 100644 --- a/Jusin154_Team3D/Editor/Private/State_Player_Combat.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Combat.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Combat.h" +#include "State_Combat.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp similarity index 97% rename from Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp rename to Jusin154_Team3D/Editor/Private/State_Dodge.cpp index f93785351..b2c342f49 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Dodge.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Dodge.h" +#include "State_Dodge.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Client/Private/State_Player_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Idle.cpp similarity index 97% rename from Jusin154_Team3D/Client/Private/State_Player_Idle.cpp rename to Jusin154_Team3D/Editor/Private/State_Idle.cpp index c11f1425d..63497dcb1 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Idle.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Idle.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Idle.h" +#include "State_Idle.h" #include "Unit.h" CState_Idle::CState_Idle() diff --git a/Jusin154_Team3D/Client/Private/State_Player_Jump.cpp b/Jusin154_Team3D/Editor/Private/State_Jump.cpp similarity index 96% rename from Jusin154_Team3D/Client/Private/State_Player_Jump.cpp rename to Jusin154_Team3D/Editor/Private/State_Jump.cpp index ed972391b..753110099 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Jump.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Jump.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Jump.h" +#include "State_Jump.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Client/Private/State_Player_Land.cpp b/Jusin154_Team3D/Editor/Private/State_Land.cpp similarity index 96% rename from Jusin154_Team3D/Client/Private/State_Player_Land.cpp rename to Jusin154_Team3D/Editor/Private/State_Land.cpp index 61ffcaba0..f1b64c618 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Land.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Land.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Land.h" +#include "State_Land.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Client/Private/State_Player_Move.cpp b/Jusin154_Team3D/Editor/Private/State_Move.cpp similarity index 97% rename from Jusin154_Team3D/Client/Private/State_Player_Move.cpp rename to Jusin154_Team3D/Editor/Private/State_Move.cpp index 856c62bfc..71621a370 100644 --- a/Jusin154_Team3D/Client/Private/State_Player_Move.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Move.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "State_Player_Move.h" +#include "State_Move.h" #include "Unit.h" diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 1358244b0..078da8ab6 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -43,6 +43,18 @@ class CPlayer final : public CUnit HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); +public: + static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; + +#pragma region STATE +private: + virtual void Add_FSM(); + virtual void Set_Anim(); + _bool IsSprint(); + _bool IsWalk(); HRESULT InputSystem(); HRESULT InputSkill(); @@ -67,20 +79,8 @@ class CPlayer final : public CUnit void Behavior_DodgeEnter(); HRESULT Behavior_DodgeExitCheck(); void Behavior_DodgeExit(); - -public: - static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; - virtual void Free() override; - virtual void Describe_Entity() override; -#pragma region STATE -private: - virtual void Add_FSM(); - virtual void Set_Anim(); - _bool IsSprint(); - _bool IsWalk(); public: virtual void Reset_Sprint() { m_bSprintToggle = false; } virtual void Reset_Walk() { m_bWalkToggle = false; } diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Combat.h b/Jusin154_Team3D/Editor/Public/State_Combat.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Combat.h rename to Jusin154_Team3D/Editor/Public/State_Combat.h diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Dodge.h b/Jusin154_Team3D/Editor/Public/State_Dodge.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Dodge.h rename to Jusin154_Team3D/Editor/Public/State_Dodge.h diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Idle.h b/Jusin154_Team3D/Editor/Public/State_Idle.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Idle.h rename to Jusin154_Team3D/Editor/Public/State_Idle.h diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Jump.h b/Jusin154_Team3D/Editor/Public/State_Jump.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Jump.h rename to Jusin154_Team3D/Editor/Public/State_Jump.h diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Land.h b/Jusin154_Team3D/Editor/Public/State_Land.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Land.h rename to Jusin154_Team3D/Editor/Public/State_Land.h diff --git a/Jusin154_Team3D/Editor/Public/State_Player_Move.h b/Jusin154_Team3D/Editor/Public/State_Move.h similarity index 100% rename from Jusin154_Team3D/Editor/Public/State_Player_Move.h rename to Jusin154_Team3D/Editor/Public/State_Move.h 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/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 1b3dea2a4..f3efbf945 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -1,7 +1,7 @@ #include "Component.h" NS_BEGIN(FSMSTATE) -enum ESTATE : Engine::_u64Flag +enum ESTATE : _u64Flag { NOT_DEFINE = 0, IDLE = 1ULL << 0, 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/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/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 355ea8a5b..ebb95553b 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -40,7 +40,7 @@ class ENGINE_DLL CState abstract : public CBase virtual void Exit()PURE; protected: - CUnit* m_pOwner = { nullptr }; + class CUnit* m_pOwner = { nullptr }; CModel* m_pModel = { nullptr }; CFSM* m_pFSM = { nullptr }; CGameInstance* m_pGameInstance = { nullptr }; 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 { From 857b7c011126bc54e5a9350125f7bc01649efecf Mon Sep 17 00:00:00 2001 From: hyunbin14 Date: Sun, 23 Nov 2025 14:14:22 +0900 Subject: [PATCH 11/12] =?UTF-8?q?[Add]=20=ED=82=A4=ED=94=84=EB=A0=88?= =?UTF-8?q?=EC=9E=84=20=EC=BB=B4=EC=89=90=EB=A1=9C=20=EC=9D=B4=EC=A0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Private/Broom.cpp | 12 ++ .../Client/Private/Level_GamePlay.cpp | 4 +- Jusin154_Team3D/Client/Private/Player.cpp | 14 +- .../ShaderFiles/Shader_Mesh_Compute.hlsl | 191 ++++++++++-------- Jusin154_Team3D/Editor/Private/Broom.cpp | 3 - .../Editor/Private/DummyObject.cpp | 5 +- .../Editor/Private/Level_ObjectViewer.cpp | 10 +- Jusin154_Team3D/Editor/Private/Player.cpp | 1 - .../Editor/Private/RootModelPart.cpp | 6 +- .../ShaderFiles/Shader_Mesh_Compute.hlsl | 191 ++++++++++-------- Jusin154_Team3D/Engine/Private/Animation.cpp | 124 ++++++++++-- Jusin154_Team3D/Engine/Private/Channel.cpp | 184 ++++++++++------- .../Engine/Private/ComputeShader.cpp | 34 +++- .../Engine/Private/GameInstance.cpp | 4 +- Jusin154_Team3D/Engine/Private/LerpAnim.cpp | 20 +- Jusin154_Team3D/Engine/Private/Model.cpp | 160 ++++++++------- Jusin154_Team3D/Engine/Public/Animation.h | 36 +++- Jusin154_Team3D/Engine/Public/Channel.h | 11 +- Jusin154_Team3D/Engine/Public/ComputeShader.h | 2 + Jusin154_Team3D/Engine/Public/Engine_Struct.h | 29 ++- Jusin154_Team3D/Engine/Public/Model.h | 27 ++- 21 files changed, 659 insertions(+), 409 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 705d3dbde..a0d336b21 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -38,6 +38,18 @@ void CBroom::Priority_Update(_float fTimeDelta) void CBroom::Update(_float fTimeDelta) { + m_pModelCom->ComputeAnimation(); + + static _uint m_iIndex = 0; + + if (m_pGameInstance->Key_Down(DIK_1)) + m_iIndex++; + if (m_pGameInstance->Key_Down(DIK_2)) + m_iIndex--; + + m_pModelCom->Set_AnimationIndex(m_iIndex); + + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index a3201bcad..0b170fda7 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -140,8 +140,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/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 15822f9ac..2420c9b4e 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -77,18 +77,23 @@ 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->ComputeAnimation(); + + Key_Input(fTimeDelta); - + m_pFSM->Update(fTimeDelta); - + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + __super::Update(fTimeDelta); Describe_Entity(); m_pCharacter_Controller->Move(fTimeDelta); @@ -96,6 +101,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); 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 271d90fd9..645fd6d0c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -8,127 +8,144 @@ struct KeyFrame float fTrackPosition; }; -struct BoneInfo +struct Channel { - int ParentIndex; + uint StartIndex; + uint KeyCount; + uint BoneIndex; }; -struct BoneMatrix +struct LocalPos { - row_major float4x4 LocalMatrix; - row_major float4x4 CombinedMatrix; + float3 Scale; + float pad0; + float4 Rotation; + + float3 Translation; + float pad1; }; -StructuredBuffer g_KeyFrameBufferInput : register(t0); -StructuredBuffer g_BoneInoBufferInput : register(t1); -RWStructuredBuffer gBoneMatrixOutput : register(u0); +StructuredBuffer g_KeyFrameBuffer : register(t0); +StructuredBuffer g_ChannelBuffer : register(t1); -cbuffer g_ConstantBuffer : register(b0) +RWStructuredBuffer g_LocalPosOutput : register(u0); + + +cbuffer AnimCB : register(b0) { float CurrentTime; float Duration; float Speed; int BoneCount; - float4x4 PreTransformMatrix; - + row_major float4x4 PreTransformMatrix; }; -float4x4 QuatToMatrix(float4 q) +float4 quatSlerp(float4 q1, float4 q2, float t) { - float x = q.x; - float y = q.y; - float z = q.z; - float w = q.w; + float cosTheta = dot(q1, q2); - float xx = x * x; - float yy = y * y; - float zz = z * z; + if (cosTheta < 0.0f) + { + q2 = -q2; + cosTheta = -cosTheta; + } - float xy = x * y; - float xz = x * z; - float yz = y * z; - float wx = w * x; - float wy = w * y; - float wz = w * z; + if (cosTheta > 0.9995f) + return normalize(lerp(q1, q2, t)); - float4x4 m; + float theta = acos(cosTheta); + float sinTheta = sin(theta); - m[0][0] = 1.0 - 2.0 * (yy + zz); - m[0][1] = 2.0 * (xy + wz); - m[0][2] = 2.0 * (xz - wy); - m[0][3] = 0.0; + float w1 = sin((1.0f - t) * theta) / sinTheta; + float w2 = sin(t * theta) / sinTheta; - m[1][0] = 2.0 * (xy - wz); - m[1][1] = 1.0 - 2.0 * (xx + zz); - m[1][2] = 2.0 * (yz + wx); - m[1][3] = 0.0; - - m[2][0] = 2.0 * (xz + wy); - m[2][1] = 2.0 * (yz - wx); - m[2][2] = 1.0 - 2.0 * (xx + yy); - m[2][3] = 0.0; - - m[3][0] = 0.0; - m[3][1] = 0.0; - m[3][2] = 0.0; - m[3][3] = 1.0; - - return m; + return q1 * w1 + q2 * w2; } -float4x4 MakeTRS(float3 scale, float4 rot, float3 trans) -{ - float4x4 S = - { - scale.x, 0, 0, 0, - 0, scale.y, 0, 0, - 0, 0, scale.z, 0, - 0, 0, 0, 1 - }; - - float4x4 R = QuatToMatrix(normalize(rot)); - - float4x4 T = - { - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - trans.x, trans.y, trans.z, 1 - }; - - return mul(S, mul(R, T)); -} [numthreads(256, 1, 1)] -void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) +void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID) { - uint boneIndex = DispatchThreadID.x; - if (boneIndex >= BoneCount) + uint boneIndex = DTID.x; + if (boneIndex >= (uint) BoneCount) return; - KeyFrame k = g_KeyFrameBufferInput[boneIndex]; - BoneInfo bi = g_BoneInoBufferInput[boneIndex]; + float time = CurrentTime; + if (Duration > 0) + time = min(time, Duration); - float3 s = k.vScale; - float4 r = k.vRotation; - float3 t = k.vTranslation; + Channel channel = g_ChannelBuffer[boneIndex]; - float4x4 local = MakeTRS(s, r, t); + LocalPos result; - float4x4 combined; - - if (bi.ParentIndex < 0) + if (channel.KeyCount == 0) { - combined = mul(local, PreTransformMatrix); - } - else - { - combined = mul(local, gBoneMatrixOutput[bi.ParentIndex].CombinedMatrix); + 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; } - gBoneMatrixOutput[boneIndex].LocalMatrix = local; - gBoneMatrixOutput[boneIndex].CombinedMatrix = combined; + 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/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/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 006d8b704..72c59ab06 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -44,7 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta) void CDummyObject::Update(_float fTimeDelta) { - m_pModelCom->ComputeSkinning(); + m_pModelCom->ComputeAnimation(); m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); @@ -77,9 +77,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/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 42781e230..2d1795709 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")))) + if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) { return E_FAIL; - }*/ + } if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) { @@ -58,7 +58,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) Find_Anim(); - m_Test->Describe_Entity(); + //m_Test->Describe_Entity(); } HRESULT CLevel_ObjectViewer::Render() @@ -702,8 +702,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/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 844eede6f..e36298e70 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -70,7 +70,6 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { m_pModelCom->ComputeAnimation(); - Key_Input(fTimeDelta); m_pFSM->Update_State(fTimeDelta); 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/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index 271d90fd9..645fd6d0c 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -8,127 +8,144 @@ struct KeyFrame float fTrackPosition; }; -struct BoneInfo +struct Channel { - int ParentIndex; + uint StartIndex; + uint KeyCount; + uint BoneIndex; }; -struct BoneMatrix +struct LocalPos { - row_major float4x4 LocalMatrix; - row_major float4x4 CombinedMatrix; + float3 Scale; + float pad0; + float4 Rotation; + + float3 Translation; + float pad1; }; -StructuredBuffer g_KeyFrameBufferInput : register(t0); -StructuredBuffer g_BoneInoBufferInput : register(t1); -RWStructuredBuffer gBoneMatrixOutput : register(u0); +StructuredBuffer g_KeyFrameBuffer : register(t0); +StructuredBuffer g_ChannelBuffer : register(t1); -cbuffer g_ConstantBuffer : register(b0) +RWStructuredBuffer g_LocalPosOutput : register(u0); + + +cbuffer AnimCB : register(b0) { float CurrentTime; float Duration; float Speed; int BoneCount; - float4x4 PreTransformMatrix; - + row_major float4x4 PreTransformMatrix; }; -float4x4 QuatToMatrix(float4 q) +float4 quatSlerp(float4 q1, float4 q2, float t) { - float x = q.x; - float y = q.y; - float z = q.z; - float w = q.w; + float cosTheta = dot(q1, q2); - float xx = x * x; - float yy = y * y; - float zz = z * z; + if (cosTheta < 0.0f) + { + q2 = -q2; + cosTheta = -cosTheta; + } - float xy = x * y; - float xz = x * z; - float yz = y * z; - float wx = w * x; - float wy = w * y; - float wz = w * z; + if (cosTheta > 0.9995f) + return normalize(lerp(q1, q2, t)); - float4x4 m; + float theta = acos(cosTheta); + float sinTheta = sin(theta); - m[0][0] = 1.0 - 2.0 * (yy + zz); - m[0][1] = 2.0 * (xy + wz); - m[0][2] = 2.0 * (xz - wy); - m[0][3] = 0.0; + float w1 = sin((1.0f - t) * theta) / sinTheta; + float w2 = sin(t * theta) / sinTheta; - m[1][0] = 2.0 * (xy - wz); - m[1][1] = 1.0 - 2.0 * (xx + zz); - m[1][2] = 2.0 * (yz + wx); - m[1][3] = 0.0; - - m[2][0] = 2.0 * (xz + wy); - m[2][1] = 2.0 * (yz - wx); - m[2][2] = 1.0 - 2.0 * (xx + yy); - m[2][3] = 0.0; - - m[3][0] = 0.0; - m[3][1] = 0.0; - m[3][2] = 0.0; - m[3][3] = 1.0; - - return m; + return q1 * w1 + q2 * w2; } -float4x4 MakeTRS(float3 scale, float4 rot, float3 trans) -{ - float4x4 S = - { - scale.x, 0, 0, 0, - 0, scale.y, 0, 0, - 0, 0, scale.z, 0, - 0, 0, 0, 1 - }; - - float4x4 R = QuatToMatrix(normalize(rot)); - - float4x4 T = - { - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - trans.x, trans.y, trans.z, 1 - }; - - return mul(S, mul(R, T)); -} [numthreads(256, 1, 1)] -void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) +void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID) { - uint boneIndex = DispatchThreadID.x; - if (boneIndex >= BoneCount) + uint boneIndex = DTID.x; + if (boneIndex >= (uint) BoneCount) return; - KeyFrame k = g_KeyFrameBufferInput[boneIndex]; - BoneInfo bi = g_BoneInoBufferInput[boneIndex]; + float time = CurrentTime; + if (Duration > 0) + time = min(time, Duration); - float3 s = k.vScale; - float4 r = k.vRotation; - float3 t = k.vTranslation; + Channel channel = g_ChannelBuffer[boneIndex]; - float4x4 local = MakeTRS(s, r, t); + LocalPos result; - float4x4 combined; - - if (bi.ParentIndex < 0) + if (channel.KeyCount == 0) { - combined = mul(local, PreTransformMatrix); - } - else - { - combined = mul(local, gBoneMatrixOutput[bi.ParentIndex].CombinedMatrix); + 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; } - gBoneMatrixOutput[boneIndex].LocalMatrix = local; - gBoneMatrixOutput[boneIndex].CombinedMatrix = combined; + 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/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 4d7d644fe..27c4cac77 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,26 +185,35 @@ 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 -void CAnimation::Set_KeyFrameDesc() -{ - for (auto& Channel : m_Channels) - { - m_KeyFrame.push_back(Channel->Get_KeyFrameDesc()); - } -} -_uint CAnimation::Get_KeyFrameCount() -{ - for (auto& Channel : m_Channels) - { - m_KeyCount+=Channel->Get_KeyFrameCount(); - } - - return m_KeyCount; -} HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { @@ -294,7 +304,7 @@ HRESULT CAnimation::Initialize(HANDLE hFile, DWORD& dwByte) 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; @@ -306,6 +316,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]); @@ -333,6 +345,64 @@ _uint CAnimation::Get_BoneIndex(const char* pChannelName) return _uint(); } +HRESULT CAnimation::CreateKeyFrameBuffer(ID3D11Device* pDevice,vector keyframe) +{ + 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; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = keyframe.data(); + + 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; +} + +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(HANDLE hFile, DWORD& dwByte) { CAnimation* pInstance = new CAnimation(); @@ -346,11 +416,11 @@ CAnimation* CAnimation::Create(HANDLE hFile, DWORD& dwByte) return pInstance; } -CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimation) +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); @@ -374,6 +444,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/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index 92c014004..4b3a29790 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -54,18 +54,40 @@ HRESULT CChannel::Initialize(const vector& Bones, const aiNodeAnim* pAIC KeyFrame.vRotation = vRotation; KeyFrame.vTranslation = vTranslation; - - m_KeyFrame.fTrackPosition = KeyFrame.fTrackPosition; - m_KeyFrame.vScale = vScale; - m_KeyFrame.vRotation = vRotation; - m_KeyFrame.vTranslation = vTranslation; - m_KeyFrames.push_back(KeyFrame); } return S_OK; } +void CChannel::Fill_GPU_Keyframes(vector& outKeyframes) +{ + 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); + } +} + +CHANNEL_DESC CChannel::Fill_GPU_ChannelDesc() +{ + CHANNEL_DESC desc{}; + desc.StartIndex = 0; + desc.KeyCount = m_iNumKeyFrames; + desc.BoneIndex = m_iBoneIndex; + + return desc; +} + + + HRESULT CChannel::SaveAsBinary(HANDLE hFile, DWORD& dwByte) { string strName = m_szName; @@ -106,84 +128,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); @@ -307,10 +349,6 @@ HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) KeyFrame.vRotation = vRotation; KeyFrame.vTranslation = vTranslation; - m_KeyFrame.fTrackPosition = KeyFrame.fTrackPosition; - m_KeyFrame.vScale = vScale; - m_KeyFrame.vRotation = vRotation; - m_KeyFrame.vTranslation = vTranslation; m_KeyFrames.push_back(KeyFrame); } @@ -362,4 +400,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..eebd01e99 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); @@ -124,6 +121,37 @@ void CComputeShader::Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex) } +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/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 52fc982e6..e2387d636 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -126,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/LerpAnim.cpp b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp index e4b4aa8c3..ed36a6c1d 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; } @@ -50,9 +50,9 @@ HRESULT CLerpAnim::Initialize(_uint iNumBone, _float fTickPerSecond, const vecto } 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 +61,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 +101,4 @@ void CLerpAnim::Free() m_CurrentKeyFrameIndices.clear(); } -; \ No newline at end of file +; diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index a24db4184..5ae671060 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -160,7 +160,7 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) _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,7 +171,7 @@ _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; } @@ -180,8 +180,11 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) 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; } @@ -881,25 +884,53 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma HRESULT CModel::Create_CS() { - _uint CS_InputStrides[] = { - sizeof(KEYFRAME_DESC), - sizeof(BONEINFO_DESC) + _uint CS1_InputStrides[] = { + sizeof(KEYFRAME_DESC), + sizeof(CHANNEL_DESC), + }; + + _uint CS1_OutputStrides[] = { + sizeof(LOCALPOS_DESC), }; - _uint CS_OutputStrides[] = { - sizeof(BONE_DESC) - }; + 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 + ); - m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, - L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", "CS_MAIN",(_uint)m_Bones.size(), 2, 1, CS_InputStrides, CS_OutputStrides); - - if (m_pComputeShader == nullptr) + if (!m_pComputeShader) return E_FAIL; return S_OK; } +void CModel::Create_Temp() +{ + for (auto& anim : m_Animations) + { + 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 = {}; @@ -913,17 +944,6 @@ void CModel::Create_Con() } - -HRESULT CModel::Bind_CS_Output(_uint Index, _uint iBufferIndex) -{ - if (m_pComputeShader == nullptr) - return E_FAIL; - - m_pComputeShader->Bind_OutPut_SRV(Index, iBufferIndex); - - return S_OK; -} - void CModel::UpdateAnimationCS() { D3D11_MAPPED_SUBRESOURCE sub{}; @@ -937,7 +957,6 @@ void CModel::UpdateAnimationCS() pDesc->Speed = pAnim->Get_AnimSpeed(); pDesc->BoneCount = (_uint)m_Bones.size(); pDesc->PreTransformMatrix = m_PreTransformMatrix; - m_pContext->Unmap(m_pConstantBuffer, 0); } } @@ -948,63 +967,40 @@ void CModel::ComputeAnimation() _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; - ID3D11Buffer* inputs[2] = { - m_pKeyFrameBuffer, - m_pBoneInfoBuffer + CAnimation* pAnim = m_Animations[m_iCurrentAnimIndex]; + ID3D11ShaderResourceView* srvs[2] = { + pAnim->Get_KeyFrameSrv(), + pAnim->Get_ChannelSrv(), }; - vector OutSubResources = {}; - D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {}; + m_pContext->CSSetShader(m_pComputeShader->Get_Compute(), nullptr, 0); + m_pContext->CSSetConstantBuffers(0, 1, &m_pConstantBuffer); + m_pContext->CSSetShaderResources(0, 2, srvs); - OutSubResources = m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), inputs, m_pConstantBuffer); + 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_KeyFrameVB() +HRESULT CModel::Create_ParentVB() { - for (_uint i = 0; i < (_uint)m_Animations[m_iCurrentAnimIndex]->Get_KeyCount(); i++) - { - m_KeyFrame.push_back(m_Animations[m_iCurrentAnimIndex]->Get_KeyFrameDesc(i)); - } - - D3D11_BUFFER_DESC desc{}; desc.Usage = D3D11_USAGE_DEFAULT; - desc.ByteWidth = (_int)sizeof(KEYFRAME_DESC) * m_Animations[m_iCurrentAnimIndex]->Get_KeyFrameCount(); + desc.ByteWidth = (_int)sizeof(PARENT_DESC) * (_uint)m_Bones.size(); desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = 0; - desc.StructureByteStride = (_int)sizeof(KEYFRAME_DESC); + desc.StructureByteStride = (_int)sizeof(PARENT_DESC); desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; D3D11_SUBRESOURCE_DATA init{}; - init.pSysMem = m_KeyFrame.data(); + init.pSysMem = m_Parent.data(); - m_pDevice->CreateBuffer(&desc, &init, &m_pKeyFrameBuffer); - - - return S_OK; -} - -HRESULT CModel::Create_BoneInfoVB() -{ - for (size_t i = 0; i < m_Bones.size(); i++) - { - m_BoneInfo[i].ParentIndex = m_Bones[i]->Get_ParentBoneIndex(); - } - - - D3D11_BUFFER_DESC desc{}; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.ByteWidth = (_int)sizeof(BONEINFO_DESC) * (_uint)m_Bones.size(); - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = 0; - desc.StructureByteStride = (_int)sizeof(BONEINFO_DESC); - desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; - - D3D11_SUBRESOURCE_DATA init{}; - init.pSysMem = m_BoneInfo.data(); - - m_pDevice->CreateBuffer(&desc, &init, &m_pBoneInfoBuffer); + m_pDevice->CreateBuffer(&desc, &init, &m_pParentBuffer); return S_OK; @@ -1061,7 +1057,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; @@ -1348,14 +1344,21 @@ HRESULT CModel::Initialize(void* pArg) if (m_eType == MODEL::ANIM) - { - Create_Con(); + { + 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; - Create_KeyFrameVB(); - Create_BoneInfoVB(); + Create_Con(); + Create_LocalPosVB(); + Create_ParentVB(); + } @@ -1413,13 +1416,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; @@ -1460,6 +1463,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); } @@ -1483,8 +1491,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/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 4456c6bff..3140d3dd6 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,6 +21,7 @@ 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; } @@ -32,10 +33,11 @@ class ENGINE_DLL CAnimation : public CBase _uint Get_ChannelCount() { return m_iNumChannels; } _float Get_Duration() { return m_fDuration; } - void Set_KeyFrameDesc(); - KEYFRAME_DESC Get_KeyFrameDesc(_uint iIndex) { return m_KeyFrame[iIndex]; } - _uint Get_KeyCount() { return (_uint)m_KeyFrame.size(); } - _uint Get_KeyFrameCount(); + + 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); @@ -47,11 +49,16 @@ class ENGINE_DLL CAnimation : public CBase 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] = {}; @@ -70,15 +77,22 @@ class ENGINE_DLL CAnimation : public CBase vector<_int> m_DestBones; // 이 애니메이션에서 영향을 받는 본들의 집합 vector m_StartKeyFrames; // 이 애니메이션의 영향을 받는 본들의 초기값 - vector<_matrix> m_vBoneTransformationMatrix = {}; + vector<_matrix> m_vBoneTransformationMatrix = {}; - _int m_iRawVertexStride = {}; - vector m_KeyFrame; - _int m_KeyCount = {}; + _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/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index f70a5a29e..759f3718c 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -13,19 +13,23 @@ 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() { m_vPrevRootPos = { 0.f, 0.f, 0.f }; m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; m_bInitialRootRotSaved = false; + m_bInitialRootPos = false; } _matrix Get_BoneTransformationMatrix() { return m_BoneTransformationMatrix; } @@ -35,8 +39,6 @@ class ENGINE_DLL CChannel : public CBase return !strcmp(pChannelname, m_szName); } _char* Get_Name() { return m_szName; } - KEYFRAME_DESC Get_KeyFrameDesc() { return m_KeyFrame; } - _int Get_KeyFrameCount() { return (_int)m_KeyFrames.size(); } private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 @@ -55,9 +57,10 @@ class ENGINE_DLL CChannel : public CBase _matrix m_BoneTransformationMatrix = {}; _float m_fPrevYaw = 0.f; _bool m_bInitialRootRotSaved = {false}; + _bool m_bInitialRootPos = { false }; _float4 m_vInitialRootRot = {}; - KEYFRAME_DESC m_KeyFrame; + vector m_KeyFrameDesc; public: static CChannel* Create(const vector& Bones, _uint iIndex); // 럴프전용 static CChannel* Create(HANDLE hFile, DWORD& dwByte); 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_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index 3a5545a87..9ad49e3c9 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -371,18 +371,33 @@ typedef struct tagKeyFrameDesc }KEYFRAME_DESC; -typedef struct tagBoneInfo +typedef struct tagChannelDesc +{ + _uint StartIndex; + _uint KeyCount; + _uint BoneIndex; + //_uint Padding; +}CHANNEL_DESC; + + +typedef struct tagParentDesc { _int ParentIndex; +}PARENT_DESC; -}BONEINFO_DESC; - - -typedef struct tagBoneMatrix +typedef struct tagLocalPos { - _float4x4 LocalMatrix; - _float4x4 CombinedMatrix; + _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/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index cedd067e4..4f070c18e 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -79,11 +79,9 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / #pragma endregion void Create_Con(); - HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); void UpdateAnimationCS(); void ComputeAnimation(); - HRESULT Create_KeyFrameVB(); - HRESULT Create_BoneInfoVB(); + HRESULT Create_ParentVB(); void Get_BoneMatrix(); public: @@ -156,16 +154,23 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / private: HRESULT Create_CS(); - _uint m_iNumBuffer = {}; - vector m_KeyFrame = {}; - vector m_BoneInfo = {}; + void Create_Temp(); + + void Create_LocalPosVB(); + + _uint m_iNumBuffer = {}; + + vector m_Parent = {}; + vector m_AnimRanges; + + LOCALPOS_DESC* m_pLocalPos = { nullptr }; + + class CComputeShader* m_pComputeShader = nullptr; - class CComputeShader* m_pComputeShader = {}; ID3D11Buffer* m_pConstantBuffer = { nullptr }; - ID3D11Buffer* m_pKeyFrameBuffer = { nullptr }; - ID3D11Buffer* m_pBoneInfoBuffer = { nullptr }; - + ID3D11Buffer* m_pParentBuffer = { nullptr }; + ID3D11Buffer* m_pLocalPosBuffer = { nullptr }; private: // 바이너리 virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); @@ -180,7 +185,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: From b06393649147c290f67945a7ce9191493e7a0463 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 23 Nov 2025 14:15:18 +0900 Subject: [PATCH 12/12] [add] PlayerMove --- Jusin154_Team3D/Client/Private/Player.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 458fd59ef..5723d6a1e 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -473,6 +473,19 @@ HRESULT CPlayer::Behavior_MoveExitCheck() 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);