diff --git a/Jusin154_Team3D/.editorconfig b/Jusin154_Team3D/.editorconfig index 51486a1fb..aba26f9aa 100644 --- a/Jusin154_Team3D/.editorconfig +++ b/Jusin154_Team3D/.editorconfig @@ -15,12 +15,12 @@ end_of_line = crlf # hlsl 저장형ì‹� 지정 [*.hlsl] -charset = utf-8-bom +charset = utf-8 insert_final_newline = true end_of_line = crlf # hlsli 저장형ì‹� 지정 [*.hlsli] -charset = utf-8-bom +charset = utf-8 insert_final_newline = true end_of_line = crlf diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 6e5d2ad4c..38eea62d7 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -19,8 +19,11 @@ float g_fSpotOuterAngle; vector g_vLightDir; vector g_vLightPos; +vector g_vLightPosOffset; + vector g_vCamPosition; + Texture2D g_NormalTexture; Texture2D g_DiffuseTexture; Texture2D g_ShadeTexture; @@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) vPosition = mul(vPosition, g_invmatProj); vPosition = mul(vPosition, g_invMatView); - vector vLightDir = vPosition - g_vLightPos; + vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset); float fDistance = length(vLightDir); float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); if (fAttenuation <= 0.f) diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 9856316b2..418e8082c 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_GamePlay.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -46,7 +46,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta) HRESULT CLevel_GamePlay::Render() { - SetWindowText(g_hWnd, TEXT("°ÔÀÓÇ÷¹ÀÌ·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("게임플레ì�´ë ˆë²¨ìž…니다")); return S_OK; } @@ -58,11 +58,12 @@ HRESULT CLevel_GamePlay::Ready_Lights() LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); LightDesc.vAmbient = _float4(0.2f, 0.2f, 0.2f, 0.f); LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); + //LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + // return E_FAIL; + //} + assert(false); return S_OK; diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index a869c2e0a..a9e42a633 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once namespace Client { #ifndef __TEXT diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Lumos.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Lumos.bin new file mode 100644 index 000000000..27d02c179 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Lumos.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LumosTest.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LumosTest.bin new file mode 100644 index 000000000..8e9cc3146 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LumosTest.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.bin new file mode 100644 index 000000000..c50ee846f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx new file mode 100644 index 000000000..8b7d31df5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8a8ff5d822a7a6cff559c7a70a8d69aaadea6a661096d3c313ad9c232bd3a5 +size 22060 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/New Piskel.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/New Piskel.png new file mode 100644 index 000000000..67a6facc0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/DummyPlane/New Piskel.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.bin new file mode 100644 index 000000000..5f6bb7145 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.fbx new file mode 100644 index 000000000..0a92c2be3 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37ef52901ab93e847caa7b3abb8ab5fa99aa20a1ad8874f61b76c1f941d5ef84 +size 196338204 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head1.fbx new file mode 100644 index 000000000..cdd002766 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/F_Head1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3a3ca772857bfc135eb2d8677f0af400eedbcb86825a84242d564efdef654b +size 196443948 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/Head.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/Head.bin new file mode 100644 index 000000000..124849aa8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/Head.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eye_Sclera_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eye_Sclera_D.png new file mode 100644 index 000000000..9ec24c5e5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eye_Sclera_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eyelash_A.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eyelash_A.png new file mode 100644 index 000000000..1d74d35e2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Eyelash_A.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_D.png new file mode 100644 index 000000000..c26cb50d5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_N.png new file mode 100644 index 000000000..6a0eefc05 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_HUM_Head_Teeth_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_D.png new file mode 100644 index 000000000..15a19a42c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_E.png new file mode 100644 index 000000000..af36de4f0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_Poltergeist_Eye_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_D.png new file mode 100644 index 000000000..9ee402d7f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_N.png new file mode 100644 index 000000000..aa18da9c5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/FeMale/T_YF_HeadBase02_Ivory_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.bin new file mode 100644 index 000000000..7d078d1d9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.fbx new file mode 100644 index 000000000..4cbeb0859 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/M_Head.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:797ab2e33f60f4fa0805ad9dd3eecd7487a1a2f14fa50de4cd1b1144698b3c00 +size 402344396 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Eyelash_A.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Eyelash_A.png new file mode 100644 index 000000000..1d74d35e2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Eyelash_A.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_D.png new file mode 100644 index 000000000..c26cb50d5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_N.png new file mode 100644 index 000000000..6a0eefc05 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_HUM_Head_Teeth_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_D.png new file mode 100644 index 000000000..15a19a42c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_E.png new file mode 100644 index 000000000..af36de4f0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Poltergeist_Eye_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_D.png new file mode 100644 index 000000000..b4ef295a6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_N.png new file mode 100644 index 000000000..136bb7cf6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Male/T_Young_M_Head_Ivory_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 6e5d2ad4c..38eea62d7 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -19,8 +19,11 @@ float g_fSpotOuterAngle; vector g_vLightDir; vector g_vLightPos; +vector g_vLightPosOffset; + vector g_vCamPosition; + Texture2D g_NormalTexture; Texture2D g_DiffuseTexture; Texture2D g_ShadeTexture; @@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) vPosition = mul(vPosition, g_invmatProj); vPosition = mul(vPosition, g_invMatView); - vector vLightDir = vPosition - g_vLightPos; + vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset); float fDistance = length(vLightDir); float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); if (fAttenuation <= 0.f) diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index d7107817d..529cf9c68 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -8,6 +8,7 @@ int g_iImageCountY; float g_fFar; float g_fTime; +float g_fTimeMult; float g_fFrame; float g_fAlpha; float g_fOwnerAlpha; @@ -16,8 +17,11 @@ float g_fDeltaU; float g_fDeltaV; uint g_iIndexU; uint g_iIndexV; - +float4 g_fNine_Slice; +float2 g_fOrigin_Size; +float2 g_fCurrent_Size; uint g_iQuestType; +float g_fPI; Texture2D g_Texture; Texture2D g_Texture1; @@ -64,7 +68,7 @@ struct PS_OUT float4 vColor : SV_Target0; }; -PS_OUT PS_MAIN(PS_IN In) // ?쇰컲 UI +PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; @@ -142,19 +146,31 @@ PS_OUT PS_Cursor(PS_IN In) Color = White; + Out.vColor = Color; + return Out; } PS_OUT PS_Key_Hold_Rotation(PS_IN In) { PS_OUT Out; - - float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - if (Color.a <= 0.1f) - discard; - - Out.vColor = Color; + + float2 uv = In.vTexcoord; + + float4 tex = g_Texture.Sample(DefaultSampler, uv); + + float2 center = float2(0.5f, 0.5f); + float2 dir = uv - center; + + float angle = atan2(dir.x, -dir.y); + if (angle < 0) + angle += g_fPI; + + float rotation = saturate(g_fTime * g_fTimeMult) * g_fPI; + + tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb; + + Out.vColor = tex; return Out; } @@ -224,6 +240,52 @@ PS_OUT PS_UVMult(PS_IN In) return Out; } +PS_OUT PS_NineSlice(PS_IN In) +{ + PS_OUT Out; + float Left = g_fNine_Slice.x / g_fOrigin_Size.x; + float Right = (g_fOrigin_Size.x - g_fNine_Slice.y) / g_fOrigin_Size.x; + float Top = g_fNine_Slice.z / g_fOrigin_Size.y; + float Bottom = (g_fOrigin_Size.y - g_fNine_Slice.w) / g_fOrigin_Size.y; + + float2 ratio = g_fCurrent_Size / g_fOrigin_Size; + + float2 UV = In.vTexcoord * 0.5f + 0.5f; + float2 ScaledUV = UV; + + if(UV.x < Left) + { + ScaledUV.x = UV.x; + } + else if(UV.x > Right) + { + ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x); + } + else + { + ScaledUV.x = Left + (UV.x - Left) / ratio.x; + } + + if(UV.y < Top) + { + ScaledUV.y = UV.y; + } + else if(UV.y > Bottom) + { + ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y); + } + else + { + ScaledUV.y = Top + (UV.y - Top) / ratio.y; + } + + float4 color = g_Texture.Sample(ClampSampler, ScaledUV); + + Out.vColor = color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -305,4 +367,15 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_UVMult(); } + + pass NineSlice + { + 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_NineSlice(); + } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 3cded6ce1..a6d171f8d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -304,6 +304,37 @@ PS_OUT PS_MAIN_TEST(PS_IN In) return Out; } +PS_OUT PS_EYELASH(PS_IN In) +{ + PS_OUT Out; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (vMtrlDiffuse.a < 0.4f) + { + discard; + } + + vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord); + float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); + + float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); + + if (true == g_bRimLight) + { + float fRimLight = GetRimLight(g_vCamPosition.xyz, In.vWorldPos.xyz, vNormal, g_fRimPower, g_fRimStrength); + vMtrlDiffuse.xyz = (vMtrlDiffuse.xyz * (1 - fRimLight)) + g_vRimColor * fRimLight; + } + + + Out.vDiffuse = float4(vMtrlDiffuse.rgb, vMtrlDiffuse.g); + Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f); + + + return Out; +} + + technique11 DefaultTechnique { pass Default @@ -354,4 +385,14 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_TEST(); } + + pass EyeLashPass + { + 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_EYELASH(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index cdfff192f..da2552728 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -29,6 +29,7 @@ Texture2D g_NormalTexture : register(t1); Texture2D g_MaskingTexture : register(t2); Texture2D g_DissolveTexture : register(t3); Texture2D g_NoiseTexture : register(t4); +Texture2D g_EmissiveTexture : register(t6); StructuredBuffer g_ParticleValue : register(t5); @@ -65,6 +66,7 @@ bool g_isDiffuse; bool g_isMasking; bool g_isDissolve; bool g_isNoise; +bool g_isEmissive; bool g_isDiffuseUVMove; bool g_isMaskUVMove; @@ -323,8 +325,16 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) Out.vDiffuse = vMtrlDiffuse; // 색깔 추가할 처리 (ì�´ë¯¸ì‹œë¸Œ) + + float4 vEmissiveMtrl; + + if (g_isEmissive == true) + { + vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); + } + if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) - Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f); + Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); else Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Mission/Mission_Icon_1.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Mission/Mission_Icon_1.png new file mode 100644 index 000000000..34190d6b3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Mission/Mission_Icon_1.png differ diff --git a/Jusin154_Team3D/Editor/Default/.bin b/Jusin154_Team3D/Editor/Default/.bin new file mode 100644 index 000000000..052ff3eb0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Default/.bin differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 5fee516e1..4106b7beb 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -129,6 +129,12 @@ + + Effect + + + 5.0 + @@ -161,6 +167,7 @@ + @@ -183,6 +190,7 @@ + @@ -226,6 +234,7 @@ + @@ -248,6 +257,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 762ab4e89..fe3b12355 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -196,6 +196,12 @@ {12d17342-7cb4-46be-8243-9e1864496338} + + {a9360a97-5ef2-476a-9f12-f4e06c28290c} + + + {6872c5bc-5eac-46a1-b6d8-3ec0f4fb2cd5} + @@ -396,6 +402,12 @@ 03.Information + + 02.GameObjects\MainLight + + + 02.GameObjects\Layer_Effect\Dummy_Plane + @@ -592,6 +604,12 @@ 03.Information + + 02.GameObjects\MainLight + + + 02.GameObjects\Layer_Effect\Dummy_Plane + diff --git a/Jusin154_Team3D/Editor/Private/Active_Icon.cpp b/Jusin154_Team3D/Editor/Private/Active_Icon.cpp index 70f50f563..947238618 100644 --- a/Jusin154_Team3D/Editor/Private/Active_Icon.cpp +++ b/Jusin154_Team3D/Editor/Private/Active_Icon.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Active_Icon.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Editor/Private/Body.cpp b/Jusin154_Team3D/Editor/Private/Body.cpp index 97e0289c2..8bbe045ff 100644 --- a/Jusin154_Team3D/Editor/Private/Body.cpp +++ b/Jusin154_Team3D/Editor/Private/Body.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Body.h" #include "GameInstance.h" @@ -75,7 +75,7 @@ CBody* CBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CBody"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -88,7 +88,7 @@ CGameObject* CBody::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CBody"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Editor/Private/BuildingContainer.cpp b/Jusin154_Team3D/Editor/Private/BuildingContainer.cpp index 30dd371fc..168bec286 100644 --- a/Jusin154_Team3D/Editor/Private/BuildingContainer.cpp +++ b/Jusin154_Team3D/Editor/Private/BuildingContainer.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "BuildingContainer.h" #include "PartObject.h" #include "Terrain.h" diff --git a/Jusin154_Team3D/Editor/Private/DebugCamera.cpp b/Jusin154_Team3D/Editor/Private/DebugCamera.cpp index 0bfc1cf3e..803bda53a 100644 --- a/Jusin154_Team3D/Editor/Private/DebugCamera.cpp +++ b/Jusin154_Team3D/Editor/Private/DebugCamera.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "DebugCamera.h" #include "Shader.h" @@ -95,6 +95,9 @@ HRESULT CDebugCamera::Initialize(void* pArg) m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f)); m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr(); m_bActive = true; + + m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey); + m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 8bdccf5e5..585113288 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "DummyObject.h" #include "GameInstance.h" @@ -44,7 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta) void CDummyObject::Update(_float fTimeDelta) { - m_pModelCom->Play_Animation(fTimeDelta); + m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); } void CDummyObject::Late_Update(_float fTimeDelta) @@ -129,7 +129,7 @@ CDummyObject* CDummyObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CDummyObject"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -142,7 +142,7 @@ CGameObject* CDummyObject::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CDummyObject"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -154,8 +154,8 @@ void CDummyObject::Free() { __super::Free(); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CDummyObject::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/DummyRect.cpp b/Jusin154_Team3D/Editor/Private/DummyRect.cpp index ee738796a..c44593cb5 100644 --- a/Jusin154_Team3D/Editor/Private/DummyRect.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyRect.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "DummyRect.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp index 2b65039ea..c26f369f4 100644 --- a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp +++ b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "DummySkyBox.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp index 9a2b40964..68094526d 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Dummy_Cube.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp index 71e22c420..92f3e2ea9 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Dummy_PhysXBox.h" #include "GameInstance.h" @@ -155,8 +155,8 @@ void CDummy_PhysXBox::Free() __super::Free(); SAFE_RELEASE(m_pRigidBody); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CDummy_PhysXBox::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp index b7abf064a..7d0fa8754 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Dummy_PhysXMesh.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp index 918bdd082..91a44dfff 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Dummy_PhysXPlayable.h" #include "GameInstance.h" @@ -117,9 +117,9 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg) Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; - Desc.tCapsuleInfo.fRadius = 0.5f; - Desc.tCapsuleInfo.fHeight = 1.0f; - Desc.tCapsuleInfo.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + Desc.fRadius = 0.5f; + Desc.fHeight = 1.0f; + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { return E_FAIL; } @@ -188,8 +188,8 @@ void CDummy_PhysXPlayable::Free() __super::Free(); SAFE_RELEASE(m_pCharacter_Controller); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CDummy_PhysXPlayable::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp new file mode 100644 index 000000000..f4febcb11 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp @@ -0,0 +1,160 @@ +#include "pch.h" +#include "Dummy_Plane.h" + +#include "GameInstance.h" + + +CDummy_Plane::CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_Plane::CDummy_Plane(const CDummy_Plane& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_Plane::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_Plane::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, -10.f, 0.f, 1.f)); + + + return S_OK; +} + +void CDummy_Plane::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_Plane::Update(_float fTimeDelta) +{ +} + +void CDummy_Plane::Late_Update(_float fTimeDelta) +{ + _float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius()); +} + +HRESULT CDummy_Plane::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + + return S_OK; +} + +HRESULT CDummy_Plane::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + ///* Com_Model */ + //if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"), + // reinterpret_cast(&m_pModelCom)))) + // return E_FAIL; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Model_DummyPlane"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CDummy_Plane::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CDummy_Plane* CDummy_Plane::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_Plane* pInstance = new CDummy_Plane(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_Plane"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_Plane::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_Plane* pInstance = new CDummy_Plane(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_Plane"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_Plane::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); +} + +void CDummy_Plane::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 400b07a45..5dfc34132 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "EditEffect.h" #include "GameInstance.h" @@ -41,7 +41,7 @@ void CEditEffect::Update(_float fTimeDelta) - if (m_isBillboard) + if (m_EffectInfo.isBillboard) m_pGameInstance->BillBoard(m_pTransformCom); if (m_pInstance_ModelCom == nullptr) @@ -61,15 +61,16 @@ void CEditEffect::Late_Update(_float fTimeDelta) _float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); - if (m_isBlur == true) + if (m_EffectInfo.isBlur == true) m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this, *vPos, m_pTransformCom->Get_Radius()); - m_pGameInstance->Add_RenderGroup(m_eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius()); + m_pGameInstance->Add_RenderGroup(m_EffectInfo.eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius()); } void CEditEffect::Reference_Mat_For_EditEffect() { + string strName = {}; const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" }; @@ -79,16 +80,37 @@ void CEditEffect::Reference_Mat_For_EditEffect() switch (m_iSelectTextureNum) { case 0: - dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this); + strName = dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this); + + if (strName != "") + { + m_strDiffuseName = strName; + } break; case 1: - dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this); + strName =dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this); + + if (strName != "") + { + m_strMaskingName = strName; + } break; case 2: - dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this); + strName = dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this); + + if (strName != "") + { + m_strNoiseName = strName; + } break; case 3: - dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this); + strName = dynamic_cast(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this); + + if (strName != "") + { + m_strDissolveName = strName; + } + break; default: break; @@ -97,6 +119,145 @@ void CEditEffect::Reference_Mat_For_EditEffect() } +HRESULT CEditEffect::Save_Effect(const _char* pPath) +{ + + _string strPerfectFilePath = pPath; + strPerfectFilePath += ".bin"; + + HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(), + GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브ì �트 저장 실패", L"System Message", MB_OK); + return E_FAIL; + } + + + + DWORD dwByte(0); + + if (m_pLightCom != nullptr) + { + m_EffectInfo.LightDesc = *m_pLightCom->Get_LightDesc(); + } + + + if (!WriteFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) { + return E_FAIL; + } + + if (m_EffectInfo.isDiffuse) + { + size_t iComponentLength = m_strDiffuseName.length(); + const _char* pFileComponentPath = m_strDiffuseName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + } + + if (m_EffectInfo.isNoise) + { + size_t iComponentLength = m_strNoiseName.length(); + const _char* pFileComponentPath = m_strNoiseName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + } + + if (m_EffectInfo.isMasking) + { + size_t iComponentLength = m_strMaskingName.length(); + const _char* pFileComponentPath = m_strMaskingName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + } + + if (m_EffectInfo.isDissolve) + { + size_t iComponentLength = m_strDissolveName.length(); + const _char* pFileComponentPath = m_strDissolveName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + } + + if (m_EffectInfo.isEmissive) + { + size_t iComponentLength = m_strEmissiveName.length(); + const _char* pFileComponentPath = m_strEmissiveName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + } + + size_t iComponentLength = m_strModelName.length(); + const _char* pFileComponentPath = m_strModelName.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + } + + m_pInstance_ModelCom->Save_InstanceModel(hFile); + + CloseHandle(hFile); + + return S_OK; +} + HRESULT CEditEffect::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) @@ -146,44 +307,46 @@ void CEditEffect::Free() void CEditEffect::Describe_Entity() { - //¿©±â¼­ ¸ðµ¨, ÅØ½ºÃÄ, ¼±ÅÃÇÒ ¼ö ÀÖµµ·Ï ÇÔ + //여기서 모ë�¸, í…�스ì³�, ì„ íƒ�í•  수 있ë�„ë¡� 함 const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" }; const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" }; - _int iCurrentItem = static_cast<_int>(m_eRenderOrder); + _int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder); if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) { - m_eRenderOrder = static_cast(iCurrentItem); + m_EffectInfo.eRenderOrder = static_cast(iCurrentItem); } m_pTransformCom->Describe_Entity(); - GUI::Checkbox("Diffuse", &m_isDiffuse); - GUI::Checkbox("Masking", &m_isMasking); - GUI::Checkbox("Dissolve", &m_isDissolve); - GUI::Checkbox("Noise", &m_isNoise); + GUI::Checkbox("Diffuse", &m_EffectInfo.isDiffuse); + GUI::Checkbox("Masking", &m_EffectInfo.isMasking); + GUI::Checkbox("Dissolve", &m_EffectInfo.isDissolve); + GUI::Checkbox("Noise", &m_EffectInfo.isNoise); - if (GUI::Checkbox("Billboard", &m_isBillboard)) + if (GUI::Checkbox("Billboard", &m_EffectInfo.isBillboard)) { m_pTransformCom->Rotation(0.f, 0.f, 0.f); } - GUI::ColorEdit4("MixColor", (_float*)&m_vColor); + GUI::ColorEdit4("MixColor", (_float*)&m_EffectInfo.vColor); ImGui::PushItemWidth(80); + m_pShaderCom->Describe_Entity(); + ImGui::PopItemWidth(); if (GUI::TreeNode("BLUR")) { - GUI::Checkbox("Blur", &m_isBlur); + GUI::Checkbox("Blur", &m_EffectInfo.isBlur); ImGui::PushItemWidth(80); - GUI::DragFloat("BlurIntensity", &m_fBlurIntensity, 0.005f, 0.f, 1.f); - GUI::DragInt("BlurWeight", &m_iBlurWeight, 1.f, 0, 32); + GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f); + GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 1.f, 0, 32); ImGui::PopItemWidth(); @@ -196,24 +359,73 @@ void CEditEffect::Describe_Entity() { const char* pCompute[] = {"NONE", "DIV" , "PLUS", "SUBSTRACT", "MULTY" , "EQUL" }; - _int iColorOption = (_int)m_fColorOption; + _int iColorOption = (_int)m_EffectInfo.fColorOption; if (ImGui::Combo("OPTION", &iColorOption, pCompute , 6)) { - m_fColorOption = (_float)iColorOption; + m_EffectInfo.fColorOption = (_float)iColorOption; } ImGui::PushItemWidth(80); - GUI::DragFloat("EmissiveCutAlpha", &m_fEmissiveCutAlpha, 0.005f, 0.f, 1.f); + GUI::DragFloat("EmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, 0.005f, 0.f, 1.f); ImGui::PopItemWidth(); - GUI::ColorEdit4("Emissive", (_float*)&m_vEmissive); + GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive); + + GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive); + + if (m_EffectInfo.isEmissive) + { + if (GUI::TreeNode("EMISSIVE_TEX")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "EMISSIVE_TEXTURE", (CComponent**)&m_pEmissive_TextureCom, nullptr, this); + + if (strName != "") { + m_strEmissiveName = strName; + } + + + GUI::TreePop(); + } + } GUI::TreePop(); } + if (GUI::TreeNode("LIGHT")) + { + if (GUI::Button("ADD LIGHT")) + { + if (m_pLightCom != nullptr) + { + GUI::TreePop(); + return; + } + LIGHT_DESC LightDesc{}; + LightDesc.eType = LIGHT::POINT; + LightDesc.vDiffuse = _float4(0.0f, 0.0f, 0.0f, 0.f); + LightDesc.vAmbient = _float4(0.0f, 0.0f, 0.0f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION); + LightDesc.iLevel = NEXT_LEVEL; + + /* Com_Light*/ + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) + { + GUI::TreePop(); + return; + } + } + + if (m_pLightCom != nullptr) + { + m_pLightCom->Describe_Entity(); + } + + GUI::TreePop(); + } if (GUI::TreeNode("MODEL")) { @@ -222,7 +434,11 @@ void CEditEffect::Describe_Entity() if (m_pInstance_ModelCom != nullptr) InstanceDesc = m_pInstance_ModelCom->Get_EffectValue(); - m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this); + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this); + + if (strName != "") { + m_strModelName = strName; + } if (m_pInstance_ModelCom != nullptr) { @@ -233,27 +449,30 @@ void CEditEffect::Describe_Entity() } - if (m_isDiffuse == true) + + + + if (m_EffectInfo.isDiffuse == true) { if (GUI::TreeNode("DIFFUSE")) { ImGui::PushItemWidth(80); - GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove); - GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_vUVCutting); + GUI::Checkbox("DiffuseUVMove", &m_EffectInfo.isDiffuseUVMove); + GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_EffectInfo.vUVCutting); GUI::Spacing(); - GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_vDiffuseUVGainAmount, 0.01f); + GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseUVGainAmount, 0.01f); - _int iDiffuseMoveLerpOption = (_int)m_iDiffuseMoveLerpOption; + _int iDiffuseMoveLerpOption = (_int)m_EffectInfo.iDiffuseMoveLerpOption; if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9)) { - m_iDiffuseMoveLerpOption = iDiffuseMoveLerpOption; + m_EffectInfo.iDiffuseMoveLerpOption = iDiffuseMoveLerpOption; } GUI::Spacing(); @@ -262,7 +481,13 @@ void CEditEffect::Describe_Entity() if (GUI::TreeNode("DIFFUSE_TEX")) { - m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this); + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this); + + if (strName != "") { + m_strDiffuseName = strName; + } + + GUI::TreePop(); } @@ -273,27 +498,27 @@ void CEditEffect::Describe_Entity() } - if (m_isMasking == true) + if (m_EffectInfo.isMasking == true) { if (GUI::TreeNode("MASKING")) { - GUI::InputFloat2("MaskUVCutting", (_float*)&m_vUVMaskCutting); - GUI::Checkbox("MaskUVMove", &m_isMaskUVMove); + GUI::InputFloat2("MaskUVCutting", (_float*)&m_EffectInfo.vUVMaskCutting); + GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove); ImGui::PushItemWidth(80); - GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_vMaskingUVGainAmount, 0.01f); + GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f); ImGui::PopItemWidth(); GUI::Spacing(); - _int iMaskMoveLerpOption = (_int)m_iMaskMoveLerpOption; + _int iMaskMoveLerpOption = (_int)m_EffectInfo.iMaskMoveLerpOption; if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9)) { - m_iMaskMoveLerpOption = iMaskMoveLerpOption; + m_EffectInfo.iMaskMoveLerpOption = iMaskMoveLerpOption; } @@ -301,7 +526,12 @@ void CEditEffect::Describe_Entity() if (GUI::TreeNode("MASKING_TEX")) { - m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this); + string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this); + + if (strName != "") { + m_strMaskingName = strName; + } + GUI::TreePop(); } GUI::Separator(); GUI::Spacing(); @@ -310,13 +540,18 @@ void CEditEffect::Describe_Entity() } } - if (m_isDissolve == true) + if (m_EffectInfo.isDissolve == true) { if (GUI::TreeNode("DISSOLVE")) { if (GUI::TreeNode("DISSOLV_TEX")) { - m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this); + _string strName = m_strDissolveName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this); + + if (strName != "") { + m_strDissolveName = strName; + } + GUI::TreePop(); } GUI::Separator(); GUI::Spacing(); @@ -325,34 +560,34 @@ void CEditEffect::Describe_Entity() } } - if (m_isNoise == true) + if (m_EffectInfo.isNoise == true) { if (GUI::TreeNode("NOISE")) { ImGui::PushItemWidth(80); - GUI::DragFloat("NoiseDistortionIntensity", &m_fNoiseDistortionIntensity, 0.005f, 0.f, 1.f); + GUI::DragFloat("NoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, 0.005f, 0.f, 1.f); GUI::Spacing(); - GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f); + GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseNoiseUVGainAmount, 0.01f); - _int iDiffuseNoiseMoveLerpOption = (_int)m_iDiffuseNoiseMoveLerpOption; + _int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseNoiseMoveLerpOption; if (ImGui::Combo("Lerp DiffuseNoiseMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9)) { - m_iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption; + m_EffectInfo.iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption; } GUI::Spacing(); - GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_vMaskNoiseUVGainAmount, 0.01f); + GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_EffectInfo.vMaskNoiseUVGainAmount, 0.01f); - _int iMaskNoiseMoveLerpOption = (_int)m_iMaskNoiseMoveLerpOption; + _int iMaskNoiseMoveLerpOption = (_int)m_EffectInfo.iMaskNoiseMoveLerpOption; if (ImGui::Combo("Lerp MaskNoiseMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9)) { - m_iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption; + m_EffectInfo.iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption; } GUI::Spacing(); @@ -361,7 +596,11 @@ void CEditEffect::Describe_Entity() if (GUI::TreeNode("NOISE_TEX")) { - m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this); + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this); + + if (strName != "") { + m_strNoiseName = strName; + } GUI::TreePop(); } diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index de7a5df24..7b16e6b60 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "EffectObject.h" #include "GameInstance.h" @@ -62,11 +62,11 @@ HRESULT CEffectObject::Render_Blur() return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_fBlurIntensity, sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_EffectInfo.fBlurIntensity, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_iBlurWeight, sizeof(_int)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_EffectInfo.iBlurWeight, sizeof(_int)))) { return E_FAIL; } @@ -95,6 +95,200 @@ HRESULT CEffectObject::Render_Blur() return S_OK; } +HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) +{ + _string strPerfectFilePath = pFilePath; + + strPerfectFilePath += ".bin"; + + HANDLE hFile = CreateFileW( + CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파ì�¼ ì�´ë¦„ + GENERIC_READ, // ì�½ê¸° 모드 + FILE_SHARE_READ, // 다른 프로세스ë�„ ì�½ê¸° 가능 + NULL, + OPEN_EXISTING, // 기존 파ì�¼ 열기 + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브ì �트 ì�½ê¸° 실패", L"System Message", MB_OK); + return E_FAIL; + } + + + DWORD dwByte(0); + + if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) { + return E_FAIL; + } + + m_EffectInfo.LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION); + m_EffectInfo.LightDesc.iLevel = ENUM_CLASS(eLevel); + + if (m_EffectInfo.LightDesc.eType != LIGHT::DIRECTIONAL) // 0ì�´ ì•„ë‹�때만 ìƒ�성 + { + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc))) + { + return E_FAIL; + } + } + + + if (m_EffectInfo.isDiffuse) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strDiffuseName = szName; + + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), + reinterpret_cast(&m_pDiffuse_TextureCom)))) + return E_FAIL; + } + + if (m_EffectInfo.isNoise) + { + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strNoiseName = szName; + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), + reinterpret_cast(&m_pNoise_TextureCom)))) + return E_FAIL; + } + + if (m_EffectInfo.isMasking) + { + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strMaskingName = szName; + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), + reinterpret_cast(&m_pMasking_TextureCom)))) + return E_FAIL; + } + + if (m_EffectInfo.isDissolve) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strDissolveName = szName; + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), + reinterpret_cast(&m_pDissolve_TextureCom)))) + return E_FAIL; + } + + if (m_EffectInfo.isEmissive) + { + size_t iComponentLength = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strEmissiveName = szName; + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), + reinterpret_cast(&m_pEmissive_TextureCom)))) + return E_FAIL; + } + + size_t iComponentLength = {}; + + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + return E_FAIL; + } + + if (iComponentLength != 0) + { + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) { + return E_FAIL; + } + + m_strModelName = szName; + } + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName), + reinterpret_cast(&m_pInstance_ModelCom)))) + return E_FAIL;; + + m_pInstance_ModelCom->Load_InstanceModel(hFile); + + CloseHandle(hFile); + + return S_OK; +} + HRESULT CEffectObject::Bind_ShaderResources() { @@ -110,91 +304,95 @@ HRESULT CEffectObject::Bind_ShaderResources() } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_EffectInfo.isDiffuse, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_isMasking, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_EffectInfo.isMasking, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_isDissolve, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_EffectInfo.isDissolve, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_EffectInfo.isNoise, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_isDiffuseUVMove, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissive", &m_EffectInfo.isEmissive, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_isMaskUVMove, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_EffectInfo.isDiffuseUVMove, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_vColor, sizeof(_float4)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_EffectInfo.isMaskUVMove, sizeof(_bool)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_vEmissive, sizeof(_float4)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_fColorOption, sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_EffectInfo.vEmissive, sizeof(_float4)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_fEmissiveCutAlpha, sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_EffectInfo.fColorOption, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_fNoiseDistortionIntensity, sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_vDiffuseUVGainAmount, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_vMaskingUVGainAmount, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_EffectInfo.vDiffuseUVGainAmount, sizeof(_float2)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_EffectInfo.vMaskingUVGainAmount, sizeof(_float2)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_vDiffuseNoiseUVGainAmount, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_EffectInfo.vDiffuseNoiseUVGainAmount, sizeof(_float2)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_vMaskNoiseUVGainAmount, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_EffectInfo.vMaskNoiseUVGainAmount, sizeof(_float2)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_vUVCutting, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_vUVMaskCutting, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_EffectInfo.vUVMaskCutting, sizeof(_float2)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_iMaskMoveLerpOption, sizeof(_int)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_EffectInfo.iMaskMoveLerpOption, sizeof(_int)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_iDiffuseMoveLerpOption, sizeof(_int)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_EffectInfo.iDiffuseMoveLerpOption, sizeof(_int)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_iMaskNoiseMoveLerpOption, sizeof(_int)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_EffectInfo.iMaskNoiseMoveLerpOption, sizeof(_int)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_iDiffuseNoiseMoveLerpOption, sizeof(_int)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_EffectInfo.iDiffuseNoiseMoveLerpOption, sizeof(_int)))) { return E_FAIL; } @@ -229,7 +427,16 @@ HRESULT CEffectObject::Bind_ShaderResources() } } + if (m_pEmissive_TextureCom != nullptr) + { + if (FAILED(m_pEmissive_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_EmissiveTexture", 0))) { + return E_FAIL; + } + } + + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } @@ -245,7 +452,9 @@ HRESULT CEffectObject::Ready_Components(void* pArg) if (FAILED(__super::Ready_Components(pArg))) { return E_FAIL; } + + //나중ì—� 로드할 때 ë�¼ì�´íŠ¸ë¥¼ ê°’ì�„ 입력받아서 ìƒ�성 하ìž� return S_OK; } @@ -275,9 +484,13 @@ void CEffectObject::Free() SAFE_RELEASE(m_pNoise_TextureCom); SAFE_RELEASE(m_pMasking_TextureCom); SAFE_RELEASE(m_pDissolve_TextureCom); + SAFE_RELEASE(m_pEmissive_TextureCom); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pInstance_ModelCom); + + if(m_pLightCom != nullptr) + SAFE_RELEASE(m_pLightCom); } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 422a6134d..ee746e3a3 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Effect_Editor.h" #include "GameInstance.h" @@ -113,14 +113,14 @@ void CEffect_Editor::ReadMaterials(const char* pDirectoryName) _string ext = file.path().extension().string(); - if (strcmp(ext.c_str(), ".txt")) // ÅØ½ºÆ® ÆÄÀÏ À϶§¸¸ ºôµåÇÔ + if (strcmp(ext.c_str(), ".txt")) // í…�스트 파ì�¼ ì�¼ë•Œë§Œ 빌드함 continue; _char szFilePath[MAX_PATH] = {}; strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); - _wstring wstrFileName = file.path().stem().wstring(); // ÆÄÀϸí + _wstring wstrFileName = file.path().stem().wstring(); // 파ì�¼ëª… ReadMaterial(wstrFileName, szFilePath); @@ -138,35 +138,35 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath) _wstring wstrFirstLine = {}; - getline(wifs, wstrFirstLine); // °¡Àå À§ÀÇ ÅØ½ºÆ® + getline(wifs, wstrFirstLine); // 가장 위ì�˜ í…�스트 - //.±âÁØÀ¸·Î µÚ¿¡ À̸§À» Áö¿ö¾ßÇÔ + //.기준으로 ë’¤ì—� ì�´ë¦„ì�„ 지워야함 size_t iPos = wstrFirstLine.find(L" "); _wstring wstrParent = {}; - wstrParent = wstrFirstLine.substr(0, iPos); // " " ÀÌÀü¸¸ ³²±è + wstrParent = wstrFirstLine.substr(0, iPos); // " " ì�´ì „ë§Œ 남김 - if (wstrParent == L"Parent") // ºÎ¸ð ¸ÓÅ׸®¾óÀÌ ÀÖ´Â °´Ã¼¿´´Ù¸é + if (wstrParent == L"Parent") // 부모 머테리얼ì�´ 있는 ê°�체였다면 { _wstring wstrMatPath = wstrFirstLine; _wstring wstrKeyword = L"VFX"; - size_t iPos = wstrMatPath.find(wstrKeyword); // VFX¸¦ ã°í ¾øÀ» ½Ã¿¡ ·ÎµåÇÏÁö ¾Ê´Â´Ù + size_t iPos = wstrMatPath.find(wstrKeyword); // VFX를 찾고 ì—†ì�„ 시ì—� 로드하지 않는다 if (iPos != _wstring::npos) { - _wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTXÀÌÈĸ¸ ³²±è" + _wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTXì�´í›„ë§Œ 남김" _wstring wstrMatName = {}; - //.±âÁØÀ¸·Î µÚ¿¡ À̸§À» Áö¿ö¾ßÇÔ + //.기준으로 ë’¤ì—� ì�´ë¦„ì�„ 지워야함 size_t iPos = wstrResult.find(L"."); - wstrResult = wstrResult.substr(0, iPos); // ".ÀÌÀü¸¸ ³²±è" + wstrResult = wstrResult.substr(0, iPos); // ".ì�´ì „ë§Œ 남김" - //ÆÄÀÏÀ̸§ ¹Þ¾Æ¿À±â + //파ì�¼ì�´ë¦„ 받아오기 size_t iNamePos = wstrResult.rfind(L"/"); wstrMatName = wstrResult.substr(iNamePos + 1); @@ -175,18 +175,18 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath) ReadMaterial(wstrMatName, CMyTools::ToString(wstrResult).c_str()); - // »óÀ§ ¸ÓÅ׸®¾ó ÆÄÀÏ¿¡¼­ ³Ö¾ú´ø ÆÄÀÏÀ» ´Ù½Ã ³» ÆÄÀÏ·Î ´ã´Â´Ù + // ìƒ�위 머테리얼 파ì�¼ì—�서 넣었ë�˜ 파ì�¼ì�„ 다시 ë‚´ 파ì�¼ë¡œ 담는다 auto Superior_iter = m_MatFiles.find(wstrMatName); auto Recent_iter = m_MatFiles.find(wstrFileName); - if (m_MatFiles.end() != Superior_iter) // °æ·Î°¡ Á¸ÀçÇÑ´Ù¸é + if (m_MatFiles.end() != Superior_iter) // 경로가 존재한다면 { - for (auto& wstrPath : Superior_iter->second) // »óÀ§ ¸ÓÅ׸®¾ó º¤Å͸¦ ¼øÈ¸ÇÏ¿© ³» º¤ÅÍ¿¡ ³ÖÀÚ + for (auto& wstrPath : Superior_iter->second) // ìƒ�위 머테리얼 벡터를 순회하여 ë‚´ 벡터ì—� ë„£ìž� { _bool isExist = { false }; - for (auto TextureInfo : Recent_iter->second) //ÀÌ¹Ì Á¸ÀçÇÑ °æ·Î¿´´Ù¸é Ãß°¡ÇÏÁö ¾Ê´Â´Ù + for (auto TextureInfo : Recent_iter->second) //ì�´ë¯¸ 존재한 경로였다면 추가하지 않는다 { if (TextureInfo.first == wstrPath.first) @@ -205,13 +205,13 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath) m_MatFiles.erase(Superior_iter); } - //º¤ÅÍ¿¡ ¸ðµÎ ³Ö¾ú´Ù¸é »óÀ§ ¸ÓÅ׸®¾óÀ» Áö¿î´Ù + //벡터ì—� 모ë‘� 넣었다면 ìƒ�위 머테리얼ì�„ 지운다 } } - // ÅØ½ºÃĸ¦ ºÒ·¯¿ÀÀÚ + // í…�스ì³�를 불러오ìž� _wstring wstrTextureLine = {}; while (getline(wifs, wstrTextureLine)) @@ -219,34 +219,34 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath) _wstring wstrKeyword = L"/VFX"; - size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX¸¦ ã°í ¾øÀ» ½Ã¿¡ ·ÎµåÇÏÁö ¾Ê´Â´Ù + size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX를 찾고 ì—†ì�„ 시ì—� 로드하지 않는다 if (iPos != _wstring::npos) { - _wstring wstrResult = wstrTextureLine.substr(iPos); // "VTXÀÌÈĸ¸ ³²±è" + _wstring wstrResult = wstrTextureLine.substr(iPos); // "VTXì�´í›„ë§Œ 남김" _wstring wstrTextureName = {}; - //.±âÁØÀ¸·Î µÚ¿¡ À̸§À» Áö¿ö¾ßÇÔ + //.기준으로 ë’¤ì—� ì�´ë¦„ì�„ 지워야함 size_t iPos = wstrResult.find(L"."); - wstrResult = wstrResult.substr(0, iPos); // ".ÀÌÀü¸¸ ³²±è" + wstrResult = wstrResult.substr(0, iPos); // ".ì�´ì „ë§Œ 남김" - // À̸§ ¸¸µé±â + // ì�´ë¦„ 만들기 size_t iNamePos = wstrResult.rfind(L"/"); wstrTextureName = wstrResult.substr(iNamePos + 1); wstrResult = L"../Bin/Resources" + wstrResult + L".png"; - //°æ·Î¸¦ ´ã´Â´Ù + //경로를 담는다 auto iter = m_MatFiles.find(wstrFileName); - if (m_MatFiles.end() != iter) // °æ·Î°¡ Á¸ÀçÇÑ´Ù¸é + if (m_MatFiles.end() != iter) // 경로가 존재한다면 { _bool isExist = { false }; for (auto TextureInfo : iter->second) { - if (TextureInfo.first == wstrTextureName) // ÀÌ¹Ì Á¸ÀçÇß¾ú´Ù¸é + if (TextureInfo.first == wstrTextureName) // ì�´ë¯¸ 존재했었다면 { isExist = true; break; @@ -263,9 +263,10 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath) wifs.close(); } -void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject) +_string CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject) { + _string strName = {}; for (auto iter : m_MatFiles) { if (GUI::TreeNode(CMyTools::ToString(iter.first).c_str())) @@ -273,14 +274,17 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb for (auto wstrTextureInfo : iter.second) { - m_pGameInstance->Asset_Description( + strName = m_pGameInstance->Asset_Description( ENUM_CLASS(LEVEL::EFFECT), CMyTools::ToString(iter.first).c_str() , pTexture , nullptr , pObject - , wstrTextureInfo.first // À̸§ + , wstrTextureInfo.first // ì�´ë¦„ ); + + if(strName != "") + return strName; }; @@ -291,7 +295,24 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb } + return ""; +} +HRESULT CEffect_Editor::Load_Edit(const _char* pPath) +{ + + if (m_pEditEffect == nullptr) + return E_FAIL; + + if (FAILED(m_pEditEffect->Load(pPath, LEVEL::EFFECT))) + { + Safe_Release(m_pEditEffect); + return E_FAIL; + } + + Safe_Release(m_pEditEffect); + + return S_OK; } @@ -337,6 +358,22 @@ void CEffect_Editor::Describe_Entity() if (m_pEditEffect != nullptr) m_pEditEffect->Describe_Entity(); + GUI::InputTextMultiline("FILE PATH", m_szBuffer, sizeof(m_szBuffer), ImVec2(250, 25)); + + m_strSavePath = m_szBuffer; + + if (GUI::Button("SAVE")) + { + m_pEditEffect->Save_Effect(m_strSavePath.c_str()); + } + + GUI::SameLine(); + + if (GUI::Button("LOAD")) + { + Load_Edit(m_strSavePath.c_str()); + } + ImGui::End(); ImGui::Begin("Reference Material"); @@ -395,7 +432,7 @@ void CEffect_Editor::Describe_Entity() if (ImGui::MenuItem("Delete Effect")) { auto iter = m_PartObjects.begin(); - advance(iter, iIndex); // ÀÌÅÍ·¹ÀÌÅ͸¦ Áõ°¡½ÃŲ´Ù + advance(iter, iIndex); // ì�´í„°ë ˆì�´í„°ë¥¼ ì¦�가시킨다 SAFE_RELEASE(pPartObject.second); m_PartObjects.erase(iter); @@ -411,7 +448,7 @@ void CEffect_Editor::Describe_Entity() #pragma endregion - if (GUI::IsItemClicked()) // ¼±ÅÃâ¿¡ ¶ç¿ì±â + if (GUI::IsItemClicked()) // ì„ íƒ�ì°½ì—� ë�„우기 { CEditEffect* pSelectedEffectObject = dynamic_cast(pPartObject.second); @@ -432,11 +469,11 @@ void CEffect_Editor::Describe_Entity() - Safe_Release(m_pEditEffect); + SAFE_RELEASE(m_pEditEffect); m_pEditEffect = pSelectedEffectObject; - Safe_AddRef(pSelectedEffectObject); + SAFE_ADDREF(pSelectedEffectObject); m_strCurrentEffectName = strName; diff --git a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp index 484764bbd..be30b4e6a 100644 --- a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GamePlay_Canvas.h" #include "GameInstance.h" #include "Mission_Panel.h" diff --git a/Jusin154_Team3D/Editor/Private/Hair.cpp b/Jusin154_Team3D/Editor/Private/Hair.cpp index 7fe0a8003..309fd1207 100644 --- a/Jusin154_Team3D/Editor/Private/Hair.cpp +++ b/Jusin154_Team3D/Editor/Private/Hair.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Hair.h" #include "GameInstance.h" @@ -136,7 +136,7 @@ CHair* CHair::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CHair"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -149,7 +149,7 @@ CGameObject* CHair::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CHair"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Editor/Private/Head.cpp b/Jusin154_Team3D/Editor/Private/Head.cpp index 5aecdf0c9..7c20ff934 100644 --- a/Jusin154_Team3D/Editor/Private/Head.cpp +++ b/Jusin154_Team3D/Editor/Private/Head.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Head.h" #include "GameInstance.h" @@ -50,7 +50,78 @@ void CHead::Late_Update(_float fTimeDelta) HRESULT CHead::Render() { - __super::Render(); + if(!m_pModelCom) + return S_OK; + + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + 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, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (i == m_HeadIndex) + { + + if (FAILED(m_pShaderCom->Begin(5))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + else + { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + } + + return S_OK; +} + +HRESULT CHead::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + + GUI::DragFloat4("COLOR", (_float*)&m_vColor, 0.1f); + + if (FAILED(m_pShaderCom->Bind_RawValue("g_TestColor", &m_vColor, sizeof(_float4)))) { + return E_FAIL; + } return S_OK; } @@ -75,7 +146,7 @@ CHead* CHead::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CHead"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -88,7 +159,7 @@ CGameObject* CHead::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CHead"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 67e98e563..e700478a2 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "IMGUIUI.h" #include "UIObject.h" #include "GamePlay_Canvas.h" @@ -38,7 +38,7 @@ void CIMGUIUI::PanelwstringTostring(vector& panelNames) for (auto& wname : panelNames) { - // wstring -> UTF-8 string º¯È¯ + // wstring -> UTF-8 string 변환 int size = WideCharToMultiByte(CP_UTF8, 0, wname.c_str(), (int)wname.size(), nullptr, 0, nullptr, nullptr); @@ -49,11 +49,11 @@ void CIMGUIUI::PanelwstringTostring(vector& panelNames) wname.c_str(), (int)wname.size(), &result[0], size, nullptr, nullptr); - // º¯È¯µÈ string ÀúÀå + // 변환ë�œ string 저장 m_iPanelNamestring.push_back(std::move(result)); } - // vector ¾÷µ¥ÀÌÆ® + // vector ì—…ë�°ì�´íЏ for (auto& str : m_iPanelNamestring) m_iPanelName.push_back(str.c_str()); @@ -70,7 +70,7 @@ void CIMGUIUI::ElementwstringTostring(vector& panelNames) for (auto& wname : panelNames) { - // wstring -> UTF-8 string º¯È¯ + // wstring -> UTF-8 string 변환 int size = WideCharToMultiByte(CP_UTF8, 0, wname.c_str(), (int)wname.size(), nullptr, 0, nullptr, nullptr); @@ -81,11 +81,11 @@ void CIMGUIUI::ElementwstringTostring(vector& panelNames) wname.c_str(), (int)wname.size(), &result[0], size, nullptr, nullptr); - // º¯È¯µÈ string ÀúÀå + // 변환ë�œ string 저장 m_pElementNamestring.push_back(std::move(result)); } - // vector ¾÷µ¥ÀÌÆ® + // vector ì—…ë�°ì�´íЏ for (auto& str : m_pElementNamestring) m_pElementName.push_back(str.c_str()); @@ -134,6 +134,11 @@ void CIMGUIUI::Update(_float fTimeDelta) m_bElementFadeOut = static_cast(m_pElementObject)->Get_FadeOut(); m_fAlphaTime = static_cast(m_pElementObject)->Get_AlphaTime(); m_UV = static_cast(m_pElementObject)->Get_UV(); + + m_fLeft = static_cast(m_pElementObject)->Get_Nine_Slice_Left(); + m_fRight = static_cast(m_pElementObject)->Get_Nine_Slice_Right(); + m_fTop = static_cast(m_pElementObject)->Get_Nine_Slice_Top(); + m_fBottom = static_cast(m_pElementObject)->Get_Nine_Slice_Bottom(); } GUI::Begin("Current_PanelObject_Info"); if (m_pGamePlay_Canvas != nullptr) @@ -306,6 +311,7 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->SizeUpdate_float(m_fSizeXY); } + GUI::Text("Time"); if (GUI::DragFloat("EndTime", &m_fEndTime, 0.01f, 0.f, 10.f)) { static_cast(m_pElementObject)->Set_TimeMult(m_fEndTime); @@ -326,6 +332,7 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_AlphaTime(m_fAlphaTime); } + GUI::Text("UV"); if (GUI::DragFloat("U", &m_UV.x, 0.01f, 0.f, 10.f)) { static_cast(m_pElementObject)->Set_U(m_UV.x); @@ -335,6 +342,28 @@ void CIMGUIUI::Update(_float fTimeDelta) { static_cast(m_pElementObject)->Set_V(m_UV.y); } + + GUI::Text("Nine_Slice"); + if (GUI::DragFloat("Left", &m_fLeft, 0.1f, 0, m_fSize.x)) + { + static_cast(m_pElementObject)->Nine_Slice_Left(m_fLeft); + } + + if (GUI::DragFloat("Right", &m_fRight, 0.1f,0.5f, m_fSize.x)) + { + static_cast(m_pElementObject)->Nine_Slice_Right(m_fRight); + } + + if (GUI::DragFloat("Top", &m_fTop, 0.1f, 0, m_fSize.y)) + { + static_cast(m_pElementObject)->Nine_Slice_Top(m_fTop); + } + + if (GUI::DragFloat("Bottom", &m_fBottom, 0.1f,0, m_fSize.y)) + { + static_cast(m_pElementObject)->Nine_Slice_Bottom(m_fBottom); + } + } GUI::End(); } diff --git a/Jusin154_Team3D/Editor/Private/Information.cpp b/Jusin154_Team3D/Editor/Private/Information.cpp index aab0c25df..35c5c8a6e 100644 --- a/Jusin154_Team3D/Editor/Private/Information.cpp +++ b/Jusin154_Team3D/Editor/Private/Information.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Information.h" diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index ef9680e6b..69dfa26cb 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_EffectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -6,6 +6,8 @@ #include "TestEffect.h" #include "Effect_Editor.h" #include "Dummy_Cube.h" +#include "MainLight.h" +#include "Dummy_Plane.h" CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -35,6 +37,9 @@ HRESULT CLevel_EffectViewer::Initialize() if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE))) + return E_FAIL; + return S_OK; } @@ -46,7 +51,7 @@ void CLevel_EffectViewer::Update(_float fTimeDelta) HRESULT CLevel_EffectViewer::Render() { - SetWindowText(g_hWnd, TEXT("ÀÌÆåÆ® ·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("ì�´íŽ™íŠ¸ 레벨입니다")); GUI::ShowDemoWindow(); return S_OK; } @@ -62,6 +67,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) CameraDesc.vEye = _float3(0.f, 10.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; @@ -74,17 +80,10 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) HRESULT CLevel_EffectViewer::Ready_Layer_Light() { - LIGHT_DESC LightDesc{}; - LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - - if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) return E_FAIL; - } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index c5ec32bd2..bd84001a1 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -8,6 +8,7 @@ #include "MapObject_Manager.h" #include "BuildingContainer.h" #include "DummySkyBox.h" +#include "MainLight.h" CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -56,17 +57,10 @@ HRESULT CLevel_MapViewer::Initialize() HRESULT CLevel_MapViewer::Ready_Layer_Light() { - LIGHT_DESC LightDesc{}; - LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - - if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) return E_FAIL; - } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index bf8300d89..5a752e30b 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_ObjectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -11,7 +11,11 @@ #include "Layer.h" #include "GameObject.h" #include "DummyObject.h" + #include "DummySkyBox.h" +#include "MainLight.h" +#include "Terrain.h" + CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -54,7 +58,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) HRESULT CLevel_ObjectViewer::Render() { - SetWindowText(g_hWnd, TEXT("¿ÀºêÁ§Æ® ·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("오브ì �트 레벨입니다")); //GUI::ShowDemoWindow(); return S_OK; } @@ -262,6 +266,7 @@ void CLevel_ObjectViewer::Show_AnimList() { pModel->Set_AnimationIndex(i); pModel->Set_CurrentTrackPosition(0.f); + pModel->Play_Animation(0.f); } } } @@ -298,9 +303,16 @@ void CLevel_ObjectViewer::Dummy_Object_Setting() GUI::Begin("Object_Info"); if (!m_Objects.empty()) { + _float3 Pos; + XMStoreFloat3(&Pos, m_Objects[m_iObjectIndex]->Get_Component()->Get_State(STATE::POSITION)); + GUI::DragFloat3("Pos", (_float*)&Pos); + Show_ObjectList(); + CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component(); + GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex())); + _float AnimTrack = pModel->Get_CurrentTrackPosition(); GUI::DragFloat("AnimTrack", &AnimTrack); @@ -330,6 +342,18 @@ void CLevel_ObjectViewer::Parts_Object_Setting() CModel* pModel = m_HumanRoot->Get_MainModel(); if (pModel) { + _float3 Pos; + XMStoreFloat3(&Pos, m_HumanRoot->Get_WorldPostion()); + + float Pos3[3] = { Pos.x, Pos.y, Pos.z }; + GUI::DragFloat3("Pos", Pos3); + + Pos.x = Pos3[0]; + Pos.y = Pos3[1]; + Pos.z = Pos3[2]; + + m_HumanRoot->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(Pos.x, Pos.y, Pos.z, 1.f)); + GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex())); _float KeyFrame = pModel->Get_CurrentTrackPosition(); @@ -464,6 +488,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) CameraDesc.vEye = _float3(0.f, 30.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; @@ -476,17 +501,9 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) HRESULT CLevel_ObjectViewer::Ready_Layer_Light() { - LIGHT_DESC LightDesc{}; - - LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.2f, 0.2f, 0.2f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - - if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) return E_FAIL; - } + return S_OK; } @@ -500,6 +517,9 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))) 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/Editor/Private/Level_PhysXLab.cpp b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp index 54db9e602..34f868c24 100644 --- a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_PhysXLab.h" #include "GameInstance.h" @@ -10,6 +10,7 @@ #include "Dummy_PhysXMesh.h" #include "MapObject_Manager.h" #include "BuildingContainer.h" +#include "MainLight.h" CLevel_PhysXLab::CLevel_PhysXLab(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -24,7 +25,7 @@ void CLevel_PhysXLab::Update(_float fTimeDelta) HRESULT CLevel_PhysXLab::Render() { - SetWindowText(g_hWnd, TEXT("PhysXEditor·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다")); GUI::ShowDemoWindow(); return S_OK; } @@ -51,17 +52,9 @@ HRESULT CLevel_PhysXLab::Initialize() HRESULT CLevel_PhysXLab::Ready_Layer_Light() { - LIGHT_DESC LightDesc{}; - - LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - - if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) return E_FAIL; - } + return S_OK; } @@ -70,10 +63,11 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag) CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; CameraDesc.fFovy = XMConvertToRadians(60.0f); CameraDesc.fNear = 0.1f; - CameraDesc.fFar = 5000.f; + CameraDesc.fFar = 500.f; CameraDesc.vEye = _float3(0.f, 10.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 2.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 036e8ed73..5f7d809fa 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1,10 +1,16 @@ #include "pch.h" #include "Loader.h" -#include "DebugCamera.h" #include "GameInstance.h" + +#pragma region DEFAULT_HEADER + +#include "DebugCamera.h" #include "DummyRect.h" #include "MainApp.h" #include "Dummy_Cube.h" +#include "MainLight.h" + +#pragma endregion #pragma region OBJECT_HEADER @@ -59,6 +65,7 @@ #include "TestEffect.h" #include "EditEffect.h" #include "Effect_Editor.h" +#include "Dummy_Plane.h" #pragma endregion @@ -222,6 +229,10 @@ HRESULT CLoader::Loading_For_Logo() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMainLight::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; @@ -236,41 +247,42 @@ HRESULT CLoader::Loading_For_UI() m_strMessage = TEXT("Texture Loading.."); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Keyboard"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Keyboard/Keyboard_%d.png"), 10)))) { - return E_FAIL; - } + Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"), CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LodingWidget1"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) { - return E_FAIL; - } + Asset_FileLoad("../Bin/Resources/Textures/Mission", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Border"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Border.png"), 0)))) { - return E_FAIL; - } + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Key"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Key.png"), 0)))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Finishi_Rect"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Finishi_Rect.png"), 0)))) { - return E_FAIL; - } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Main"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Mission_Main.png"), 0)))) { - return E_FAIL; - } + return S_OK; + }); if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Mission_Icon"), CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/Mission_Icon_%d.png"), 2)))) { @@ -292,6 +304,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Loading", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -448,6 +476,10 @@ HRESULT CLoader::Loading_For_Effect() 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(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Model_DummyPlane"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx", XMMatrixIdentity())))) + return E_FAIL; + m_strMessage = TEXT("Shader Loading.."); @@ -482,6 +514,10 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDummy_Cube::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDummy_Plane::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; @@ -563,25 +599,29 @@ HRESULT CLoader::Loading_For_PhysXLevel() } ModelPrototypeTags.push_back(strFileName); - ModelPrototypePath.push_back(file.path()); - _uint iNumMesh = pModel->Get_NumMeshes(); + { /* cache rigidbody */ // More Info In 리지드바디, CCT, 엔진ì�´ë„˜ + ModelPrototypePath.push_back(file.path()); - CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; - for (_uint i = 0; i < iNumMesh; ++i) { - _string strDestName = pModel->Get_MeshName(i) + to_string(i); - { - Desc.eType = ACTOR::TRIANGLEMESH; - Desc.ePxRigidBodyFlags = {}; - Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; - Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; - Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; - } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) { - return E_FAIL; + _uint iNumMesh = pModel->Get_NumMeshes(); + + CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; + for (_uint i = 0; i < iNumMesh; ++i) { + _string strDestName = pModel->Get_MeshName(i) + to_string(i); + { // basic static RIGIDBODY + Desc.eType = ACTOR::TRIANGLEMESH; + Desc.ePxRigidBodyFlags = {}; + Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; + Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); + Desc.fContactOffset = 0.f; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } } } + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))){ return E_FAIL; @@ -695,6 +735,14 @@ HRESULT CLoader::Loading_For_ObjectViewer() CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * 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.001f, 0.001f, 0.001f) * 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.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + #pragma endregion #pragma region HAIR @@ -716,6 +764,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() return E_FAIL; #pragma endregion + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TestHuman_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/TestHuman.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + #pragma region MONSTER if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), @@ -752,10 +804,20 @@ HRESULT CLoader::Loading_For_ObjectViewer() 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; + } + m_strMessage = TEXT("Shader Loading.."); m_strMessage = TEXT("Prototype Loading.."); + /* For.Prototype_Component_VIBuffer_Terrain */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"), + CVIBuffer_Terrain::Create(m_pDevice, m_pContext, nullptr, 100, 100)))) + return E_FAIL; + /* For.Prototype_GameObject_RootModelPart */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRootModelPart::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -780,6 +842,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Terrain */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext)))) + return E_FAIL; + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp new file mode 100644 index 000000000..feab5b2af --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -0,0 +1,124 @@ +#include "pch.h" +#include "MainLight.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CMainLight::CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CMainLight::CMainLight(const CMainLight& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CMainLight::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMainLight::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f)); + + return S_OK; +} + +void CMainLight::Priority_Update(_float fTimeDelta) +{ + +} + +void CMainLight::Update(_float fTimeDelta) +{ + +} + +void CMainLight::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CMainLight::Render() +{ + return S_OK; +} + + + +HRESULT CMainLight::Ready_Components() +{ + __super::Ready_Components(nullptr); + + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::DIRECTIONAL; + LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); + LightDesc.iLevel = NEXT_LEVEL; + + /* Com_Light*/ + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) + { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CMainLight::Bind_ShaderResources() +{ + return S_OK; +} + + + +CMainLight* CMainLight::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMainLight* pInstance = new CMainLight(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMainLight"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CMainLight::Clone(void* pArg, CGameObject* pOwner) +{ + CMainLight* pInstance = new CMainLight(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMainLight"); + Safe_Release(pInstance); + } + + return pInstance; +} + + + +void CMainLight::Free() +{ + __super::Free(); + + Safe_Release(m_pLightCom); +} + +void CMainLight::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp index 0f9956dc8..1199726dd 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MapObject_LOD.h" #include "GameInstance.h" @@ -222,10 +222,10 @@ void CMapObject_LOD::Free() { __super::Free(); - Safe_Release(m_pShaderCom); + SAFE_RELEASE(m_pShaderCom); for(auto& pModel : m_pModelComs) - Safe_Release(pModel); + SAFE_RELEASE(pModel); m_pModelComs.clear(); } diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 67cc3c8f8..8d50b328e 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -374,7 +374,7 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName) #pragma endregion - // ÀúÀå + // ?ú?Ã¥ if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) { MSG_BOX("Failed to Save File"); } @@ -498,7 +498,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch m_pSelectObject = nullptr; #pragma endregion - // ÀúÀå + // ?ú?Ã¥ if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) { MSG_BOX("Failed to Save File"); } @@ -1084,7 +1084,7 @@ CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11Devi if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags, ModelPrototypePaths))) { MSG_BOX("Failed to Created : CMapObject_Manager"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -1097,7 +1097,7 @@ CGameObject* CMapObject_Manager::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CMapObject_Manager"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Static.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Static.cpp index 69b4f1871..392f83091 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Static.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Static.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MapObject_Static.h" #include "GameInstance.h" @@ -192,8 +192,8 @@ void CMapObject_Static::Free() { __super::Free(); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CMapObject_Static::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp b/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp index 18aab854e..c2ef793f5 100644 --- a/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp +++ b/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp @@ -23,8 +23,8 @@ HRESULT CMissionBanner_Border::Initialize(void* pArg) Desc.fX = -248.f; Desc.fY = 100.f; - Desc.fSizeX = 480.f; - Desc.fSizeY = 240.f; + Desc.fSizeX = 256.f; + Desc.fSizeY = 128.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) }; @@ -110,7 +110,7 @@ HRESULT CMissionBanner_Border::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::UVMULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -170,6 +170,18 @@ HRESULT CMissionBanner_Border::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + 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_fCurrent_Posigion, sizeof(_float2)))) + { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp b/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp index c259f0e95..69d58ea73 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp +++ b/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp @@ -40,6 +40,7 @@ HRESULT CMission_KeyHold::Initialize(void* pArg) m_fTimeMult = 1.f; m_fAlpha = 1.f; m_fAlphaTime = 3.f; + m_fPI = AI_MATH_TWO_PI_F; return S_OK; } @@ -159,7 +160,11 @@ HRESULT CMission_KeyHold::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTimeMult", &m_fTimeMult, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fPI", &m_fPI, sizeof(_float)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/ModelParts.cpp b/Jusin154_Team3D/Editor/Private/ModelParts.cpp index c85302a2a..7337f9efe 100644 --- a/Jusin154_Team3D/Editor/Private/ModelParts.cpp +++ b/Jusin154_Team3D/Editor/Private/ModelParts.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Body.h" #include "GameInstance.h" @@ -96,7 +96,13 @@ void CModelParts::Change_Model(const _wchar* Prototype) Remove_Component(); SAFE_RELEASE(m_pModelCom); } - + ; + if (strstr(CMyTools::ToString(Prototype).c_str(), "_F_")) + { + m_HeadIndex = 2; + } + else + m_HeadIndex = 1; if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, Prototype, reinterpret_cast(&m_pModelCom)))) return; @@ -138,8 +144,8 @@ void CModelParts::Free() { __super::Free(); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CModelParts::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index a4f7e1b02..728a58183 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Monster.h" #include "GameInstance.h" @@ -129,7 +129,7 @@ CMonster* CMonster::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CMonster"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -142,7 +142,7 @@ CGameObject* CMonster::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CMonster"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -154,8 +154,8 @@ void CMonster::Free() { __super::Free(); - Safe_Release(m_pShaderCom); - Safe_Release(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); } void CMonster::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp index dee210e73..a3ef26530 100644 --- a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp +++ b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "RootModelPart.h" #include "GameInstance.h" @@ -71,7 +71,7 @@ void CRootModelPart::Update_Anim(_float fTimeDelta) { pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim()); pModel->Set_AnimSpeed(m_pMainModel->Get_AnimSpeed()); - pModel->Play_Animation(fTimeDelta); + pModel->Play_Animation(fTimeDelta,m_pTransformCom); } } } @@ -171,7 +171,7 @@ CRootModelPart* CRootModelPart::Create(ID3D11Device* pDevice, ID3D11DeviceContex if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CRootModelPart"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -184,7 +184,7 @@ CGameObject* CRootModelPart::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CRootModelPart"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index 2f5b73f20..693105460 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Terrain.h" #include "GameInstance.h" @@ -126,7 +126,7 @@ CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CTerrain"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -139,7 +139,7 @@ CGameObject* CTerrain::Clone(void* pArg, CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CTerrain"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -149,9 +149,9 @@ void CTerrain::Free() { __super::Free(); - Safe_Release(m_pShaderCom); - Safe_Release(m_pVIBufferCom); - Safe_Release(m_pTextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); + SAFE_RELEASE(m_pTextureCom); } void CTerrain::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Public/Active_Icon.h b/Jusin154_Team3D/Editor/Public/Active_Icon.h index 11896987b..b19d0d329 100644 --- a/Jusin154_Team3D/Editor/Public/Active_Icon.h +++ b/Jusin154_Team3D/Editor/Public/Active_Icon.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "ElementObject.h" diff --git a/Jusin154_Team3D/Editor/Public/DebugCamera.h b/Jusin154_Team3D/Editor/Public/DebugCamera.h index 01adc1098..56c07bc30 100644 --- a/Jusin154_Team3D/Editor/Public/DebugCamera.h +++ b/Jusin154_Team3D/Editor/Public/DebugCamera.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "Camera.h" diff --git a/Jusin154_Team3D/Editor/Public/DummyObject.h b/Jusin154_Team3D/Editor/Public/DummyObject.h index 54de78e53..fd9c5ddd2 100644 --- a/Jusin154_Team3D/Editor/Public/DummyObject.h +++ b/Jusin154_Team3D/Editor/Public/DummyObject.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -34,8 +34,8 @@ class CDummyObject final : public CGameObject _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } private: - CShader* m_pShaderCom = { nullptr }; - CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; _wstring m_strModelPrototypeTag; _bool m_bRimLight = { true }; _float m_fRimLightPower = { 3.2f }; @@ -53,4 +53,4 @@ class CDummyObject final : public CGameObject virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/DummyRect.h b/Jusin154_Team3D/Editor/Public/DummyRect.h index 404c1b391..8d92ae12f 100644 --- a/Jusin154_Team3D/Editor/Public/DummyRect.h +++ b/Jusin154_Team3D/Editor/Public/DummyRect.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/DummySkyBox.h b/Jusin154_Team3D/Editor/Public/DummySkyBox.h index df368f9af..c13a2a814 100644 --- a/Jusin154_Team3D/Editor/Public/DummySkyBox.h +++ b/Jusin154_Team3D/Editor/Public/DummySkyBox.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Dummy_Cube.h b/Jusin154_Team3D/Editor/Public/Dummy_Cube.h index 2f3ced385..9ba5ab09f 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_Cube.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_Cube.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h index 00f39daa0..cf2d7f4bb 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h index bfea43799..06fc3e4ea 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXPlayable.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXPlayable.h index 44d4b7f3b..0a9e42f12 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_PhysXPlayable.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXPlayable.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Dummy_Plane.h b/Jusin154_Team3D/Editor/Public/Dummy_Plane.h new file mode 100644 index 000000000..b3cf85747 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_Plane.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Editor) + +class CDummy_Plane final : public CGameObject +{ +private: + CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_Plane(const CDummy_Plane& rhs); + virtual ~CDummy_Plane() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CDummy_Plane* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/EditEffect.h b/Jusin154_Team3D/Editor/Public/EditEffect.h index 26ff9cdeb..be9ec7891 100644 --- a/Jusin154_Team3D/Editor/Public/EditEffect.h +++ b/Jusin154_Team3D/Editor/Public/EditEffect.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "EffectObject.h" @@ -23,8 +23,8 @@ class CEditEffect final : public CEffectObject virtual void Late_Update(_float fTimeDelta) override; public: - void Reference_Mat_For_EditEffect(); - + void Reference_Mat_For_EditEffect(); + HRESULT Save_Effect(const _char* pPath); private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -39,4 +39,4 @@ class CEditEffect final : public CEffectObject void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 42c99a567..8ef743ad2 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -24,7 +24,7 @@ namespace Editor enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR ,END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, NINECLICE , END }; } using namespace Editor; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Macro.h b/Jusin154_Team3D/Editor/Public/Editor_Macro.h index 057790628..b6589b9d8 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Macro.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Macro.h @@ -20,6 +20,7 @@ namespace Editor { #define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL") #define FX_UIEDITOR TEXT("FX_UIEDITOR") + #pragma endregion #pragma region MACRO_PROTOTYPE #define CURRENT_LEVEL m_pGameInstance->Get_CurrentLevelID() @@ -50,6 +51,7 @@ namespace Editor { #define LAYER_DOT TEXT("Layer_Dot") #define LAYER_CELL TEXT("Layer_Cell") #define LAYER_TRIGGER TEXT("Layer_Trigger") +#define LAYER_LIGHT TEXT("Layer_Light") #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index 7ab131a7b..bbafb10c6 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "PartObject.h" @@ -7,12 +7,56 @@ NS_BEGIN(Engine) class CInstance_Model; class CShader; class CTexture; +class CLight; NS_END NS_BEGIN(Editor) class CEffectObject abstract : public CPartObject { +public: + typedef struct tagEffectInfo + { + _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; + + _float2 vDiffuseUVGainAmount = {}; + _float2 vMaskingUVGainAmount = {}; + + _float2 vDiffuseNoiseUVGainAmount = {}; + _float2 vMaskNoiseUVGainAmount = {}; + + _float2 vUVCutting = { 1.f ,1.f }; + _float2 vUVMaskCutting = { 1.f ,1.f }; + + _int iMaskMoveLerpOption = { 0 }; + _int iDiffuseMoveLerpOption = { 0 }; + _int iMaskNoiseMoveLerpOption = { 0 }; + _int iDiffuseNoiseMoveLerpOption = { 0 }; + _int iBlurWeight = { 0 }; + + + _bool isDiffuse = {}; + _bool isMasking = {}; + _bool isDissolve = {}; + _bool isNoise = {}; + _bool isEmissive = {}; + _bool isDiffuseUVMove = {}; + _bool isMaskUVMove = {}; + _bool isBlur = {}; + _bool isBillboard = {}; + + + _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; + _float fColorOption = {}; + _float fBlurIntensity = {}; + _float fNoiseDistortionIntensity = {}; + _float fEmissiveCutAlpha = {}; + + LIGHT_DESC LightDesc = {}; + RENDER eRenderOrder = { RENDER::EFFECT }; + + }EFFECT_INFO; + protected: CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CEffectObject(const CEffectObject& rhs); @@ -24,6 +68,8 @@ class CEffectObject abstract : public CPartObject virtual void Late_Update(_float fTimeDelta); virtual HRESULT Render() override; virtual HRESULT Render_Blur() override; +public: + HRESULT Load(const _char* pFilePath, LEVEL eLevel); protected: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -35,50 +81,24 @@ class CEffectObject abstract : public CPartObject CTexture* m_pNoise_TextureCom = { nullptr }; CTexture* m_pMasking_TextureCom = { nullptr }; CTexture* m_pDissolve_TextureCom = { nullptr }; + CTexture* m_pEmissive_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; + CLight* m_pLightCom = { nullptr }; + CInstance_Model* m_pInstance_ModelCom = { nullptr }; protected: - _float4 m_vColor = { 0.f ,0.f ,0.f ,1.f }; - - _float2 m_vDiffuseUVGainAmount = {}; - _float2 m_vMaskingUVGainAmount = {}; - - _float2 m_vDiffuseNoiseUVGainAmount = {}; - _float2 m_vMaskNoiseUVGainAmount = {}; - - _float2 m_vUVCutting = { 1.f ,1.f }; - _float2 m_vUVMaskCutting = { 1.f ,1.f }; - - _int m_iMaskMoveLerpOption = { 0 }; - _int m_iDiffuseMoveLerpOption = { 0 }; - _int m_iMaskNoiseMoveLerpOption = { 0 }; - _int m_iDiffuseNoiseMoveLerpOption = { 0 }; - _int m_iBlurWeight = { 0 }; - - - _bool m_isDiffuse = {}; - _bool m_isMasking = {}; - _bool m_isDissolve = {}; - _bool m_isNoise = {}; - _bool m_isDiffuseUVMove = {}; - _bool m_isMaskUVMove = {}; - _bool m_isBlur = {}; - _bool m_isBillboard = {}; - - - _float4 m_vEmissive = { 0.f ,0.f ,0.f ,0.f }; - _float m_fColorOption = {}; - _float m_fBlurIntensity = {}; - _float m_fNoiseDistortionIntensity = {}; - _float m_fEmissiveCutAlpha = {}; - - - RENDER m_eRenderOrder = { RENDER::EFFECT }; + EFFECT_INFO m_EffectInfo = {}; + _string m_strDiffuseName = {}; + _string m_strNoiseName = {}; + _string m_strMaskingName = {}; + _string m_strDissolveName = {}; + _string m_strModelName = {}; + _string m_strEmissiveName = {}; public: virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Effect_Editor.h b/Jusin154_Team3D/Editor/Public/Effect_Editor.h index f79d06dc0..60d90a65b 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Editor.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Editor.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "ContainerObject.h" @@ -23,7 +23,8 @@ class CEffect_Editor final : public CContainerObject virtual void Late_Update(_float fTimeDelta) override; public: - void Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject); + _string Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject); + HRESULT Load_Edit(const _char* pPath); private: virtual HRESULT Initialize_Prototype() override; @@ -37,9 +38,13 @@ class CEffect_Editor final : public CContainerObject private: _string m_strCurrentEffectName = {}; + _uint m_iNumPart = { 0 }; class CEditEffect* m_pEditEffect = { nullptr }; - map<_wstring, vector>> m_MatFiles = {}; // map<¸ÓÅ׸®¾ó À̸§, vector<ÅØ½ºÃÄÀ̸§ , ÅØ½ºÃÄ °æ·Î>> + map<_wstring, vector>> m_MatFiles = {}; // map<머테리얼 ì�´ë¦„, vector<í…�스ì³�ì�´ë¦„ , í…�스ì³� 경로>> + + _char m_szBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/"}; + _string m_strSavePath = {}; public: static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -50,4 +55,4 @@ class CEffect_Editor final : public CContainerObject }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h b/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h index 8bd437356..53f22e997 100644 --- a/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h +++ b/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "CanvasObject.h" diff --git a/Jusin154_Team3D/Editor/Public/Hair.h b/Jusin154_Team3D/Editor/Public/Hair.h index d1070ca33..5b55ab3dc 100644 --- a/Jusin154_Team3D/Editor/Public/Hair.h +++ b/Jusin154_Team3D/Editor/Public/Hair.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "ModelParts.h" @@ -28,7 +28,6 @@ class CHair final : public CModelParts private: CTexture* m_pTextureCom = { nullptr }; _uint iTextureIndex = { 0 }; - _float4 m_vColor = _float4{1.f,1.f,1.f,1.f}; public: static CHair* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -37,4 +36,4 @@ class CHair final : public CModelParts virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Head.h b/Jusin154_Team3D/Editor/Public/Head.h index 6afbfb83e..56cde3b20 100644 --- a/Jusin154_Team3D/Editor/Public/Head.h +++ b/Jusin154_Team3D/Editor/Public/Head.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "ModelParts.h" @@ -19,6 +19,7 @@ class CHead final : public CModelParts virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + HRESULT Bind_ShaderResources(); private: HRESULT Ready_Components(); @@ -29,4 +30,4 @@ class CHead final : public CModelParts virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index ce197199b..ac2298f44 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -46,6 +46,12 @@ class CIMGUIUI final : public CGameObject _float m_fAlpha{}; _float2 m_UV{}; + _float m_fLeft{}; + _float m_fRight{}; + _float m_fTop{}; + _float m_fBottom{}; + _float4 m_fNineSlice{}; + _float2 m_fPanelPos{}; _float2 m_fPanelSize{}; _float3 m_fPanelSizeXY{}; diff --git a/Jusin154_Team3D/Editor/Public/Information.h b/Jusin154_Team3D/Editor/Public/Information.h index 77b8932ea..dc4c393dd 100644 --- a/Jusin154_Team3D/Editor/Public/Information.h +++ b/Jusin154_Team3D/Editor/Public/Information.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" #include "Editor_Define.h" @@ -15,7 +15,7 @@ typedef class CInformation final : public CBase _bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents); _bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents); -#pragma endregion // Àü¿ª +#pragma endregion // ì „ì—­ #pragma region OBJECTVIEWER diff --git a/Jusin154_Team3D/Editor/Public/MainLight.h b/Jusin154_Team3D/Editor/Public/MainLight.h new file mode 100644 index 000000000..87a3e8dad --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/MainLight.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Editor) + +class CMainLight final : public CGameObject +{ + +private: + CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMainLight(const CMainLight& Prototype); + virtual ~CMainLight() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CLight* m_pLightCom = { nullptr }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CMainLight* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h b/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h index 1befac445..d63d76fa6 100644 --- a/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h +++ b/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h @@ -31,6 +31,7 @@ class CMission_KeyHold final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _float m_fPI{}; public: static CMission_KeyHold* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/ModelParts.h b/Jusin154_Team3D/Editor/Public/ModelParts.h index e34d3834a..1061d45bf 100644 --- a/Jusin154_Team3D/Editor/Public/ModelParts.h +++ b/Jusin154_Team3D/Editor/Public/ModelParts.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "PartObject.h" @@ -34,14 +34,15 @@ class CModelParts abstract : public CPartObject _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } protected: - CShader* m_pShaderCom = { nullptr }; - CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; _bool m_bRimLight = { true }; _float m_fRimLightPower = { 3.2f }; _float m_fRimLightStrength = { 3.04f }; _float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f }; - + _uint m_HeadIndex = {}; _wstring m_strModelPrototypeTag; + _float4 m_vColor = _float4{ 1.f,1.f,1.f,1.f }; protected: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); @@ -52,4 +53,4 @@ class CModelParts abstract : public CPartObject virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 6e5d2ad4c..38eea62d7 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -19,8 +19,11 @@ float g_fSpotOuterAngle; vector g_vLightDir; vector g_vLightPos; +vector g_vLightPosOffset; + vector g_vCamPosition; + Texture2D g_NormalTexture; Texture2D g_DiffuseTexture; Texture2D g_ShadeTexture; @@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) vPosition = mul(vPosition, g_invmatProj); vPosition = mul(vPosition, g_invMatView); - vector vLightDir = vPosition - g_vLightPos; + vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset); float fDistance = length(vLightDir); float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); if (fAttenuation <= 0.f) diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index bcb0104ff..4ece1fa21 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -135,6 +135,12 @@ call Update_Lib.bat + + Effect + + + 5.0 + @@ -197,6 +203,7 @@ call Update_Lib.bat + @@ -412,6 +419,7 @@ call Update_Lib.bat + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index f1f28be21..86210937d 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -34,9 +34,6 @@ {d7596dbd-fa1c-414b-9f4e-f05a1a982434} - - {0c8440f6-63b2-4dcb-9cb8-4c2356106fd0} - {6f4f880c-b0f2-4fab-ba8b-0939f6bc9321} @@ -106,9 +103,6 @@ {5fec6152-84b6-4811-a2ee-f5f1044cc1eb} - - {2bb63dcf-1503-446f-820e-03bfc3e1e38e} - {b89f3382-3069-4263-8e56-6116866a2518} @@ -226,9 +220,6 @@ {96600587-16b1-4627-914d-7fc413c501ba} - - {a60a7ba5-a937-41d7-baac-db67f86f3ba1} - {5948985e-f67e-4627-aca4-09b8e9edc359} @@ -250,6 +241,27 @@ {1eafb189-2d0c-4ad7-8690-10a517668206} + + {a60a7ba5-a937-41d7-baac-db67f86f3ba1} + + + {05865481-fa20-4432-a5a7-945d4f8c7f3c} + + + {bed0de44-4e62-4b5f-9767-65cfc8a933a3} + + + {33ac85a2-be8e-4ad9-a179-1239d818dc9c} + + + {fda41884-634b-4dd4-8bd2-f6f7ad68ab1f} + + + {7c82051e-19af-4284-8156-16f504db30b6} + + + {8727e975-e9e2-4b59-9a52-27ad3ad79f2f} + @@ -330,12 +342,6 @@ 01.Utility\05.Shadow - - 01.Utility\04.Light - - - 01.Utility\04.Light\Manager - 99.Define\99.THIRDPARTY\IMGUI @@ -445,7 +451,7 @@ 02.Element\02.Component\06.Model\Instance_Model - 01.Utility\06. Picking + 01.Utility\06.Picking 01.Utility\06.ComputeShader @@ -465,6 +471,15 @@ 02.Element\01.GameObject\50.UI\PanelObject + + 02.Element\02.Component\09.Light + + + 03.Management\03.Light_Manager + + + 02.Element\02.Component\08.Character_Controller\Collision_Callback + @@ -932,12 +947,6 @@ 01.Utility\05.Shadow - - 01.Utility\04.Light - - - 01.Utility\04.Light\Manager - 00.System\00.Device\Input\00.Key_Manager @@ -1023,7 +1032,7 @@ 01.Utility\06.ComputeShader - 01.Utility\06. Picking + 01.Utility\06.Picking 02.Element\02.Component\02.VIBuffer\Terrain @@ -1046,6 +1055,15 @@ 02.Element\01.GameObject\50.UI\PanelObject + + 02.Element\02.Component\09.Light + + + 03.Management\03.Light_Manager + + + 02.Element\02.Component\08.Character_Controller\Collision_Callback + diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 7171b26d4..5c68587e0 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -1,7 +1,9 @@ -#include "pch.h" +#include "pch.h" #include "Animation.h" #include "Channel.h" +#include "Model.h" +#include "Transform.h" CAnimation::CAnimation() { @@ -29,12 +31,12 @@ CAnimation::CAnimation(const CAnimation& rhs) SAFE_ADDREF(pChannel); } } -_bool CAnimation::Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta) +_bool CAnimation::Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform) { //m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta; m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta * m_fAnimSpeed; if (m_fCurrentTrackPosition >= m_fDuration) { - m_fCurrentTrackPosition = 0.f; // ·çÇÁ + m_fCurrentTrackPosition = 0.f; // 루프 if (false == bIsLoop) { m_fCurrentTrackPosition = m_fDuration; return true; @@ -47,12 +49,17 @@ _bool CAnimation::Update_TransformationMatrices(const vector& Bone _uint iIndex = {}; for (auto& pChannel : m_Channels) { - pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++]); + pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++],pTransform); } return false; } +void CAnimation::ResetRootMotion() +{ + for (auto& pChannel : m_Channels) + pChannel->ResetRootMotion(); +} void CAnimation::Depart_Animation() { @@ -97,7 +104,25 @@ vector<_int>* CAnimation::Capture_Bones() } return &m_DestBones; } + +void CAnimation::Remap_Channels_By_Name(CModel* TargetModel) +{ + for (auto& channel : m_Channels) + { + const string& name = channel->Get_Name(); + + int idx = TargetModel->Get_BoneIndex(name.c_str()); + + if (idx != -1) + channel->Set_BoneIndex(idx); + else + channel->Set_BoneIndex(-1); + } +} + + #ifdef EDITOR_PROJECT + HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { m_strName = pAIAnimation->mName.data; @@ -244,7 +269,7 @@ CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimati if (FAILED(pInstance->Initialize(pModel, pSaveAnimation))) { MSG_BOX("Failed to Created : CAnimation"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -272,4 +297,4 @@ void CAnimation::Describe_Entity() //if (GUI::CollapsingHeader(m_strName.c_str())) { // //} -} \ No newline at end of file +} diff --git a/Jusin154_Team3D/Engine/Private/Base.cpp b/Jusin154_Team3D/Engine/Private/Base.cpp index 0e9d8af33..9bae93d12 100644 --- a/Jusin154_Team3D/Engine/Private/Base.cpp +++ b/Jusin154_Team3D/Engine/Private/Base.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Base.h" diff --git a/Jusin154_Team3D/Engine/Private/Bone.cpp b/Jusin154_Team3D/Engine/Private/Bone.cpp index 265f1d410..3a621f426 100644 --- a/Jusin154_Team3D/Engine/Private/Bone.cpp +++ b/Jusin154_Team3D/Engine/Private/Bone.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Bone.h" CBone::CBone() @@ -76,7 +76,7 @@ CBone* CBone::Create(const SaveNode& _SaveNode, _int iParentIndex) if (FAILED(pInstance->Initialize(_SaveNode, iParentIndex))) { MSG_BOX("Failed to Created : CBone"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Engine/Private/Bounding.cpp b/Jusin154_Team3D/Engine/Private/Bounding.cpp index 692d73322..693b4bf72 100644 --- a/Jusin154_Team3D/Engine/Private/Bounding.cpp +++ b/Jusin154_Team3D/Engine/Private/Bounding.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Bounding.h" diff --git a/Jusin154_Team3D/Engine/Private/Bounding_AABB.cpp b/Jusin154_Team3D/Engine/Private/Bounding_AABB.cpp index d8d644831..73e4d1bf5 100644 --- a/Jusin154_Team3D/Engine/Private/Bounding_AABB.cpp +++ b/Jusin154_Team3D/Engine/Private/Bounding_AABB.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Bounding_AABB.h" #include "Bounding_OBB.h" #include "Bounding_Sphere.h" diff --git a/Jusin154_Team3D/Engine/Private/Bounding_OBB.cpp b/Jusin154_Team3D/Engine/Private/Bounding_OBB.cpp index 83a7f831b..6af136805 100644 --- a/Jusin154_Team3D/Engine/Private/Bounding_OBB.cpp +++ b/Jusin154_Team3D/Engine/Private/Bounding_OBB.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Bounding_AABB.h" #include "Bounding_OBB.h" #include "Bounding_Sphere.h" diff --git a/Jusin154_Team3D/Engine/Private/Bounding_Sphere.cpp b/Jusin154_Team3D/Engine/Private/Bounding_Sphere.cpp index 7ba372247..9ae0e3a95 100644 --- a/Jusin154_Team3D/Engine/Private/Bounding_Sphere.cpp +++ b/Jusin154_Team3D/Engine/Private/Bounding_Sphere.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Bounding_AABB.h" #include "Bounding_OBB.h" #include "Bounding_Sphere.h" diff --git a/Jusin154_Team3D/Engine/Private/Camera.cpp b/Jusin154_Team3D/Engine/Private/Camera.cpp index f0d9fb141..e809ad4ec 100644 --- a/Jusin154_Team3D/Engine/Private/Camera.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Camera.h" CCamera::CCamera(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -32,6 +32,7 @@ HRESULT CCamera::Initialize(void* pArg) m_fFar = pDesc->fFar; m_bActive = false; m_iPriority = pDesc->iPriority; + m_pCameraKey = pDesc->pCameraKey; m_pFollowTarget = pDesc->pFollowTarget; SAFE_ADDREF(m_pFollowTarget); m_pLookTarget = pDesc->pLookTarget; @@ -81,12 +82,12 @@ void CCamera::Transition(_float fTimeDelta) void CCamera::Active_Camera(pair<_float4, _float3>& pairTransitionInfo) { //if (true == m_bTransitionLerp) { - m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), - XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); - m_fTransitionCurrentTime = 0.f; - m_bIsCurrentTransition = true; + // m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), + // XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); + // m_fTransitionCurrentTime = 0.f; + // m_bIsCurrentTransition = true; //} - //m_bActive = true; + m_bActive = true; } void CCamera::DeActive_Camera(pair<_float4, _float3>& pairTransition) diff --git a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp index b79c844f6..3d1329dab 100644 --- a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Camera_Manager.h" #include "Camera.h" #include "GameInstance.h" @@ -66,6 +66,14 @@ HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey) return E_FAIL; } +void CCamera_Manager::Force_CamPosition(_fvector vPos) +{ + if (nullptr == m_pCurrentMainCamera) + return; + + m_pCurrentMainCamera->Get_Component()->Set_State(STATE::POSITION, XMVectorSetW(vPos, 1.f)); +} + const _float* CCamera_Manager::Get_CurrentCameraFar() { return &m_fFar; @@ -92,9 +100,13 @@ CCamera* CCamera_Manager::Find_Camera(_uint iLevel, const _wstring& wstrCameraKe HRESULT CCamera_Manager::Clear_Cameras(_uint iLevel) { if (nullptr != m_pCurrentMainCamera) { - pair<_float4, _float3> pairTransitionInfo = { }; - m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo); - SAFE_RELEASE(m_pCurrentMainCamera); + for (pair& pairCamera : m_Cameras[iLevel]) { + if (m_pCurrentMainCamera == pairCamera.second) { + pair<_float4, _float3> pairTransitionInfo = { }; + m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo); + SAFE_RELEASE(m_pCurrentMainCamera); + } + } } for (auto& iter : m_Cameras[iLevel]) { SAFE_RELEASE(iter.second); diff --git a/Jusin154_Team3D/Engine/Private/CanvasObject.cpp b/Jusin154_Team3D/Engine/Private/CanvasObject.cpp index 2d19b0533..ccbfa92da 100644 --- a/Jusin154_Team3D/Engine/Private/CanvasObject.cpp +++ b/Jusin154_Team3D/Engine/Private/CanvasObject.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "CanvasObject.h" CCanvasObject::CCanvasObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -144,5 +144,5 @@ void CCanvasObject::Free() m_Panels.clear(); m_PanelNames.clear(); - m_Panels_map.clear(); // map ºñ¿ì±â + m_Panels_map.clear(); // map 비우기 } diff --git a/Jusin154_Team3D/Engine/Private/Cell.cpp b/Jusin154_Team3D/Engine/Private/Cell.cpp index 9595aaf8a..a48d211dd 100644 --- a/Jusin154_Team3D/Engine/Private/Cell.cpp +++ b/Jusin154_Team3D/Engine/Private/Cell.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Cell.h" #include "VIBuffer_Cell.h" @@ -44,7 +44,7 @@ _ubyte CCell::Get_CellAttribute() HRESULT CCell::Initialize(const _float3* pPoints, _uint iIndex) { if (nullptr == pPoints) { - return S_OK; // ·Îµù Àü¿ë + return S_OK; // 로딩 ì „ìš© } memcpy(m_vPoints, pPoints, sizeof(_float3) * ENUM_CLASS(NAVI_POINT::END)); @@ -153,7 +153,7 @@ HRESULT CCell::LoadAsBinary(HANDLE hFile, DWORD& dwByte, _uint iCellIndex) HRESULT CCell::SaveAsBinary(HANDLE hFile, DWORD& dwByte) { if (UINT_MAX == m_iIndex) { - assert(false); // ÃʱâÈ­ µÇÁö ¾ÊÀº Á¤Á¡ ÀúÀå ½Ãµµ + assert(false); // 초기화 ë�˜ì§€ 않ì�€ ì •ì � 저장 시ë�„ return E_FAIL; } WriteFile(hFile, m_vPoints, sizeof(_float3) * ENUM_CLASS(NAVI_POINT::END), &dwByte, nullptr); diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index a5ec4fa99..db221bf69 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -1,8 +1,9 @@ -#include "pch.h" +#include "pch.h" #include "Channel.h" #include "Model.h" #include "Bone.h" +#include "Transform.h" CChannel::CChannel() { @@ -99,7 +100,7 @@ HRESULT CChannel::Initialize(const vector& Bones, _uint iIndex) } -void CChannel::Update_TransformationMatirx(const vector& Bones, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex) +void CChannel::Update_TransformationMatirx(const vector& Bones, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, CTransform* pTransform) { if (0.f == fCurrentTrackPosition) { @@ -142,10 +143,41 @@ void CChannel::Update_TransformationMatirx(const vector& Bones, _float f vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSrcRotation), XMLoadFloat4(&vDstRotation), fRatio); vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSrcTranslation), XMLoadFloat3(&vDstTranslation), fRatio), 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); + + _vector vRight = pTransform->Get_State(STATE::RIGHT); + _vector vUp = pTransform->Get_State(STATE::UP); + _vector vLook = pTransform->Get_State(STATE::LOOK); + + _float dx = XMVectorGetX(vDeltaAdjusted); + _float dy = XMVectorGetY(vDeltaAdjusted); + _float dz = XMVectorGetZ(vDeltaAdjusted); + + _vector vDeltaWorld = vRight * dx + vUp * dz + vLook * dy; + + _vector vCurrentPos = pTransform->Get_State(STATE::POSITION); + _vector vTargetPos = vCurrentPos + vDeltaWorld; + + pTransform->Set_State(STATE::POSITION, vTargetPos); + + m_vPrevRootPos = vCurRootPos; + vTranslation = XMVectorZero(); + } + _matrix BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - if(Bones.size()>m_iBoneIndex) - Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix); + Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix); } @@ -267,7 +299,7 @@ CChannel* CChannel::Create(const CModel* pModel, SaveChannel* pSaveChannel) if (FAILED(pInstance->Initialize(pModel, pSaveChannel))) { MSG_BOX("Failed to Created : CChannel"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index c518f534b..ab1f4eacc 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -1,6 +1,7 @@ -#include "pch.h" +#include "pch.h" #include "Character_Controller.h" #include "GameInstance.h" +#include "Collision_Callback.h" CCharacter_Controller::CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } @@ -29,7 +30,7 @@ HRESULT CCharacter_Controller::Render() { case ACTOR::BOX: { - // vVolume = half-extents(Hx,Hy,Hz) ¶ó°í °¡Á¤ + // vVolume = half-extents(Hx,Hy,Hz) ë�¼ê³  가정 const _matrix ScaleMatrix = XMMatrixScaling(vVolume.x / 0.5f, vVolume.y / 0.5f, @@ -62,6 +63,11 @@ HRESULT CCharacter_Controller::Render() #endif // _DEBUG +void CCharacter_Controller::Resize_Volume(_float fHeight) +{ + m_pController->resize(fHeight); +} + void CCharacter_Controller::Modify_Volume(_float3 fVolume) { switch (m_eBodyType) @@ -129,18 +135,13 @@ _float3 CCharacter_Controller::Get_Volume() void CCharacter_Controller::Move(_float fTimeDelta) { - PSX::PxVec3 pxVecMomentum = {}; // ¼ø°£ À̵¿·® - _float fMinimumDistant = FLT_EPSILON3; // À̵¿·® ¿ÀÂ÷ Çã¿ëÄ¡, ( Å©¸é Ŭ¼ö·Ï À̵¿ÀÌ ´õ ÀÏÂï ³¡³­´Ù, ¼ø°£ À̵¿·®º¸´Ù °°°Å³ª ´õ Å©¸é ¾È¿òÁ÷Àϵí? ) - _vector vMomentum = m_pTransform->Get_CurrentMomentum(); - XMStoreFloat3((_float3*)&pxVecMomentum, vMomentum); - - PSX::PxControllerFilters pxFilter = {}; // Ãæµ¹ ´ë»ó ÇÊÅÍ - const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // ij¸¯ÅͰ¡ Ãæµ¹ÇؾßÇÒ Ãß°¡ÀûÀÎ Àå¾Ö¹° °´Ã¼?, ´êÀº Àå¾Ö¹°Àº ij½ÃµÈ´Ù? + PSX::PxVec3 pxVecMomentum = {}; // 순간 ì�´ë�™ëŸ‰ + _float fMinimumDistant = FLT_EPSILON3; // ì�´ë�™ëŸ‰ 오차 허용치, ( í�¬ë©´ í�´ìˆ˜ë¡� ì�´ë�™ì�´ ë�” ì�¼ì°� ë��난다, 순간 ì�´ë�™ëŸ‰ë³´ë‹¤ 같거나 ë�” í�¬ë©´ 안움ì§�ì�¼ë“¯? ) + PSX::PxControllerFilters pxFilter = {}; // ì¶©ë�Œ 대ìƒ� í•„í„° + const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // ìº�릭터가 ì¶©ë�Œí•´ì•¼í•  추가ì �ì�¸ 장애물 ê°�ì²´?, ë‹¿ì�€ 장애물ì�€ ìº�시ë�œë‹¤? + XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum()); - // eCOLLISION_SIDES = (1 << 0), //!< Character is colliding to the sides. - // eCOLLISION_UP = (1 << 1), //!< Character has collision above. - // eCOLLISION_DOWN = (1 << 2) //!< Character has collision below. m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles); @@ -171,11 +172,6 @@ _float3 CCharacter_Controller::Get_FootPosition() return { (_float)pxLVecfootPos.x, (_float)pxLVecfootPos.y, (_float)pxLVecfootPos.z }; } -void CCharacter_Controller::Resize_Volume(_float fHeight) -{ - m_pController->resize(fHeight); -} - HRESULT CCharacter_Controller::Initialize_Prototype() { return S_OK; @@ -184,55 +180,90 @@ HRESULT CCharacter_Controller::Initialize_Prototype() HRESULT CCharacter_Controller::Initialize(void* pArg) { Character_Controller_DESC* pDesc = static_cast(pArg); - m_eBodyType = pDesc->eBodyType; - m_bAutoStepping = pDesc->bAutoStepping; - m_pTransform = pDesc->pTransform; + { // Character_Controller_DESC + m_eBodyType = pDesc->eBodyType; + m_bAutoStepping = pDesc->bAutoStepping; + m_pTransform = pDesc->pTransform; + + } + { // PhsXUserData + m_tagData.eKind = PHYSX_KIND::CCTActor; + m_tagData.pOwner = m_pOwner; + XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); + m_tagData.pCharacter = this; + } switch (m_eBodyType) { case Engine::ACTOR::BOX: { PSX::PxBoxControllerDesc Desc{}; - Desc.halfHeight = {}; - Desc.halfSideExtent = {}; - Desc.halfForwardExtent = {}; - Desc.contactOffset = pDesc->fContactOffset; - Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial); - m_pController = m_pGameInstance->Add_BoxController(Desc); -#ifdef _DEBUG - _float3 vVolume = Get_Volume(); - m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false)); -#endif // _DEBUG + Desc.halfHeight = pDesc->vBoxSize.y; + Desc.halfSideExtent = pDesc->vBoxSize.x; + Desc.halfForwardExtent = pDesc->vBoxSize.z; + Desc.contactOffset = pDesc->fContactOffset; + Desc.reportCallback = static_cast(pDesc->pCallback); + Desc.behaviorCallback = static_cast(pDesc->pCallback); + Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); + m_pController = m_pGameInstance->Add_BoxController(Desc); + m_pController->setUserData(&m_tagData); } break; case Engine::ACTOR::CAPSULE: { PSX::PxCapsuleControllerDesc Desc{}; - Desc.radius = pDesc->tCapsuleInfo.fRadius; - Desc.height = pDesc->tCapsuleInfo.fHeight; - Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // ±âº» eEASY - Desc.contactOffset = pDesc->fContactOffset; - Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial); - m_pController = m_pGameInstance->Add_CapsuleController(Desc); -#ifdef _DEBUG - _float3 vVolume = Get_Volume(); - m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false)); - m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false)); -#endif // _DEBUG + Desc.radius = pDesc->fRadius; + Desc.height = pDesc->fHeight; + Desc.climbingMode = pDesc->eClimbingMode; // 기본 eEASY + Desc.contactOffset = pDesc->fContactOffset; + Desc.reportCallback = static_cast(pDesc->pCallback); + Desc.behaviorCallback = static_cast(pDesc->pCallback); + Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); + m_pController = m_pGameInstance->Add_CapsuleController(Desc); + m_pController->setUserData(&m_tagData); } break; default: - assert(false); // PhysX¿¡¼­ ºÒ°¡´É + assert(false); // PhysXì—�서 불가능 return E_FAIL; break; } + if (nullptr == m_pController) { assert(false); return E_FAIL; } + m_pController->setSlopeLimit(m_fSlopeLimit); +#ifdef _DEBUG + if (FAILED(Debug_Initialize())) { + return E_FAIL; + } +#endif // _DEBUG + return S_OK; } +#ifdef _DEBUG +HRESULT CCharacter_Controller::Debug_Initialize() +{ + _float3 vVolume = Get_Volume(); + switch (m_eBodyType) + { + case ACTOR::BOX: + m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false)); + break; + case ACTOR::CAPSULE: + m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false)); + m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false)); + break; + default: + break; + } + return S_OK; +} +#endif // _DEBUG + + _bool CCharacter_Controller::Check_Overlap() { return _bool(); @@ -295,6 +326,7 @@ void CCharacter_Controller::Describe_Entity() if (GUI::SliderFloat("StepOffset", &fStepOffset, 0.f, 3.f, "%.2f")) { m_pController->setStepOffset(fStepOffset); } GUIHelpMarker("In stepped regions, the tolerance height the controller can climb.\n Capsule behaves slightly differently."); + if (ACTOR::CAPSULE == m_eBodyType) { PSX::PxCapsuleController* pController = (PSX::PxCapsuleController*)m_pController; @@ -317,6 +349,7 @@ void CCharacter_Controller::Describe_Entity() GUIHelpMarker("A capsule is affected by its lower sphere and tends to generate an up vector on steps.\nIn eEASY, the up vector is combined with the step offset, allowing easier climbing; in eCONSTRAINED, the up vector is removed during step detection and only the step offset is used."); } } + if (GUI::SliderFloat3("Volume", (_float*)&vVolume, 0.1f, 10.f, "%.2f")) { Modify_Volume(vVolume); }GUIHelpMarker("Box uses vSize; Capsule uses x->fRadius, y->fHeight.\nThe capsule's fHeight is likely the distance from the lower sphere center to the upper sphere center."); diff --git a/Jusin154_Team3D/Engine/Private/Collider.cpp b/Jusin154_Team3D/Engine/Private/Collider.cpp index 4f6f12421..139cca0e4 100644 --- a/Jusin154_Team3D/Engine/Private/Collider.cpp +++ b/Jusin154_Team3D/Engine/Private/Collider.cpp @@ -1,4 +1,4 @@ -#include "Collider.h" +#include "Collider.h" #include "pch.h" #include "Collider.h" diff --git a/Jusin154_Team3D/Engine/Private/Collider_Manager.cpp b/Jusin154_Team3D/Engine/Private/Collider_Manager.cpp index e09cb2760..8bae0523c 100644 --- a/Jusin154_Team3D/Engine/Private/Collider_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Collider_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Collider_Manager.h" #include "GameInstance.h" #include "GameObject.h" diff --git a/Jusin154_Team3D/Engine/Private/Collision_Callback.cpp b/Jusin154_Team3D/Engine/Private/Collision_Callback.cpp new file mode 100644 index 000000000..92b8c75bd --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Collision_Callback.cpp @@ -0,0 +1,116 @@ +#include "pch.h" +#include "Collision_Callback.h" +#include "GameInstance.h" + +CCollision_Callback::CCollision_Callback() +{ +} + +void CCollision_Callback::onShapeHit(const PSX::PxControllerShapeHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지ì � + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노ë§� + PSX::PxVec3 vDir = hit.dir; // move ë°©í–¥ + _float fLength = hit.length; // move 길ì�´ + + PSX::PxShape* pShape = hit.shape; + PSX::PxRigidActor* pActor = hit.actor; + + + if (nullptr != pController && nullptr != pActor) { + PhsXUserData* pActorData = static_cast(pActor->userData); + assert(nullptr != pActor); // missing user data + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + // action + break; + case PHYSX_KIND::BODY_DYNAMIC: + // action + break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCollision_Callback::onControllerHit(const PSX::PxControllersHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지ì � + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노ë§� + PSX::PxVec3 vDir = hit.dir; // move ë°©í–¥ + _float fLength = hit.length; // move 길ì�´ + + PSX::PxController* pOtherController= hit.other; // 다른 컨트롤러 + + if (nullptr != pController && nullptr != pOtherController) { + PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + assert(nullptr != pOtherController); // missing user data + + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + assert(false); + break; + case PHYSX_KIND::BODY_DYNAMIC: + assert(false); + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCollision_Callback::onObstacleHit(const PSX::PxControllerObstacleHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지ì � + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노ë§� + PSX::PxVec3 vDir = hit.dir; // move ë°©í–¥ + _float fLength = hit.length; // move 길ì�´ + + const void* pOtherController= hit.userData; // 장애물 + + //switch (pOtherController.member) + //{ + //default: + // break; + //} +} + +PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + //if (actor.userData.subKind == kMovingPlatformTag) + // return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT + // | PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + + // 나머지는 아무 특별 ë�™ìž‘ ì—†ì�Œ + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCTë�¼ë¦¬ 부딪íž� 때를 êµ³ì�´ 안 ì“°ë©´ 0 리턴 + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacleì�´ 움ì§�ì�´ëŠ” ë°œíŒ�ì�´ë‹¤? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(); +} diff --git a/Jusin154_Team3D/Engine/Private/Component.cpp b/Jusin154_Team3D/Engine/Private/Component.cpp index e62fa471c..7a1e259e3 100644 --- a/Jusin154_Team3D/Engine/Private/Component.cpp +++ b/Jusin154_Team3D/Engine/Private/Component.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Component.h" #include "GameInstance.h" diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index 76d9b05c8..e1660bda6 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "ComputeShader.h" #include "GameInstance.h" #include "Instance_Model.h" @@ -8,9 +8,9 @@ CComputeShader::CComputeShader(ID3D11Device* pDevice, ID3D11DeviceContext* pCont , m_pContext{ pContext } , m_pGameInstance{ CGameInstance::GetInstance() } { - Safe_AddRef(m_pDevice); - Safe_AddRef(m_pContext); - Safe_AddRef(m_pGameInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + SAFE_ADDREF(m_pGameInstance); } HRESULT CComputeShader::Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iNumOutputBuffer, _uint iInputStructStride[], _uint iOutputStructStride[]) @@ -37,10 +37,10 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint { //VBBuffer-> dynamic , pConstantBuffer-> dynamic , m_pInputBuffer, m_pOutputBuffer-> default , m_pStagingBuffer-> Staging - //³» ½ÃÀÛ ¹öÆÛ °ªÀ» ä¿î´Ù. + //ë‚´ 시작 버í�¼ ê°’ì�„ 채운다. - //´ÙÀ̳ª¹ÍÀ¸·Î »ý¼ºµÈ ¹öÆÛ¸¦ ¹Ù·Î µðÆúÆ® ¹öÆÛ·Î ¶§·Á¹ÚÀ» ¼ö ¾øÀ½ - //µû¶ó¼­ ½ºÅ×ÀÌ¡ ¹öÆÛ¸¦ µû·Î ¼±¾ðÇÏ¿© °ªÀ» º¹»ç¹Þ´Â´Ù. + //다ì�´ë‚˜ë¯¹ìœ¼ë¡œ ìƒ�성ë�œ 버í�¼ë¥¼ 바로 ë””í�´íЏ 버í�¼ë¡œ 때려박ì�„ 수 ì—†ì�Œ + //ë”°ë�¼ì„œ 스테ì�´ì§• 버í�¼ë¥¼ 따로 선언하여 ê°’ì�„ 복사받는다. for (_uint i = 0; i < m_iNumInputBuffer; i++) @@ -55,22 +55,22 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint - //ÄÄǻƮ ½¦ÀÌ´õ ¹ÙÀεù + //컴퓨트 ì‰�ì�´ë�” ë°”ì�¸ë”© m_pContext->CSSetShader(m_pComputeShader, nullptr, 0); m_pContext->CSSetConstantBuffers(0, 1, &pConstantBuffer); - //SRV, UAV ¹ÙÀεù + //SRV, UAV ë°”ì�¸ë”© Bind_SRV(iSRVIndex); Bind_UAV(iUAVIndex); - //ÄÄǻƮ ½¦ÀÌ´õ ½ÇÇà + //컴퓨트 ì‰�ì�´ë�” 실행 - //³» ¹öÆÛÀÇ Â÷¿ø(1,2,3Â÷¿ø ¹è¿­)¿¡ µû¸¥ ±×·ì Ä«¿îÆ®¸¦ ¼³Á¤ << Á¤È®È÷ ¸ð¸£°ÚÀ½ + //ë‚´ 버í�¼ì�˜ ì°¨ì›�(1,2,3ì°¨ì›� ë°°ì—´)ì—� 따른 그룹 카운트를 설정 << 정확히 모르겠ì�Œ m_pContext->Dispatch((_uint)vGroupCount.x, (_uint)vGroupCount.y, (_uint)vGroupCount.z); - //µðÆúÆ®-> ½ºÅ×ÀÌ¡ ¹öÆÛ´Â º¹»ç°¡ °¡´ÉÇÔ (´ÙÀ̳ª¹ÍÀº cpu ±â¹ÝÀÌ¶ó º¹»ç ¾ÈµÊ) - //0¹ø ½ºÅ×ÀÌ¡ ¹öÆÛ°¡ ¾Æ¿ìDz ½ºÅ×ÀÌ¡ ¹öÆÛ¿Í °°À½ + //ë””í�´íЏ-> 스테ì�´ì§• 버í�¼ëŠ” 복사가 가능함 (다ì�´ë‚˜ë¯¹ì�€ cpu 기반ì�´ë�¼ 복사 안ë�¨) + //0번 스테ì�´ì§• 버í�¼ê°€ ì•„ìš°í’‹ 스테ì�´ì§• 버í�¼ì™€ ê°™ì�Œ vector StagingSubResources = {}; @@ -78,7 +78,7 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint { m_pContext->CopyResource(m_pOutputStagingBuffer[i], m_pOutputBuffer[i]); - //½ºÅ×ÀÌ¡ ¹öÆÛ¸¦ ¿­¾î¼­ Ä«ÇÇÇÔ + //스테ì�´ì§• 버í�¼ë¥¼ 열어서 카피함 D3D11_MAPPED_SUBRESOURCE StagingSubResource = {}; if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, D3D11_MAP_READ, 0, &StagingSubResource))) @@ -99,9 +99,9 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint void CComputeShader::Bind_SRV(_uint iIndex) { - m_pContext->CSSetShaderResources(iIndex, // ½ÃÀÛ½½·Ô ¹øÈ£ - m_iNumInputBuffer, // ¹öÆÛ °³¼ö - &m_pInputSRV[0]); // ¹öÆÛ ½ÃÀÛ ÁÖ¼Ò + m_pContext->CSSetShaderResources(iIndex, // 시작슬롯 번호 + m_iNumInputBuffer, // 버í�¼ 개수 + &m_pInputSRV[0]); // 버í�¼ 시작 주소 } void CComputeShader::Bind_UAV(_uint iIndex) @@ -111,15 +111,15 @@ void CComputeShader::Bind_UAV(_uint iIndex) void CComputeShader::Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex) { - m_pContext->PSSetShaderResources(iIndex, // ½ÃÀÛ½½·Ô ¹øÈ£ - 1, // ¹öÆÛ °³¼ö - &m_pOutputSRV[iBufferIndex]); // ¹öÆÛ ½ÃÀÛ ÁÖ¼Ò + m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호 + 1, // 버í�¼ 개수 + &m_pOutputSRV[iBufferIndex]); // 버í�¼ 시작 주소 } void CComputeShader::Reset() { - //´ÙÀ½ ·£´õ¸µ ÆÐ½º¿¡ ¿¬°üµÇÁö ¾Êµµ·Ï ÃʱâÈ­ + //다ì�Œ ëžœë�”ë§� 패스ì—� ì—°ê´€ë�˜ì§€ 않ë�„ë¡� 초기화 vector pResetSRVs = {}; vector pResetUAVs = {}; @@ -141,10 +141,10 @@ void CComputeShader::Reset() HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride[], _uint iOuputStructStride[]) { - //ÀÎ ¾Æ¿ôDz ¹öÆÛ + //ì�¸ 아웃풋 버í�¼ - for (_uint i = 0; i < m_iNumInputBuffer; i++) // ÀÎDz ¹öÆÛ¸¦ ¿©·¯°³ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ¸¸µç´Ù + for (_uint i = 0; i < m_iNumInputBuffer; i++) // ì�¸í’‹ 버í�¼ë¥¼ 여러개 사용할 수 있ë�„ë¡� 만든다 { D3D11_BUFFER_DESC InputBufferdesc = {}; @@ -162,9 +162,9 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride m_pInputBuffer.push_back(pInputBuffer); - //½ºÅ×ÀÌ¡ ¹öÆÛ À̸§ + //스테ì�´ì§• 버í�¼ ì�´ë¦„ D3D11_BUFFER_DESC StagingBufferDesc = {}; - StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // ½ºÅ×ÀÌ¡ ¹öÆÛ + StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테ì�´ì§• 버í�¼ StagingBufferDesc.ByteWidth = iInputStructStride[i] * iNumElement; StagingBufferDesc.StructureByteStride = iInputStructStride[i]; StagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; @@ -181,14 +181,14 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride for (_uint i = 0; i < m_iNumOutputBuffer; i++) { - // ¾Æ¿ôDz ¹öÆÛ + // 아웃풋 버í�¼ D3D11_BUFFER_DESC Bufferdesc = {}; Bufferdesc.ByteWidth = iOuputStructStride[i] * iNumElement; Bufferdesc.StructureByteStride = iOuputStructStride[i]; - Bufferdesc.Usage = D3D11_USAGE_DEFAULT; // ÀÎ ¾Æ¿ôDz ¹öÆÛ´Â µðÆúÆ®·Î ¼³Á¤ÇؾßÇÔ - Bufferdesc.CPUAccessFlags = 0; // µðÆúÆ® ¹öÆÛ´Â CPU¿¡¼­ Read Write°¡ ºÒ°¡´ÉÇϸç - //¿ÀÁ÷ Update_SubResource¸¦ ÅëÇØ¼­¸¸ °»½ÅÀÌ °¡´ÉÇÏ´Ù. + Bufferdesc.Usage = D3D11_USAGE_DEFAULT; // ì�¸ 아웃풋 버í�¼ëŠ” ë””í�´íŠ¸ë¡œ 설정해야함 + Bufferdesc.CPUAccessFlags = 0; // ë””í�´íЏ 버í�¼ëŠ” CPUì—�서 Read Writeê°€ 불가능하며 + //오ì§� Update_SubResource를 통해서만 갱신ì�´ 가능하다. Bufferdesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; Bufferdesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; @@ -201,9 +201,9 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride m_pOutputBuffer.push_back(pOutputBuffer); - //¾Æ¿ôDz ½ºÅ×ÀÌ¡ ¹öÆÛ + //아웃풋 스테ì�´ì§• 버í�¼ D3D11_BUFFER_DESC OutPutStagingBufferDesc = {}; - OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // ½ºÅ×ÀÌ¡ ¹öÆÛ + OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테ì�´ì§• 버í�¼ OutPutStagingBufferDesc.ByteWidth = iOuputStructStride[i] * iNumElement; OutPutStagingBufferDesc.StructureByteStride = iOuputStructStride[i]; OutPutStagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; @@ -222,7 +222,7 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuffer) { // SRV - for (_uint i = 0; i < iNumInputBuffer; i++) // ÀÎDz ¹öÆÛ¸¦ ¿©·¯°³ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ¸¸µç´Ù + for (_uint i = 0; i < iNumInputBuffer; i++) // ì�¸í’‹ 버í�¼ë¥¼ 여러개 사용할 수 있ë�„ë¡� 만든다 { ID3D11ShaderResourceView* pSrv = {}; @@ -261,7 +261,7 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf //SRV D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; - srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer´Â UNKNOWN + srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer는 UNKNOWN srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; srvDesc.Buffer.NumElements = iNumElement; srvDesc.Buffer.FirstElement = 0; @@ -283,7 +283,7 @@ HRESULT CComputeShader::CreateComputeShader(const _tchar* pShaderFilePath, const { ID3DBlob* pCSBlob = nullptr; - // Debug ¸ðµå¿Í release ¸ðµåÀÇ Ç÷¹±×¸¦ ´Ù¸£°Ô Áà¾ßÇÔ + // Debug 모드와 release 모드ì�˜ 플레그를 다르게 줘야함 UINT HLSLFlags = {}; #ifdef _DEBUG HLSLFlags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; @@ -303,10 +303,10 @@ HRESULT CComputeShader::CreateComputeShader(const _tchar* pShaderFilePath, const if (FAILED(m_pDevice->CreateComputeShader( - pCSBlob->GetBufferPointer(), // ÄÄÆÄÀÏµÈ ½¦ÀÌ´õ ÄÚµå - pCSBlob->GetBufferSize(), // ÄÚµå ±æÀÌ - nullptr, // Ŭ·¡½º ÀνºÅϽº (¾øÀ½) - &m_pComputeShader // ÄÄǻƮ ½¦ÀÌ´õ °´Ã¼ + pCSBlob->GetBufferPointer(), // 컴파ì�¼ë�œ ì‰�ì�´ë�” 코드 + pCSBlob->GetBufferSize(), // 코드 길ì�´ + nullptr, // í�´ëž˜ìФ ì�¸ìŠ¤í„´ìŠ¤ (ì—†ì�Œ) + &m_pComputeShader // 컴퓨트 ì‰�ì�´ë�” ê°�ì²´ ))) return E_FAIL; @@ -323,7 +323,7 @@ CComputeShader* CComputeShader::Create(ID3D11Device* pDevice, ID3D11DeviceContex if (FAILED(pInstance->Initialize(pShaderFilePath, pStartFunctionName, iNumElement, iNumInputBuffer, iNumOutputBuffer, iOutputStructStride, iInputStructStride))) { MSG_BOX("Failed to Created : CComputeShader Prototype"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -335,22 +335,22 @@ void CComputeShader::Free() for (_uint i = 0; i < m_iNumInputBuffer; i++) { - Safe_Release(m_pInputSRV[i]); - Safe_Release(m_pInputBuffer[i]); - Safe_Release(m_pInputStagingBuffer[i]); + SAFE_RELEASE(m_pInputSRV[i]); + SAFE_RELEASE(m_pInputBuffer[i]); + SAFE_RELEASE(m_pInputStagingBuffer[i]); } for (_uint i = 0; i < m_iNumOutputBuffer; i++) { - Safe_Release(m_pOutputUAV[i]); - Safe_Release(m_pOutputBuffer[i]); - Safe_Release(m_pOutputSRV[i]); - Safe_Release(m_pOutputStagingBuffer[i]); + SAFE_RELEASE(m_pOutputUAV[i]); + SAFE_RELEASE(m_pOutputBuffer[i]); + SAFE_RELEASE(m_pOutputSRV[i]); + SAFE_RELEASE(m_pOutputStagingBuffer[i]); } - Safe_Release(m_pComputeShader); - Safe_Release(m_pDevice); - Safe_Release(m_pContext); - Safe_Release(m_pGameInstance); + SAFE_RELEASE(m_pComputeShader); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pGameInstance); } diff --git a/Jusin154_Team3D/Engine/Private/DebugDraw.cpp b/Jusin154_Team3D/Engine/Private/DebugDraw.cpp index eccac74d4..6e9ed447f 100644 --- a/Jusin154_Team3D/Engine/Private/DebugDraw.cpp +++ b/Jusin154_Team3D/Engine/Private/DebugDraw.cpp @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: DebugDraw.cpp // // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/Jusin154_Team3D/Engine/Private/ElementObject.cpp b/Jusin154_Team3D/Engine/Private/ElementObject.cpp index 389b02c9a..0cac26b33 100644 --- a/Jusin154_Team3D/Engine/Private/ElementObject.cpp +++ b/Jusin154_Team3D/Engine/Private/ElementObject.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "ElementObject.h" CElementObject::CElementObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -41,6 +41,7 @@ void CElementObject::Update(_float fTimeDelta) 0.f, 1.f)); m_fCurrent_Posigion = XMVectorSet(m_fX, m_fY, 0.f, 1.f); + m_vNine_Slice = _float4(m_fLeft, m_fRight, m_fTop, m_fBottom); } void CElementObject::Late_Update(_float fTimeDelta) @@ -79,6 +80,46 @@ _bool CElementObject::Chack_Visible() return m_bVisible; } +void CElementObject::Nine_Slice_Left(_float X) +{ + m_fLeft = X; +} + +void CElementObject::Nine_Slice_Right(_float Y) +{ + m_fRight = Y; +} + +void CElementObject::Nine_Slice_Top(_float Z) +{ + m_fTop = Z; +} + +void CElementObject::Nine_Slice_Bottom(_float W) +{ + m_fBottom = W; +} + +_float CElementObject::Get_Nine_Slice_Left() +{ + return m_fLeft; +} + +_float CElementObject::Get_Nine_Slice_Right() +{ + return m_fRight; +} + +_float CElementObject::Get_Nine_Slice_Top() +{ + return m_fTop; +} + +_float CElementObject::Get_Nine_Slice_Bottom() +{ + return m_fBottom; +} + HRESULT CElementObject::Ready_Components(void* pArg) { return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index caec4e169..97d4e7c0f 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GameInstance.h" #include "Prototype_Manager.h" #include "GameObject_Manager.h" @@ -140,7 +140,8 @@ void CGameInstance::Clear_Resources(_uint iLevelIndex) m_pPrototype_Manager->Clear_Resource(iLevelIndex); m_pCamera_Manager->Clear_Cameras(iLevelIndex); m_pObject_Manager->Clear(iLevelIndex); - m_pLight_Manager->Change_Level(iLevelIndex); + m_pLight_Manager->Light_Clear(iLevelIndex); + } _float CGameInstance::Random_Normal() @@ -314,23 +315,23 @@ void CGameInstance::Present_TimeCost() const float minY = 0.f; float maxY = 0.025f; - //float threshold = 166.f / 250.f; // ¾à 0.664f + //float threshold = 166.f / 250.f; // 약 0.664f ImVec2 graph_size(0, 80.0f); ImVec2 start_pos = GUI::GetCursorScreenPos(); GUI::PlotLines("##FrameCount", values, IM_ARRAYSIZE(values), values_offset, overlay, minY, maxY, ImVec2(0, 80.0f)); - // PlotLinesÀÇ ½ÇÁ¦ Ç¥½Ã ¿µ¿ª °¡Á®¿À±â + // PlotLinesì�˜ 실제 표시 ì˜�ì—­ 가져오기 ImVec2 plot_min = GUI::GetItemRectMin(); ImVec2 plot_max = GUI::GetItemRectMax(); - // ±âÁؼ± (60FPS) - float threshold = 1.0f / 60.0f; // 0.0166ÃÊ + // 기준선 (60FPS) + float threshold = 1.0f / 60.0f; // 0.0166ì´ˆ float normalized = (threshold - minY) / (maxY - minY); float y = plot_max.y - normalized * (plot_max.y - plot_min.y); - // »¡°£ ¼± ±×¸®±â + // 빨간 ì„  그리기 ImDrawList* draw_list = GUI::GetWindowDrawList(); draw_list->AddLine( ImVec2(plot_min.x, y), @@ -429,20 +430,27 @@ const _vector CGameInstance::Get_CamXMPosition() return m_pPipeLine->Get_CamXMPosition(); } -HRESULT CGameInstance::On_Light(_uint iLevel, const _wstring& wstrLightKey, const LIGHT_DESC& LightDesc, CLight** ppOut) +void CGameInstance::Add_Light(_uint _iCurrentLevel, CLight* _pLight) { - return m_pLight_Manager->On_Light(iLevel, wstrLightKey, LightDesc, ppOut); -} -HRESULT CGameInstance::Off_Light(_uint iLevel, const _wstring& wstrLightKey) -{ - return m_pLight_Manager->Off_Light(iLevel, wstrLightKey); + m_pLight_Manager->Add_Light(_iCurrentLevel, _pLight); } -HRESULT CGameInstance::Render_Lights(class CShader* pShader, class CVIBuffer* pVIBuffer) +void CGameInstance::Delete_Light(_uint _iCurrentLevel, CLight* _pLight) { - return m_pLight_Manager->Render_Lights(pShader, pVIBuffer); + m_pLight_Manager->Delete_Light(_iCurrentLevel, _pLight); } +const LIGHT_DESC* CGameInstance::Get_Light_Info(_uint _iCurrentLevel, _uint _iLightIndex) +{ + return m_pLight_Manager->Get_Light_Info(_iCurrentLevel, _iLightIndex); +} + +HRESULT CGameInstance::Render_Lights(_uint _iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) +{ + return m_pLight_Manager->Render_Lights(_iCurrentLevel, pShader, pVIBuffer); +} + + HRESULT CGameInstance::Add_ColliderGroup(_uint iColliderGroup, class CCollider* pBounding) { return m_pCollider_Manager->Add_ColliderGroup(iColliderGroup, pBounding); @@ -492,14 +500,14 @@ HRESULT CGameInstance::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Tex return m_pRenderTarget_Manager->Copy_RenderTarget(strTargetTag, pTexture2D); } -HRESULT CGameInstance::Ready_RenderTarget_Debug(const _wstring& strTargetTag, _float fX, _float fY, _float fSizeX, _float fSizeY) +void CGameInstance::RenderTarget_Debuger() { - return m_pRenderTarget_Manager->Ready_RenderTarget_Debug(strTargetTag, fX, fY, fSizeX, fSizeY); + m_pRenderTarget_Manager->RenderTarget_Debuger(); } -HRESULT CGameInstance::Render_RenderTarget_Debug(const _wstring& strMRTTag, CShader* pShader, CVIBuffer_Rect* pVIBuffer) +HRESULT CGameInstance::Render_RenderTarget_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer) { - return m_pRenderTarget_Manager->Render_RenderTarget_Debug(strMRTTag, pShader, pVIBuffer); + return m_pRenderTarget_Manager->Render_RenderTarget_Debug(pShader, pVIBuffer); } HRESULT CGameInstance::Clear_Cameras(_uint iLevel) { @@ -525,6 +533,10 @@ const _float* CGameInstance::Get_CurrentCameraFar() { return m_pCamera_Manager->Get_CurrentCameraFar(); } +void CGameInstance::Force_CamPosition(_fvector vPos) +{ + return m_pCamera_Manager->Force_CamPosition(vPos); +} HRESULT CGameInstance::Ready_Shadow_Light(const SHADOW_LIGHT_DESC& Desc) { return m_pShadow->Ready_Shadow_Light(Desc); @@ -559,9 +571,9 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath) } #pragma region PhysX_Manager -PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo) +PSX::PxMaterial* CGameInstance::Create_Material(_float3* vMatInfo) { - return m_pPhysX_Manager->Get_Material(vMatInfo); + return m_pPhysX_Manager->Create_Material(vMatInfo); } void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) @@ -569,11 +581,11 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh); } -const PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody) +PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody) { return m_pPhysX_Manager->Add_DynamicActor(RigidBody); } -const PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody& RigidBody) +PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody& RigidBody) { return m_pPhysX_Manager->Add_StaticActor(RigidBody); } @@ -593,6 +605,14 @@ void CGameInstance::ReleaseController(_uint iControllerIndex) { m_pPhysX_Manager->ReleaseController(iControllerIndex); } +void CGameInstance::Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor) +{ + m_pPhysX_Manager->Attach_Actor(RigidBody, Actor); +} +void CGameInstance::Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor) +{ + m_pPhysX_Manager->Detach_Actor(RigidBody, pActor); +} HRESULT CGameInstance::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) { return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes, WorldMatrix); @@ -714,21 +734,21 @@ void CGameInstance::Release_Engine() { DestroyInstance(); - SAFE_RELEASE(m_pPhysX_Manager); SAFE_RELEASE(m_pPicking); SAFE_RELEASE(m_pCollider_Manager); SAFE_RELEASE(m_pShadow); SAFE_RELEASE(m_pCamera_Manager); SAFE_RELEASE(m_pRenderTarget_Manager); - SAFE_RELEASE(m_pLight_Manager); SAFE_RELEASE(m_pPipeLine); SAFE_RELEASE(m_pKey_Manager); SAFE_RELEASE(m_pMouse_Manager); SAFE_RELEASE(m_pTimer_Manager); SAFE_RELEASE(m_pRenderer); SAFE_RELEASE(m_pObject_Manager); + SAFE_RELEASE(m_pPhysX_Manager); SAFE_RELEASE(m_pLevel_Manager); SAFE_RELEASE(m_pPrototype_Manager); + SAFE_RELEASE(m_pLight_Manager); // Light Manager�� m_pObject_Manager ���� ���� �ҷ����� SAFE_RELEASE(m_pGraphic_Device); } diff --git a/Jusin154_Team3D/Engine/Private/GameObject.cpp b/Jusin154_Team3D/Engine/Private/GameObject.cpp index df233fc89..0415223fd 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GameObject.h" #include "GameInstance.h" #include "Transform.h" diff --git a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp index d45517faa..0ceedfeb9 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GameObject_Manager.h" #include "Layer.h" @@ -15,7 +15,7 @@ HRESULT CGameObject_Manager::Initialize(_uint iNumLevels) m_iNumLevels = iNumLevels; m_pLayers = new map[iNumLevels]; - + return S_OK; } @@ -39,6 +39,7 @@ HRESULT CGameObject_Manager::Add_GameObject_ToLayer(_uint iLayerLevelIndex, cons void CGameObject_Manager::Priority_Update(_float fTimeDelta) { + Describe_Entity(); #ifdef _DEBUG m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate")); #endif // _DEBUG @@ -157,3 +158,46 @@ void CGameObject_Manager::Free() Safe_Delete_Array(m_pLayers); } + +#ifdef _DEBUG + +void CGameObject_Manager::Describe_Entity() +{ + ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar; + GUI::Begin("Object_Manager"); + GUI::Text("Levels : "); GUI::SameLine(); + if (GUI::BeginTabBar("Levels")) { + for (_uint i = 0; i < m_iNumLevels; ++i) { + + if (GUI::BeginTabItem(to_string(i).c_str(), nullptr)) { // Insert Here Level Names + GUI::BeginChild("Object_Lists"); + if (GUI::BeginTabBar("Layers")) { + string strlayerName; + for (pair< const _wstring, CLayer*>& pairLayer : m_pLayers[i]) { + size_t pos = pairLayer.first.find(TEXT("Layer_")); + strlayerName = "NOT_STARTED_WITH_Layer_"; + if (pos != wstring::npos) { + strlayerName = CMyTools::ToString(pairLayer.first.c_str() + pos + wcslen(TEXT("Layer_"))).c_str(); + } + if (GUI::BeginTabItem(strlayerName.c_str(), nullptr)) { + if (GUI::BeginChild("Items", ImVec2(0, 0), 0, window_flags)) { + pairLayer.second->Describe_Entity(); + GUI::EndChild(); + } + GUI::EndTabItem(); + } + } + GUI::EndTabBar(); + } + GUI::EndChild(); + GUI::EndTabItem(); + } + } + GUI::EndTabBar(); + } + GUI::End(); +} + + +#endif // _DEBUG + diff --git a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp index a016e734c..43ee13950 100644 --- a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp +++ b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Graphic_Device.h" CGraphic_Device::CGraphic_Device() @@ -95,32 +95,32 @@ HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY) IDXGIFactory* pFactory = nullptr; pAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&pFactory); - /* ½º¿ÒüÀÎÀ» »ý¼ºÇÑ´Ù. = ÅØ½ºÃĸ¦ »ý¼ºÇÏ´Â ÇàÀ§ + ½º¿ÒÇÏ´Â ÇüÅ */ + /* 스왑체ì�¸ì�„ ìƒ�성한다. = í…�스ì³�를 ìƒ�성하는 행위 + 스왑하는 형태 */ DXGI_SWAP_CHAIN_DESC SwapChain; ZeroMemory(&SwapChain, sizeof(DXGI_SWAP_CHAIN_DESC)); - /* ¹é¹öÆÛ == ÅØ½ºÃÄ */ - /*ÅØ½ºÃ³(¹é¹öÆÛ == ID3D11Texture2D)¸¦ »ý¼ºÇÏ´Â ÇàÀ§*/ - SwapChain.BufferDesc.Width = iWinCX; /* °¡·Î Çȼ¿ ¼ö */ - SwapChain.BufferDesc.Height = iWinCY; /* ¼¼·Î Çȼ¿ ¼ö */ + /* 백버í�¼ == í…�스ì³� */ + /*í…�스처(백버í�¼ == ID3D11Texture2D)를 ìƒ�성하는 행위*/ + SwapChain.BufferDesc.Width = iWinCX; /* 가로 픽셀 수 */ + SwapChain.BufferDesc.Height = iWinCY; /* 세로 픽셀 수 */ /* float4(1.f, 1.f, 1.f, 1.f) */ /* float4(1.f, 0.f, 0.f, 1.f) */ - SwapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; /* ¸¸µç Çȼ¿ÇϳªÀÇ µ¥ÀÌÅÍ Á¤º¸ : 32BITÇȼ¿»ý¼ºÇ쵂 ºÎÈ£°¡ ¾ø´Â Á¤±ÔÈ­µÈ ¼ö¸¦ ÀúÀåÇÒ²² */ + SwapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; /* 만든 픽셀하나ì�˜ ë�°ì�´í„° ì •ë³´ : 32BIT픽셀ìƒ�성하ë�˜ 부호가 없는 정규화ë�œ 수를 저장할께 */ SwapChain.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; SwapChain.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; - /* ½ºÄÉÄ¡ºÏ¿¡ »ç°ú¸¦ ±×¸±²¨¾ß. */ - /* RENDER_TARGET : ±×¸²À» ´çÇÏ´Â ´ë»ó. ½ºÄÉÄ¡ºÏ */ + /* 스케치ë¶�ì—� 사과를 그릴꺼야. */ + /* RENDER_TARGET : 그림ì�„ 당하는 대ìƒ�. 스케치ë¶� */ SwapChain.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; SwapChain.BufferCount = 1; - /*½º¿ÒÇÏ´Â ÇüÅ : ¸ð´ÏÅÍ ÁÖ»çÀ²¿¡ µû¶ó Á¶ÀýÇØµµ µÊ. */ + /*스왑하는 형태 : 모니터 주사율ì—� ë”°ë�¼ 조절해ë�„ ë�¨. */ SwapChain.BufferDesc.RefreshRate.Numerator = 60; SwapChain.BufferDesc.RefreshRate.Denominator = 1; - /* ¸ÖƼ»ùÇøµ : ¾ÈƼ¾ó¶óÀÌ¡ (°è´ÜÇö»ó¹æÁö) */ - /* ³ªÁß¿¡ ÈÄó¸® ·»´õ¸µ : ¸ÖƼ»ùÇøµ Áö¿ø(x) */ + /* 멀티샘플ë§� : 안티얼ë�¼ì�´ì§• (계단현ìƒ�ë°©ì§€) */ + /* 나중ì—� 후처리 ë Œë�”ë§� : 멀티샘플ë§� ì§€ì›�(x) */ SwapChain.SampleDesc.Quality = 0; SwapChain.SampleDesc.Count = 1; @@ -128,7 +128,7 @@ HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY) SwapChain.Windowed = static_cast(true); SwapChain.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; - /* ¹é¹öÆÛ¶ó´Â ÅØ½ºÃ³(ID3D11Texture2D)¸¦ »ý¼ºÇß´Ù. */ + /* 백버í�¼ë�¼ëŠ” í…�스처(ID3D11Texture2D)를 ìƒ�성했다. */ if (FAILED(pFactory->CreateSwapChain(m_pDevice, &SwapChain, &m_pSwapChain))) return E_FAIL; diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 06e7fcd3a..1c4321113 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Instance_Model.h" #include "Mesh.h" @@ -23,7 +23,7 @@ CInstance_Model::CInstance_Model(const CInstance_Model& rhs) SAFE_ADDREF(pMesh); } - Safe_AddRef(m_pVBInstance); + SAFE_ADDREF(m_pVBInstance); } #ifdef EDITOR_PROJECT HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) @@ -88,50 +88,65 @@ HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fma return S_OK; } +HRESULT CInstance_Model::Save_InstanceModel(HANDLE hFile) +{ + DWORD dwByte = {}; + + if (!WriteFile(hFile, &m_InstanceDesc, sizeof(INSTANCE_DESC), &dwByte, nullptr)) { + return E_FAIL; + } + return S_OK; +} + #endif +HRESULT CInstance_Model::Load_InstanceModel(HANDLE hFile) +{ + DWORD dwByte = {}; + + if (!ReadFile(hFile, &m_InstanceDesc, sizeof(INSTANCE_DESC), &dwByte, nullptr)) { + return E_FAIL; + } + + Change_NumInstance(); + + return S_OK; +} + HRESULT CInstance_Model::Change_NumInstance() { - Safe_Release(m_pVBInstance); - Safe_Release(m_pComputeShader); - Safe_Release(m_pConstantBuffer); - Safe_Release(m_pParticleValueBuffer); + SAFE_RELEASE(m_pVBInstance); + SAFE_RELEASE(m_pComputeShader); + SAFE_RELEASE(m_pConstantBuffer); + SAFE_RELEASE(m_pParticleValueBuffer); - //¸ðµç ¹öÆÛ¸¦ Áö¿ì°í Àç »ý¼º ÇØ¾ßÇÔ + //모든 버í�¼ë¥¼ 지우고 재 ìƒ�성 해야함 - if (FAILED(Create_Instance_Buffer(&m_InstanceDesc))) + if (FAILED(Create_Instance_Buffer())) return E_FAIL; if (FAILED(Create_SubResource_Buffer())) return E_FAIL; - //½ÃÀÛ ½Ã¿¡ ÀνºÅÏÆ® ¹öÆÛ¸¦ ±¸¼º ÇØÁÜ + + //시작 시ì—� ì�¸ìŠ¤í„´íŠ¸ 버í�¼ë¥¼ 구성 해줌 Instane_Buffer_ReStruct(); - _uint CS_InputStrides[] = { - sizeof(VTX_INSTANCE_PARTICLE), - sizeof(CS_PARTICLE_VALUE_DESC), - }; - - _uint CS_OutputStrides[] = { - sizeof(VTX_INSTANCE_PARTICLE), - sizeof(CS_PARTICLE_VALUE_DESC), - }; - - m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, - L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, 2, CS_OutputStrides, CS_InputStrides); - - if (m_pComputeShader == nullptr) + if (FAILED(Create_CS())) return E_FAIL; + + + + + return S_OK; } -HRESULT CInstance_Model::Create_Instance_Buffer(const INSTANCE_DESC* pDesc) +HRESULT CInstance_Model::Create_Instance_Buffer() { - if (pDesc != nullptr) - m_InstanceDesc = *pDesc; + m_iNumInstance = m_InstanceDesc.iNumInstance; @@ -158,7 +173,7 @@ HRESULT CInstance_Model::Create_Instance_Buffer(const INSTANCE_DESC* pDesc) HRESULT CInstance_Model::Create_SubResource_Buffer() { - // º§·ù ¹öÆÛ »ý¼ºÇϱâ + // 벨류 버í�¼ ìƒ�성하기 D3D11_BUFFER_DESC Particle_Buffer_Desc = {}; Particle_Buffer_Desc.ByteWidth = sizeof(CS_PARTICLE_VALUE_DESC) * m_iNumInstance; Particle_Buffer_Desc.Usage = D3D11_USAGE_DYNAMIC; @@ -175,7 +190,7 @@ HRESULT CInstance_Model::Create_SubResource_Buffer() return E_FAIL; - //ÄÁ½ºÅÏÆ® ¹öÆÛ »ý¼ºÇϱâ + //컨스턴트 버í�¼ ìƒ�성하기 D3D11_BUFFER_DESC cbDesc = {}; cbDesc.Usage = D3D11_USAGE_DYNAMIC; @@ -191,26 +206,11 @@ HRESULT CInstance_Model::Create_SubResource_Buffer() return S_OK; } - -HRESULT CInstance_Model::Initialize(void* pArg) +HRESULT CInstance_Model::Create_CS() { - - INSTANCE_DESC* pInstanceDesc = static_cast(pArg); - - - - if (FAILED(Create_Instance_Buffer(pInstanceDesc))) - return E_FAIL; - - if (FAILED(Create_SubResource_Buffer())) - return E_FAIL; - - //½ÃÀÛ ½Ã¿¡ ÀνºÅÏÆ® ¹öÆÛ¸¦ ±¸¼º ÇØÁÜ - Instane_Buffer_ReStruct(); - _uint CS_InputStrides[] = { - sizeof(VTX_INSTANCE_PARTICLE), - sizeof(CS_PARTICLE_VALUE_DESC), + sizeof(VTX_INSTANCE_PARTICLE), + sizeof(CS_PARTICLE_VALUE_DESC), }; _uint CS_OutputStrides[] = { @@ -227,6 +227,32 @@ HRESULT CInstance_Model::Initialize(void* pArg) return S_OK; } + +HRESULT CInstance_Model::Initialize(void* pArg) +{ + + INSTANCE_DESC* pInstanceDesc = static_cast(pArg); + + if (pInstanceDesc != nullptr) + m_InstanceDesc = *pInstanceDesc; + else + return S_OK; + + if (FAILED(Create_Instance_Buffer())) + return E_FAIL; + + if (FAILED(Create_SubResource_Buffer())) + return E_FAIL; + + //시작 시ì—� ì�¸ìŠ¤í„´íŠ¸ 버í�¼ë¥¼ 구성 해줌 + Instane_Buffer_ReStruct(); + + if(FAILED(Create_CS())) + return E_FAIL; + + return S_OK; +} + void CInstance_Model::Drop(_float fTimeDelta) { D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; @@ -262,7 +288,7 @@ void CInstance_Model::Drop(_float fTimeDelta) if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &VBInstanceResource))) { - memcpy(VBInstanceResource.pData, OutSubResources[0].pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // ¾Æ¿ôDz ¹öÆÛ¿¡ µé¾î¿Â °ªµéÀ» ÀüºÎ º¹»çÇÑ´Ù. + memcpy(VBInstanceResource.pData, OutSubResources[0].pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // 아웃풋 버í�¼ì—� 들어온 값들ì�„ ì „ë¶€ 복사한다. m_pContext->Unmap(m_pVBInstance, 0); } @@ -273,7 +299,7 @@ void CInstance_Model::Drop(_float fTimeDelta) { CS_PARTICLE_VALUE_DESC* pValueDesc = static_cast(OutSubResources[1].pData); - memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // ¾Æ¿ôDz ¹öÆÛ¿¡ µé¾î¿Â °ªµéÀ» ÀüºÎ º¹»çÇÑ´Ù. + memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // 아웃풋 버í�¼ì—� 들어온 값들ì�„ ì „ë¶€ 복사한다. m_pContext->Unmap(m_pParticleValueBuffer, 0); } @@ -312,7 +338,7 @@ void CInstance_Model::Instane_Buffer_ReStruct() for (size_t i = 0; i < m_iNumInstance; i++) { - //½ºÄÉÀÏ ¼³Á¤ + //스케ì�¼ 설정 _float3 vScale = _float3( m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.x, m_InstanceDesc.vSizeMax.x), m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.y, m_InstanceDesc.vSizeMax.y), @@ -321,7 +347,7 @@ void CInstance_Model::Instane_Buffer_ReStruct() _matrix ScaleMatrix = XMMatrixScaling(vScale.x, vScale.y, vScale.z); - //·ÎÅ×ÀÌ¼Ç ¼³Á¤ + //로테ì�´ì…˜ 설정 _float3 vRoataion = _float3( m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.x, m_InstanceDesc.vRotationAngleMax.x), m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.y, m_InstanceDesc.vRotationAngleMax.y), @@ -335,7 +361,7 @@ void CInstance_Model::Instane_Buffer_ReStruct() ); - //À§Ä¡ ¼³Á¤ + //위치 설정 _float4x4 SRMatrix = {}; XMStoreFloat4x4(&SRMatrix, ScaleMatrix * RotationMatrix); @@ -351,7 +377,7 @@ void CInstance_Model::Instane_Buffer_ReStruct() m_pGameInstance->Random_Float(m_InstanceDesc.vCenter.z - m_InstanceDesc.vRange.z * 0.5f, m_InstanceDesc.vCenter.z + m_InstanceDesc.vRange.z * 0.5f), 1.f); - //¶óÀÌÇÁ ŸÀÓ ¼³Á¤ + //ë�¼ì�´í”„ 타임 설정 pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y)); pParticleValues[i].vAniTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vAniTime.x, m_InstanceDesc.vAniTime.y)); @@ -423,17 +449,17 @@ void CInstance_Model::Free() { __super::Free(); - Safe_Release(m_pVBInstance); + SAFE_RELEASE(m_pVBInstance); for (auto& pMesh : m_Meshes) - Safe_Release(pMesh); + SAFE_RELEASE(pMesh); for (auto& pBone : m_Bones) - Safe_Release(pBone); + SAFE_RELEASE(pBone); - Safe_Release(m_pComputeShader); - Safe_Release(m_pConstantBuffer); - Safe_Release(m_pParticleValueBuffer); + SAFE_RELEASE(m_pComputeShader); + SAFE_RELEASE(m_pConstantBuffer); + SAFE_RELEASE(m_pParticleValueBuffer); } void CInstance_Model::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Layer.cpp b/Jusin154_Team3D/Engine/Private/Layer.cpp index 19935a629..bfbddb5b3 100644 --- a/Jusin154_Team3D/Engine/Private/Layer.cpp +++ b/Jusin154_Team3D/Engine/Private/Layer.cpp @@ -1,14 +1,12 @@ -#include "pch.h" +#include "pch.h" #include "Layer.h" #include "GameObject.h" #include "GameInstance.h" -CLayer::CLayer() -{ -} - -CLayer::~CLayer() +CLayer::CLayer(): + m_pGameInstance(CGameInstance::GetInstance()) { + SAFE_ADDREF(m_pGameInstance); } HRESULT CLayer::Initialize() @@ -89,9 +87,9 @@ void CLayer::Free() for (auto& iter : m_ObjectList) { SAFE_RELEASE(iter); - } + } m_ObjectList.clear(); - m_ObjectList.clear(); + SAFE_RELEASE(m_pGameInstance); } CLayer* CLayer::Create() @@ -106,3 +104,21 @@ CLayer* CLayer::Create() return pInstance; } + +#ifdef _DEBUG + +void CLayer::Describe_Entity() +{ + _int iIndex = 0; + + for (CGameObject*& iter : m_ObjectList) + { + GUI::PushID(iter); + if (GUI::SmallButton((to_string(iIndex) + " : " + typeid(*iter).name()).c_str())) { + m_pGameInstance->Force_CamPosition(iter->Get_WorldPostion() - XMVectorSet(0.f, -1.f, 1.f, 0.f) * 10.f); + } iIndex++; + GUI::PopID(); + } +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/Light.cpp b/Jusin154_Team3D/Engine/Private/Light.cpp index 3e63e9715..64296c575 100644 --- a/Jusin154_Team3D/Engine/Private/Light.cpp +++ b/Jusin154_Team3D/Engine/Private/Light.cpp @@ -1,12 +1,22 @@ -#include "pch.h" +#include "pch.h" #include "Light.h" #include "Shader.h" #include "VIBuffer.h" +#include "GameInstance.h" +#include "GameObject.h" -CLight::CLight() + +CLight::CLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CComponent{ pDevice, pContext } { } +CLight::CLight(const CLight& rhs) + : CComponent{ rhs } +{ + +} + _bool CLight::operator==(const CLight& rhs) const { return this->operator==(rhs.m_LightDesc); @@ -14,36 +24,36 @@ _bool CLight::operator==(const CLight& rhs) const _bool CLight::operator==(const LIGHT_DESC& rhs) const { + _float4 vSrcPositon = *m_LightDesc.pPosition; + _float4 vDstPositon = *rhs.pPosition; + if (m_LightDesc.eType != rhs.eType || - m_LightDesc.vPosition.x != rhs.vPosition.x || - m_LightDesc.vPosition.y != rhs.vPosition.y || - m_LightDesc.vPosition.z != rhs.vPosition.z) { + vSrcPositon.x != vDstPositon.x || + vSrcPositon.y != vDstPositon.y || + vSrcPositon.z != vDstPositon.z) { return false; } + return true; } -HRESULT CLight::Replace_LightTo(_fvector vPosition) +HRESULT CLight::Initialize_Prototype() { - //GUI::Begin("Light_Position"); - //GUI::SliderFloat("fRange", (_float*)&m_LightDesc.fRange, 0.f, 30.f); - //GUI::SliderFloat4("vDiffuse", (_float*)&m_LightDesc.vDiffuse, 0.f, 1.f); - //GUI::SliderFloat4("vAmbient", (_float*)&m_LightDesc.vAmbient, 0.f, 1.f); - //GUI::SliderFloat4("vSpecular", (_float*)&m_LightDesc.vSpecular, 0.f, 1.f); - //GUI::SliderFloat3("fAngle", (_float*)&m_LightDesc.vDirection.x, -1.f, 1.f); - //GUI::SliderFloat("fSpotInner", (_float*)&m_LightDesc.vSpotAngles.x, 0.f, 1.f); - //GUI::SliderFloat("fSpotOutter", (_float*)&m_LightDesc.vSpotAngles.y, 0.f, 1.f); - //GUI::End(); - if (LIGHT::POINT == m_LightDesc.eType || LIGHT::SPOT == m_LightDesc.eType) { - XMStoreFloat4(&m_LightDesc.vPosition, vPosition); - return S_OK; - } - return E_FAIL; + + return S_OK; } -HRESULT CLight::Initialize(const LIGHT_DESC& LightDesc) +HRESULT CLight::Initialize(void* pArg) { - m_LightDesc = LightDesc; + LIGHT_DESC* pLightDesc = static_cast(pArg); + + if (nullptr == pLightDesc) + return E_FAIL; + + m_LightDesc = *pLightDesc; + + m_pGameInstance->Add_Light(m_LightDesc.iLevel, this); + return S_OK; } @@ -51,16 +61,19 @@ HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const { _uint iPassIndex = { 0 }; if (LIGHT::DIRECTIONAL == m_LightDesc.eType) { - if (FAILED(pShader->Bind_RawValue("g_vLightDir", &m_LightDesc.vDirection, sizeof(_float4)))) { + if (FAILED(pShader->Bind_RawValue("g_vLightDir", m_LightDesc.pDirection, sizeof(_float4)))) { return E_FAIL; } iPassIndex = ENUM_CLASS(SHADER_PASS_DEFERRED::DIRECTIONAL); } else if (LIGHT::SPOT == m_LightDesc.eType) { - if (FAILED(pShader->Bind_RawValue("g_vLightDir", &m_LightDesc.vDirection, sizeof(_float4)))) { + if (FAILED(pShader->Bind_RawValue("g_vLightDir", m_LightDesc.pDirection, sizeof(_float4)))) { return E_FAIL; } - if (FAILED(pShader->Bind_RawValue("g_vLightPos", &m_LightDesc.vPosition, sizeof(_float4)))) { + if (FAILED(pShader->Bind_RawValue("g_vLightPos", m_LightDesc.pPosition, sizeof(_float4)))) { + return E_FAIL; + } + if (FAILED(pShader->Bind_RawValue("g_vLightPosOffset", &m_LightDesc.vPosOffset, sizeof(_float4)))) { return E_FAIL; } if (FAILED(pShader->Bind_RawValue("g_fLightRange", &m_LightDesc.fRange, sizeof(_float)))) { @@ -75,7 +88,10 @@ HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const iPassIndex = ENUM_CLASS(SHADER_PASS_DEFERRED::SPOT); } else { - if (FAILED(pShader->Bind_RawValue("g_vLightPos", &m_LightDesc.vPosition, sizeof(_float4)))) { + if (FAILED(pShader->Bind_RawValue("g_vLightPos", m_LightDesc.pPosition, sizeof(_float4)))) { + return E_FAIL; + } + if (FAILED(pShader->Bind_RawValue("g_vLightPosOffset", &m_LightDesc.vPosOffset, sizeof(_float4)))) { return E_FAIL; } if (FAILED(pShader->Bind_RawValue("g_fLightRange", &m_LightDesc.fRange, sizeof(_float)))) { @@ -99,13 +115,15 @@ HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const } return pVIBuffer->Render(); + return S_OK; } -CLight* CLight::Create(const LIGHT_DESC& LightDesc) -{ - CLight* pInstance = new CLight(); - if (FAILED(pInstance->Initialize(LightDesc))) +CLight* CLight::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CLight* pInstance = new CLight(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) { MSG_BOX("Failed to Created : CLight"); SAFE_RELEASE(pInstance); @@ -114,9 +132,58 @@ CLight* CLight::Create(const LIGHT_DESC& LightDesc) return pInstance; } +CComponent* CLight::Clone(void* pArg, class CGameObject* pOwner) +{ + CLight* pInstance = new CLight(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CLight"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + void CLight::Free() { __super::Free(); - +} + + +void CLight::Describe_Entity() +{ + if (ImGui::TreeNode("LIGHT_INFO")) + { + ImGui::Separator(); ImGui::Spacing(); + + const char* pLightTypeNames[] = { "DIRECTIONAL", "POINT", "SPOT" }; + + int iCurrentItem = static_cast(m_LightDesc.eType); + + if (ImGui::Combo("LightType", &iCurrentItem, pLightTypeNames, ENUM_CLASS(LIGHT::END))) + { + m_LightDesc.eType = static_cast(iCurrentItem); + } + + GUI::DragFloat4("Diffuse", reinterpret_cast(&m_LightDesc.vDiffuse) , 0.01f , 0.f ,1.f); + GUI::DragFloat4("Ambient", reinterpret_cast(&m_LightDesc.vAmbient), 0.01f, 0.f, 1.f); + GUI::DragFloat4("Specular", reinterpret_cast(&m_LightDesc.vSpecular), 0.01f, 0.f, 1.f); + GUI::DragFloat("Range", &m_LightDesc.fRange, 1.f, 0.f); + GUI::DragFloat2("SpotAngle", reinterpret_cast(&m_LightDesc.vSpotAngles)); + + GUI::Spacing(); + GUI::Spacing(); + + GUI::DragFloat3("PosOffest", reinterpret_cast(&m_LightDesc.vPosOffset)); + + GUI::Spacing(); + + m_pOwner->Get_Component()->Describe_Entity(); + + GUI::TreePop(); + } + + GUI::Separator(); } diff --git a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp index 215a6a143..601ccdf56 100644 --- a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp @@ -6,92 +6,95 @@ CLight_Manager::CLight_Manager() { } -HRESULT CLight_Manager::On_Light(_uint iLevel, const _wstring& wstrLightKey, const LIGHT_DESC& LightDesc, class CLight** ppOut) + + + +HRESULT CLight_Manager::Initialize(_uint iNumLevels) { - list* pLights = Find_Lights(iLevel, wstrLightKey); - if (nullptr != pLights) { - if (*(*pLights).front() == LightDesc) { // °°Àº Á¾·ù, °°Àº À§Ä¡ÀÇ ±¤¿øÀº Ãß°¡ÇÏÁö ¾ÊÀ½ - return E_FAIL; - } - } - else if (nullptr == pLights) { - pLights = new list(); - m_pLights[iLevel].emplace(wstrLightKey, pLights); - } - CLight* pLight = CLight::Create(LightDesc); - if (nullptr == pLight) { - return E_FAIL; - } - if (nullptr != ppOut) { - *ppOut = pLight; - } - pLights->push_back(pLight); + m_iLevelNumber = iNumLevels; + + m_Lights = new list[m_iLevelNumber]; + return S_OK; } -HRESULT CLight_Manager::Off_Light(_uint iLevel, const _wstring& wstrLightKey) +void CLight_Manager::Add_Light(_uint _iCurrentLevel, CLight* _pLight) { - map<_wstring, list*>::iterator iter = m_pLights[iLevel].find(wstrLightKey); - if (iter == m_pLights[iLevel].end()) { - return E_FAIL; + if (nullptr == _pLight) + return; + + m_Lights[_iCurrentLevel].push_back(_pLight); + + SAFE_ADDREF(_pLight); + +} + +void CLight_Manager::Delete_Light(_uint _iCurrentLevel, CLight* _pLight) +{ + for (auto iter = m_Lights[_iCurrentLevel].begin(); iter != m_Lights[_iCurrentLevel].end();) + { + if (*iter == _pLight) + { + SAFE_RELEASE(_pLight); + + iter = m_Lights[_iCurrentLevel].erase(iter); + + } + else + { + iter++; + } } - for (auto& pLight : *(*iter).second) { +} + +void CLight_Manager::Light_Clear(_uint _iCurrentLevel) +{ + for (auto& pLight : m_Lights[_iCurrentLevel]) + { SAFE_RELEASE(pLight); } - Safe_Delete((*iter).second); - (m_pLights[iLevel]).erase(iter); - return S_OK; + + m_Lights[_iCurrentLevel].clear(); } -HRESULT CLight_Manager::Render_Lights(CShader* pShader, CVIBuffer* pVIBuffer) +const LIGHT_DESC* CLight_Manager::Get_Light_Info(_uint _iCurrentLevel, _uint _iLightIndex) { - for (_uint i = 0; i < m_iNumLevel; ++i) { - for (auto& pairLight : m_pLights[i]) - { - for (auto& pLight : *pairLight.second) { - if (FAILED((pLight)->Render(pShader, pVIBuffer))) { - return E_FAIL; - } - } - } - } - return S_OK; -} - -HRESULT CLight_Manager::Change_Level(_uint iLevel) -{ - for (auto& pairLight : m_pLights[iLevel]) { - for (auto& pLight : *pairLight.second) { - SAFE_RELEASE(pLight); - } - Safe_Delete(pairLight.second); - } m_pLights[iLevel].clear(); - return S_OK; -} - -list* CLight_Manager::Find_Lights(_uint iLevel, const _wstring& wstrLightKey) -{ - map<_wstring, list*>::iterator iter = m_pLights[iLevel].find(wstrLightKey); - if (iter == m_pLights[iLevel].end()) { + if (_iLightIndex >= m_Lights[_iCurrentLevel].size()) return nullptr; + + auto iter = m_Lights[_iCurrentLevel].begin(); + + for (size_t i = 0; i < _iLightIndex; i++) + { + iter++; } - return iter->second; + + return (*iter)->Get_LightDesc(); } -HRESULT CLight_Manager::Initialize(_uint iLevelNumber) + +HRESULT CLight_Manager::Render_Lights(_uint _iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) { - m_iNumLevel = iLevelNumber; - m_pLights = new map<_wstring, list*>[iLevelNumber]; + + for (auto& pLight : m_Lights[_iCurrentLevel]) + { + pLight->Render(pShader, pVIBuffer); + } + return S_OK; } + CLight_Manager* CLight_Manager::Create(_uint iLevelNumber) { CLight_Manager* pInstance = new CLight_Manager(); + if (FAILED(pInstance->Initialize(iLevelNumber))) { + SAFE_RELEASE(pInstance); } + return pInstance; } @@ -99,12 +102,18 @@ void CLight_Manager::Free() { __super::Free(); - for (_uint i = 0; i < m_iNumLevel; ++i) { - for (auto& pairLight : m_pLights[i]) { - for (auto& pLight : *pairLight.second) { - SAFE_RELEASE(pLight); - } - Safe_Delete(pairLight.second); - } m_pLights[i].clear(); - } Safe_Delete_Array(m_pLights); + for (size_t i = 0; i < m_iLevelNumber; i++) + { + for (auto& Light : m_Lights[i]) + { + SAFE_RELEASE(Light); + } + + m_Lights[i].clear(); + + } + + Safe_Delete_Array(m_Lights); + + } diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 0ad54a6c9..40a7335b4 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Material.h" #include "GameInstance.h" #include "Shader.h" @@ -60,9 +60,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI strcat_s(szTextureFilePath, szTextureFileName); strcat_s(szTextureFilePath, ".dds"); - hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // ÀÏ´Ü dds·Î ½ÃµµÇϰí + hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // ì�¼ë‹¨ dds로 시ë�„하고 if (FAILED(hr)) { - memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // ½ÇÆÐÇÏ¸é ¿ø·¡ È®ÀåÀÚ·Î ´Ù½Ã ½Ãµµ + memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 ì›�래 확장ìž�로 다시 시ë�„ strcat_s(szTextureFilePath, szTextureFileName); strcat_s(szTextureFilePath, szEXT); @@ -327,13 +327,13 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType { size_t startPos = mapRePos + strSearchString.length(); - // 'MapRe' µÚ¿¡ ¿À´Â °æ·Î °Ç³Ê¶Ù±â + // 'MapRe' ë’¤ì—� 오는 경로 건너뛰기 if (startPos < strTexturePath.length() && (strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) { startPos++; } - // 'MapRe' ÀÌÈÄÀÇ ³ª¸ÓÁö °æ·Î¸¦ ÃßÃâ + // 'MapRe' ì�´í›„ì�˜ 나머지 경로를 추출 strResultPath = strPrefix + strTexturePath.substr(startPos); } else @@ -350,19 +350,19 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType } HRESULT CMaterial::SaveAsBinary(HANDLE hFile, DWORD& dwByte) { - // ½ÇÁ¦ °ªÀ» ÀúÀåÇÏÁö ¾Ê°í ÆÄÀÏÀ̸§.È®ÀåÀÚ¸íÀÇ ¹®ÀÚ¿­À» ÀúÀåÇØ¼­ ¼öÁ¤ÇÏ±â ÆíÇÏ°Ô ¸¸µé±â - // ´ë½Å ¸®¼Ò½º¸¦ °øÀ¯ÇؾßÇÔ - // ÅØ½ºÃĸ¦ ÀúÀåÇÏÁö ¾Ê°í - // ÅØ½ºÃÄ °æ·Î¸¸ ( "À̸§.È®ÀåÀÚ" ) ¸¸ ÀúÀåÇÔ + // 실제 ê°’ì�„ 저장하지 않고 파ì�¼ì�´ë¦„.확장ìž�명ì�˜ 문ìž�ì—´ì�„ 저장해서 수정하기 편하게 만들기 + // 대신 리소스를 공유해야함 + // í…�스ì³�를 저장하지 않고 + // í…�스ì³� 경로만 ( "ì�´ë¦„.확장ìž�" ) ë§Œ 저장함 for (int i = 0; i < AI_TEXTURE_TYPE_MAX; ++i) { _uint iNumSrv = (_uint)m_strPath[i].size(); - WriteFile(hFile, &i, sizeof(_uint), &dwByte, nullptr); // Á¾·ù ÀúÀå - WriteFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr); // Á¾·ùÀÇ °¹¼ö ÀúÀå + WriteFile(hFile, &i, sizeof(_uint), &dwByte, nullptr); // 종류 저장 + WriteFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr); // 종류ì�˜ 갯수 저장 for (_uint j = 0; j < iNumSrv; ++j) { m_strPath[i][j].shrink_to_fit(); _uint strLength = (_uint)(sizeof(_char) * m_strPath[i][j].length()); - WriteFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr); // »çÀÌÁî ÀúÀå - WriteFile(hFile, m_strPath[i][j].data(), strLength, &dwByte, nullptr); // ½ÇÁ¦ °ª ÀúÀå + WriteFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr); // 사ì�´ì¦ˆ 저장 + WriteFile(hFile, m_strPath[i][j].data(), strLength, &dwByte, nullptr); // 실제 ê°’ 저장 } } return S_OK; @@ -452,7 +452,7 @@ CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex if (FAILED(pInstance->Initialize(pModelFilePath, _SaveMaterial))) { MSG_BOX("Failed to Created : CMaterial"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 4305bda17..6861970b3 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Mesh.h" #include "Model.h" #include "Bone.h" @@ -154,7 +154,7 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance) HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte) { - { // ¸â¹öº¯¼ö + { // 멤버변수 if (!ReadFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr)) { return E_FAIL; } @@ -535,7 +535,7 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) { - { // ¸â¹öº¯¼ö + { // 멤버변수 WriteFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr); WriteFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr); WriteFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr); @@ -556,7 +556,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) } { // Vertex Buffer D3D11_BUFFER_DESC VBDesc{}; - m_pVB->GetDesc(&VBDesc); // ¹öÆÛ µð½ºÅ©¸³¼Ç ÀúÀå + m_pVB->GetDesc(&VBDesc); // 버í�¼ 디스í�¬ë¦½ì…˜ 저장 WriteFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr); D3D11_BUFFER_DESC StagingDesc{}; @@ -570,7 +570,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) { return E_FAIL; } - m_pContext->CopyResource(pStaging, m_pVB); // ¹öÆÛ º¹»ç + m_pContext->CopyResource(pStaging, m_pVB); // 버í�¼ 복사 D3D11_MAPPED_SUBRESOURCE mapped{}; m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped); @@ -799,7 +799,7 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL if (FAILED(pInstance->Initialize_Prototype(eType, pModel, _SaveMesh, PreTransformMatrix))) { MSG_BOX("Failed to Created : CMesh"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index cd5c2f967..e27b64933 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -6,6 +6,7 @@ #include "Animation.h" #include "LerpAnim.h" #include "GameObject.h" +#include "Transform.h" CModel::CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } @@ -140,7 +141,7 @@ HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _cha return m_Meshes[iMeshIndex]->Bind_BoneMatrices(m_Bones, pShader, pConstantName); } -_bool CModel::Play_Animation(_float fTimeDelta) +_bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) { if (!m_bPlayAnim) return false; @@ -154,7 +155,7 @@ _bool CModel::Play_Animation(_float fTimeDelta) m_bIsFinishedLerp = m_pLerpAnim->Update_TransformationMatrices(m_Bones, fTimeDelta); } else { // 럴프중ì�´ì§€ 않다면 실제 애니메ì�´ì…˜ 재ìƒ�ì�„ 시작함 - m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta); + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, pTransform); } for (_int i = 0; i < m_Bones.size(); ++i) @@ -183,6 +184,9 @@ _bool CModel::Play_Animation(_float fTimeDelta) } } + if(m_bIsFinishedAnim) + m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); + return m_bIsFinishedAnim; } @@ -194,6 +198,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop) { m_iCurrentAnimIndex = iIndex; m_bIsLoop = isLoop; + m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); } else m_iCurrentAnimIndex = -1; @@ -308,6 +313,17 @@ void CModel::Set_AnimSpeed(_float fSpeed) m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed); } +void CModel::Set_Anim(CModel* Source) +{ + m_Animations = Source->m_Animations; + + for (auto& anim : m_Animations) + anim->Remap_Channels_By_Name(this); + + m_iNumAnimations = (_uint)m_Animations.size(); +} + + HRESULT CModel::Render(_uint iMeshIndex) { m_Meshes[iMeshIndex]->Bind_Resources(); @@ -1113,7 +1129,7 @@ CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MOD if (FAILED(pInstance->Initialize_Prototype(eType, pModelFilePath, PreTransformMatrix))) { MSG_BOX("Failed to Created : CModel"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 50c8631c5..c62c73e1f 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -1,23 +1,10 @@ -#include "pch.h" +#include "pch.h" #include "PhysX_Manager.h" #include "GameObject.h" #include "GameInstance.h" #include "RigidBody.h" #include "Mesh.h" -static PSX::PxTransform XMWorldToPx_NoScale(const _matrix& WorldMatrix) -{ - _vector vPos, vRotq, vScale; - XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); - - vRotq = XMQuaternionNormalize(vRotq); - - PSX::PxTransform out; - XMStoreFloat3((_float3*)&out.p, vPos); - XMStoreFloat4((_float4*)&out.q, vRotq); - return out; -} - CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice(pDevice), m_pContext(pContext), @@ -28,17 +15,14 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont SAFE_ADDREF(m_pGameInstance); } -const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody) +PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); - // PxRigidDynamic ¾ÀÀÇ µ¿Àû ¹Ùµð ÀÎÅÍÆäÀ̽º + // PxRigidDynamic 씬ì�˜ ë�™ì � 바디 ì�¸í„°íŽ˜ì�´ìФ PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix); - pActorDynamic->userData = &RigidBody; - - PSX::PxShape* pClone = nullptr; + PSX::PxShape* pShape = nullptr; PSX::PxGeometryHolder geoHolder = {}; _float3 vVolume = RigidBody.Get_HalfGeometryInfo(); @@ -46,29 +30,27 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod switch (RigidBody.Get_Type()) { case ACTOR::BOX: geoHolder = PSX::PxBoxGeometry(PSX::PxVec3(vVolume.x, vVolume.y, vVolume.z)); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; case ACTOR::CAPSULE: geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; case ACTOR::SPHERE: geoHolder = PSX::PxCapsuleGeometry(vVolume.x); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; default: - assert(false); break; + assert(false); + break; } + assert(nullptr != pShape); - pClone->setFlags(RigidBody.Get_ShapeFlags()); - pClone->setContactOffset(RigidBody.Get_ContactOffset()); - pClone->setRestOffset(0.f); + pShape->setFlags(RigidBody.Get_ShapeFlags()); + pShape->setContactOffset(RigidBody.Get_ContactOffset()); + pShape->setRestOffset(0.f); - - pActorDynamic->attachShape(*pClone); + pActorDynamic->attachShape(*pShape); PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags(); pActorDynamic->setRigidBodyFlags(pxRigidFlags); @@ -81,69 +63,76 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density()); } - m_RigidBodys.emplace_back(&RigidBody, pActorDynamic); - m_pScene->addActor(*pActorDynamic); + Attach_Actor(RigidBody, *pActorDynamic); return pActorDynamic; } -const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody) +PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); - - // PxRigidStatic ¾ÀÀÇ Á¤Àû ¹Ùµð ÀÎÅÍÆäÀ̽º - PSX::PxTriangleMesh* pPxMesh = { nullptr }; - { - auto iter = m_TriangleMeshes.find(RigidBody.Get_PxMeshKey()); - if (m_TriangleMeshes.end() == iter) { - assert(false); - return nullptr; - } - pPxMesh = iter->second; - } - _vector vPos, vRotq, vScale; - XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); - - vRotq = XMQuaternionNormalize(vRotq); - - PSX::PxTransform out; - XMStoreFloat3((_float3*)&out.p, vPos); - XMStoreFloat4((_float4*)&out.q, vRotq); - PSX::PxMeshScale meshScale( - PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])), - PSX::PxQuat(PSX::PxIdentity) // ½ºÄÉÀÏ ÃàÀº ·ÎÄà ±âÁØ(º¸Åë Identity°¡ °¡Àå ¾ÈÀü) - ); - PSX::PxTriangleMeshGeometry* pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale); - { - pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED; - PX_ASSERT(pPxMeshGeometry.isValid()); // À¯È¿¼º üũ - m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry); - } + // PxRigidStatic 씬ì�˜ ì •ì � 바디 ì�¸í„°íŽ˜ì�´ìФ PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); - PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - - pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true); - pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true); + PSX::PxShape* pShape = { nullptr }; + PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey()); + PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr }; - pActor->userData = &RigidBody; - m_RigidBodys.emplace_back(&RigidBody, pActor); - m_pScene->addActor(*pActor); + switch (RigidBody.Get_Type()) + { + case ACTOR::PLANE: + break; + case ACTOR::TRIANGLEMESH: + { // SetUp Geometry + _vector vPos, vRotq, vScale; + XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); + vRotq = XMQuaternionNormalize(vRotq); + + PSX::PxTransform out; + XMStoreFloat3((_float3*)&out.p, vPos); + XMStoreFloat4((_float4*)&out.q, vRotq); + PSX::PxMeshScale meshScale( + PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])), + PSX::PxQuat(PSX::PxIdentity) // 스케ì�¼ ì¶•ì�€ 로컬 기준 + ); + pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale); + + // GeoFlag 중 ë�”블사ì�´ë“œëŠ” ì�´ì œ ì§€ì›� 안함, í• ê±°ë©´ ë…¸ë§� 뒤집어서 하ë�¼ê³  함 + // pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED; + // 유효성 ì²´í�¬ + PX_ASSERT(pPxMeshGeometry.isValid()); + m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry); + } + break; + case ACTOR::HEIGHTFIELD: + break; + default: + assert(false); + break; + } + + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); + + pShape->setFlags(RigidBody.Get_ShapeFlags()); + pShape->setContactOffset(RigidBody.Get_ContactOffset()); + pShape->setRestOffset(0.f); + + + Attach_Actor(RigidBody, *pActor); return pActor; } -PSX::PxMaterial* CPhysX_Manager::Get_Material(const _float3* vMatInfo) +PSX::PxMaterial* CPhysX_Manager::Create_Material(const _float3* vMatInfo) { PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z); return pPxMaterial; } -void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) { +void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) +{ m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh); - } HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) @@ -233,8 +222,8 @@ HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector& TriMeshes) //{ // filesystem::path pathPhysX = pPath; @@ -312,8 +301,8 @@ void CPhysX_Manager::Update(_float fTimeDelta) _bool bResult = m_pScene->fetchResults(true); } { // Post - // Update_Dynamic_ActiveActors(); - Update_Dynamic_AllActors(); + Update_Dynamic_ActiveActors(); + //Update_Dynamic_AllActors(); } } @@ -323,15 +312,18 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor); for (PSX::PxU32 i = 0; i < iNumActiveActor; ++i) { + PhsXUserData* pUserData = (PhsXUserData*)ppActiveActors[i]->userData; PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is(); - if (nullptr != pActorDynamic) { if (nullptr == ppActiveActors[i]->userData) { continue; } - CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_TransformPtr(); + CTransform* pTransform = pUserData->pOwner->Get_Component(); + + + // PSX::PxTransform pPrevPxTransform = pUserData->m_BeforeMatrix; + // XMMatrixDecompose(nullptr, (_vector*)&pPrevPxTransform.q, (_vector*)&pPrevPxTransform.p, XMLoadFloat4x4(&pUserData->m_BeforeMatrix)); - PSX::PxTransform pPrevPxTransform; PSX::PxTransform pPxTransform = pActorDynamic->getGlobalPose(); _float3 vOriginalScale = pTransform->Get_Scale(); _matrix WorldMatrix = {}; @@ -347,21 +339,21 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() //} } -void CPhysX_Manager::Update_Dynamic_AllActors() -{ - for (pair& pairActors : m_RigidBodys) { - PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is(); - if (nullptr != pActorDynamic) { - CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr(); - - PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose(); - _float3 vOriginalScale = pTransform->Get_Scale(); - _matrix WorldMatrix = {}; - WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p)); - pTransform->Set_WorldMatrix(WorldMatrix); - } - } -} +//void CPhysX_Manager::Update_Dynamic_AllActors() +//{ +// for (pair& pairActors : m_RigidBodys) { +// PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is(); +// if (nullptr != pActorDynamic) { +// CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr(); +// +// PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose(); +// _float3 vOriginalScale = pTransform->Get_Scale(); +// _matrix WorldMatrix = {}; +// WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p)); +// pTransform->Set_WorldMatrix(WorldMatrix); +// } +// } +//} void CPhysX_Manager::ClearScene() { @@ -369,6 +361,32 @@ void CPhysX_Manager::ClearScene() pObject.second->release(); } m_RigidBodys.clear(); } +void CPhysX_Manager::Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor) +{ + if (m_pScene == nullptr){ + return; + } + + m_RigidBodys.emplace_back(&RigidBody, &Actor); + m_pScene->addActor(Actor); +} + +void CPhysX_Manager::Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor) +{ + if (m_pScene == nullptr){ + return; + } + + list>::iterator iter = m_RigidBodys.begin(); + for (; iter != m_RigidBodys.end(); ++iter){ + if ((*iter).second == pActor) { + m_RigidBodys.erase(iter); + break; + } + } + + m_pScene->removeActor(*pActor); +} PSX::PxController* CPhysX_Manager::Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc) { @@ -426,8 +444,7 @@ HRESULT CPhysX_Manager::Initialize() assert(false); } - - { // ¾À ¼¼ÆÃ + { // 씬 세팅 m_ToleranceScale.length = 1.f; // 1 meter m_ToleranceScale.speed = GRAVITY; // @@ -440,26 +457,51 @@ HRESULT CPhysX_Manager::Initialize() sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f); - m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu ÄÚ¾î °¹¼ö*/); + m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/); if (nullptr == m_pDispatcher) { assert(false); return E_FAIL; } sceneDesc.cpuDispatcher = m_pDispatcher; + //sceneDesc.simulationEventCallback = ; // fetchResults 때 불림. 아래 í•„í„°ëž‘, pairëž‘ ê°™ì�´ ì§�ê¿�ìž„. 좀 ë�” 공부해야 쓸 수 있ì�„듯;; + sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader; // ë ˆì�´ì–´ ì¶©ë�Œ, 오브ì �트ì—� ì†�성ì�„ 주고 복잡한 í•„í„°ë§� ì¶©ë�Œ ì‹� + sceneDesc.flags = + PSX::PxSceneFlag::eENABLE_PCM // 기본 true, 현대ì �ì�¸ ì¶©ë�Œì‹œìŠ¤í…œ ì �ìš© + | PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS // 현재 움ì§�ìž„ì�´ 있는 ì•¡í„°ë§Œ 가져옴 + | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS // 그중ì—� 키네틱ì�€ 뺌 + | PSX::PxSceneFlag::eENABLE_CCD // CCD 기본플래그, 키면 비쌈. 단ì�¼ì˜¤ë¸Œì �트만 켤 수 있으니 ì„ íƒ�ì �으로 ê³ ë ¤ + | PSX::PxSceneFlag::eDISABLE_CCD_RESWEEP // CCD 옵션플래그, 정확ë�„ 낮추고 비용 아낌 + //| PSX::PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE // ì ‘ì´‰ 리í�¬íŠ¸ë²„í�¼ 리사ì�´ì¦ˆ 금지 -> 보통 ë�” + //| PSX::PxSceneFlag::eDISABLE_CONTACT_CACHE // ì ‘ì´‰ ìº�시를 금지 -> 그냥 켜ë‘�ìž�, ìº�시 있는게 보통 ë�” 낫다 + //| PSX::PxSceneFlag::eREQUIRE_RW_LOCK // 멀티스레딩 환경ì—�서 혹시ë�¼ë�„ ë�½ 걸고 접근하지 않아 ë°œìƒ�í•  ì�¼ì�„ 제거, + //| PSX::PxSceneFlag::eENABLE_STABILIZATION // 물체가 얽힌 ìƒ�황ì—�서 불안정한걸 ë°©ì§€. 추가비용ì�¸ë“¯ + //| PSX::PxSceneFlag::eENABLE_AVERAGE_POINT // ì�´í•´ 못하겠ì�Œ + //| PSX::PxSceneFlag::eEnable_GPU_Dynamics // 피ì§�스 그래픽가ì†� 설정. 여기선 세팅 안ë�¼ì„œ 비활성화ã…� + //| PSX::PxSceneFlag::eEnable_Direct_GPU_API // ì§�ì ‘ 그래픽버í�¼ë¥¼ 다루게ë�” 설정 + //| PSX::PxSceneFlag::eEnable_Enhanced_Determinism // 중간ì—� ì•¡í„° 추가해ë�„ 결과가 바뀌지 않는 ê²°ì •ë¡  수준 í–¥ìƒ�, 리플레ì�´ê¸°ëŠ¥ ㅇㅇ + //| PSX::PxSceneFlag::eENABLE_FRICTION_EVERY_ITERATION // 마찰 ê¼�ì‚° 추가 + //| PSX::PxSceneFlag::eENABLE_EXTERNAL_FORCES_EVERY_ITERATION_TGS // 중력 나눠서 여러번 ì �ìš© + //| PSX::PxSceneFlag::eENABLE_PCM // 기본 true + //| PSX::PxSceneFlag::eENABLE_BODY_ACCELERATIONS // 선형 ê°�ê°€ì†�ë�„ ê°’ì�„ 쿼리가능하ë�„ë¡� 설정 + //| PSX::PxSceneFlag::eEnable_solver_residual_reporting // 고급 디버깅, 연구 ìš© + //| PSX::PxSceneFlag::eSOLVE_ARTICULATION_CONTACT_LAST 물리 관절 처리 시나리오 순서 변경 + ; - sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader; - - sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_CCD| PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS; if (false == sceneDesc.isValid()) { assert(false); return E_FAIL; } + m_pScene = m_pPhysics->createScene(sceneDesc); + + // CCT m_pCCTManager = PxCreateControllerManager(*m_pScene); - m_pCCTManager->setOverlapRecoveryModule(false); + m_pCCTManager->setOverlapRecoveryModule(true); // 복구모듈ì�€ 하ì�´íŠ¸í•„ë“œì—�는 ì �ìš©ë�˜ì§€ 않ì�Œ, 오ì§� 스태틱만 대ìƒ� + m_pCCTManager->setPreciseSweeps(true); // ì •ë°€ 스윕 + m_pCCTManager->setPreventVerticalSlidingAgainstCeiling(false); // 천장타고 슬ë�¼ì�´ë”© 허용 비허용 } - // µð¹ö±×¼­¹öÀÇ Å¬¶ó ¼¼ÆÃ + // 디버그서버ì�˜ í�´ë�¼ 세팅 PSX::PxPvdSceneClient* pPvdClient = m_pScene->getScenePvdClient(); if (nullptr != pPvdClient) { pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true); @@ -469,7 +511,7 @@ HRESULT CPhysX_Manager::Initialize() // m_pScene->overlap();?????? -#ifdef ±â¹«¸® +#ifdef 기무리 m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END)); m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f)); PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); @@ -491,7 +533,7 @@ HRESULT CPhysX_Manager::Initialize() // } // } //} -#endif // ±â¹«¸® +#endif // 기무리 @@ -500,7 +542,7 @@ HRESULT CPhysX_Manager::Initialize() HRESULT CPhysX_Manager::Connect_DebugServer() { - // ³×Æ®¿öÅ© µð¹ö°Å Àü¼Û°´Ã¼ »ý¼º + // 네트워í�¬ 디버거 전송ê°�ì²´ ìƒ�성 m_pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10); if (nullptr == m_pTransport) { assert(false); diff --git a/Jusin154_Team3D/Engine/Private/Picking.cpp b/Jusin154_Team3D/Engine/Private/Picking.cpp index 9d4ab103a..316c3fafb 100644 --- a/Jusin154_Team3D/Engine/Private/Picking.cpp +++ b/Jusin154_Team3D/Engine/Private/Picking.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Picking.h" #include "GameInstance.h" @@ -7,9 +7,9 @@ CPicking::CPicking(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) , m_pContext{ pContext } , m_pGameInstance{ CGameInstance::GetInstance() } { - Safe_AddRef(m_pDevice); - Safe_AddRef(m_pContext); - Safe_AddRef(m_pGameInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + SAFE_ADDREF(m_pGameInstance); } HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY) @@ -90,7 +90,7 @@ CPicking* CPicking::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, if (FAILED(pInstance->Initialize(hWnd, iSizeX, iSizeY))) { MSG_BOX("Failed to Created : CPicking"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -100,9 +100,9 @@ void CPicking::Free() { __super::Free(); - Safe_Release(m_pDevice); - Safe_Release(m_pContext); - Safe_Release(m_pTexture2D); - Safe_Release(m_pGameInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pTexture2D); + SAFE_RELEASE(m_pGameInstance); Safe_Delete_Array(m_pPixels); } diff --git a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp index 5e3f6f86f..e13552062 100644 --- a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp @@ -95,6 +95,9 @@ HRESULT CPrototype_Manager::Ready_StaticComponents() if (FAILED(Add_Prototype(g_iStaticLevel, CVIBuffer_Cube::Create(m_pDevice, m_pContext)))) { return E_FAIL; } + if (FAILED(Add_Prototype(g_iStaticLevel, CLight::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp index 8c607e644..6e1886687 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp @@ -44,8 +44,14 @@ HRESULT CRenderTarget::Initialize(_uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixel return E_FAIL; } + m_vClearColor = vClearColor; + +#ifdef _DEBUG + Ready_Debug(); +#endif + return S_OK; } @@ -69,40 +75,58 @@ void CRenderTarget::Copy_Resource(ID3D11Texture2D* pTexture2D) } #ifdef _DEBUG -HRESULT CRenderTarget::Ready_Debug(_float fX, _float fY, _float fSizeX, _float fSizeY) +void CRenderTarget::Ready_Debug() { + XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity()); // µð¹ö±× ¿ùµå ¸ÞÆ®¸¯½º ÃʱâÈ­ + _uint iNumViewports = { 1 }; D3D11_VIEWPORT Viewport{}; m_pContext->RSGetViewports(&iNumViewports, &Viewport); + m_ptWindowSize.x = (LONG)Viewport.Width; + m_ptWindowSize.y = (LONG)Viewport.Height; - XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity()); - m_WorldMatrix._11 = fSizeX; - m_WorldMatrix._22 = fSizeY; - m_WorldMatrix._41 = fX - Viewport.Width * 0.5f; - m_WorldMatrix._42 = -fY + Viewport.Height * 0.5f; - - return S_OK; + return; } -void CRenderTarget::Render_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer) +void CRenderTarget::Describe_Entity(const _char* pName) { + if (GUI::Checkbox(pName, &m_isDraw)) + { + + } +} + +_bool CRenderTarget::Render_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer ,_float fX, _float fY, _float fSizeX, _float fSizeY) +{ + + if (m_isDraw == false) + return false; + + m_WorldMatrix._11 = fSizeX; + m_WorldMatrix._22 = fSizeY; + m_WorldMatrix._41 = fX - m_ptWindowSize.x * 0.5f; + m_WorldMatrix._42 = -fY + m_ptWindowSize.y * 0.5f; + + if (FAILED(pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix))) - return; + return false; if (FAILED(pShader->Bind_SRV("g_Texture", m_pSRV))) - return; + return false; if (FAILED(pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG)))) - return; + return false; if (FAILED(pVIBuffer->Bind_Resources())) - return; + return false; if (FAILED(pVIBuffer->Render())) - return; + return false; + + return true; } #endif diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index 5460b242e..e9b868d0c 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -149,31 +149,53 @@ HRESULT CRenderTarget_Manager::Bind_RenderTarget(const _wstring& strTargetTag, C return pRenderTarget->Bind_ShaderResource(pShader, pConstantName); } #ifdef _DEBUG -HRESULT CRenderTarget_Manager::Ready_RenderTarget_Debug(const _wstring& strTargetTag, _float fX, _float fY, _float fSizeX, _float fSizeY) + +HRESULT CRenderTarget_Manager::Render_RenderTarget_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer) { - CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag); - if (nullptr == pRenderTarget) { - return E_FAIL; - } - return pRenderTarget->Ready_Debug(fX, fY, fSizeX, fSizeY); -} -HRESULT CRenderTarget_Manager::Render_RenderTarget_Debug(const _wstring& strMRTTag, CShader* pShader, CVIBuffer_Rect* pVIBuffer) -{ - list* pMRTList = Find_MRT(strMRTTag); + _float fX = m_iSizeX * 0.5f; + _float fY = m_iSizeY * 0.5f; - if (nullptr == pMRTList) { - return E_FAIL; - } - - for (auto& pRenderTarget : *pMRTList) + for (auto& pRenderTarget : m_RenderTargets) { - pRenderTarget->Render_Debug(pShader, pVIBuffer); + if (pRenderTarget.second->Render_Debug(pShader, pVIBuffer, fX, fY, (_float)m_iSizeX, (_float)m_iSizeY) == false) + continue; + + fX += m_iSizeX; + + if (fX > 1920.f - m_iSizeX * 0.5f) + { + fX = m_iSizeX * 0.5f; + fY += m_iSizeY; + } } return S_OK; } +void CRenderTarget_Manager::RenderTarget_Debuger() +{ + GUI::Begin("RenderTarget Debuger"); + + GUI::Spacing(); + + GUI::Text("Active Btn -> F10"); + + GUI::Spacing(); + + GUI::PushItemWidth(80); + GUI::DragInt("Target Size X" , &m_iSizeX); + GUI::DragInt("Target Size Y", &m_iSizeY); + GUI::PopItemWidth(); + + for (auto& pTarget : m_RenderTargets) + { + pTarget.second->Describe_Entity(CMyTools::ToString(pTarget.first).c_str()); + } + + GUI::End(); +} + #endif // _DEBUG CRenderTarget* CRenderTarget_Manager::Find_RenderTarget(const _wstring& strRenderTargetKey) diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 8a240eaab..957215c22 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -117,6 +117,8 @@ void CRenderer::Render() Render_UI(); #ifdef _DEBUG + m_pGameInstance->RenderTarget_Debuger(); + if(m_pGameInstance->Key_Pressing(DIK_F10)) Render_Debug(); #endif @@ -229,7 +231,7 @@ void CRenderer::Render_LightAcc() m_pVIBuffer->Bind_Resources(); - if (FAILED(m_pGameInstance->Render_Lights(m_pShader, m_pVIBuffer))) { + if (FAILED(m_pGameInstance->Render_Lights(m_pGameInstance->Get_CurrentLevelID(), m_pShader, m_pVIBuffer))) { return; } @@ -523,27 +525,10 @@ void CRenderer::Render_Debug() } /* ë Œë�”타겟ì�„ 디버그로 ì§�êµ�투ì˜�ì�„ 통해 그려ë�¼. */ - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_GameObjects"), m_pShader, m_pVIBuffer))) { - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_LightAcc"), m_pShader, m_pVIBuffer))) { - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Shadow"), m_pShader, m_pVIBuffer))) { - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_PreShadow"), m_pShader, m_pVIBuffer))) { - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Blur"), m_pShader, m_pVIBuffer))) { - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Blur_X"), m_pShader, m_pVIBuffer))){ - return; - } - if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Color"), m_pShader, m_pVIBuffer))) { + if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(m_pShader, m_pVIBuffer))) { return; } + } #endif @@ -701,45 +686,6 @@ HRESULT CRenderer::Initialize() XMStoreFloat4x4(&m_ViewMatrix, XMMatrixIdentity()); XMStoreFloat4x4(&m_ProjMatrix, XMMatrixOrthographicLH(Viewport.Width, Viewport.Height, 0.f, 1.f)); -#ifdef _DEBUG - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Diffuse"), 75.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Normal"), 75.f, 225.f, 150.0f, 150.0f))) { - return E_FAIL; - } - //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shade"), 225.f, 75.f, 150.0f, 150.0f))) { - // return E_FAIL; - //} - //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) { - // return E_FAIL; - //} - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"),75.f , 1080 - 75.f, 150.f, 150.f))) { - return E_FAIL; - } - - //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) { - // return E_FAIL; - //} - //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) { - // return E_FAIL; - - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_Weight"), 75.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 75.f, 225.f, 150.0f, 150.0f))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), 225.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } - - - - -#endif return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/RigidBody.cpp b/Jusin154_Team3D/Engine/Private/RigidBody.cpp index 803097118..be78ff429 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "RigidBody.h" #include "GameInstance.h" #include "GameObject.h" @@ -53,6 +53,25 @@ HRESULT CRigidBody::Render() } #endif // _DEBUG +void CRigidBody::Set_Kinematic(_bool bKinematic) +{ + static_cast(m_pRigidBody)->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic); +} + +void CRigidBody::Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType) +{ + PSX::PxVec3 vPxForce = {}; + XMStoreFloat3((_float3*)&vPxForce, vForce); + static_cast(m_pRigidBody)->addForce(vPxForce, eType); +} + +void CRigidBody::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType) +{ + PSX::PxVec3 vPxTorque = {}; + XMStoreFloat3((_float3*)&vPxTorque, vDirection); + static_cast(m_pRigidBody)->addForce(vPxTorque, eType); +} + HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc) { m_eActorType = Desc.eType; @@ -63,11 +82,6 @@ HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc) m_fContactOffset = Desc.fContactOffset; m_vhalfGeometryInfo = Desc.vhalfGeometryInfo; m_fDensity = Desc.fDensity; -#ifdef _DEBUG - if (FAILED(Add_DebugShape())) { - return E_FAIL; - } -#endif // _DEBUG return S_OK; } @@ -102,13 +116,62 @@ HRESULT CRigidBody::Initialize(void* pArg) default: break; } + + Initialize_UserData(); + m_pRigidBody->userData = &m_tagData; + + + #ifdef _DEBUG - Add_DebugShape(); + if (FAILED(Add_DebugShape())) { + return E_FAIL; + } #endif // _DEBUG return S_OK; } +HRESULT CRigidBody::Initialize_UserData() +{ + switch (m_eActorType) + { + case Engine::ACTOR::BOX: + m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC; + m_tagData.pOwner = m_pOwner; + XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); + m_tagData.pBody = this; + break; + case Engine::ACTOR::CAPSULE: + m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC; + m_tagData.pOwner = m_pOwner; + XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); + m_tagData.pBody = this; + break; + case Engine::ACTOR::SPHERE: + m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC; + m_tagData.pOwner = m_pOwner; + XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); + m_tagData.pBody = this; + break; + case Engine::ACTOR::PLANE: + break; + case Engine::ACTOR::TRIANGLEMESH: + m_tagData.eKind = PHYSX_KIND::BODY_STATIC; + m_tagData.pOwner = m_pOwner; + XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); + m_tagData.pBody = this; + break; + case Engine::ACTOR::HEIGHTFIELD: + break; + case Engine::ACTOR::END: + break; + default: + break; + } + + return S_OK; +} + #ifdef _DEBUG HRESULT CRigidBody::Add_DebugShape() { @@ -161,6 +224,9 @@ CComponent* CRigidBody::Clone(void* pArg, CGameObject* pOwner) void CRigidBody::Free() { + if (nullptr != m_pRigidBody) { + m_pRigidBody = nullptr; + } __super::Free(); SAFE_RELEASE(m_pTransform); diff --git a/Jusin154_Team3D/Engine/Private/Shader.cpp b/Jusin154_Team3D/Engine/Private/Shader.cpp index 235527990..b10c8276f 100644 --- a/Jusin154_Team3D/Engine/Private/Shader.cpp +++ b/Jusin154_Team3D/Engine/Private/Shader.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Shader.h" CShader::CShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -12,61 +12,33 @@ CShader::CShader(const CShader& rhs) , m_pEffect{ rhs.m_pEffect } , m_iNumPasses{ rhs.m_iNumPasses } , m_InputLayouts{ rhs.m_InputLayouts } + +#ifdef _DEBUG + , m_strShaderPath { rhs.m_strShaderPath } + , m_pElements{ rhs.m_pElements } + , m_iNumElements{ rhs.m_iNumElements } +#endif { - Safe_AddRef(m_pEffect); + SAFE_ADDREF(m_pEffect); for (auto& pInputLayout : m_InputLayouts) - Safe_AddRef(pInputLayout); + SAFE_ADDREF(pInputLayout); } HRESULT CShader::Initialize_Prototype(const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements) { - _uint iHlslFlag = {}; + #ifdef _DEBUG - iHlslFlag = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; -#else - iHlslFlag = D3DCOMPILE_OPTIMIZATION_LEVEL1; + m_strShaderPath = pShaderFilePath; + m_pElements = pElements; + m_iNumElements = iNumElements; #endif - /*ID3DBlob* pBlob;*/ - if (FAILED(D3DX11CompileEffectFromFile(pShaderFilePath, nullptr, D3D_COMPILE_STANDARD_FILE_INCLUDE, iHlslFlag, 0, m_pDevice, &m_pEffect, nullptr))) + if (FAILED(CreateShader(pShaderFilePath, pElements, iNumElements))) return E_FAIL; - ID3DX11EffectTechnique* pTechnique = m_pEffect->GetTechniqueByIndex(0); - if (nullptr == pTechnique) - return E_FAIL; - - D3DX11_TECHNIQUE_DESC TechniqueDesc{}; - - if (FAILED(pTechnique->GetDesc(&TechniqueDesc))) - return E_FAIL; - - m_iNumPasses = TechniqueDesc.Passes; - - for (_uint i = 0; i < m_iNumPasses; i++) - { - ID3D11InputLayout* pInputLayout = { nullptr }; - - ID3DX11EffectPass* pPass = pTechnique->GetPassByIndex(i); - if (nullptr == pPass) - return E_FAIL; - - D3DX11_PASS_DESC PassDesc{}; - if (FAILED(pPass->GetDesc(&PassDesc))) - return E_FAIL; - - if (FAILED(m_pDevice->CreateInputLayout( - pElements, - iNumElements, - PassDesc.pIAInputSignature/*½¦ÀÌ´õ¿¡¼­ ¹Þ¾ÆÁÙ¼ö ÀÖ´Â Á¤Á¡ÀÇ Á¤º¸*/, - PassDesc.IAInputSignatureSize/*½¦ÀÌ´õ¿¡¼­ ¹Þ¾ÆÁÙ¼ö ÀÖ´Â Á¤Á¡ÀÇ ¸â¹öº¯¼ö°¹¼ö*/, - &pInputLayout))) - return E_FAIL; - - m_InputLayouts.push_back(pInputLayout); - } return S_OK; } @@ -139,6 +111,89 @@ HRESULT CShader::Bind_SRVs(const _char* pConstantName, ID3D11ShaderResourceView* return pSRVariable->SetResourceArray(ppSRV, 0, iNumSRVs); } +HRESULT CShader::CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements) +{ + + _uint iHlslFlag = {}; + +#ifdef _DEBUG + iHlslFlag = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; +#else + iHlslFlag = D3DCOMPILE_OPTIMIZATION_LEVEL1; +#endif + + /*ID3DBlob* pBlob;*/ + + if (FAILED(D3DX11CompileEffectFromFile(pShaderFilePath, nullptr, D3D_COMPILE_STANDARD_FILE_INCLUDE, iHlslFlag, 0, m_pDevice, &m_pEffect, nullptr))) + return E_FAIL; + + ID3DX11EffectTechnique* pTechnique = m_pEffect->GetTechniqueByIndex(0); + if (nullptr == pTechnique) + return E_FAIL; + + D3DX11_TECHNIQUE_DESC TechniqueDesc{}; + + if (FAILED(pTechnique->GetDesc(&TechniqueDesc))) + return E_FAIL; + + m_iNumPasses = TechniqueDesc.Passes; + + for (_uint i = 0; i < m_iNumPasses; i++) + { + ID3D11InputLayout* pInputLayout = { nullptr }; + + ID3DX11EffectPass* pPass = pTechnique->GetPassByIndex(i); + if (nullptr == pPass) + return E_FAIL; + + D3DX11_PASS_DESC PassDesc{}; + if (FAILED(pPass->GetDesc(&PassDesc))) + return E_FAIL; + + if (FAILED(m_pDevice->CreateInputLayout( + pElements, + iNumElements, + PassDesc.pIAInputSignature/*ì‰�ì�´ë�”ì—�서 받아줄수 있는 ì •ì �ì�˜ ì •ë³´*/, + PassDesc.IAInputSignatureSize/*ì‰�ì�´ë�”ì—�서 받아줄수 있는 ì •ì �ì�˜ 멤버변수갯수*/, + + &pInputLayout))) + return E_FAIL; + + m_InputLayouts.push_back(pInputLayout); + } + return S_OK; +} + +#ifdef _DEBUG + +HRESULT CShader::Shader_Refresh() +{ + // ë‚´ ì�¸í’‹ ë ˆì�´ì•„웃 ì�´íŽ™íŠ¸ 소멸시키고 + + Safe_Release(m_pEffect); + + for (auto& pInputLayout : m_InputLayouts) + Safe_Release(pInputLayout); + + m_InputLayouts.clear(); + + //ê·¸ 경로로 재 ìƒ�성한다. + + if (FAILED(CreateShader(m_strShaderPath.c_str(), m_pElements, m_iNumElements))) + { + MessageBox(NULL, L"ì‰�ì�´ë�” 변경 실패", L"System Message", MB_OK); + return E_FAIL; + } + + + MessageBox(NULL, L"ì‰�ì�´ë�” 변경 성공", L"System Message", MB_OK); + + return S_OK; +} + +#endif // + + HRESULT CShader::Begin(_uint iPassIndex) { if (iPassIndex >= m_iNumPasses) @@ -146,8 +201,9 @@ HRESULT CShader::Begin(_uint iPassIndex) m_pContext->IASetInputLayout(m_InputLayouts[iPassIndex]); - /* Apply¸¦ ¹Ýµå½Ã È£ÃâÇØ¾ß¸¸ ½¦ÀÌ´õ·Î ±×·ÁÁø´Ù. */ - /* ApplyÀÌÀü¿¡ ½¦ÀÌ´õ¿¡ Àü´ÞÇÒ ¸ðµç µ¥ÀÌÅ͵éÀ» ´Ù ´øÁ®³õ¾Æ¾ßÇÑ´Ù. */ + /* Apply를 반드시 호출해야만 ì‰�ì�´ë�”로 그려진다. */ + /* Applyì�´ì „ì—� ì‰�ì�´ë�”ì—� 전달할 모든 ë�°ì�´í„°ë“¤ì�„ 다 ë�˜ì ¸ë†“아야한다. */ + m_pEffect->GetTechniqueByIndex(0)->GetPassByIndex(iPassIndex)->Apply(0, m_pContext); return S_OK; @@ -160,7 +216,7 @@ CShader* CShader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, c if (FAILED(pInstance->Initialize_Prototype(pShaderFilePath, pElements, iNumElements))) { MSG_BOX("Failed to Created : CShader"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -173,7 +229,7 @@ CComponent* CShader::Clone(void* pArg, class CGameObject* pOwner) if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CShader"); - Safe_Release(pInstance); + SAFE_RELEASE(pInstance); } return pInstance; @@ -183,14 +239,27 @@ void CShader::Free() { __super::Free(); - Safe_Release(m_pEffect); + SAFE_RELEASE(m_pEffect); for (auto& pInputLayout : m_InputLayouts) - Safe_Release(pInputLayout); + SAFE_RELEASE(pInputLayout); m_InputLayouts.clear(); } void CShader::Describe_Entity() { + + if(GUI::TreeNode("SHADER")) + { + if (GUI::Button("Shader Refresh")) + { + + Shader_Refresh(); + + } + + GUI::TreePop(); + } + } diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index b816c5a49..ecccc43a1 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -83,7 +83,12 @@ HRESULT CUIObject::Initialize(void* pArg) m_bVisible = true; - m_vNine_Slice = XMVectorSet(-m_fSizeX * 0.5f, m_fSizeX * 0.5f, -m_fSizeY * 0.5f, m_fSizeY * 0.5f); + m_fLeft = 0.f; + m_fRight = m_fSizeX; + m_fTop = 0.f; + m_fBottom = m_fSizeY; + + m_vNine_Slice = _float4(m_fLeft, m_fRight, m_fTop, m_fBottom); return S_OK; } @@ -98,7 +103,7 @@ void CUIObject::Update(_float fTimeDelta) m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f); m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f,-m_fY + m_fWinSizeY * 0.5f,0.f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f)); m_fCurrent_Posigion = XMVectorSet(m_fX, m_fY, 0.f, 1.f); @@ -275,22 +280,42 @@ _float2 CUIObject::Get_UV() void CUIObject::Nine_Slice_Left(_float X) { - XMVectorSetX(m_vNine_Slice, X); + m_fLeft = -m_fSizeX * 0.5f + X; } void CUIObject::Nine_Slice_Right(_float Y) { - XMVectorSetY(m_vNine_Slice, Y); + m_fRight = m_fSizeX * 0.5f - Y; } void CUIObject::Nine_Slice_Top(_float Z) { - XMVectorSetZ(m_vNine_Slice, Z); + m_fTop = -m_fSizeY * 0.5f + Z; } void CUIObject::Nine_Slice_Bottom(_float W) { - XMVectorSetW(m_vNine_Slice, W); + m_fBottom = m_fSizeY * 0.5f - W; +} + +_float CUIObject::Get_Nine_Slice_Left() +{ + return m_fLeft; +} + +_float CUIObject::Get_Nine_Slice_Right() +{ + return m_fRight; +} + +_float CUIObject::Get_Nine_Slice_Top() +{ + return m_fTop; +} + +_float CUIObject::Get_Nine_Slice_Bottom() +{ + return m_fBottom; } _float2 CUIObject::Get_Origin_Position() diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 717d565b9..d7cc21eec 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -11,7 +11,8 @@ class ENGINE_DLL CAnimation : public CBase CAnimation(const CAnimation& rhs); virtual ~CAnimation() = default; public: - _bool Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta); + _bool Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr); + void ResetRootMotion(); void Depart_Animation(); void Set_AnimPause(_bool bValue) { m_bPause = bValue; } _float Get_AnimProgressRatio(); @@ -27,7 +28,8 @@ 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; } - + void Set_Channel(CAnimation* Animation); + void Remap_Channels_By_Name(class CModel* TargetModel); #ifdef EDITOR_PROJECT private: HRESULT Initialize(const vector& Bones, const aiAnimation* pAIAnimation); @@ -38,7 +40,7 @@ class ENGINE_DLL CAnimation : public CBase private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ HRESULT Initialize(const class CModel* pModel,SaveAnimation* pSaveAnimation); // HRESULT Combined_Initialize(); @@ -50,22 +52,22 @@ class ENGINE_DLL CAnimation : public CBase _float m_fTickPerSecond = {}; _float m_fAnimSpeed = {1.f}; - _bool m_bPause = { FALSE }; // ¾Ö´ÔÆÛÁî À妽º - _string m_strName = {}; // ¾Ö´Ô À̸§ - _float m_fCurrentTrackPosition = {}; // ÇöÀç Æ®·¢ À§Ä¡ - _float m_fDuration = {}; // Æ®·¢ÀÇ Àüü ±æÀÌ - _float m_TickPerSeconds[2] = { 0.f, 0.f }; // ÃÊ´ç Æ®·¢ À̵¿ °Å¸® - _uint m_iNumChannels = {}; // ¿µÇâÀ» ¹Þ´Â º»ÀÇ ¼ö + _bool m_bPause = { FALSE }; // 애님í�¼ì¦ˆ ì�¸ë�±ìФ + _string m_strName = {}; // 애님 ì�´ë¦„ + _float m_fCurrentTrackPosition = {}; // 현재 트랙 위치 + _float m_fDuration = {}; // 트랙ì�˜ ì „ì²´ 길ì�´ + _float m_TickPerSeconds[2] = { 0.f, 0.f }; // 초당 트랙 ì�´ë�™ 거리 + _uint m_iNumChannels = {}; // ì˜�í–¥ì�„ 받는 본ì�˜ 수 - vector m_Channels; // ÀÌ ¾Ö´Ï¸ÞÀ̼ÇÀÌ ¿µÇâÀ» ÁØ »çÀü °è»êµÈ º»ÀÇ ¹è¿­ - vector<_uint> m_CurrentKeyFrameIndices; // °¢ º»ÀÌ ÇöÀç ¾Ö´Ï¸ÞÀ̼ǿ¡¼­ ÃëÇØ¾ßÇÒ Å°ÇÁ·¹ÀÓ ¿ÞÂÊ À妽º + vector m_Channels; // ì�´ 애니메ì�´ì…˜ì�´ ì˜�í–¥ì�„ 준 사전 계산ë�œ 본ì�˜ ë°°ì—´ + vector<_uint> m_CurrentKeyFrameIndices; // ê°� 본ì�´ 현재 애니메ì�´ì…˜ì—�서 취해야할 키프레임 왼쪽 ì�¸ë�±ìФ - vector<_int> m_DestBones; // ÀÌ ¾Ö´Ï¸ÞÀ̼ǿ¡¼­ ¿µÇâÀ» ¹Þ´Â º»µéÀÇ ÁýÇÕ - vector m_StartKeyFrames; // ÀÌ ¾Ö´Ï¸ÞÀ̼ÇÀÇ ¿µÇâÀ» ¹Þ´Â º»µéÀÇ ÃʱⰪ + vector<_int> m_DestBones; // ì�´ 애니메ì�´ì…˜ì—�서 ì˜�í–¥ì�„ 받는 본들ì�˜ ì§‘í•© + vector m_StartKeyFrames; // ì�´ 애니메ì�´ì…˜ì�˜ ì˜�í–¥ì�„ 받는 본들ì�˜ 초기값 public: static CAnimation* Create(HANDLE hFile, DWORD& dwByte); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ static CAnimation* Create(const class CModel* pModel, SaveAnimation* pSaveAnimation); // CAnimation* Clone(); @@ -73,4 +75,4 @@ class ENGINE_DLL CAnimation : public CBase void Describe_Entity(); }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Assimp/BaseImporter.h b/Jusin154_Team3D/Engine/Public/Assimp/BaseImporter.h index 45cb527ea..2572c72f4 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/BaseImporter.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/BaseImporter.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/Bitmap.h b/Jusin154_Team3D/Engine/Public/Assimp/Bitmap.h index 815c964a2..c4a6ba57e 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/Bitmap.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/Bitmap.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/BlobIOSystem.h b/Jusin154_Team3D/Engine/Public/Assimp/BlobIOSystem.h index 800d75542..5341f05f8 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/BlobIOSystem.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/BlobIOSystem.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/ByteSwapper.h b/Jusin154_Team3D/Engine/Public/Assimp/ByteSwapper.h index bb15ea43a..d0f84fe17 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/ByteSwapper.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/ByteSwapper.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/ColladaMetaData.h b/Jusin154_Team3D/Engine/Public/Assimp/ColladaMetaData.h index 451c82899..20e83342a 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/ColladaMetaData.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/ColladaMetaData.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/CreateAnimMesh.h b/Jusin154_Team3D/Engine/Public/Assimp/CreateAnimMesh.h index 5a258a300..7936b43c7 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/CreateAnimMesh.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/CreateAnimMesh.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOStream.h b/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOStream.h index cbc1cb405..56bfb4562 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOStream.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOStream.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOSystem.h b/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOSystem.h index a3aff4961..46f124692 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOSystem.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/DefaultIOSystem.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/Exceptional.h b/Jusin154_Team3D/Engine/Public/Assimp/Exceptional.h index 9ea2788bc..e24ab129c 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/Exceptional.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/Exceptional.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/GenericProperty.h b/Jusin154_Team3D/Engine/Public/Assimp/GenericProperty.h index 537fc05f0..e99d7c7d2 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/GenericProperty.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/GenericProperty.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/GltfMaterial.h b/Jusin154_Team3D/Engine/Public/Assimp/GltfMaterial.h index 7522bb4a1..32e3f2edb 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/GltfMaterial.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/GltfMaterial.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/Hash.h b/Jusin154_Team3D/Engine/Public/Assimp/Hash.h index 71ed9aa53..ec7447b6c 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/Hash.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/Hash.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/aabb.h b/Jusin154_Team3D/Engine/Public/Assimp/aabb.h index 1ff494a66..8861e1d9f 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/aabb.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/aabb.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/anim.h b/Jusin154_Team3D/Engine/Public/Assimp/anim.h index 797748fb1..a92df7f5e 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/anim.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/anim.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/camera.h b/Jusin154_Team3D/Engine/Public/Assimp/camera.h index b3580794e..db8214cbb 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/camera.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/camera.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/cexport.h b/Jusin154_Team3D/Engine/Public/Assimp/cexport.h index 1d559f239..06366f1cf 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/cexport.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/cexport.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/cfileio.h b/Jusin154_Team3D/Engine/Public/Assimp/cfileio.h index 671b70ce0..205270033 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/cfileio.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/cfileio.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/cimport.h b/Jusin154_Team3D/Engine/Public/Assimp/cimport.h index f296a98d8..692a0d354 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/cimport.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/cimport.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/color4.h b/Jusin154_Team3D/Engine/Public/Assimp/color4.h index dbadcf33b..dde77c469 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/color4.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/color4.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/commonMetaData.h b/Jusin154_Team3D/Engine/Public/Assimp/commonMetaData.h index 0f9286cff..e47e0b9a6 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/commonMetaData.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/commonMetaData.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/config.h b/Jusin154_Team3D/Engine/Public/Assimp/config.h index f47b7a8b0..d0b4897dd 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/config.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/config.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/defs.h b/Jusin154_Team3D/Engine/Public/Assimp/defs.h index 2f98d0211..6957a38f1 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/defs.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/defs.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/fast_atof.h b/Jusin154_Team3D/Engine/Public/Assimp/fast_atof.h index 0e8339643..654b114e8 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/fast_atof.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/fast_atof.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine" and the "irrXML" project. diff --git a/Jusin154_Team3D/Engine/Public/Assimp/importerdesc.h b/Jusin154_Team3D/Engine/Public/Assimp/importerdesc.h index 8d60ca96b..223695fa1 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/importerdesc.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/importerdesc.h @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/AndroidJNIIOSystem.h b/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/AndroidJNIIOSystem.h index 29ad8e079..066418b21 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/AndroidJNIIOSystem.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/AndroidJNIIOSystem.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/BundledAssetIOSystem.h b/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/BundledAssetIOSystem.h index c6adae60e..abc67a43b 100644 --- a/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/BundledAssetIOSystem.h +++ b/Jusin154_Team3D/Engine/Public/Assimp/port/AndroidJNI/BundledAssetIOSystem.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- diff --git a/Jusin154_Team3D/Engine/Public/Base.h b/Jusin154_Team3D/Engine/Public/Base.h index 141398bf0..df272ea38 100644 --- a/Jusin154_Team3D/Engine/Public/Base.h +++ b/Jusin154_Team3D/Engine/Public/Base.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Engine_Define.h" diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 48cfa4251..12b408475 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -22,22 +22,22 @@ class ENGINE_DLL CBone final : public CBase _bool Compare_Name(const _char* pBoneName) const { return !strcmp(pBoneName, m_szName); } - void Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame); // ÇöÀç º»ÀÇ ·ÎÄÃ¸ÅÆ®¸¯½º¸¦ ĸÃÄÇØ¼­ ŰÇÁ·¹ÀÓÀ¸·Î ¼ººÐ ºÐÇØÇÏ¿© ¿Ã·Áº¸³½´Ù. + void Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame); // 현재 본ì�˜ 로컬매트릭스를 캡ì³�해서 키프레임으로 성분 분해하여 올려보낸다. const _char* Get_Name() const { return m_szName; } _float3 Get_LocalPosition(); void Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix); - void Set_TransformationMatrix(_fmatrix TransformationMatrix); // ¾Ö´Ï¸ÞÀ̼ǿ¡¼­ ÇöÀç ·ÎÄà ¸ÅÆ®¸¯½º¸¦ º¯°æÇÒ ¶§ »ç¿ëµÈ´Ù + void Set_TransformationMatrix(_fmatrix TransformationMatrix); // 애니메ì�´ì…˜ì—�서 현재 로컬 매트릭스를 변경할 때 사용ë�œë‹¤ private: - _char m_szName[MAX_PATH] = {}; // º»ÀÇ À̸§ - _float4x4 m_TransformationMatrix = {}; // º»ÀÇ ÇöÀç ·ÎÄà ¸ÅÆ®¸¯½º - _float4x4 m_CombinedTransformationMatrix = {}; // º»ÀÇ ·çÆ®³ëµå·ÎºÎÅÍ »ó´ëÀûÀÎ º¹ÇՏů®¸¯½º ( ºÎ¸ð³ëµå´Â PreTranformMatrix¿Í ¿ùµåÁÂÇ¥·ÎºÎÅÍ »ó´ëÀûÀÓ ) - _int m_iParentBoneIndex = { -1 }; // ºÎ¸ðº»ÀÇ À妽º ( ¸ðµ¨¿¡ ÀÖ´Â º»º¤ÅÍÀÇ À妽º ) ( ºÎ¸ð´Â À妽º -1 °íÁ¤ ) + _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); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ HRESULT Initialize(const SaveNode& _SaveNode, _int iParentIndex); // @@ -46,7 +46,7 @@ class ENGINE_DLL CBone final : public CBase CBone* Clone(); virtual void Free() override; - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ static CBone* Create(const SaveNode& _SaveNode, _int iParentIndex); // #ifdef EDITOR_PROJECT diff --git a/Jusin154_Team3D/Engine/Public/Bounding.h b/Jusin154_Team3D/Engine/Public/Bounding.h index 4beac6292..b86650f89 100644 --- a/Jusin154_Team3D/Engine/Public/Bounding.h +++ b/Jusin154_Team3D/Engine/Public/Bounding.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" diff --git a/Jusin154_Team3D/Engine/Public/Bounding_AABB.h b/Jusin154_Team3D/Engine/Public/Bounding_AABB.h index 786c06990..1edae7941 100644 --- a/Jusin154_Team3D/Engine/Public/Bounding_AABB.h +++ b/Jusin154_Team3D/Engine/Public/Bounding_AABB.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Bounding.h" diff --git a/Jusin154_Team3D/Engine/Public/Bounding_OBB.h b/Jusin154_Team3D/Engine/Public/Bounding_OBB.h index aad0cae28..8c0599a99 100644 --- a/Jusin154_Team3D/Engine/Public/Bounding_OBB.h +++ b/Jusin154_Team3D/Engine/Public/Bounding_OBB.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Bounding.h" diff --git a/Jusin154_Team3D/Engine/Public/Bounding_Sphere.h b/Jusin154_Team3D/Engine/Public/Bounding_Sphere.h index 44e8de478..7d7d6788a 100644 --- a/Jusin154_Team3D/Engine/Public/Bounding_Sphere.h +++ b/Jusin154_Team3D/Engine/Public/Bounding_Sphere.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Bounding.h" diff --git a/Jusin154_Team3D/Engine/Public/Camera.h b/Jusin154_Team3D/Engine/Public/Camera.h index d871a705c..595ab25f9 100644 --- a/Jusin154_Team3D/Engine/Public/Camera.h +++ b/Jusin154_Team3D/Engine/Public/Camera.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "GameObject.h" @@ -9,10 +9,11 @@ class ENGINE_DLL CCamera abstract : public CGameObject public: typedef struct tagCameraDesc : public CTransform::TRANSFORM_DESC { - _float fFovy{}, fNear{}, fFar{}; - _uint iPriority = { UINT_MAX }; - CGameObject* pFollowTarget = { nullptr }; - CGameObject* pLookTarget = { nullptr }; + _float fFovy{}, fNear{}, fFar{}; + _uint iPriority = { UINT_MAX }; + const _wchar* pCameraKey = { }; + CGameObject* pFollowTarget = { nullptr }; + CGameObject* pLookTarget = { nullptr }; }CAMERA_DESC; protected: @@ -48,6 +49,7 @@ class ENGINE_DLL CCamera abstract : public CGameObject _bool m_bActive = { false }; + const _wchar* m_pCameraKey = { nullptr }; CGameObject* m_pFollowTarget = { nullptr }; CGameObject* m_pLookTarget = { nullptr }; @@ -65,4 +67,4 @@ class ENGINE_DLL CCamera abstract : public CGameObject virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Camera_Manager.h b/Jusin154_Team3D/Engine/Public/Camera_Manager.h index 49b20ed78..a6c31d7dc 100644 --- a/Jusin154_Team3D/Engine/Public/Camera_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Camera_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" NS_BEGIN(Engine) @@ -17,8 +17,9 @@ class CCamera_Manager final : public CBase HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority); HRESULT IsBinded_Camera(const _wstring& wstrCameraKey); - const _float* Get_CurrentCameraFar(); + void Force_CamPosition(_fvector vPos); + const _float* Get_CurrentCameraFar(); private: ID3D11Device* m_pDevice = { nullptr }; @@ -42,4 +43,4 @@ class CCamera_Manager final : public CBase virtual void Free()override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/CanvasObject.h b/Jusin154_Team3D/Engine/Public/CanvasObject.h index 340cf5174..b36e37cf5 100644 --- a/Jusin154_Team3D/Engine/Public/CanvasObject.h +++ b/Jusin154_Team3D/Engine/Public/CanvasObject.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "UIObject.h" @@ -34,10 +34,10 @@ class ENGINE_DLL CCanvasObject abstract : public CUIObject virtual void Add_Panel(wstring Name, class CGameObject* pPanel); protected: - vector m_Panels; // ĵ¹ö½º°¡ ÆÐ³ÎµéÀ» °ü¸® Çϱâ À§Çؼ­ ÇÊ¿äÇÔ - vector m_PanelNames; // ÆÐ³ÎµéÀÇ À̸§À» ÀüÇØÁÖ±â À§Çؼ­ - map m_Panels_map; // ĵ¹ö½º¿¡¼­ ³»°¡ ¿øÇÏ´Â ÆÐ³ÎÀ» ã±â À§Çؼ­ - _int m_iPanel_Count{}; // Àüü ÆÐ³ÎÀÇ °¹¼ö + vector m_Panels; // 캔버스가 패ë„�들ì�„ 관리 하기 위해서 필요함 + vector m_PanelNames; // 패ë„�들ì�˜ ì�´ë¦„ì�„ 전해주기 위해서 + map m_Panels_map; // 캔버스ì—�서 ë‚´ê°€ ì›�하는 패ë„�ì�„ 찾기 위해서 + _int m_iPanel_Count{}; // ì „ì²´ 패ë„�ì�˜ 갯수 private: virtual class CGameObject* Find_Panel(const wstring& Name); diff --git a/Jusin154_Team3D/Engine/Public/Cell.h b/Jusin154_Team3D/Engine/Public/Cell.h index 7c77f2e8f..e79bfb399 100644 --- a/Jusin154_Team3D/Engine/Public/Cell.h +++ b/Jusin154_Team3D/Engine/Public/Cell.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index fb1379f26..cba4f9bf1 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -19,37 +19,39 @@ class ENGINE_DLL CChannel : public CBase #endif // EDITOR_PROJECT public: - void Update_TransformationMatirx(const vector& Bones, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex); + void Update_TransformationMatirx(const vector& Bones, _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 }; } KEYFRAME* Get_Frame(_uint iIndex); void Set_Frame(_uint iIndex, KEYFRAME& kf); _bool Compare_Name(const _char* pChannelname) const { return !strcmp(pChannelname, m_szName); } + _char* Get_Name() { return m_szName; } private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ HRESULT Initialize(const class CModel* pModel, SaveChannel* pSaveChannel); // HRESULT Initialize(const vector& Bones, _uint iIndex); private: - _char m_szName[MAX_PATH] = {}; // ¿µÇâÀ» ¹ÞÀ» º»ÀÇ À̸§ - _int m_iBoneIndex = { -1 }; // º» º¤ÅÍ¿¡¼­ º»ÀÇ À妽º - _uint m_iNumKeyFrames = {}; // AnimationÀÇ m_fDurationµ¿¾È ÀÌ º»ÀÌ ÃëÇØ¾ßÇÒ Å°ÇÁ·¹ÀÓÀÇ °¹¼ö + _char m_szName[MAX_PATH] = {}; // ì˜�í–¥ì�„ ë°›ì�„ 본ì�˜ ì�´ë¦„ + _int m_iBoneIndex = { -1 }; // 본 벡터ì—�서 본ì�˜ ì�¸ë�±ìФ + _uint m_iNumKeyFrames = {}; // Animationì�˜ m_fDurationë�™ì•ˆ ì�´ 본ì�´ 취해야할 키프레임ì�˜ 갯수 _float4x4 m_PreTransformMatrix = {}; - vector m_KeyFrames; // ŰÇÁ·¹ÀÓ º¤ÅÍ - + vector m_KeyFrames; // 키프레임 벡터 + _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; public: - static CChannel* Create(const vector& Bones, _uint iIndex); // ·²ÇÁÀü¿ë + static CChannel* Create(const vector& Bones, _uint iIndex); // 럴프전용 static CChannel* Create(HANDLE hFile, DWORD& dwByte); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel); // virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 5e92e8839..baf5c7826 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" NS_BEGIN(Engine) @@ -8,69 +8,69 @@ class ENGINE_DLL CCharacter_Controller final : { /* dev-treadmill.tistory.com/158 */ /* dev-treadmill.tistory.com/159 */ + // 기본ì �으로 아무 힘ë�„ 받지 않는, 주지 않는 놈임 + // kinematic 기반임 public: #pragma region STRUCT struct CapsuleInfo { - _float fRadius; - _float fHeight; - PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // ±âº» (eEASY, stepOffset °ªÀÌ ¹«Á¦ÇÑ), (eCONSTRAINED, stepOffset °ªÀÌ Á¦´ë·Î ¸ÔÀ½) }; typedef struct tagCharacter_ControllerDesc { - CTransform* pTransform = { nullptr }; - ACTOR eBodyType = { ACTOR::END }; - _float fContactOffset = { 0.f }; - _float3 fMaterial = { 0.5f, 0.5f, 0.6f }; - _bool bAutoStepping = { false }; // °è´Ü ³ôÀÌ Å¸°Ô ÇÒ°ÇÁö // ¹Ú½º ÄݶóÀÌ´õ´Â »ý°¢ÇÑ´ë·Î µÇ´Âµ¥ ĸ½¶Àº ¹Ù´ÚÀÇ ±¸Ã¼ ¶§¹®¿¡ ¿¹»óº¸´Ù ´õ ³ôÀº °÷±îÁö ¿À¸¦ ¼ö ÀÖÀ½ - _float fStepOffset = { 0.05f }; // Çã¿ë°¡´ÉÇÑ °è´Ü ³ôÀÌ, ÀÛ°Ô À¯ÁöÇÏ´Â°Ô ÁÁÀ½ + CTransform* pTransform = { nullptr }; + ACTOR eBodyType = { ACTOR::END }; + _float fContactOffset = { 0.f }; + _float3 fMaterial = { 0.5f, 0.5f, 0.6f }; + _bool bAutoStepping = { false }; // 계단 높ì�´ 타게 í• ê±´ì§€ // 박스 콜ë�¼ì�´ë�”는 ìƒ�ê°�한대로 ë�˜ëŠ”ë�° 캡ìŠ�ì�€ 바닥ì�˜ 구체 때문ì—� 예ìƒ�보다 ë�” 높ì�€ 곳까지 오를 수 있ì�Œ + _float fStepOffset = { 0.05f }; // 허용가능한 계단 높ì�´, 작게 유지하는게 좋ì�Œ - function funcHitCallback = { nullptr }; - function funcBehaviorCallback = { nullptr }; + void* pCallback = { }; // moveê°€ 호출ë�  때 호출 ë�¨ // dllì�„ 받는 ê°� 프로ì �트ì—�서 CCollision_Callback ì�„ 구현해야함 - // Ÿ°í ¿Ã¶ó°¥ ¼ö ¾ø´Â °æ»ç¸éÀÇ °¢µµ¸¦ Á¤ÀÇÇÔ. 0.f ¸é ºñȰ¼ºÈ­ µÊ - // _float fSlopeLimit = { ÄÚ»çÀΰ¢µµ }; + // 타고 올ë�¼ê°ˆ 수 없는 경사면ì�˜ ê°�ë�„를 ì •ì�˜í•¨. 0.f ë©´ 비활성화 ë�¨ + // _float fSlopeLimit = { 코사ì�¸ê°�ë�„ }; - union - { - _float3 vBoxSize; // ¹Ú½º´Â AABBÀÓ - CapsuleInfo tCapsuleInfo; - }; + + + // Boxì�¸ 경우 채워넣기 + _float3 vBoxSize = { 0.5f, 0.5f, 0.5f }; // CCT박스는 회전없는 AABBìž„ + + // Capsuleì�¸ 경우 채워넣기 + _float fRadius; + _float fHeight; + PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset ê°’ì�´ 무제한), (eCONSTRAINED, stepOffset ê°’ì�´ 제대로 먹ì�Œ) }Character_Controller_DESC; #pragma endregion private: CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CCharacter_Controller(const CCharacter_Controller& rhs); virtual ~CCharacter_Controller() = default; + public: #ifdef _DEBUG virtual HRESULT Render() override; #endif - _float Get_ContactOffset() const { return m_pController->getContactOffset(); } - void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); } + _float Get_ContactOffset() const { return m_pController->getContactOffset(); } + void Set_ContactOffset(_float fValue) { return m_pController->setContactOffset((PSX::PxF32)fValue); } - void Move(_float fTimeDelta); // À̵¿ - void Set_Position(_fvector vNewPos); // ¼ø°£À̵¿ - _vector Get_Position(); - _float3 Get_FootPosition(); // ContactOffsetÀÌ °í·ÁµÈ ¹ß¹Ù´Ú À§Ä¡( ½ÇÁ¦º¸´Ù ´õ ¾Æ·¡¿¡ À§Ä¡ÇÑ´Ù´Â ¶æ ) + void Move(_float fTimeDelta); // ì�´ë�™ // ì¶©ë�Œë³´ì •ë§Œ 있ì�Œ, + void Set_Position(_fvector vNewPos); // 순간ì�´ë�™ + _vector Get_Position(); + _float3 Get_FootPosition(); // ContactOffsetì�´ ê³ ë ¤ë�œ 발바닥 위치( 실제보다 바닥 위치가 ë�” 아래ì—� 위치한다는 뜻 ) - - void Resize_Volume(_float fHeight); // ³ôÀ̸¦ ¼öÁ¤ÇÏ°í ¹Ù´Ú¿¡ ºÙÀÓ - void Modify_Volume(_float3 fVolume); - _float3 Get_Volume(); + void Resize_Volume(_float fHeight); // 높ì�´ë¥¼ 수정하고 바닥ì—� 붙임 + void Modify_Volume(_float3 fVolume); + _float3 Get_Volume(); private: ACTOR m_eBodyType = { ACTOR::END }; PSX::PxController* m_pController = { nullptr }; CTransform* m_pTransform = { nullptr }; _bool m_bAutoStepping = { false }; - _float m_fSlopeLimit = { 0.f }; // cosf + _float m_fSlopeLimit = { 0.f }; // cosfê°�ë�„, 오르막 경사ê°� 제한. ( 추가설정 필요함 ) + PhsXUserData m_tagData = {}; - - function m_funcHitCallback = { nullptr }; - function m_funcBehaviorCallback = { nullptr }; - PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};; + PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {}; #ifdef _DEBUG unique_ptr m_pMainShape = { nullptr }; unique_ptr m_pSubShape = { nullptr }; @@ -79,6 +79,10 @@ class ENGINE_DLL CCharacter_Controller final : private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +#ifdef _DEBUG + virtual HRESULT Debug_Initialize(); +#endif // _DEBUG + _bool Check_Overlap(); @@ -89,4 +93,4 @@ class ENGINE_DLL CCharacter_Controller final : virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Collider.h b/Jusin154_Team3D/Engine/Public/Collider.h index 538ece0c7..01c399467 100644 --- a/Jusin154_Team3D/Engine/Public/Collider.h +++ b/Jusin154_Team3D/Engine/Public/Collider.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" #include "Bounding_AABB.h" #include "Bounding_OBB.h" diff --git a/Jusin154_Team3D/Engine/Public/Collider_Manager.h b/Jusin154_Team3D/Engine/Public/Collider_Manager.h index 487b5ef35..205896621 100644 --- a/Jusin154_Team3D/Engine/Public/Collider_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Collider_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" diff --git a/Jusin154_Team3D/Engine/Public/Collision_Callback.h b/Jusin154_Team3D/Engine/Public/Collision_Callback.h new file mode 100644 index 000000000..d413812ce --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Collision_Callback.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Base.h" + +class CCollision_Callback final : public PSX::PxUserControllerHitReport, PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBodyì�˜ PxSimulationEventCallbackì—� 안걸리고, ì�´ ì „ìš© 콜백ì—�서 처리ë�˜ëŠ” 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(ì�´ë²¤íЏ 알림)" + // PxControllerBehaviorCallback = "부딪힌 것ì—� 대해 ì–´ë–¤ í–‰ë�™ ì •ì±…ì�„ 쓸지 물어봄(질ì�˜)" + // PxSimulationEventCallback = "씬 ì „ì²´ì—� 대한 글로벌 콜백(ì�¼ë°˜ 물리 ì�´ë²¤íЏ)" + +public: + NO_COPY(CCollision_Callback) + CCollision_Callback(); + ~CCollision_Callback()=default; + +public: + // PxUserControllerHitReportì�„(를) 통해 ìƒ�ì†�ë�¨ + // ì¶©ë�Œì•Œë¦¼!! + // 주ì�¸ì�´ ë�˜ëŠ” CCTê°€ ì�´ 물체ì—� 대해 어떻게 ë°˜ì�‘해야 할까? + virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우 + + virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우 + + virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용ìž� ì •ì�˜ 장애물과 부딪힌 경우 + + + // PxControllerBehaviorCallbackì�„(를) 통해 ìƒ�ì†�ë�¨ + // ì¶©ë�Œì•Œë¦¼ì�´ 아닌, í–‰ë�™ì •ì±… 정해주기. CCT vs CCT는 ì§€ì›�안함 + // slopeLimit로 미ë�„러져 ê°ˆ 수 있는지 없는지 ì�´ë¶„법ì �ì�¸ 계산 대신, ì›�하는 물체ì—� 대해서만 미ë�„러운 표면으로 ì •ì�˜í•´ì¤Œ + // 주ì�¸ì�´ ë�˜ëŠ” CCTê°€ ì�´ 물체ì—� 대해 ì�´ 물체를 어떻게 해야 할까? -> (타고 올ë�¼ê°ˆê¹Œ? Ride?) (미ë�„러져갈까? Slide?) ( ì§�ì ‘ ë‚´ê°€ 구현할까? user defined ride? ) + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) override; + + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override; + + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override; +}; + diff --git a/Jusin154_Team3D/Engine/Public/Component.h b/Jusin154_Team3D/Engine/Public/Component.h index 4ff590597..9fed78368 100644 --- a/Jusin154_Team3D/Engine/Public/Component.h +++ b/Jusin154_Team3D/Engine/Public/Component.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -30,7 +30,7 @@ class ENGINE_DLL CComponent abstract : public CBase virtual void Free(); #ifdef _DEBUG - virtual void Describe_Entity()PURE; // IMGUI Àü¿ë + virtual void Describe_Entity()PURE; // IMGUI ì „ìš© #endif }; diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index 4d3a00a4a..d13457208 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -47,9 +47,9 @@ class ENGINE_DLL CComputeShader final : public CBase private: - _uint m_iNumElement = 0; // Àμö °³¼ö - _uint m_iNumInputBuffer = 0; // ÀÎDz ¹öÆÛÀÇ °³¼ö - _uint m_iNumOutputBuffer = 0; // ÀÎDz ¹öÆÛÀÇ °³¼ö + _uint m_iNumElement = 0; // ì�¸ìˆ˜ 개수 + _uint m_iNumInputBuffer = 0; // ì�¸í’‹ 버í�¼ì�˜ 개수 + _uint m_iNumOutputBuffer = 0; // ì�¸í’‹ 버í�¼ì�˜ 개수 public: static CComputeShader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iNumOutputBuffer, _uint iInputStructStride[], _uint iOutputStructStride[]); diff --git a/Jusin154_Team3D/Engine/Public/DebugDraw.h b/Jusin154_Team3D/Engine/Public/DebugDraw.h index 452e66726..1162ea2d5 100644 --- a/Jusin154_Team3D/Engine/Public/DebugDraw.h +++ b/Jusin154_Team3D/Engine/Public/DebugDraw.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: DebugDraw.h // // Helpers for drawing various debug shapes using PrimitiveBatch diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/Audio.h b/Jusin154_Team3D/Engine/Public/DirectXTK/Audio.h index ffb3896fb..14171b1fe 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/Audio.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/Audio.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: Audio.h // // DirectXTK for Audio header diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/BufferHelpers.h b/Jusin154_Team3D/Engine/Public/DirectXTK/BufferHelpers.h index cd462d818..838758d14 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/BufferHelpers.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/BufferHelpers.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: BufferHelpers.h // // Copyright (c) Microsoft Corporation. diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/DDSTextureLoader.h b/Jusin154_Team3D/Engine/Public/DirectXTK/DDSTextureLoader.h index ff2b1ee30..77035e793 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/DDSTextureLoader.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/DDSTextureLoader.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: DDSTextureLoader.h // // Functions for loading a DDS texture and creating a Direct3D runtime resource for it diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/DirectXHelpers.h b/Jusin154_Team3D/Engine/Public/DirectXTK/DirectXHelpers.h index ffc9d9746..920572be7 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/DirectXHelpers.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/DirectXHelpers.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: DirectXHelpers.h // // Copyright (c) Microsoft Corporation. diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/Effects.h b/Jusin154_Team3D/Engine/Public/DirectXTK/Effects.h index aa32fff69..7280d4805 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/Effects.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/Effects.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: Effects.h // // Copyright (c) Microsoft Corporation. diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/GamePad.h b/Jusin154_Team3D/Engine/Public/DirectXTK/GamePad.h index 03e372bcd..684807275 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/GamePad.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/GamePad.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: GamePad.h // // Copyright (c) Microsoft Corporation. diff --git a/Jusin154_Team3D/Engine/Public/DirectXTK/GeometricPrimitive.h b/Jusin154_Team3D/Engine/Public/DirectXTK/GeometricPrimitive.h index 5d6f37700..bc72ce08d 100644 --- a/Jusin154_Team3D/Engine/Public/DirectXTK/GeometricPrimitive.h +++ b/Jusin154_Team3D/Engine/Public/DirectXTK/GeometricPrimitive.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: GeometricPrimitive.h // // Copyright (c) Microsoft Corporation. diff --git a/Jusin154_Team3D/Engine/Public/ElementObject.h b/Jusin154_Team3D/Engine/Public/ElementObject.h index 0a728b3cb..7cf53aa8f 100644 --- a/Jusin154_Team3D/Engine/Public/ElementObject.h +++ b/Jusin154_Team3D/Engine/Public/ElementObject.h @@ -21,7 +21,14 @@ class ENGINE_DLL CElementObject abstract : public CUIObject public: virtual void Visible(_bool bVisible) override; virtual _bool Chack_Visible() override; - + virtual void Nine_Slice_Left(_float X) override; + virtual void Nine_Slice_Right(_float Y) override; + virtual void Nine_Slice_Top(_float Z) override; + virtual void Nine_Slice_Bottom(_float W) override; + virtual _float Get_Nine_Slice_Left() override; + virtual _float Get_Nine_Slice_Right() override; + virtual _float Get_Nine_Slice_Top() override; + virtual _float Get_Nine_Slice_Bottom() override; protected: virtual HRESULT Initialize_Prototype(); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 01b17de36..32fb7e138 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -73,11 +73,11 @@ enum aiTextureType { #endif // !EDITOR_PROJECT enum class PHYSX_KIND { - NOT_DEFINED = 0, - CCTActor = 1, - OBSTACLEActor = 2, - BODY_STATIC = 3, - BODY_DYNAMIC = 4, + NOT_DEFINED, + BODY_STATIC, + BODY_DYNAMIC, + CCTActor, + OBSTACLEActor, }; NS_END @@ -174,4 +174,4 @@ NS_END // // PhysX Particle들ì�´ 닿는 순간 ê·¸ 파티í�´ì�„ 'í�¡ìˆ˜'해서 제거함 // // (default = off) // [ePARTICLE_DRAIN], -//}; \ No newline at end of file +//}; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Function.h b/Jusin154_Team3D/Engine/Public/Engine_Function.h index 2937e7b56..6ce4121da 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Function.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Function.h @@ -24,7 +24,7 @@ void Safe_Delete_Array(T& Pointer) } template -unsigned long Safe_AddRef(T& pInstance) +unsigned long SAFE_ADDREF(T& pInstance) { unsigned long dwRefCnt = 0; @@ -47,6 +47,19 @@ unsigned long Safe_Release(T& pInstance) return dwRefCnt; } +static PSX::PxTransform XMWorldToPx_NoScale(const _fmatrix& WorldMatrix) +{ + _vector vPos, vRotq, vScale; + XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); + + vRotq = XMQuaternionNormalize(vRotq); + + PSX::PxTransform out; + XMStoreFloat3((_float3*)&out.p, vPos); + XMStoreFloat4((_float4*)&out.q, vRotq); + return out; +} + static void GUIHelpMarker(const char* desc) { GUI::SameLine(); @@ -60,4 +73,4 @@ static void GUIHelpMarker(const char* desc) } } -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index e6fb9b42c..00bf5e20e 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -140,4 +140,4 @@ constexpr unsigned int g_iMaxShadowHeight = 9216; s_pInstance = nullptr; \ } \ return iRefCnt; \ - } \ No newline at end of file + } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index a053164a4..aa8a0f72a 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -38,15 +38,20 @@ struct LERPDESC { typedef struct tagLightDesc { - LIGHT eType = {}; - _float4 vDiffuse = {}; - _float4 vAmbient = {}; - _float4 vSpecular = {}; + LIGHT eType = {}; + _float4 vDiffuse = {}; + _float4 vAmbient = {}; + _float4 vSpecular = {}; - _float4 vDirection = {}; - _float4 vPosition = {}; - _float fRange = {}; - _float2 vSpotAngles = {}; + const XMFLOAT4* pDirection = nullptr; + const XMFLOAT4* pPosition = nullptr; + + _float4 vPosOffset = {}; + + _float fRange = {}; + _float2 vSpotAngles = {}; + + _uint iLevel = {}; }LIGHT_DESC; typedef struct tagShadowLight @@ -312,14 +317,18 @@ typedef struct tagVertexModelInstanceParticleDesc typedef struct tagPhsXUserData { - PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + + PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + _uint iSubKind = UINT_MAX; class CGameObject* pOwner = { nullptr }; _float4x4 m_BeforeMatrix = { }; + union { class CRigidBody* pBody; class CCharacter_Controller* pCharacter; class CObstacle_Controller* pObstacle = { nullptr }; }; + }PhsXUserData; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/FX11/d3dx11effect.h b/Jusin154_Team3D/Engine/Public/FX11/d3dx11effect.h index 76f3d2ba0..8926284aa 100644 --- a/Jusin154_Team3D/Engine/Public/FX11/d3dx11effect.h +++ b/Jusin154_Team3D/Engine/Public/FX11/d3dx11effect.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: D3DX11Effect.h // // Direct3D 11 Effect Types & APIs Header diff --git a/Jusin154_Team3D/Engine/Public/FX11/d3dxGlobal.h b/Jusin154_Team3D/Engine/Public/FX11/d3dxGlobal.h index ee23c9fa9..1a29c398e 100644 --- a/Jusin154_Team3D/Engine/Public/FX11/d3dxGlobal.h +++ b/Jusin154_Team3D/Engine/Public/FX11/d3dxGlobal.h @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- // File: D3DXGlobal.h // // Direct3D 11 Effects helper defines and data structures diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 0433ef372..7b2e7446e 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Prototype_Manager.h" #include "GameObject_Manager.h" @@ -66,7 +66,7 @@ class ENGINE_DLL CGameInstance final : public CBase } template - void 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, Engine::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); } @@ -132,9 +132,10 @@ class ENGINE_DLL CGameInstance final : public CBase const _vector Get_CamXMPosition(); #pragma endregion #pragma region LIGHT_MANAGER - HRESULT On_Light(_uint iLevel, const _wstring& wstrLightKey, const LIGHT_DESC& LightDesc, class CLight** ppOut); - HRESULT Off_Light(_uint iLevel, const _wstring& wstrLightKey); - HRESULT Render_Lights(class CShader* pShader, class CVIBuffer* pVIBuffer); + void Add_Light(_uint _iCurrentLevel, class CLight* _pLight); + void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); + const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel, _uint _iLightIndex); + HRESULT Render_Lights(_uint _iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); #pragma endregion #pragma region COLLIDER_MANAGER HRESULT Add_ColliderGroup(_uint iColliderGroup, class CCollider* pBounding); @@ -152,8 +153,8 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); #ifdef _DEBUG - HRESULT Ready_RenderTarget_Debug(const _wstring& strTargetTag, _float fX, _float fY, _float fSizeX, _float fSizeY); - HRESULT Render_RenderTarget_Debug(const _wstring& strMRTTag, class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); + void RenderTarget_Debuger(); + HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); #endif // _DEBUG #pragma endregion #pragma region CAMERA_MANAGER @@ -163,6 +164,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority); HRESULT IsBinded_Camera(const _wstring& strCameraKey); const _float* Get_CurrentCameraFar(); + void Force_CamPosition(_fvector vPos); #pragma endregion #pragma region SHADOW @@ -178,20 +180,22 @@ class ENGINE_DLL CGameInstance final : public CBase _bool isPicking(_float3* pOut); #pragma endregion #pragma region PhysX_Manager - PSX::PxMaterial* Get_Material(_float3* vMatInfo); + PSX::PxMaterial* Create_Material(_float3* vMatInfo); void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh); - const PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody); - const PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody); + PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody); + PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody); PSX::PxController* Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc); PSX::PxController* Add_BoxController(PSX::PxBoxControllerDesc& Desc); PSX::PxController* Get_Controller(_uint iControllerIndex); void ReleaseController(_uint iControllerIndex); + void Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor); + void Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor); HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity()); HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); - HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); // ¸ðµ¨ ºÒ·¯¿Ô´ø °æ·Î¿¡ ±×´ë·Î ÀÖÀ½ + HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); // 모ë�¸ 불러왔ë�˜ 경로ì—� 그대로 있ì�Œ #pragma endregion @@ -254,4 +258,4 @@ class ENGINE_DLL CGameInstance final : public CBase virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index d4d1daa8c..4d068bad7 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Transform.h" #include "GameInstance.h" @@ -22,12 +22,12 @@ class ENGINE_DLL CGameObject abstract virtual HRESULT Render_Shadow() { return S_OK; } virtual HRESULT Render_Blur() { return S_OK; } - virtual _float Get_Depth(); // z ¼ÒÆÃ ÇÒ ¶§ ¾²½Ã¸é µÊ + virtual _float Get_Depth(); // z 소팅 í•  때 쓰시면 ë�¨ - // ³»°¡ ¸ÂÀ½ ( Collider_Manager°¡ ºÎ¸§ ) + // ë‚´ê°€ ë§žì�Œ ( Collider_Managerê°€ 부름 ) virtual void OnCollision(CGameObject* pOther = nullptr); - // ³»°¡ ¶§¸² ( È÷Æ®¹Ú½º°¡ ºÎ¸§ ) + // ë‚´ê°€ 때림 ( 히트박스가 부름 ) virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr); virtual _vector Get_WorldPostion(); diff --git a/Jusin154_Team3D/Engine/Public/GameObject_Manager.h b/Jusin154_Team3D/Engine/Public/GameObject_Manager.h index 795b351a3..39d622ba3 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject_Manager.h +++ b/Jusin154_Team3D/Engine/Public/GameObject_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -34,6 +34,12 @@ class ENGINE_DLL CGameObject_Manager final : public CBase static CGameObject_Manager* Create(_uint iNumLevels); virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity(); +#endif // _DEBUG + + + }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Graphic_Device.h b/Jusin154_Team3D/Engine/Public/Graphic_Device.h index c3910cba8..bcc42305a 100644 --- a/Jusin154_Team3D/Engine/Public/Graphic_Device.h +++ b/Jusin154_Team3D/Engine/Public/Graphic_Device.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" diff --git a/Jusin154_Team3D/Engine/Public/IMGUI/imconfig.h b/Jusin154_Team3D/Engine/Public/IMGUI/imconfig.h index 4dab1b604..8bd07e2a1 100644 --- a/Jusin154_Team3D/Engine/Public/IMGUI/imconfig.h +++ b/Jusin154_Team3D/Engine/Public/IMGUI/imconfig.h @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // DEAR IMGUI COMPILE-TIME OPTIONS // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. diff --git a/Jusin154_Team3D/Engine/Public/IMGUI/imgui_internal.h b/Jusin154_Team3D/Engine/Public/IMGUI/imgui_internal.h index e92ab7b5c..bbb68a086 100644 --- a/Jusin154_Team3D/Engine/Public/IMGUI/imgui_internal.h +++ b/Jusin154_Team3D/Engine/Public/IMGUI/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.92.2 WIP +// dear imgui, v1.92.2 WIP // (internal structures/api) // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. diff --git a/Jusin154_Team3D/Engine/Public/IMGUI/imstb_rectpack.h b/Jusin154_Team3D/Engine/Public/IMGUI/imstb_rectpack.h index f6917e7a6..df7f81888 100644 --- a/Jusin154_Team3D/Engine/Public/IMGUI/imstb_rectpack.h +++ b/Jusin154_Team3D/Engine/Public/IMGUI/imstb_rectpack.h @@ -1,4 +1,4 @@ -// [DEAR IMGUI] +// [DEAR IMGUI] // This is a slightly modified version of stb_rect_pack.h 1.01. // Grep for [DEAR IMGUI] to find the changes. // diff --git a/Jusin154_Team3D/Engine/Public/IMGUI/imstb_textedit.h b/Jusin154_Team3D/Engine/Public/IMGUI/imstb_textedit.h index 33eef7095..ec2659452 100644 --- a/Jusin154_Team3D/Engine/Public/IMGUI/imstb_textedit.h +++ b/Jusin154_Team3D/Engine/Public/IMGUI/imstb_textedit.h @@ -1,4 +1,4 @@ -// [DEAR IMGUI] +// [DEAR IMGUI] // This is a slightly modified version of stb_textedit.h 1.14. // Those changes would need to be pushed into nothings/stb: // - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321) diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index 58dea1a6d..763cfe150 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" #include "Assimp/scene.h" @@ -10,19 +10,19 @@ class ENGINE_DLL CInstance_Model final : public CComponent public: typedef struct tagInstanceDesc { - _int iNumInstance = { 1 }; // ÀνºÅϽº °³¼ö + _int iNumInstance = { 1 }; // ì�¸ìŠ¤í„´ìŠ¤ 개수 _bool isLoop = { true }; _bool isBillboard = { false }; - _float2 vLifeTime = { 1.f , 1.f }; // ¶óÀÌÇÁ ŸÀÓ min , max - _float3 vSizeMin = { 1.f, 1.f ,1.f }; // »çÀÌÁî min xyz - _float3 vSizeMax = { 1.f ,1.f ,1.f }; // »çÀÌÁî max xyz - _float3 vRotationAngleMin = {}; // ·ÎÅ×ÀÌ¼Ç min x y z for angle - _float3 vRotationAngleMax = {};// ·ÎÅ×ÀÌ¼Ç max x y z for angle - _float2 vRotationSpeed = {}; // ·ÎÅ×ÀÌ¼Ç ½ºÇǵå min , max - _float2 vSpeed = {}; // ½ºÇǵå min , max - _float3 vCenter = {}; // ¼¾ÅÍ À§Ä¡ - _float3 vRange = {}; // À§Ä¡ ¹üÀ§ + _float2 vLifeTime = { 1.f , 1.f }; // ë�¼ì�´í”„ 타임 min , max + _float3 vSizeMin = { 1.f, 1.f ,1.f }; // 사ì�´ì¦ˆ min xyz + _float3 vSizeMax = { 1.f ,1.f ,1.f }; // 사ì�´ì¦ˆ max xyz + _float3 vRotationAngleMin = {}; // 로테ì�´ì…˜ min x y z for angle + _float3 vRotationAngleMax = {};// 로테ì�´ì…˜ max x y z for angle + _float2 vRotationSpeed = {}; // 로테ì�´ì…˜ 스피드 min , max + _float2 vSpeed = {}; // 스피드 min , max + _float3 vCenter = {}; // 센터 위치 + _float3 vRange = {}; // 위치 범위 _float2 vMaskingUVMoveTime = { 1.f, 1.f }; _float2 vDiffuseUVMoveTime = { 1.f, 1.f }; @@ -75,25 +75,29 @@ class ENGINE_DLL CInstance_Model final : public CComponent public: #ifdef EDITOR_PROJECT virtual HRESULT Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); - + HRESULT Save_InstanceModel(HANDLE hFile); #endif virtual HRESULT Initialize(void* pArg) override; void Drop(_float fTimeDelta); public: - HRESULT Render(_uint iMeshIndx); + HRESULT Render(_uint iMeshIndx); void Instane_Buffer_ReStruct(); _uint Get_NumMeshes() const { return m_iNumMeshes; } - HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); + HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); INSTANCE_DESC Get_EffectValue() { return m_InstanceDesc; } + HRESULT Load_InstanceModel(HANDLE hFile); private: #ifdef EDITOR_PROJECT HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); HRESULT Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix); + #endif + HRESULT Change_NumInstance(); - HRESULT Create_Instance_Buffer(const INSTANCE_DESC* pDesc); + HRESULT Create_Instance_Buffer(); HRESULT Create_SubResource_Buffer(); + HRESULT Create_CS(); private: ID3D11Buffer* m_pVBInstance = { nullptr }; @@ -111,12 +115,12 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float4x4 m_PreTransformMatrix = {}; vector m_Meshes = {}; - vector m_Bones = {}; // ³ªÁß¿¡ Ȥ½Ã ¾Ö´Ô¸Þ½¬¸¦ ÀνºÅÏ½Ì ÇÒ ÀÏÀÌ ÀÖÀ»Áöµµ ¸ð¸£´Ï ³²°Ü³õÀ½ + vector m_Bones = {}; // 나중ì—� 혹시 애님메쉬를 ì�¸ìŠ¤í„´ì‹± í•  ì�¼ì�´ 있ì�„ì§€ë�„ 모르니 남겨놓ì�Œ private: class CComputeShader* m_pComputeShader = {}; - ID3D11Buffer* m_pConstantBuffer = { nullptr }; // ÄÄǻƮ ½¦À̵å Àü¿ë »ó¼ö¹öÆÛ - ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // ÄÄǻƮ ½¦ÀÌµå µÎ¹øÂ° ¹öÆÛ (½ºÇǵå, ·ÎÅ×À̼Ç) + ID3D11Buffer* m_pConstantBuffer = { nullptr }; // 컴퓨트 ì‰�ì�´ë“œ ì „ìš© ìƒ�수버í�¼ + ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // 컴퓨트 ì‰�ì�´ë“œ ë‘�번째 버í�¼ (스피드, 로테ì�´ì…˜) public: #ifdef EDITOR_PROJECT @@ -127,4 +131,4 @@ class ENGINE_DLL CInstance_Model final : public CComponent void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Layer.h b/Jusin154_Team3D/Engine/Public/Layer.h index 7bb2cfef1..cb6ea67c4 100644 --- a/Jusin154_Team3D/Engine/Public/Layer.h +++ b/Jusin154_Team3D/Engine/Public/Layer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" NS_BEGIN(Engine) @@ -7,7 +7,7 @@ class ENGINE_DLL CLayer final : public CBase { private: CLayer(); - virtual ~CLayer(); + virtual ~CLayer() = default; public: virtual void Priority_Update(_float fTimeDelta); virtual void Update(_float fTimeDelta); @@ -40,8 +40,13 @@ class ENGINE_DLL CLayer final : public CBase HRESULT Initialize(); public: - virtual void Free() override; static CLayer* Create(); + virtual void Free() override; + + +#ifdef _DEBUG + void Describe_Entity(); +#endif // _DEBUG }; diff --git a/Jusin154_Team3D/Engine/Public/Light.h b/Jusin154_Team3D/Engine/Public/Light.h index fe327fa26..ea5877295 100644 --- a/Jusin154_Team3D/Engine/Public/Light.h +++ b/Jusin154_Team3D/Engine/Public/Light.h @@ -1,13 +1,14 @@ -#pragma once -#include "Base.h" +#pragma once +#include "Component.h" NS_BEGIN(Engine) -class ENGINE_DLL CLight final : public CBase +class ENGINE_DLL CLight final : public CComponent { private: - CLight(); + CLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CLight(const CLight& rhs); virtual ~CLight() = default; public: @@ -15,15 +16,21 @@ class ENGINE_DLL CLight final : public CBase _bool operator==(const Engine::LIGHT_DESC& rhs) const; public: - HRESULT Replace_LightTo(_fvector vPosition); - HRESULT Initialize(const LIGHT_DESC& LightDesc); - HRESULT Render(class CShader* pShader, class CVIBuffer* pVIBuffer) const; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; +public: + const LIGHT_DESC* Get_LightDesc() { return &m_LightDesc; } +public: + HRESULT Render(class CShader* pShader, class CVIBuffer* pVIBuffer) const; private: - LIGHT_DESC m_LightDesc{}; + LIGHT_DESC m_LightDesc = {}; public: - static CLight* Create(const LIGHT_DESC& LightDesc); + static CLight* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CComponent* Clone(void* pArg, CGameObject* pOwner) override; virtual void Free() override; + void Describe_Entity() override; + }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Light_Manager.h b/Jusin154_Team3D/Engine/Public/Light_Manager.h index 10ce6bc90..c028d0752 100644 --- a/Jusin154_Team3D/Engine/Public/Light_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Light_Manager.h @@ -10,19 +10,22 @@ class CLight_Manager final : public CBase CLight_Manager(); virtual ~CLight_Manager() = default; + public: - HRESULT On_Light(_uint iLevel, const _wstring& wstrLightKey, const LIGHT_DESC& LightDesc, class CLight** ppOut); - HRESULT Off_Light(_uint iLevel, const _wstring& wstrLightKey); - HRESULT Render_Lights(class CShader* pShader, class CVIBuffer* pVIBuffer); - HRESULT Change_Level(_uint iLevel); + void Add_Light(_uint _iCurrentLevel, class CLight* _pLight); + void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); + void Light_Clear(_uint _iCurrentLevel); + const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel ,_uint _iLightIndex); + +public: + HRESULT Render_Lights(_uint _iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); private: - map<_wstring, list*>* m_pLights = { nullptr }; - _uint m_iNumLevel = {}; -private: - list* Find_Lights(_uint iLevel, const _wstring& wstrLightKey); - HRESULT Initialize(_uint iNumLevel); + HRESULT Initialize(_uint iNumLevels); +private: + _uint m_iLevelNumber = {}; + list* m_Lights = { nullptr }; public: static CLight_Manager* Create(_uint iNumLevel); virtual void Free() override; diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 2cdd0b66f..0398fb078 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" @@ -20,19 +20,19 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); #pragma endregion #pragma region Animation - void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // ¾Ö´Ï¸ÞÀ̼ÇÀ» ´Ù¸¥ À妽º·Î º¯°æÇÔ - _bool Play_Animation(_float fTimeDelta); // ¾Ö´Ï¸ÞÀ̼ǿ¡ µ¨Å¸Å¸ÀÓÀ» ³Ö¾îÁÜ - void RefreshAnim(); // ¾Ö´ÔÀ» ÇöÀç ¾Ö´ÔÀÇ Ãʱâ»óÅ·ΠµÇµ¹¸² + void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // 애니메ì�´ì…˜ì�„ 다른 ì�¸ë�±ìŠ¤ë¡œ 변경함 + _bool Play_Animation(_float fTimeDelta); // 애니메ì�´ì…˜ì—� ë�¸íƒ€íƒ€ìž„ì�„ 넣어줌 + void RefreshAnim(); // 애님ì�„ 현재 애님ì�˜ 초기ìƒ�태로 ë�˜ë�Œë¦¼ void Set_AnimationIndex(_uint iIndex, _bool isLoop = true); - void Stop_Animation(); // ¾Ö´Ï¸ÞÀ̼ÇÀ» Á¤Áö (Ãʱâ»óÅ·Î) + void Stop_Animation(); // 애니메ì�´ì…˜ì�„ ì •ì§€ (초기ìƒ�태로) _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } _bool IsFinishedLerp() const { return m_bIsFinishedLerp; } _float Get_AnimProgressRatio(); - _int Get_AnimProgressPostion(const char* pAnimChannelName); + _int Get_AnimProgressPostion(const _char* pAnimChannelName); _float Get_AnimEstimatedDuration(); void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition); - void Set_AnimPauseState(_bool bValue);// ¾Ö´ÔÀ» ÇöÀç»óÅ·ΠÁ¤Áö - void ReallocateResources(class CTransform* pTransform = nullptr); // ¾Ö´Ô À̵¿ÀÇ ´ë»ó Æ®·£½ºÆû(À̵¿½ÃÄѾßÇÒ Æ®·£½ºÆû)À» ÀçÁöÁ¤ÇÔ + void Set_AnimPauseState(_bool bValue);// 애님ì�„ 현재ìƒ�태로 ì •ì§€ + void ReallocateResources(class CTransform* pTransform = nullptr); // 애님 ì�´ë�™ì�˜ 대ìƒ� 트랜스í�¼(ì�´ë�™ì‹œì¼œì•¼í•  트랜스í�¼)ì�„ 재지정함 void Set_CurrentTrackPosition(_float TrackPosition); const _char* Get_AnimList(_uint iIndex); size_t Get_AnimSize() { return m_Animations.size(); } @@ -54,7 +54,7 @@ class ENGINE_DLL CModel final : public CComponent const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; _int Get_RootBoneIndex() const { return m_iRootBoneIndex; } void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; } -static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // º»ÀÇ º¤ÅÍ¿Í À̸§À» ³Ñ°ÜÁÖ¸é À妽º¸¦ ³Ñ°ÜÁÜ ( n ¼øÈ¸ ) +static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본ì�˜ 벡터와 ì�´ë¦„ì�„ 넘겨주면 ì�¸ë�±ìŠ¤ë¥¼ 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); #pragma endregion @@ -74,7 +74,7 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Animations(const aiScene* pAIScene); HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex); - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ _bool SaveAssimpModel(const _char* filename); _int SaveNodeRecursive(const aiNode* pAINode, std::vector& outNodes, _int parentIndex); // @@ -88,49 +88,49 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / #endif private: - MODEL m_eType = {}; // ¸ðµ¨ÀÇ Å¸ÀÔ - _float4x4 m_PreTransformMatrix = {}; // »çÀü¿¡ ·çÆ®º»¿¡ °öÇØÁÙ ¸ÅÆ®¸¯½º + MODEL m_eType = {}; // 모ë�¸ì�˜ 타입 + _float4x4 m_PreTransformMatrix = {}; // 사전ì—� 루트본ì—� 곱해줄 매트릭스 - _uint m_iNumMeshes = {}; // ¸Þ½¬ÀÇ °¹¼ö - vector m_Meshes; // ¸Þ½¬ÀÇ º¤ÅÍ - _uint m_iNumPhysXMeshes = {}; // ÇÇÁ÷½º ¸Þ½¬ÀÇ °¹¼ö - vector m_TriMeshes = {}; // ÇÇÁ÷½º ¸Þ½¬ÀÇ °¹¼ö + _uint m_iNumMeshes = {}; // 메쉬ì�˜ 갯수 + vector m_Meshes; // 메쉬ì�˜ 벡터 + _uint m_iNumPhysXMeshes = {}; // 피ì§�스 메쉬ì�˜ 갯수 + vector m_TriMeshes = {}; // 피ì§�스 메쉬ì�˜ 갯수 - _uint m_iNumMaterials = {}; // ¸ÓÅ׸®¾óÀÇ °¹¼ö - vector m_Materials; // ¸ÓÅ׸®¾óÀÇ º¤ÅÍ + _uint m_iNumMaterials = {}; // 머테리얼ì�˜ 갯수 + vector m_Materials; // 머테리얼ì�˜ 벡터 - vector m_Bones; // º»ÀÇ º¤ÅÍ, Á¤·Ä¼ø¼­´Â ·çÆ®º»ºÎÅÍ Æ®¸®ÀÇ ¸¶Áö¸· ³ëµå±îÁö + vector m_Bones; // 본ì�˜ 벡터, 정렬순서는 루트본부터 트리ì�˜ 마지막 노드까지 - _int m_iCurrentAnimIndex = { -1 }; // ÇöÀç ¼±ÅÃµÈ ¾Ö´Ï¸ÞÀÌ¼Ç ( m_AnimationsÀÇ À妽º ) - _uint m_iNumAnimations = {}; // ¾Ö´Ï¸ÞÀ̼ÇÀÇ Á¾·ù - _bool m_bIsLoop = { false }; // ·çÇÁ¾Ö´Ï¸ÞÀ̼ÇÀÎÁö - _bool m_bIsFinishedAnim = { false }; // ´ë»ó ¾Ö´Ï¸ÞÀ̼ÇÀÌ ³¡³µ´ÂÁö - _bool m_bIsFinishedLerp = { false }; // ·²ÇÁ ¾Ö´Ï¸ÞÀ̼ÇÀÌ ³¡³µ´ÂÁö + _int m_iCurrentAnimIndex = { -1 }; // 현재 ì„ íƒ�ë�œ 애니메ì�´ì…˜ ( m_Animationsì�˜ ì�¸ë�±ìФ ) + _uint m_iNumAnimations = {}; // 애니메ì�´ì…˜ì�˜ 종류 + _bool m_bIsLoop = { false }; // 루프애니메ì�´ì…˜ì�¸ì§€ + _bool m_bIsFinishedAnim = { false }; // 대ìƒ� 애니메ì�´ì…˜ì�´ ë��났는지 + _bool m_bIsFinishedLerp = { false }; // 럴프 애니메ì�´ì…˜ì�´ ë��났는지 _bool m_bPlayAnim = { true }; - vector m_Animations; // ¾Ö´Ï¸ÞÀ̼ÇÀÇ º¤ÅÍ, + vector m_Animations; // 애니메ì�´ì…˜ì�˜ 벡터, - class CLerpAnim* m_pLerpAnim = { nullptr }; // ·²ÇÁÀü¿ë ¾Ö´Ï¸ÞÀÌ¼Ç + class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메ì�´ì…˜ - _int m_iRootBoneIndex = { -1 }; // ·çÆ®º»ÀÇ À妽º - _matrix m_PrevAnimationMatrix = XMMatrixIdentity(); // ·çÆ®º»ÀÇ ÀÌÀü À§Ä¡ - _matrix m_DeltaAnimationMatrix = {}; // ·çÆ®º»ÀÇ µ¨Å¸¾Ö´Ï¸ÞÀÌ¼Ç - class CTransform* m_pTransform = { nullptr }; // ¸ðµ¨ ´ë»óÀÇ Æ®·£½ºÆû + _int m_iRootBoneIndex = { -1 }; // 루트본ì�˜ ì�¸ë�±ìФ + _matrix m_PrevAnimationMatrix = XMMatrixIdentity(); // 루트본ì�˜ ì�´ì „ 위치 + _matrix m_DeltaAnimationMatrix = {}; // 루트본ì�˜ ë�¸íƒ€ì• ë‹ˆë©”ì�´ì…˜ + class CTransform* m_pTransform = { nullptr }; // 모ë�¸ 대ìƒ�ì�˜ 트랜스í�¼ - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ SaveModel* m_pSaveModel = { nullptr }; list m_SaveModel; // private: - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); bool LoadData(const _char* filename); // virtual HRESULT Initialize(void* pArg) override; private: - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ HRESULT Ready_Meshes(); HRESULT Ready_Materials(const _char* pModelFilePath); HRESULT Ready_Bones(const std::vector& allNodes, _int currentIndex, _int parentIndex); @@ -138,7 +138,7 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / // public: - // ¹ÙÀ̳ʸ® + // ë°”ì�´ë„ˆë¦¬ static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix = XMMatrixIdentity()); // virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr); @@ -147,4 +147,4 @@ virtual void Free(); public: void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/PhysX/PxActor.h b/Jusin154_Team3D/Engine/Public/PhysX/PxActor.h index aeb490a4a..b0785c2fe 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/PxActor.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/PxActor.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/PxSceneDesc.h b/Jusin154_Team3D/Engine/Public/PhysX/PxSceneDesc.h index f72edc4a3..c2edf3161 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/PxSceneDesc.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/PxSceneDesc.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxController.h b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxController.h index 6eb2e45d4..c9db9be66 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxController.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxController.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerBehavior.h b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerBehavior.h index 0bb3cd593..91cee88f9 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerBehavior.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerBehavior.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerObstacles.h b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerObstacles.h index 1095725fb..b3239011e 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerObstacles.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/characterkinematic/PxControllerObstacles.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h b/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h index 719c49540..72e5911c4 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index ad0abf562..ae18d5506 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -17,14 +17,14 @@ class CPhysX_Manager final : public CBase public: /* dev-treadmill.tistory.com/155 */ -// HRESULT Update_RegionOfInterest(); ( Ãæµ¹ Äøµ, ÇÊÅ͸µµµ °Ë»öÇØ¾ßÇÔ ) -// Aggregate ( Ãæµ¹ ±×·ì, ÀÌ ±×·ì³¢¸®´Â ¼­·Î Ãæµ¹°Ë»ç¸¦ ÇÏÁö ¾ÊÀ½, ÁöÇü, ·¹±×µ¹ µî ) +// HRESULT Update_RegionOfInterest(); ( ì¶©ë�Œ 컬ë§�, í•„í„°ë§�ë�„ 검색해야함 ) +// Aggregate ( ì¶©ë�Œ 그룹, ì�´ 그룹ë�¼ë¦¬ëŠ” 서로 ì¶©ë�Œê²€ì‚¬ë¥¼ 하지 않ì�Œ, 지형, 레그ë�Œ 등 ) - const PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody); - const PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody); + PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody); + PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody); void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh); - PSX::PxMaterial* Get_Material(const _float3* vMatInfo); + PSX::PxMaterial* Create_Material(const _float3* vMatInfo); HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix); HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); @@ -34,7 +34,8 @@ class CPhysX_Manager final : public CBase void Update(_float fTimeDelta); void ClearScene(); - + void Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor); + void Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor); #pragma endregion #pragma region CHARACTER_CONTROLLER @@ -54,19 +55,19 @@ class CPhysX_Manager final : public CBase private: class CGameInstance* m_pGameInstance = { nullptr }; - ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; - PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // ÇÇÁ÷½º µ¿ÀûÇÒ´çÀÚ - PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // ÇÇÁ÷½º ¿À·ùó¸®ÀÚ - PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // ÇÇÁ÷½º CPUµð½ºÆÐÃÄ ( ÇöÀç ÇÇÁ÷½º´Â CPU only ) - PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // ÇÇÁ÷½º °øÂ÷ÀÇ ÁýÇÕ ( ±âº» ´ÜÀ§ ÁýÇÕ ) - PSX::PxFoundation* m_pFoundation = { nullptr }; // ÇÇÁ÷½º ÃʱâÈ­ Á¾·á ´ã´çÀÚ - PSX::PxPhysics* m_pPhysics = { nullptr }; // ÇÇÁ÷½º °´Ã¼ÀÇ »ý¼º, ÃʱâÈ­, Á¶ÀÛ ´ã´ç (½Ì±ÛÅæ) + PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // 피ì§�스 ë�™ì �할당ìž� + PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // 피ì§�스 오류처리ìž� + PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // 피ì§�스 CPU디스패ì³� ( 현재 피ì§�스는 CPU only ) + PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // 피ì§�스 공차ì�˜ ì§‘í•© ( 기본 단위 ì§‘í•© ) + PSX::PxFoundation* m_pFoundation = { nullptr }; // 피ì§�스 초기화 종료 담당ìž� + PSX::PxPhysics* m_pPhysics = { nullptr }; // 피ì§�스 ê°�ì²´ì�˜ ìƒ�성, 초기화, ì¡°ìž‘ 담당 (싱글톤) - PSX::PxScene* m_pScene = { nullptr }; // ÇÇÁ÷½º ½Ã¹Ä·¹À̼ÇÀÇ °ø°£ - PSX::PxControllerManager* m_pCCTManager = { nullptr }; // ÇÇÁ÷½º ij¸¯ÅÍ ÄÁÆ®·Ñ·¯¸¦ ÀüºÎ ÃßÀûÇÏ°í ¸Å´Ï¡ÇÔ - PSX::PxPvd* m_pPvd = { nullptr }; // ÇÇÁ÷½º ½Ã¹Ä·¹ÀÌ¼Ç µð¹ö±ëÀ» À§ÇÑ µµ±¸ + PSX::PxScene* m_pScene = { nullptr }; // 피ì§�스 시뮬레ì�´ì…˜ì�˜ 공간 + PSX::PxControllerManager* m_pCCTManager = { nullptr }; // 피ì§�스 ìº�릭터 컨트롤러를 ì „ë¶€ ì¶”ì �하고 매니징함 + PSX::PxPvd* m_pPvd = { nullptr }; // 피ì§�스 시뮬레ì�´ì…˜ 디버깅ì�„ 위한 ë�„구 PSX::PxCookingParams* m_pCookingParam = { nullptr }; PSX::PxPvdTransport* m_pTransport = { nullptr }; @@ -83,11 +84,11 @@ class CPhysX_Manager final : public CBase HRESULT Connect_DebugServer(); void Update_Kinematic(); void Update_Dynamic_ActiveActors(); - void Update_Dynamic_AllActors(); + //void Update_Dynamic_AllActors(); public: static CPhysX_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index ddf1ceeb8..2d0692764 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Transform.h" #include "VIBuffer_Rect.h" #include "VIBuffer_Cube.h" @@ -11,6 +11,7 @@ #include "Model.h" #include "Instance_Model.h" #include "Character_Controller.h" +#include "Light.h" NS_BEGIN(Engine) @@ -67,11 +68,11 @@ class CPrototype_Manager final : public CBase } #ifdef _DEBUG public: - //ƯÁ¤ ŸÀÔÀÇ ÄÄÆ÷³ÍÆ®µéÀÇ À̸§À» ÅëÇÑ ÄÞº¸¹Ú½º , À̹ÌÁö´Â À̹ÌÁö Ŭ¸³À» - //¸¸µé°í ¼±ÅÃÇÒ ½Ã¿¡ ³» ppOut¿¡ Ŭ·ÐÇÏ´Â ±â´ÉÀ» ´ã´ç + //특정 타입ì�˜ ì»´í�¬ë„ŒíŠ¸ë“¤ì�˜ ì�´ë¦„ì�„ 통한 콤보박스 , ì�´ë¯¸ì§€ëŠ” ì�´ë¯¸ì§€ í�´ë¦½ì�„ + //만들고 ì„ íƒ�í•  시ì—� ë‚´ ppOutì—� í�´ë¡ í•˜ëŠ” 기능ì�„ 담당 template - void 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, Engine::CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"") { vector pComponentNames = {}; vector<_string> strNames = {}; @@ -79,7 +80,7 @@ class CPrototype_Manager final : public CBase for (auto& Pair : m_pAssets[iLevel]) { - if (typeid(*Pair.second) == typeid(T)) // °°Àº ŸÀÔÀÇ ÄÄÆ÷³ÍÆ® ¿´´Ù¸é + if (typeid(*Pair.second) == typeid(T)) // ê°™ì�€ 타입ì�˜ ì»´í�¬ë„ŒíЏ 였다면 { strNames.push_back(CMyTools::ToString(Pair.first)); @@ -88,7 +89,7 @@ class CPrototype_Manager final : public CBase } } - if (typeid(CTexture) == typeid(T)) // ÅØ½ºÃÄÀÏ °æ¿ì À̹ÌÁö·Î ¶ç¿ì±â + if (typeid(CTexture) == typeid(T)) // í…�스ì³�ì�¼ 경우 ì�´ë¯¸ì§€ë¡œ ë�„우기 { _int iIndex = {}; @@ -107,34 +108,34 @@ class CPrototype_Manager final : public CBase if (pTexture == nullptr) continue; - if (pTexture->Compare_GroupName(wstrGroupName) == false) // ±×·ì³×ÀÓÀ» ºñ±³Çؼ­ °°Àº °Í¸¸ ¶ç¿ï ¼ö ÀÖµµ·Ï ÇÑ´Ù , Default½Ã L"" + if (pTexture->Compare_GroupName(wstrGroupName) == false) // 그룹네임ì�„ 비êµ�해서 ê°™ì�€ 것만 ë�„울 수 있ë�„ë¡� 한다 , Default시 L"" continue; if (GUI::ImageButton(strName.c_str(), pTexture->Get_SRV(0), ImVec2(48, 48))) { if (*ppOut != nullptr) - Safe_Release(*ppOut); + SAFE_RELEASE(*ppOut); *ppOut = iter->second->Clone(pDesc, pOwner); - return; + return strName; } pTexture->HoverName(); if ((iIndex++ + 1) % 4 != 0) - GUI::SameLine(); // °°Àº ÁÙ¿¡ À̾ + GUI::SameLine(); // ê°™ì�€ 줄ì—� ì�´ì–´ì„œ } - return; + return ""; } static _int s_iCurrentItem = 0; static ImGuiTextFilter filter; - // ´Ù¸¥ ¾î¼ÂÀÏ °æ¿ì ÄÞº¸·Î ¶ç¿ì±â + // 다른 ì–´ì…‹ì�¼ 경우 콤보로 ë�„우기 if(GUI::BeginCombo(pComponentName, (s_iCurrentItem >= 0 && s_iCurrentItem < pComponentNames.size()) ? pComponentNames[s_iCurrentItem] : "NONE")) @@ -183,15 +184,18 @@ class CPrototype_Manager final : public CBase GUI::EndCombo(); - return; + return ""; } if (*ppOut != nullptr) - Safe_Release(*ppOut); + SAFE_RELEASE(*ppOut); *ppOut = iter->second->Clone(pDesc, pOwner); + + return pComponentNames[s_iCurrentItem]; } + return ""; } #endif diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget.h b/Jusin154_Team3D/Engine/Public/RenderTarget.h index 3c848457b..e10d2ac3f 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget.h @@ -21,9 +21,9 @@ class CRenderTarget final : public CBase #ifdef _DEBUG public: - HRESULT Ready_Debug(_float fX, _float fY, _float fSizeX, _float fSizeY); - void Render_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); - + _bool Render_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer, _float fX, _float fY, _float fSizeX, _float fSizeY); + void Ready_Debug(); + void Describe_Entity(const _char* pName); #endif private: @@ -38,6 +38,8 @@ class CRenderTarget final : public CBase #ifdef _DEBUG private: _float4x4 m_WorldMatrix = {}; + _point m_ptWindowSize = {}; + _bool m_isDraw = { false }; #endif public: diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 58e4d421f..53416cb62 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -20,8 +20,14 @@ class CRenderTarget_Manager final : public CBase #ifdef _DEBUG public: - HRESULT Ready_RenderTarget_Debug(const _wstring& strTargetTag, _float fX, _float fY, _float fSizeX, _float fSizeY); - HRESULT Render_RenderTarget_Debug(const _wstring& strMRTTag, class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); + HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); + void RenderTarget_Debuger(); +#endif // _DEBUG + +#ifdef _DEBUG +private: + _int m_iSizeX = { 100 }; + _int m_iSizeY = { 100 }; #endif // _DEBUG private: diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index 2de7495d8..6b6620497 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" NS_BEGIN(PSX) @@ -13,17 +13,19 @@ class CMesh; class ENGINE_DLL CRigidBody final : public CComponent { public: // MORE INFO ON ENGINE_ENUM - typedef struct tagRigidBody_PrototypeDesc // ´Ù ä¿ì¼¼¿ä NONE »©°í, ¸ñÀû¿¡ ¾È¸Â´Â°Å »©°í + typedef struct tagRigidBody_PrototypeDesc // 다 채우세요 NONE 빼고, 목ì �ì—� 안맞는거 빼고 { ACTOR eType; PSX::PxRigidBodyFlags ePxRigidBodyFlags = { /* NONE */}; PSX::PxShapeFlags ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; PXMATERIAL ePxMaterialTypes = { PXMATERIAL::DEFAULT }; - _float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // ÇÇÁ÷½º °´Ã¼ÀÇ ¼Ó¼º µî - _float fContactOffset = { 0.05f }; // Á¢ÃË À¯°Ý ¿ÀÇÁ¼Â + _float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피ì§�스 ê°�ì²´ì�˜ ì†�성 등 + _float fContactOffset = { 0.05f }; // ì ‘ì´‰ 유격 오프셋 + #pragma region DYNAMIC - _float3 vhalfGeometryInfo; // ¹Ú½º´Â vSize, ĸ½¶Àº radius, height·Î ¾¸ - _float fDensity = { 1000.f }; // ¹Ðµµ, ½ÇÁ¦ ¹«°Ô´Â ºÎÇÇ¿¡ µû¶ó ´Þ¶óÁü + _float3 vhalfGeometryInfo; // 박스는 vSize, 캡ìŠ�ì�€ radius, height로 씀 + _float fDensity = { 1000.f }; // ë°€ë�„, 실제 무게는 부피ì—� ë”°ë�¼ 달ë�¼ì§� + #pragma endregion #pragma region STATIC #pragma endregion @@ -34,7 +36,7 @@ class ENGINE_DLL CRigidBody final : public CComponent #pragma region DYNAMIC #pragma endregion #pragma region STATIC - const _char* szMeshName = { }; + const _char* szMeshName = { }; #pragma endregion }RIGIDBODY_DESC; @@ -42,6 +44,7 @@ class ENGINE_DLL CRigidBody final : public CComponent CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CRigidBody(const CRigidBody& rhs); virtual ~CRigidBody() = default; + public: #ifdef _DEBUG virtual HRESULT Render()override; @@ -49,6 +52,7 @@ class ENGINE_DLL CRigidBody final : public CComponent ACTOR Get_Type() const { return m_eActorType; } + PSX::PxActor* Get_Actor() const { return m_pRigidBody; } CTransform* Get_TransformPtr() const { return m_pTransform; } const _tchar* Get_PxMeshKey() const { return m_wstrMeshKey.c_str(); } PXMATERIAL Get_MaterialType() const { return m_eMatType; } @@ -56,28 +60,37 @@ class ENGINE_DLL CRigidBody final : public CComponent _float Get_Density() const { return m_fDensity; } PSX::PxShapeFlags Get_ShapeFlags() const { return m_ePxShapeFlags; } PSX::PxRigidBodyFlags Get_RigidBodyFlags() const { return m_ePxRigidBodyFlags; } - _float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; } + _float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; } + + + // 키네마틱ì�€ transform으로 ì�´ë�™ ( simulate ì „ì—� ì�´ë�™í•¨ ) + // 키네마틱ì�´ 아닌 dynamicì�€ 토í�¬ì™€ í�¬ìŠ¤ë¡œ ì�´ë�™ ( simulate 후ì—� ì�´ë�™í•¨ ) + void Set_Kinematic(_bool bKinematic); + + + void Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // ì†�ë�„ + ë°©í–¥ + void Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // ë°©í–¥ private: ACTOR m_eActorType = ACTOR::END; PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = {}; PXMATERIAL m_eMatType = { PXMATERIAL::END }; _float m_fContactOffset = { 0.05f }; - const PSX::PxActor* m_pRigidBody = { nullptr }; // ½ÇÁ¦ ½Ã¹Ä·¹À̼ÇÀ» µµ´Â º»Ã¼ + PSX::PxActor* m_pRigidBody = { nullptr }; // 실제 시뮬레ì�´ì…˜ì�„ ë�„는 본체 CTransform* m_pTransform = { nullptr }; + PhsXUserData m_tagData = {}; #pragma region DYNAMIC PSX::PxShapeFlags m_ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; _float3 m_vMatInfo = {}; _float3 m_vhalfGeometryInfo = {}; + _float3 m_vCenterOfMess = {}; // 회전축 _float m_fDensity = { 1000.f }; #pragma endregion #pragma region STATIC - _wstring m_wstrMeshKey = { }; // ¦²á ½ºÅÂÆ½ ¸Þ½ÃÀÇ triangleMesh Ű + _wstring m_wstrMeshKey = { }; // ì§�ê¿� 스태틱 메시ì�˜ triangleMesh 키 #pragma endregion - -private: #ifdef _DEBUG unique_ptr m_pMainShape = { nullptr }; unique_ptr m_pSubShape = { nullptr }; @@ -86,6 +99,7 @@ class ENGINE_DLL CRigidBody final : public CComponent private: HRESULT Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc); HRESULT Initialize(void* pArg); + HRESULT Initialize_UserData(); #ifdef _DEBUG HRESULT Add_DebugShape(); #endif @@ -97,4 +111,4 @@ class ENGINE_DLL CRigidBody final : public CComponent virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Shader.h b/Jusin154_Team3D/Engine/Public/Shader.h index 9962d2625..75c14e3e4 100644 --- a/Jusin154_Team3D/Engine/Public/Shader.h +++ b/Jusin154_Team3D/Engine/Public/Shader.h @@ -23,15 +23,31 @@ class ENGINE_DLL CShader final : public CComponent HRESULT Bind_SRV(const _char* pConstantName, ID3D11ShaderResourceView* pSRV); HRESULT Bind_SRVs(const _char* pConstantName, ID3D11ShaderResourceView** ppSRV, _uint iNumSRVs); + +private: + HRESULT CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements); + +#ifdef _DEBUG +public: + HRESULT Shader_Refresh(); +#endif + public: HRESULT Begin(_uint iPassIndex); private: - ID3DX11Effect* m_pEffect = { nullptr }; + ID3DX11Effect* m_pEffect = { nullptr }; _uint m_iNumPasses = {}; vector m_InputLayouts; +#ifdef _DEBUG +private: + _wstring m_strShaderPath = {}; + const D3D11_INPUT_ELEMENT_DESC* m_pElements = nullptr; + _uint m_iNumElements = {}; +#endif + public: static CShader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements); virtual CComponent* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Engine/Public/Transform.h b/Jusin154_Team3D/Engine/Public/Transform.h index 85baf277d..a14d47ede 100644 --- a/Jusin154_Team3D/Engine/Public/Transform.h +++ b/Jusin154_Team3D/Engine/Public/Transform.h @@ -13,6 +13,7 @@ class ENGINE_DLL CTransform final : _float fRotationPerSec = 0.f; _float fRadius = 20.f; }TRANSFORM_DESC; + private: CTransform(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CTransform(const CTransform& rhs); @@ -32,6 +33,7 @@ class ENGINE_DLL CTransform final : _vector Get_QuarternionVector() const; // ÇöÀç ȸÀüÁ¤º¸¸¦ ´ã°í ÀÖ´Â ÄõÅʹϾ𠺤Å͸¦ out _vector Get_RollPitchYawVector() const; _vector Get_State(STATE eState) const { return XMLoadFloat4(reinterpret_cast(&m_WorldMatrix.m[ENUM_CLASS(eState)])); } + const _float4* Get_StatePtr(STATE eState) { return reinterpret_cast<_float4*>(&m_WorldMatrix.m[ENUM_CLASS(eState)]); } const _float4x4* Get_WorldMatrixPtr() const { return &m_WorldMatrix; } const _matrix Get_XMWorldMatrix() const { return XMLoadFloat4x4(&m_WorldMatrix); } const _matrix Get_WorldMatrixInv() const { return XMMatrixInverse(nullptr, XMLoadFloat4x4(&m_WorldMatrix)); } diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 4d6db2fc7..a52aaa0e6 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -64,8 +64,11 @@ class ENGINE_DLL CUIObject abstract : public CGameObject virtual void Nine_Slice_Right(_float Y); virtual void Nine_Slice_Top(_float Z); virtual void Nine_Slice_Bottom(_float W); + virtual _float Get_Nine_Slice_Left(); + virtual _float Get_Nine_Slice_Right(); + virtual _float Get_Nine_Slice_Top(); + virtual _float Get_Nine_Slice_Bottom(); -public: virtual _float2 Get_Origin_Position(); // Start Position virtual _vector Get_Current_Position(); // Current Position virtual _float3 Get_Origin_Size(); // Start Size @@ -104,7 +107,11 @@ class ENGINE_DLL CUIObject abstract : public CGameObject RECT m_pRect{}; - _vector m_vNine_Slice{}; + _float4 m_vNine_Slice{}; + _float m_fLeft{}; + _float m_fRight{}; + _float m_fTop{}; + _float m_fBottom{}; protected: virtual HRESULT Initialize_Prototype(); diff --git a/Jusin154_Team3D/Engine/Public/fMod/fmod.h b/Jusin154_Team3D/Engine/Public/fMod/fmod.h index a72e0b505..92e4bb4c2 100644 --- a/Jusin154_Team3D/Engine/Public/fMod/fmod.h +++ b/Jusin154_Team3D/Engine/Public/fMod/fmod.h @@ -1,4 +1,4 @@ -/* ======================================================================================== */ +/* ======================================================================================== */ /* FMOD Core API - C header file. */ /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ /* */ diff --git a/Jusin154_Team3D/Engine/Public/fMod/fmod_common.h b/Jusin154_Team3D/Engine/Public/fMod/fmod_common.h index d289558c0..9ddfd4a44 100644 --- a/Jusin154_Team3D/Engine/Public/fMod/fmod_common.h +++ b/Jusin154_Team3D/Engine/Public/fMod/fmod_common.h @@ -1,4 +1,4 @@ -/* ======================================================================================== */ +/* ======================================================================================== */ /* FMOD Core API - Common C/C++ header file. */ /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ /* */ diff --git a/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp.h b/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp.h index b20dda259..19d7dad31 100644 --- a/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp.h +++ b/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp.h @@ -1,4 +1,4 @@ -/* ======================================================================================== */ +/* ======================================================================================== */ /* FMOD Core API - DSP header file. */ /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ /* */ diff --git a/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp_effects.h b/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp_effects.h index e7408a9bf..03566683e 100644 --- a/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp_effects.h +++ b/Jusin154_Team3D/Engine/Public/fMod/fmod_dsp_effects.h @@ -1,4 +1,4 @@ -/* ============================================================================================================= */ +/* ============================================================================================================= */ /* FMOD Core API - Built-in effects header file. */ /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ /* */