diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 1a8c94894..b8aba5069 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -119,7 +119,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; - float fRoughness = 0.5f; + float fRoughness = 0.f; float fOcclusion = 1.f; float fAttenuation = 1.f; @@ -146,12 +146,12 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fOcclusion = vSRO.b; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); PBR_Out.vShade *= fDiffuseAOStrength; - + saturate(PBR_Out.vShade); Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -355,6 +355,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f); Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static)); + //float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x; //float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x; //bool IsShadow = { false }; @@ -389,6 +390,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) //} //[loop] // 변수로 루프돌리려면 반드시 필요함 + for (int i = -15; i < 16; ++i) { vTexcoord.x = In.vTexcoord.x; diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 5c8f5c81a..cb79ebc0b 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -50,7 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); if (0.f == vColorTexture.a) { diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 529cf9c68..e614342ce 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -6,22 +6,28 @@ Texture2D g_DepthTexture; int g_iImageCountX; int g_iImageCountY; +uint g_iIndexU; +uint g_iIndexV; +uint g_iQuestType; +uint g_iSpellType; + +float g_fPI; float g_fFar; float g_fTime; float g_fTimeMult; float g_fFrame; +float g_fDeltaU; +float g_fDeltaV; float g_fAlpha; float g_fOwnerAlpha; float g_fCanvasAlpha; -float g_fDeltaU; -float g_fDeltaV; -uint g_iIndexU; -uint g_iIndexV; -float4 g_fNine_Slice; +float g_fAngle; +float g_fCoolTime; + float2 g_fOrigin_Size; float2 g_fCurrent_Size; -uint g_iQuestType; -float g_fPI; + +float4 g_fNine_Slice; Texture2D g_Texture; Texture2D g_Texture1; @@ -71,12 +77,13 @@ struct PS_OUT PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); if (Color.a <= 0.1f) discard; + Color.a *= Alpha; Out.vColor = Color; return Out; } @@ -84,9 +91,11 @@ PS_OUT PS_MAIN(PS_IN In) PS_OUT PS_AlphaBlend(PS_IN In) { PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color.a *= Alpha; Out.vColor = Color; return Out; @@ -95,45 +104,47 @@ PS_OUT PS_AlphaBlend(PS_IN In) PS_OUT PS_Clamp(PS_IN In) { PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color.a *= Alpha; Out.vColor = Color; - return Out; } -PS_OUT PS_Cursor(PS_IN In) +PS_OUT PS_Cursor(PS_IN In) { PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(0.f, 0.f, 0.f, 0.f); - float4 White = float4(1.f, 1.f, 1.f, 1.f); + float4 Color = float4(0.f, 0.f, 0.f, 0.f); + float4 White = float4(1.f, 1.f, 1.f, 1.f); - float2 UV = In.vTexcoord; - float2 Center = float2(0.5f, 0.5f); + float2 UV = In.vTexcoord; + float2 Center = float2(0.5f, 0.5f); - float CW = -g_fTime; - float CCW = g_fTime; + float CW = -g_fTime; + float CCW = g_fTime; - float2 RedCircle = UV; - float2 RedUV = UV - Center; + float2 RedCircle = UV; + float2 RedUV = UV - Center; - RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); - RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); - RedCircle = RedCircle + Center; + RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); + RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); + RedCircle = RedCircle + Center; - float2 BlueCircle = UV; + float2 BlueCircle = UV; float2 BlueUV = UV - Center; - BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); - BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); - BlueCircle = BlueCircle + Center; + BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); + BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); + BlueCircle = BlueCircle + Center; - float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); - float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); + float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); + float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); if (Texture1.r >= 0.7f) Color = Texture1; @@ -144,7 +155,9 @@ PS_OUT PS_Cursor(PS_IN In) if (all(Color.rgb <= 0.5f)) discard; - Color = White; + Color = White; + + Color.a *= Alpha; Out.vColor = Color; @@ -154,6 +167,7 @@ PS_OUT PS_Cursor(PS_IN In) PS_OUT PS_Key_Hold_Rotation(PS_IN In) { PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float2 uv = In.vTexcoord; @@ -170,30 +184,53 @@ PS_OUT PS_Key_Hold_Rotation(PS_IN In) tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb; + tex.a *= Alpha; + Out.vColor = tex; return Out; } +PS_OUT PS_Mission(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(0.f, 0.f, 0.f, 0.f); + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.a *= 0.5f; + + if (tex1.a >= 0.f) + Color = tex1; + + Color = lerp(Color, tex2, tex2.a); + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + PS_OUT PS_Sptire_Sheet(PS_IN In) { PS_OUT Out; - - float4 Color = float4(0.f, 0.f, 0.f, 0.f); float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(0.f, 0.f, 0.f, 0.f); float2 UV = In.vTexcoord; int iTotalFrame = g_iImageCountX * g_iImageCountY; - int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; + uint iCurrentFrame = uint(floor(g_fTime / g_fFrame)) % iTotalFrame; - int iFrameX = iCurrentFrame % g_iImageCountX; - int iFrameY = iCurrentFrame / g_iImageCountX; + int iFrameX = iCurrentFrame % g_iImageCountX; + int iFrameY = iCurrentFrame / g_iImageCountX; - float fFreamWidth = 1.0 / g_iImageCountX; - float fFreamHeight = 1.0 / g_iImageCountY; + float fFreamWidth = 1.0 / g_iImageCountX; + float fFreamHeight = 1.0 / g_iImageCountY; - UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; + UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; float4 Texture = g_Texture.Sample(DefaultSampler, UV); @@ -203,7 +240,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In) if (Color.r <= 0.4f) discard; - Color.a = Alpha; + Color.a *= Alpha; Out.vColor = Color; @@ -213,6 +250,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In) PS_OUT PS_QuestType(PS_IN In) { PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float3 Color = float3(253.f, 207.f, 11.f) / 255.f; float4 Texture1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); @@ -224,6 +262,7 @@ PS_OUT PS_QuestType(PS_IN In) } } + Texture1.a *= Alpha; Out.vColor = Texture1; return Out; @@ -232,9 +271,11 @@ PS_OUT PS_QuestType(PS_IN In) PS_OUT PS_UVMult(PS_IN In) { PS_OUT Out; - + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + color.a *= Alpha; Out.vColor = color; return Out; @@ -243,46 +284,191 @@ PS_OUT PS_UVMult(PS_IN In) 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; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; - float2 ratio = g_fCurrent_Size / g_fOrigin_Size; + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); - float2 UV = In.vTexcoord * 0.5f + 0.5f; - float2 ScaledUV = UV; - - if(UV.x < Left) + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) { - ScaledUV.x = UV.x; + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; } - else if(UV.x > Right) + else if (CurrentPixelPosition.x > CurrentRight) { - ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x); + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; } else { - ScaledUV.x = Left + (UV.x - Left) / ratio.x; + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); } - if(UV.y < Top) + if (CurrentPixelPosition.y < CurrentTop) { - ScaledUV.y = UV.y; + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; } - else if(UV.y > Bottom) + else if (CurrentPixelPosition.y > CurrentBottom) { - ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y); + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; } else { - ScaledUV.y = Top + (UV.y - Top) / ratio.y; + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); } - float4 color = g_Texture.Sample(ClampSampler, ScaledUV); + float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); + + tex1.a *= 0.5f; + + if (tex1.a >= 0.f) + Color = tex1; + + Color = lerp(Color, tex2, tex2.a); + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + +PS_OUT PS_Rotation(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 color = float4(0.f, 0.f, 0.f, 0.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + + color.a *= Alpha; + + Out.vColor = color; + return Out; + +} + +PS_OUT PS_Slot(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 color = g_Texture.Sample(ClampSampler, Rotation); + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_SpellAnim(PS_IN In) +{ + PS_OUT Out; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + + float3 BGColor = float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(208.f, 179.f, 54.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(37.f, 129.f, 162.f) / 255.f; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + case 5: + BGColor = float3(0.f, 80.f, 55.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float2 uv = In.vTexcoord; + float CoolTime = 1.f - g_fDeltaV; + float CoolTime2 = 1.f - g_fDeltaV + 0.05; + + float4 tex1 = g_Texture.Sample(ClampSampler, uv); + tex1.rgb *= BGColor; + float4 tex2 = g_Texture1.Sample(DefaultSampler, uv); + + if (tex2.a >= 0.9f) + tex1 = tex2; + + color = tex1; + + float wave1 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + + float waveThreshold1 = CoolTime + wave1; + float waveThreshold2 = CoolTime2 + wave2; + + if (g_fDeltaV <= 1.f) + { + if (uv.y >= waveThreshold1 && uv.y <= waveThreshold2) + { + color.rgb = float3(1.f, 1.f, 1.f); + } + } + + if (uv.y <= CoolTime) + { + color.a = 0.f; + } + + color.a *= Alpha; Out.vColor = color; - return Out; } @@ -292,7 +478,7 @@ technique11 PosTexTechnique11 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + 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_MAIN(); @@ -348,6 +534,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Key_Hold_Rotation(); } + pass Mission + { + 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_Mission(); + } + pass QuestType { SetRasterizerState(RS_Default); @@ -378,4 +574,33 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_NineSlice(); } + pass Rotation + { + 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_Rotation(); + } + + pass Slot + { + 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_Slot(); + } + + pass SpellAnim + { + 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_SpellAnim(); + } } diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index bbb47719c..e0fd8e188 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -1,6 +1,17 @@ #include "Engine_Shader_Defines.hlsli" +struct SkinngMesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; +}; + + + matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; bool g_bRimLight; @@ -14,10 +25,13 @@ float3 g_vRimColor; float4 g_TestColor; vector g_vCamPosition; -Texture2D g_DiffuseTexture; -Texture2D g_NormalTexture; -Texture2D g_DAOTexture; -Texture2D g_THVTexture; +Texture2D g_DiffuseTexture : register(t0); +Texture2D g_NormalTexture : register(t1); +Texture2D g_DAOTexture : register(t2); +Texture2D g_THVTexture : register(t3); +Texture2D g_SurfaceParamsTexture : register(t4); + +StructuredBuffer g_SkinngMesh : register(t5); float3 g_RootColor; float3 g_TipColor; @@ -25,6 +39,7 @@ float3 g_DyeColor; float g_DyeOpacity; float g_HairRoughness; +float g_fUsingSurfaceParams; matrix g_BoneMatrices[512]; @@ -52,26 +67,31 @@ struct VS_OUT float4 vWorldPos : TEXCOORD1; float4 vProjPos : TEXCOORD2; }; - -VS_OUT VS_MAIN(VS_IN In) +VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID) { VS_OUT Out; - float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + //float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); - matrix BoneMatrix = - mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + - mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + - mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + - mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + //matrix BoneMatrix = + // mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + // mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + // mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + // mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); - vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); - vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); - vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); - vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); + //vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + //vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + //vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); + //vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); - matrix matWV, matWVP; + + vector vPosition = float4(g_SkinngMesh[vertexID].vPosition, 1.f); + + vector vNormal = float4(g_SkinngMesh[vertexID].vNormal, 0.f); + vector vBinormal = float4(g_SkinngMesh[vertexID].vBinormal, 0.f); + vector vTangent = float4(g_SkinngMesh[vertexID].vTangent, 0.f); + matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -79,7 +99,8 @@ VS_OUT VS_MAIN(VS_IN In) Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; - Out.vTexcoord = In.vTexcoord; + Out.vTexcoord = g_SkinngMesh[vertexID].vTexcoord; + //In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; return Out; @@ -156,10 +177,10 @@ VS_OUT_SHADOW VS_MAIN_SHADOW(VS_IN In) float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); - matrix BoneMatrix = g_BoneMatrices[In.vBlendIndex.x] * In.vBlendWeight.x + - g_BoneMatrices[In.vBlendIndex.y] * In.vBlendWeight.y + - g_BoneMatrices[In.vBlendIndex.z] * In.vBlendWeight.z + - g_BoneMatrices[In.vBlendIndex.w] * fWeightW; + matrix BoneMatrix = mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); /* ?ㅽ궎??*/ vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); @@ -188,25 +209,25 @@ struct PS_IN struct PS_OUT { - float4 vDiffuse : SV_TARGET0; + float4 vAlbedo : SV_TARGET0; float4 vNormal : SV_TARGET1; float4 vDepth : SV_TARGET2; + float4 vColor : SV_Target3; + float4 vSurface : SV_Target4; }; PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.4f) - { - discard; - } + vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); + if (vMtrlDiffuse.a < 0.2f) { discard; } - vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord); + float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); - float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); + float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); if (true == g_bRimLight) { @@ -214,11 +235,14 @@ PS_OUT PS_MAIN(PS_IN In) vMtrlDiffuse.xyz = (vMtrlDiffuse.xyz * (1 - fRimLight)) + g_vRimColor * fRimLight; } - - Out.vDiffuse = vMtrlDiffuse; + Out.vAlbedo = vMtrlDiffuse; 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); - + Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) + (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z + g_fUsingSurfaceParams, // 서페이스 파라미터 + 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 1.f); + Out.vSurface = vSurface; return Out; } @@ -313,7 +337,7 @@ PS_OUT PS_HAIR(PS_IN In) baseColor = lerp(baseColor, g_vRimColor.rgb, fRim); } - Out.vDiffuse = float4(baseColor, alpha); + Out.vAlbedo = float4(baseColor, alpha); Out.vNormal = float4(normal * 0.5f + 0.5f, 0.f); Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f); @@ -342,7 +366,7 @@ PS_OUT PS_EYELASH(PS_IN In) } - Out.vDiffuse = float4(vMtrlDiffuse.rgb, vMtrlDiffuse.g); + Out.vAlbedo = 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); diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 4a503675a..1c0cd858a 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -5,6 +5,7 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; bool g_bUVTargetDiffuse; bool g_bAdditiveDisolve; + float g_LifeRatio; float g_fFar; float g_fTime; @@ -14,6 +15,7 @@ uint g_iIndexU; uint g_iIndexV; float g_fDisolveRatio; +float g_fUsingSurfaceParams; float2 g_vClipBoxSize; float2 g_vClipBoxLTPos; @@ -24,6 +26,7 @@ Texture2D g_ClippingTexture; Texture2D g_DisolveTexture; Texture2D g_NormalTexture; Texture2D g_GlowTexture; +Texture2D g_SurfaceParamsTexture; struct VS_IN { @@ -155,32 +158,37 @@ struct PS_IN struct PS_OUT { - float4 vDiffuse : SV_TARGET0; + float4 vAlbedo : SV_TARGET0; float4 vNormal : SV_TARGET1; float4 vDepth : SV_TARGET2; - + float4 vColor : SV_Target3; + float4 vSurface : SV_Target4; }; PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.1f) - { - discard; - } + vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); + if (vMtrlDiffuse.a < 0.2f) { discard; } - vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord); + float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); - float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); + float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); - Out.vDiffuse = vMtrlDiffuse; + Out.vAlbedo = vMtrlDiffuse; 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); + Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) + (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z + g_fUsingSurfaceParams, // 서페이스 파라미터 + 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 1.f); + Out.vSurface = vSurface; return Out; } + PS_OUT PS_MAIN_SELECT(PS_IN In) { PS_OUT Out; @@ -196,7 +204,7 @@ PS_OUT PS_MAIN_SELECT(PS_IN In) float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); - Out.vDiffuse = vMtrlDiffuse * float4(0.f, 1.f, 1.f, 0.3f); + Out.vAlbedo = vMtrlDiffuse * float4(0.f, 1.f, 1.f, 0.3f); 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; @@ -207,14 +215,14 @@ PS_OUT PS_GLASS(PS_IN In) PS_OUT Out; vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - vector vMtrlGlow = g_GlowTexture.Sample(DefaultSampler, In.vTexcoord); 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); - Out.vDiffuse = lerp(vMtrlDiffuse, vMtrlGlow, vMtrlDiffuse.a); + Out.vAlbedo = lerp(vMtrlDiffuse, float4(1.f, 1.f, 1.f, 1.f), 0.5f); + float4(vMtrlDiffuse.xyz, 1.f); 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); @@ -356,7 +364,7 @@ technique11 MeshTechnique11 { pass MeshPass // 0 { - SetRasterizerState(RS_Nocull); + SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 64d670aae..01cc9d648 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -1,7 +1,5 @@ #include "Engine_Shader_Defines.hlsli" -float PI = 3.141592; - struct ParticleValue { float fSpeed; @@ -14,6 +12,7 @@ struct ParticleValue float2 vMaskingUVMoveTime; float2 vDiffuseUVMoveTime; + float2 vDistortionUVMoveTime; float2 vNoiseUVMoveTime; float2 vAniTime; @@ -35,6 +34,7 @@ StructuredBuffer g_ParticleValue : register(t5); Texture2D g_EmissiveTexture : register(t6); Texture2D g_DepthStencilTexture : register(t7); +Texture2D g_DistortionTexture : register(t8); @@ -44,27 +44,30 @@ vector g_vColor; float2 g_vDiffuseUVGainAmount; float2 g_vMaskingUVGainAmount; +float2 g_vNoiseUVGainAmount; -float2 g_vDiffuseNoiseUVGainAmount; -float2 g_vMaskNoiseUVGainAmount; - -// int g_iMaskMoveLerpOption; int g_iDiffuseMoveLerpOption; -int g_iMaskNoiseMoveLerpOption; -int g_iDiffuseNoiseMoveLerpOption; +int g_iNoiseMoveLerpOption; + +// +float2 g_vDiffuseDistortionUVGainAmount; +float2 g_vMaskDistortionUVGainAmount; + +int g_iMaskDistortionMoveLerpOption; +int g_iDiffuseDistortionMoveLerpOption; // float2 g_vUVCutting; float2 g_vUVMaskCutting; +float g_fDiffuseAlpha; int g_iBlurWeight; // 블러 강도 float g_fBlurIntensity; //블러 세기 -float g_fNoiseDistortionIntensity; // 노이즈 왜곡 세기 +float g_fNoiseDistortionIntensity; // 디스토션 왜곡 세기 float4 g_vEmissive; -float g_fColorOption; float g_fEmissiveCutAlpha; bool g_isDiffuse; @@ -72,9 +75,14 @@ bool g_isMasking; bool g_isDissolve; bool g_isNoise; bool g_isEmissive; +bool g_isDistortion; bool g_isDiffuseUVMove; bool g_isMaskUVMove; +bool g_isNoiseUVMove; + +bool g_isReverseDissolve; +bool g_isEmissiveDissolve; float g_fFar; @@ -151,11 +159,11 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) { VS_OUT Out = (VS_OUT) 0; - row_major matrix matW, matWV, matWVP; + matrix matW, matWV, matWVP; - row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); - matW = mul(g_WorldMatrix, TransformMatrix); + matW = mul(TransformMatrix, g_WorldMatrix); matWV = mul(matW, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -201,31 +209,32 @@ PS_OUT BlendedWeight(vector fDiffuse, float fLinearZ) { PS_OUT Out; - - float3 vColor = fDiffuse.rgb; float fAlpha = fDiffuse.a; - float fWeight = -max( - min(1.0, max(max(vColor.r, vColor.g), vColor.b) * fAlpha), fAlpha) - * - clamp( 0.01 / (1e-4 + pow(fLinearZ / 200, 4.0)), 0.01f, 1000 ); +// float fWeight = +//max( +// min(1.0, max(max(vColor.r, vColor.g), vColor.b) * fAlpha), fAlpha) +// * +// clamp(0.01 / (1e-4 + pow(fLinearZ / 200, 4.0)), 0.01f, 1000); - //float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 2.0f)), 0.01, 3e3); + //float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 4.0f)), 0.01, 3e3); //fWeight = max(fWeight, 1.0); //이게 오리지널 웨이트 함수 //float fWeight = pow(fLinearZ, -2.5); - //float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f); - + + float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f); + + Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight; - Out.vRevealage.a = fAlpha; + Out.vRevealage.r = fAlpha; + return Out; } @@ -266,11 +275,13 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vector vMtrlMask; vector vMtrlNoise; vector vMtrlDissolve; + vector vMtrlDistortion; float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; + float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime; if (g_isDiffuse == true) { @@ -283,57 +294,74 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption); } - /* 노이즈 */ - if (g_isNoise == true) + /* 디퓨즈 디스토션 */ + if (g_isDistortion == true) { - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption); + float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iDiffuseDistortionMoveLerpOption); - vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion); //0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다. - vMtrlNoise.rg -= 0.5f; + vMtrlDistortion.rg -= 0.5f; //아마 분할되었다면 noise도 분할해야할듯 - vMtrlNoise.rg /= g_vUVCutting; + vMtrlDistortion.rg /= g_vUVCutting; - //노이즈 텍스쳐로 uv를 왜곡함 + //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 - UV = UV + (vMtrlNoise).rg * g_fNoiseDistortionIntensity; + UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity; + } /* 최종 색깔 */ vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); + + if (g_vColor.a > 0) vMtrlDiffuse += g_vColor; - if (vMtrlDiffuse.a < 0.3f) - discard; - } else { vMtrlDiffuse = g_vColor; } + + /* 노이즈 */ + + if(g_isNoise) + { + float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); + + vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); + + vMtrlDiffuse *= vMtrlNoise; + } + + /* 마스크 */ if (g_isMasking == true) { float2 vMaskTexcoord = In.vTexcoord; vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x)); - if (g_isNoise == true) + // 마스크 디스토션 + if (g_isDistortion == true) { float2 UV; // 이미지의 UV값 - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption); + float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption); - vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV); + + //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 + vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity; - //노이즈 텍스쳐로 uv를 왜곡함 - vMaskTexcoord = vMaskTexcoord + (vMtrlNoise - 0.5f).rg * g_fNoiseDistortionIntensity; } if (g_isMaskUVMove) @@ -343,6 +371,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) } vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); + } else { @@ -353,6 +382,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); + + if (vMtrlDiffuse.a <= 0.f) discard; @@ -360,15 +391,26 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) - discard; + if(g_isReverseDissolve == true) + { + if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + else + { + if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + + + } - + vMtrlDiffuse.a *= g_fDiffuseAlpha; // 색깔 추가할 처리 (이미시브) - float4 vEmissiveMtrl; + float4 vEmissiveMtrl = vector(0.f ,0.f ,0.f ,0.f); if (g_isEmissive == true) { @@ -380,20 +422,29 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; - float fbias = 0.00005f; + float fbias = 0.000005f; if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) discard; - - Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); - - //if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) - // Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); - //else - // Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + + float fEmissiveCutAlpha = g_fEmissiveCutAlpha; + + if (g_isEmissiveDissolve == true) + { + fEmissiveCutAlpha += (In.vLifeTime.x / In.vLifeTime.y) / 2; + } + + float fSmoothAlpha = smoothstep(fEmissiveCutAlpha - 0.1f, fEmissiveCutAlpha + 0.1f, vMtrlDiffuse.a); + + + + float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); + + Out.vColorTarget = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); + return Out; } @@ -414,7 +465,7 @@ VS_BLUR_OUT VS_BLUR(VS_IN In, uint iGPUIndex : SV_InstanceID) row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); - matW = mul(g_WorldMatrix, TransformMatrix); + matW = mul(TransformMatrix, g_WorldMatrix); matWV = mul(matW, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -441,7 +492,6 @@ struct PS_BLUR_IN struct PS_BLUR_OUT { float4 vDiffuse : SV_TARGET0; - float4 vBlurWeight : SV_TARGET1; }; @@ -450,16 +500,17 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) PS_BLUR_OUT Out; - vector vMtrlDiffuse; vector vMtrlMask; vector vMtrlNoise; vector vMtrlDissolve; + vector vMtrlDistortion; float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; + float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime; if (g_isDiffuse == true) { @@ -472,57 +523,74 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption); } - /* 노이즈 */ - if (g_isNoise == true) + /* 디퓨즈 디스토션 */ + if (g_isDistortion == true) { - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption); + float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iDiffuseDistortionMoveLerpOption); - vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion); //0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다. - vMtrlNoise.rg -= 0.5f; + vMtrlDistortion.rg -= 0.5f; //아마 분할되었다면 noise도 분할해야할듯 - vMtrlNoise.rg /= g_vUVCutting; + vMtrlDistortion.rg /= g_vUVCutting; - //노이즈 텍스쳐로 uv를 왜곡함 + //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 - UV = UV + (vMtrlNoise).rg * g_fNoiseDistortionIntensity; + UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity; + } /* 최종 색깔 */ vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); + + if (g_vColor.a > 0) vMtrlDiffuse += g_vColor; - if (vMtrlDiffuse.a < 0.3f) - discard; - } else { vMtrlDiffuse = g_vColor; } + + /* 노이즈 */ + + if (g_isNoise) + { + float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); + + vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); + + vMtrlDiffuse *= vMtrlNoise; + } + + /* 마스크 */ if (g_isMasking == true) { float2 vMaskTexcoord = In.vTexcoord; vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x)); - if (g_isNoise == true) + // 마스크 디스토션 + if (g_isDistortion == true) { float2 UV; // 이미지의 UV값 - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption); + float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption); - vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); + vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV); + + //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 + vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity; - //노이즈 텍스쳐로 uv를 왜곡함 - vMaskTexcoord = vMaskTexcoord + (vMtrlNoise - 0.5f).rg * g_fNoiseDistortionIntensity; } if (g_isMaskUVMove) @@ -532,6 +600,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) } vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); + } else { @@ -542,27 +611,43 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); - if (g_isDissolve == true) - { - vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - - if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) - discard; - } - vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); + if (vMtrlDiffuse.a <= 0.f) + discard; if (g_isDissolve == true) { vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) - discard; + if (g_isReverseDissolve == true) + { + if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + else + { + if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + } - Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity; - Out.vBlurWeight.r = g_iBlurWeight / 32.f; + vMtrlDiffuse.a *= g_fDiffuseAlpha; + + // 색깔 추가할 처리 (이미시브) + + vector vEmissive; + + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); + + float fSmoothAlpha = smoothstep(g_fEmissiveCutAlpha - 0.02f, g_fEmissiveCutAlpha + 0.02f, vMtrlDiffuse.a); + + float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); + + vEmissive = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); + + Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity + vEmissive; return Out; } @@ -584,7 +669,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); @@ -593,7 +678,7 @@ technique11 DefaultTechnique pass Blur { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_Default, 0); + SetDepthStencilState(DSS_Effect, 0); SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_BLUR(); GeometryShader = NULL; diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl index 6b9fcb9b8..926473fa9 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl @@ -11,9 +11,14 @@ uint g_iIndexU; uint g_iIndexV; Texture2D g_Texture; + Texture2D g_DiffuseTexture; Texture2D g_MaskingTexture; +Texture2D g_NoiseTexture; +bool g_isDiffuse; +bool g_isNoise; +bool g_isMask; struct VS_IN { @@ -25,27 +30,55 @@ struct VS_OUT { float4 vPosition : SV_Position; float2 vTexcoord : TEXCOORD0; + float4 vProjPos : TEXCOORD1; }; VS_OUT VS_MAIN(VS_IN In) { VS_OUT Out; - + + matrix matWV, matWVP; matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); + + vector vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); Out.vTexcoord = In.vTexcoord; + Out.vProjPos = vPosition; return Out; } +VS_OUT VS_TRAIL(VS_IN In) +{ + VS_OUT Out; + + + matrix matWVP; + + matWVP = mul(g_ViewMatrix , g_ProjMatrix); //월드행렬 곱해져서 오기때문에 월드 곱하지 않음 + + + vector vPosition = mul(vector(In.vPosition, 1.f), matWVP); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + Out.vProjPos = vPosition; + + + return Out; + +} + struct PS_IN { float4 vPosition : SV_Position; float2 vTexcoord : TEXCOORD0; + float4 vProjPos : TEXCOORD1; }; struct PS_OUT @@ -72,17 +105,54 @@ PS_OUT PS_UVMove(PS_IN In) return Out; } -PS_OUT PS_Trail(PS_IN In) + + +struct PS_TRAILOUT { - PS_OUT Out; + float4 vDiffuse : SV_TARGET0; + float4 vRevealage : SV_TARGET1; + float4 vColorTarget : SV_TARGET2; +}; + +PS_TRAILOUT PS_Trail(PS_IN In) +{ + PS_TRAILOUT Out; - vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - vector vMasking = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord); + vector vMtrlDiffuse; + vector vMtrlMask; + vector vMtrlNoise; + + if (g_isDiffuse == true) + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + else + vMtrlDiffuse = vector(0.f, 0.f, 0.f, 1.f); + + if (g_isMask == true) + vMtrlMask = g_MaskingTexture.Sample(PointSampler, In.vTexcoord); + else + vMtrlMask = vector(1.f, 1.f, 1.f, 1.f); + + if (g_isNoise == true) + { + vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord); + + //vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); + + vMtrlDiffuse *= vMtrlNoise; + } + + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); + + + float fWeight = clamp(pow(In.vProjPos.w, -2.5f), 1.0f, 1000.0f); + + + Out.vDiffuse = vector(vMtrlDiffuse.rgb * vMtrlDiffuse.a, vMtrlDiffuse.a) * fWeight; + + Out.vRevealage.r = vMtrlDiffuse.a; + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); - vDiffuse.a = vDiffuse.a * vMasking.r; - Out.vColor = vDiffuse; - Out.vColor.a *= In.vTexcoord.x; - clip(Out.vColor.a - 0.01f); return Out; } diff --git a/Jusin154_Team3D/Client/Default/Client.aps b/Jusin154_Team3D/Client/Default/Client.aps new file mode 100644 index 000000000..c2afa22ef Binary files /dev/null and b/Jusin154_Team3D/Client/Default/Client.aps differ diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index dbbcc6a86..9c88f7596 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -110,7 +110,7 @@ Level3 true - EDITOR_PROJECT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + _DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) @@ -136,7 +136,7 @@ true true true - EDITOR_PROJECT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) @@ -157,29 +157,111 @@ + + + + + + + + + + + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create Create + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 264f91f6e..6ffd06472 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -37,6 +37,126 @@ 01.Levels\02.GamePlay + + 99.Define + + + 03.InfoInstance + + + 01.Levels\10.Field + + + 01.Levels\99.Restart + + + 02.GameObjects\Cameras\Debug + + + 02.GameObjects\Environment\Lights\Main + + + 03.InfoInstance\00.PlayerInfo + + + 03.InfoInstance\01.MonsterInfo + + + 03.InfoInstance\02.MapInfo + + + 02.GameObjects\Player + + + 02.GameObjects\Item\Wand + + + 80.State + + + 80.State\State_Combat + + + 80.State\State_Combat\State_Cast + + + 80.State\State_Combat\State_LightAttack + + + 80.State\State_Combat\State_Skill + + + 80.State\State_Combat\State_Skill2 + + + 80.State\State_Move + + + 80.State\State_Move\State_Idle + + + 80.State\State_Move\State_Jog + + + 80.State\State_Move\State_Walk + + + 80.State\State_Move\State_Sprint + + + 80.State\State_Move\State_Dodge + + + 80.State\State_Move\State_Idle_Turn + + + 80.State\State_Jump + + + 80.State\State_Land + + + 02.GameObjects\Cameras\CameraPosition\Player + + + 02.GameObjects\Cameras\CameraPosition\Arm + + + 02.GameObjects\Cameras\CameraPosition + + + 02.GameObjects\Cameras + + + 02.GameObjects\SkyBox + + + 02.GameObjects\Item\Broom + + + 02.GameObjects\PhysX + + + 02.GameObjects\PhysX + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\HitReport + + + 02.GameObjects\PhysX\CallBack\HitReport + + + 02.GameObjects\PhysX\CallBack\HitReport + @@ -74,9 +194,6 @@ {27434478-691e-42a8-83c7-ecd1a60f46ce} - - {cdfbb346-6cae-4094-93cd-b82685efa68e} - {7efd65d5-eb4d-4331-a746-f0fa2de6275b} @@ -98,6 +215,150 @@ {a7d0a3fa-b3dc-40c6-b258-ffcde49b05c1} + + {b5bef783-5315-4488-ac64-cb98d16a84a9} + + + {31681680-d5de-43c9-bc2d-2c91ca58a593} + + + {1bfec6dc-f008-4d18-87d6-be38824b1272} + + + {3eb21e8e-e01c-47fe-828e-800212456eb5} + + + {9f952e5a-835c-4de9-b7b5-9a731912774d} + + + {c5b61cb3-bc5f-4429-8715-b309dcf054b2} + + + {2b209526-b728-4fba-a184-b9224d72903a} + + + {e12b3048-dd6d-41bf-b346-e4abdaa4f215} + + + {74f21f9b-30bf-412e-ba4e-526958ab2a52} + + + {8d89a59c-fbd2-4a4a-ab01-a70abb80cc49} + + + {708bbc88-47fb-42c5-b060-14cec7d646f2} + + + {b24c78ef-dccc-41f0-a086-053ae6b7fbf4} + + + {603938cc-e4fe-44d8-890b-784174a86161} + + + {11250d84-e19c-4999-a5d6-d9f89123e7ae} + + + {b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d} + + + {2814c935-13d9-4b9a-94ba-c9e470219a18} + + + {19ee2ea4-2d79-46bd-b857-c759e3ec6cf4} + + + {2561df42-3dfa-4045-a30c-85f44cd65e09} + + + {25ad4a41-5b06-4659-bd29-c0c4265a3277} + + + {5a667a7b-6c90-44f6-9c9f-aac3108b6561} + + + {cdfbb346-6cae-4094-93cd-b82685efa68e} + + + {1cfdfc05-0b0d-4c58-8c2d-58090efea4fd} + + + {621b87a7-54b8-4d90-84b2-fa8cd26cc396} + + + {413e6692-6e4a-4b00-8306-edf652bd876a} + + + {be963729-ed65-4506-82f2-24213f5ecf5a} + + + {fb0a8b8b-5376-4606-8e6e-b020abf2d476} + + + {5e4bd8c2-9ace-4617-880b-9c7fa826dfd4} + + + {28b2cdcb-e307-4da5-a222-24a77480605c} + + + {8f9ce518-cd40-4a0c-ac4f-f77459a13cfd} + + + {68ec69bb-6697-42aa-abf4-cd6d148a1648} + + + {99f16910-04c8-44e2-84ff-17321d94d1f0} + + + {e2599ab3-3d02-420c-b29c-0f87b4263429} + + + {3110d3d0-422e-42eb-a045-c8c784528165} + + + {cd90a5f0-2428-4537-801f-a65b7273c3be} + + + {5f5abe29-f43a-4de7-8955-b21ca1c6fb94} + + + {03cf23a9-5c0f-4cb1-a32b-5807a612c039} + + + {b3fdd366-2689-49c9-b1c1-6843772e9661} + + + {309d0593-507f-484c-92aa-7c8fc483941b} + + + {a3ab0237-10b3-4699-a39d-63c625024f67} + + + {f0da95a0-107f-42ff-9e77-3503bb48aa12} + + + {e83f88ec-c414-43b4-b437-52288cee431a} + + + {9cc88058-bda3-4ed0-9ec9-1968963fdda4} + + + {aac01a47-304a-4319-8bd8-fdd9020ddf18} + + + {b719d948-fce3-4144-9d2c-edcab4cfceaf} + + + {ddf8c8e6-ca51-42e0-b08f-13ae0fd9d842} + + + {5fd99d60-e641-4229-9a72-8f5d7744c6b0} + + + {ad7a67bd-df18-4c03-85eb-960881922128} + + + {dc05dfc9-22e5-4a2a-b016-c55b215c0c68} + @@ -121,6 +382,123 @@ 01.Levels\02.GamePlay + + 03.InfoInstance + + + 01.Levels\10.Field + + + 01.Levels\99.Restart + + + 02.GameObjects\Cameras\Debug + + + 02.GameObjects\Environment\Lights\Main + + + 03.InfoInstance\00.PlayerInfo + + + 03.InfoInstance\01.MonsterInfo + + + 03.InfoInstance\02.MapInfo + + + 02.GameObjects\Player + + + 02.GameObjects\Item\Wand + + + 80.State + + + 80.State\State_Combat + + + 80.State\State_Combat\State_Cast + + + 80.State\State_Combat\State_LightAttack + + + 80.State\State_Combat\State_Skill + + + 80.State\State_Combat\State_Skill2 + + + 80.State\State_Move + + + 80.State\State_Move\State_Idle + + + 80.State\State_Move\State_Jog + + + 80.State\State_Move\State_Walk + + + 80.State\State_Move\State_Sprint + + + 80.State\State_Move\State_Dodge + + + 80.State\State_Move\State_Idle_Turn + + + 80.State\State_Jump + + + 80.State\State_Land + + + 02.GameObjects\Cameras\CameraPosition\Player + + + 02.GameObjects\Cameras\CameraPosition\Arm + + + 02.GameObjects\Cameras\CameraPosition + + + 02.GameObjects\Cameras + + + 02.GameObjects\SkyBox + + + 02.GameObjects\Item\Broom + + + 02.GameObjects\PhysX + + + 02.GameObjects\PhysX + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\Behavior + + + 02.GameObjects\PhysX\CallBack\HitReport + + + 02.GameObjects\PhysX\CallBack\HitReport + + + 02.GameObjects\PhysX\CallBack\HitReport + diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp new file mode 100644 index 000000000..346c77b83 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -0,0 +1,165 @@ +#include "pch.h" +#include "Broom.h" + +#include "GameInstance.h" + +CBroom::CBroom(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CBroom::CBroom(const CBroom& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CBroom::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CBroom::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + m_pModelCom->Set_AnimationIndex(5); + + return S_OK; +} + +void CBroom::Priority_Update(_float fTimeDelta) +{ +} + +void CBroom::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + m_pModelCom->ComputeSkinning(); +} + +void CBroom::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); +} + +HRESULT CBroom::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_Material(i, m_pShaderCom))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + return E_FAIL; + + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CBroom::Ready_Components() +{ + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Broom_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CBroom::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; +} + +CBroom* CBroom::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CBroom* pInstance = new CBroom(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CBroom"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CBroom::Clone(void* pArg, CGameObject* pOwner) +{ + CBroom* pInstance = new CBroom(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CBroom"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CBroom::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + + +} + +void CBroom::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp new file mode 100644 index 000000000..140eb3454 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp @@ -0,0 +1,97 @@ +#include "pch.h" +#include "CallBack_EffectHitBox_Behavior.h" +#include "GameInstance.h" + + +CCallBack_EffectHitBox_Behavior::CCallBack_EffectHitBox_Behavior() +{ +} + +CCallBack_EffectHitBox_Behavior::~CCallBack_EffectHitBox_Behavior() +{ +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + if (nullptr == actor.userData) { + return PSX::PxControllerBehaviorFlags(0); + } + PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); + PhsXUserData* pActorData = static_cast(actor.userData); + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case PHYSX_KIND::BODY_DYNAMIC: + switch (pActorData->iSubKind) + { + case 20: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + break; + case 21: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 22: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 23: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 24: + eResults = PSX::PxControllerBehaviorFlags(0); + break; + default: + break; + } + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + + return eResults; +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacle이 움직이는 발판이다? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(0); +} + +HRESULT CCallBack_EffectHitBox_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_EffectHitBox_Behavior::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_EffectHitBox_Behavior* CCallBack_EffectHitBox_Behavior::Create() +{ + return new CCallBack_EffectHitBox_Behavior(); +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp new file mode 100644 index 000000000..f4d5a5677 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp @@ -0,0 +1,148 @@ +#include "pch.h" +#include "CallBack_EffectHitBox_HitReport.h" +#include "GameInstance.h" +#include "GameObject.h" + +CCallBack_EffectHitBox_HitReport::CCallBack_EffectHitBox_HitReport() +{ +} + +CCallBack_EffectHitBox_HitReport::~CCallBack_EffectHitBox_HitReport() +{ +} + +void CCallBack_EffectHitBox_HitReport::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; + + + ON_COLLISION_INFO CollisionDesc = {}; + + if (nullptr != pController && nullptr != pActor) { + PhsXUserData* pTargetActorData = static_cast(pActor->userData); + PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + if (nullptr == pTargetActorData) { // missing user data + return; + } + + switch (pTargetActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + // action + break; + case PHYSX_KIND::BODY_DYNAMIC: + { + switch (pTargetActorData->iSubKind) + { + case 23: // 무거운데 올라갈 수 있는 벽 + + /* OnCollision 함수에 넘길 값 */ + + + CollisionDesc.vWorldPos = XMVectorSet( (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); + memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); + CollisionDesc.fLength = fLength; + + pOwnerActorData->pOwner->Get_Owner()->OnCollision(pTargetActorData->pOwner , &CollisionDesc); + + break; + default: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + } + break; + } + } break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_EffectHitBox_HitReport::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 != pActorData); // 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 CCallBack_EffectHitBox_HitReport::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; + //} +} + +HRESULT CCallBack_EffectHitBox_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_EffectHitBox_HitReport::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_EffectHitBox_HitReport* CCallBack_EffectHitBox_HitReport::Create() +{ + return new CCallBack_EffectHitBox_HitReport(); +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp new file mode 100644 index 000000000..699647c82 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp @@ -0,0 +1,97 @@ +#include "pch.h" +#include "CallBack_Monster_Behavior.h" +#include "GameInstance.h" + + +CCallBack_Monster_Behavior::CCallBack_Monster_Behavior() +{ +} + +CCallBack_Monster_Behavior::~CCallBack_Monster_Behavior() +{ +} + +PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + if (nullptr == actor.userData) { + return PSX::PxControllerBehaviorFlags(0); + } + PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); + PhsXUserData* pActorData = static_cast(actor.userData); + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case PHYSX_KIND::BODY_DYNAMIC: + switch (pActorData->iSubKind) + { + case 20: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + break; + case 21: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 22: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 23: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 24: + eResults = PSX::PxControllerBehaviorFlags(0); + break; + default: + break; + } + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + + return eResults; +} + +PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacle이 움직이는 발판이다? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(0); +} + +HRESULT CCallBack_Monster_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_Monster_Behavior::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_Monster_Behavior* CCallBack_Monster_Behavior::Create() +{ + return new CCallBack_Monster_Behavior();; +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp new file mode 100644 index 000000000..348ab72db --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp @@ -0,0 +1,136 @@ +#include "pch.h" +#include "CallBack_Monster_HitReport.h" +#include "GameInstance.h" +#include "Character_Controller.h" +#include "RigidBody_Dynamic.h" +#include "GameObject.h" + +CCallBack_Monster_HitReport::CCallBack_Monster_HitReport() +{ +} + +CCallBack_Monster_HitReport::~CCallBack_Monster_HitReport() +{ +} + +void CCallBack_Monster_HitReport::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* pTargetActorData = static_cast(pActor->userData); + PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + if (nullptr == pTargetActorData) { // missing user data + return; + } + + switch (pTargetActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + // action + break; + case PHYSX_KIND::BODY_DYNAMIC: + { + switch (pTargetActorData->iSubKind) + { + case 0: + m_pController->ConvertToDO(*m_pPartDynamicBody); + m_pPartDynamicBody->Add_Force(XMVectorSet(vDir.x, vDir.y, vDir.z, 0.f) * fLength * 100.f, PSX::PxForceMode::eIMPULSE); + break; + default: + { + } + break; + } + } break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_Monster_HitReport::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 != pActorData); // 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 CCallBack_Monster_HitReport::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; + //} +} + +HRESULT CCallBack_Monster_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_Monster_HitReport::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_Monster_HitReport* CCallBack_Monster_HitReport::Create() +{ + return new CCallBack_Monster_HitReport(); +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp new file mode 100644 index 000000000..b74143b2f --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp @@ -0,0 +1,97 @@ +#include "pch.h" +#include "CallBack_Playable_Behavior.h" +#include "GameInstance.h" + + +CCallBack_Playable_Behavior::CCallBack_Playable_Behavior() +{ +} + +CCallBack_Playable_Behavior::~CCallBack_Playable_Behavior() +{ +} + +PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + if (nullptr == actor.userData) { + return PSX::PxControllerBehaviorFlags(0); + } + PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); + PhsXUserData* pActorData = static_cast(actor.userData); + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case PHYSX_KIND::BODY_DYNAMIC: + switch (pActorData->iSubKind) + { + case 20: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + break; + case 21: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 22: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 23: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 24: + eResults = PSX::PxControllerBehaviorFlags(0); + break; + default: + break; + } + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + + return eResults; +} + +PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacle이 움직이는 발판이다? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(0); +} + +HRESULT CCallBack_Playable_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_Playable_Behavior::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_Playable_Behavior* CCallBack_Playable_Behavior::Create() +{ + return new CCallBack_Playable_Behavior(); +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp new file mode 100644 index 000000000..60808b2c7 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -0,0 +1,163 @@ +#include "pch.h" +#include "CallBack_Playable_HitReport.h" +#include "GameInstance.h" +#include "GameObject.h" + +CCallBack_Playable_HitReport::CCallBack_Playable_HitReport() +{ +} + +CCallBack_Playable_HitReport::~CCallBack_Playable_HitReport() +{ +} + +void CCallBack_Playable_HitReport::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* pTargetActorData = static_cast(pActor->userData); + PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + if (nullptr == pTargetActorData) { // missing user data + return; + } + + switch (pTargetActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + // action + break; + case PHYSX_KIND::BODY_DYNAMIC: + { + switch (pTargetActorData->iSubKind) + { + case 23: // 무거운데 올라갈 수 있는 벽 + if (m_pGameInstance->Key_Pressing(DIK_E)) { + pOwnerActorData->pOwner->Get_Component()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f)); + } + else if (m_pGameInstance->Key_Pressing(DIK_R)) { + pOwnerActorData->pOwner->Get_Component()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f)); + } + //pOwnerActorData->pOwner->Get_Component()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f)); + break; + case 24: // 문짝 + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + _float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f)); + if (fDot > 0) { + pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + } + else { + pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + } + } break; + case 25: // 문짝 + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + _float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f)); + if (fDot > 0) { + pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eFORCE); + } + else { + pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eFORCE); + } + } break; + default: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + } + break; + } + } break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_Playable_HitReport::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 != pActorData); // 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 CCallBack_Playable_HitReport::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; + //} +} + +HRESULT CCallBack_Playable_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_Playable_HitReport::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_Playable_HitReport* CCallBack_Playable_HitReport::Create() +{ + return new CCallBack_Playable_HitReport(); +} diff --git a/Jusin154_Team3D/Client/Private/CamPosition.cpp b/Jusin154_Team3D/Client/Private/CamPosition.cpp new file mode 100644 index 000000000..7b2fce6ba --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition.cpp @@ -0,0 +1,49 @@ +#include "pch.h" + +#include "CamPosition.h" + + +CCamPosition::CCamPosition(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPartObject(pDevice, pContext) +{ +} +CCamPosition::CCamPosition(const CCamPosition& rhs) + :CPartObject(rhs) +{ +} +HRESULT CCamPosition::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + return S_OK; +} +HRESULT CCamPosition::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + return S_OK; +} +void CCamPosition::Free() +{ + __super::Free(); +} + +HRESULT CCamPosition::Bind_ShaderResources() +{ + return E_NOTIMPL; +} + +CGameObject* CCamPosition::Clone(void* pArg, CGameObject* pOwner) +{ + return nullptr; +} + +void CCamPosition::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp new file mode 100644 index 000000000..14c06801f --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp @@ -0,0 +1,107 @@ +#include "pch.h" +#include "CamPosition_Arm.h" +#include "GameInstance.h" + +CCamPosition_Arm::CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamPosition(pDevice, pContext) +{ +} + +CCamPosition_Arm::CCamPosition_Arm(const CCamPosition_Arm& rhs) + : CCamPosition(rhs) +{ +} + +HRESULT CCamPosition_Arm::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamPosition_Arm::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + CameraArm_DESC* pDesc = static_cast(pArg); + m_fMouseSensor = pDesc->fMouseSensor; + m_fDistance = pDesc->fDistance; + + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVectorSetW(XMLoadFloat3(&pDesc->fEye), 0.f)); + m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->fAt), 1.f)); + + return S_OK; +} + +void CCamPosition_Arm::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->Set_State(STATE::LOOK, XMVector3Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f))); + m_pTransformCom->Rotation(XMConvertToRadians(60.f), XMConvertToRadians(m_fAccDegreeY), 0.f); + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) - XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)) * m_fDistance); +} + +void CCamPosition_Arm::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Arm::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamPosition_Arm::Render() +{ + return S_OK; +} + +HRESULT CCamPosition_Arm::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC DescTransfrom = {}; + DescTransfrom.fRadius = 30.f; + DescTransfrom.fRotationPerSec = 0.f; + DescTransfrom.fSpeedPerSec = 0.f; + if (FAILED(__super::Ready_Components(&DescTransfrom))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CCamPosition_Arm::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Arm* CCamPosition_Arm::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Arm* pInstance = new CCamPosition_Arm(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Arm"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Arm* CCamPosition_Arm::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Arm* pInstance = new CCamPosition_Arm(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Arm"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamPosition_Arm::Free() +{ + __super::Free(); +} + +void CCamPosition_Arm::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp new file mode 100644 index 000000000..074fdc97e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp @@ -0,0 +1,105 @@ +#include "pch.h" + +#include "CamPosition_Player.h" + +CCamPosition_Player::CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCamPosition(pDevice, pContext) +{ +} + +CCamPosition_Player::CCamPosition_Player(const CCamPosition_Player& rhs) + :CCamPosition(rhs) +{ +} + +void CCamPosition_Player::Priority_Update(_float fTimeDelta) +{ + /*_matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + }*/ + m_pTransformCom->Set_WorldMatrix(/*socketMatrix * */XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); +} + +void CCamPosition_Player::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Player::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamPosition_Player::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamPosition_Player::Initialize(void* pArg) +{ + CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast (pArg); + //m_pSocketMatrices = pDesc->pSocketMatrices; + if (FAILED(__super::Initialize(pArg))) + { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Player::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Player::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Player* pInstance = new CCamPosition_Player(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Player"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Player* pInstance = new CCamPosition_Player(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Player"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamPosition_Player::Free() +{ + __super::Free(); +} + +void CCamPosition_Player::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp new file mode 100644 index 000000000..c82a2a622 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -0,0 +1,156 @@ +#include "pch.h" +#include "Camera_Debug.h" +#include "Shader.h" + +CCamera_Debug::CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamera(pDevice, pContext) +{ +} + +CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs) + : CCamera(rhs) +{ +} + +void CCamera_Debug::Priority_Update(_float fTimeDelta) +{ +} + +void CCamera_Debug::Update(_float fTimeDelta) +{ + Transition(fTimeDelta); + _float3 vCamPos = {}; + XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); + GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); + if (m_pGameInstance->Key_Up(DIK_GRAVE)) { + m_bMovable = !m_bMovable; + } + if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + m_pGameInstance->Toggle_MouseCenter(); + } + if (m_bMovable) { +#pragma region Position + _float fSpeed = 5.f; + if (m_pGameInstance->Key_Pressing(DIK_W)) { + m_pTransformCom->Go_Straight(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_A)) { + m_pTransformCom->Go_Left(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_S)) { + m_pTransformCom->Go_Backward(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_D)) { + m_pTransformCom->Go_Right(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_SPACE)) { + m_pTransformCom->Go_Up(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_C)) { + m_pTransformCom->Go_Down(fTimeDelta * fSpeed); + } + if (m_pGameInstance->Key_Pressing(DIK_TAB)) { + Set_InitialPos(); + } + +#pragma endregion +#pragma region Angle + + _float3 fMove = m_pGameInstance->Get_MouseMove(); + m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fTimeDelta * fMove.x * m_fMouseSensor); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::RIGHT), fTimeDelta * fMove.y * m_fMouseSensor); + +#pragma endregion + + } + __super::Bind_Matrices(); +} + +void CCamera_Debug::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamera_Debug::Render() +{ + return S_OK; +} + +HRESULT CCamera_Debug::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamera_Debug::Initialize(void* pArg) +{ + CAMERA_DEBUG_DESC* pDesc = static_cast(pArg); + m_fMouseSensor = pDesc->fMouseSensor; + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vEye), 1.f)); + 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; +} + +HRESULT CCamera_Debug::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamera_Debug::Bind_ShaderResources() +{ + return S_OK; +} + +void CCamera_Debug::Set_InitialPos() +{ + m_pTransformCom->Set_WorldMatrix(m_matInitial); +} + +CCamera_Debug* CCamera_Debug::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamera_Debug* pInstance = new CCamera_Debug(pDevice, pContext); + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamera_Debug"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CCamera_Debug* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner) +{ + CCamera_Debug* pInstance = new CCamera_Debug(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamera_Debug"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamera_Debug::Free() +{ + __super::Free(); +} + +void CCamera_Debug::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp new file mode 100644 index 000000000..a7eeb9049 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp @@ -0,0 +1,103 @@ +#include "pch.h" +#include "Camera_Gaze.h" + +CCamera_Gaze::CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamera(pDevice, pContext) +{ +} + +CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs) + : CCamera(rhs) +{ +} + +void CCamera_Gaze::Priority_Update(_float fTimeDelta) +{ + if (false == m_bIsCurrentTransition) { + m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component()->Get_State(STATE::POSITION)); + m_pTransformCom->LookAt(m_pLookTarget->Get_Component()->Get_State(STATE::POSITION)); + } + m_bActive = true; + __super::Bind_Matrices(); +} + +void CCamera_Gaze::Update(_float fTimeDelta) +{ +} + +void CCamera_Gaze::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamera_Gaze::Render() +{ + return S_OK; +} + +HRESULT CCamera_Gaze::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamera_Gaze::Initialize(void* pArg) +{ + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamera_Gaze::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamera_Gaze::Bind_ShaderResources() +{ + return S_OK; +} + +CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamera_Gaze* pInstance = new CCamera_Gaze(pDevice, pContext); + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamera_Gaze"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner) +{ + CCamera_Gaze* pInstance = new CCamera_Gaze(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamera_Gaze"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamera_Gaze::Free() +{ + __super::Free(); +} + +void CCamera_Gaze::Describe_Entity() +{ + +} diff --git a/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp new file mode 100644 index 000000000..8c1ad4266 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp @@ -0,0 +1,226 @@ +#include "pch.h" +#include "Dummy_PhysXPlayable.h" +#include "GameInstance.h" + +CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext): + CGameObject(pDevice, pContext) +{ +} + +CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs): + CGameObject(rhs) +{ +} + +void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->RewindMomentum(); + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); +} + +void CDummy_PhysXPlayable::Update(_float fTimeDelta) +{ + if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Pressing(DIK_LEFT)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Pressing(DIK_DOWN)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) { + if (m_pGameInstance->Key_Pressing(DIK_SPACE)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Pressing(DIK_C)) { + m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + } + if (m_pGameInstance->Key_Down(DIK_V)) { + m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor()); + } + } + else { + if (m_pGameInstance->Key_Down(DIK_V)) { + m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor()); + } + } + m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); + m_pCharacter_Controller->Move(fTimeDelta); +} + +void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta) +{ + Describe_Entity(); + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + } +} + +HRESULT CDummy_PhysXPlayable::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Render(0))) { + // return E_FAIL; + //} +#ifdef _DEBUG + if (FAILED(m_pCharacter_Controller->Render())) { + return E_FAIL; + } +#endif // _DEBUG + + return S_OK; +} + +HRESULT CDummy_PhysXPlayable::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXPlayable::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + + return S_OK; +} + +HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC TransformDesc{}; + TransformDesc.fRadius = 100.f; + TransformDesc.fRotationPerSec = XMConvertToRadians(60.f); + TransformDesc.fSpeedPerSec = 15.f; + if (FAILED(__super::Ready_Components(&TransformDesc))) { + return E_FAIL; + } + PHYSXDUMMY_DESC* pDesc = static_cast(pArg); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f)); + m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z); + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = pDesc->iSubKind; + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::CAPSULE; + Desc.fContactOffset = 0.1f; + Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.05f }; + Desc.fRadius = 0.5f; + Desc.fHeight = 1.0f; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Playable_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Playable_Behavior::Create(); + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + } + m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = pDesc->iSubKind; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); + } + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))){ + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CDummy_PhysXPlayable::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_PhysXPlayable* CDummy_PhysXPlayable::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXPlayable* pInstance = new CDummy_PhysXPlayable(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXPlayable"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXPlayable::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXPlayable* pInstance = new CDummy_PhysXPlayable(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXPlayable"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXPlayable::Free() +{ + __super::Free(); + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + SAFE_RELEASE(m_pCharacter_Controller); + SAFE_RELEASE(m_pRigidBody); + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CDummy_PhysXPlayable::Describe_Entity() +{ + m_pCharacter_Controller->Describe_Entity(); +} diff --git a/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp b/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp new file mode 100644 index 000000000..e48126ef6 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp @@ -0,0 +1,167 @@ +#include "pch.h" +#include "Dummy_PhysXWall.h" + +#include "GameInstance.h" + + +CDummy_PhysXWall::CDummy_PhysXWall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_PhysXWall::CDummy_PhysXWall(const CDummy_PhysXWall& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_PhysXWall::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXWall::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CDummy_PhysXWall::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_PhysXWall::Update(_float fTimeDelta) +{ +} + +void CDummy_PhysXWall::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); +} + +HRESULT CDummy_PhysXWall::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Render(0))) { + // return E_FAIL; + //} +#ifdef _DEBUG + if (FAILED(m_pRigidBody->Render())) { + return E_FAIL; + } +#endif // _DEBUG + + + return S_OK; +} + +HRESULT CDummy_PhysXWall::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast(pArg); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f)); + m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z); + + + { // RIGID_BODY + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = pPhysXDummyDesc->iSubKind; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + } + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CDummy_PhysXWall::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_PhysXWall* CDummy_PhysXWall::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXWall* pInstance = new CDummy_PhysXWall(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXWall"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXWall::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXWall* pInstance = new CDummy_PhysXWall(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXWall"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXWall::Free() +{ + if (nullptr != m_pRigidBody) { + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); + } + + __super::Free(); + + SAFE_RELEASE(m_pRigidBody); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CDummy_PhysXWall::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp new file mode 100644 index 000000000..a7ba7db91 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -0,0 +1,68 @@ +#include "pch.h" +#include "InfoInstance.h" +#include "GameInstance.h" +#include "MapInfo.h" +#include "MonsterInfo.h" +#include "PlayerInfo.h" + +IMPLEMENT_SINGLETON(CInfoInstance) + +CInfoInstance::CInfoInstance() +{ +} + + +void CInfoInstance::Update(_float fTimeDelta) +{ + +} + +LEVEL CInfoInstance::Get_RestartLevel() +{ + return LEVEL::GAMEPLAY; +} + +HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContext; + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + m_pMapInfo = CMapInfo::Create(pDevice, pContext); + if (nullptr == m_pMapInfo) { + return E_FAIL; + } + m_pPlayerInfo = CPlayerInfo::Create(pDevice, pContext); + if (nullptr == m_pPlayerInfo) { + return E_FAIL; + } + m_pMonsterInfo = CMonsterInfo::Create(pDevice, pContext); + if (nullptr == m_pMonsterInfo) { + return E_FAIL; + } + + + return S_OK; +} + +void CInfoInstance::Release_Information() +{ + DestroyInstance(); + + + SAFE_RELEASE(m_pMapInfo); + SAFE_RELEASE(m_pPlayerInfo); + SAFE_RELEASE(m_pMonsterInfo); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pGameInstance); +} + +void CInfoInstance::Free() +{ + __super::Free(); + +} diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp new file mode 100644 index 000000000..8101093b3 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -0,0 +1,115 @@ +#include "pch.h" +#include "Level_Field.h" +#include "GameInstance.h" +#include "Level_Loading.h" +#include "InfoInstance.h" +#include "Light_Main.h" +#include "Layer.h" + +CLevel_Field::CLevel_Field(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) + : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } +{ + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CLevel_Field::Initialize(void* pArg) +{ + if (FAILED(Ready_Lights())) { + return E_FAIL; + } + + if (FAILED(Ready_Markers())) { + return E_FAIL; + } + if (FAILED(Ready_Layer_UI(LAYER_UI))) { + return E_FAIL; + } + if (FAILED(Ready_Layer_Effect(LAYER_EFFECT))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CLevel_Field::Initialize() +{ + assert(false); + return E_FAIL; +} + +void CLevel_Field::Update(_float fTimeDelta) +{ + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + m_pInfoInstance->Update(fTimeDelta); + + if (true == m_pGameInstance->Check_LevelShouldChange()) { + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::RESTART)))) { + return; + } + } +} + +HRESULT CLevel_Field::Render() +{ + SetWindowText(g_hWnd, TEXT("필드레벨")); + return S_OK; +} + +HRESULT CLevel_Field::Ready_Lights() +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CLevel_Field::Ready_Layer_UI(const _wstring& strLayerTag) +{ + return S_OK; +} + +HRESULT CLevel_Field::Ready_Layer_Camera() +{ + return S_OK; +} + +HRESULT CLevel_Field::Ready_Layer_Sound() +{ + return S_OK; +} + +HRESULT CLevel_Field::Ready_Markers() +{ + + return S_OK; +} + +HRESULT CLevel_Field::Ready_Layer_Effect(const _wstring& strLayerTag) +{ + return S_OK; +} + +pair> CLevel_Field::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg) +{ + CLevel_Field* pInstance = new CLevel_Field(pDevice, pContext, eLevelID); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Created : CLevel_Field"); + SAFE_RELEASE(pInstance); + } + + return { pInstance, [pInstance]() { pInstance->Ready_Layer_Camera(); pInstance->Ready_Layer_Sound(); } }; +} + +void CLevel_Field::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); +} diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 418e8082c..c089be113 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -2,12 +2,21 @@ #include "Level_GamePlay.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "Light_Main.h" +#include "Camera_Debug.h" +#include "InfoInstance.h" #include "Layer.h" +#include "Player.h" +#include "SkyBox.h" +#include "Broom.h" +#include "Dummy_PhysXWall.h" +#include "Dummy_PhysXPlayable.h" CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_GamePlay::Initialize(void* pArg) @@ -15,7 +24,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Lights())) { return E_FAIL; } - if (FAILED(Ready_Markers())) { return E_FAIL; } @@ -26,6 +34,14 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } + if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) { + return E_FAIL; + } + + if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) { + return E_FAIL; + } + return S_OK; } @@ -37,10 +53,17 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + m_pInfoInstance->Update(fTimeDelta); + if (true == m_pGameInstance->Check_LevelShouldChange()) { - //if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::WOODS)))) { - // return; - //} + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) { + return; + } } } @@ -52,19 +75,9 @@ HRESULT CLevel_GamePlay::Render() HRESULT CLevel_GamePlay::Ready_Lights() { - 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))) { - // return E_FAIL; - //} - assert(false); - + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))){ + return E_FAIL; + } return S_OK; } @@ -76,6 +89,28 @@ HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Camera() { + /*CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{}; + Camera_Desc.fFovy = XMConvertToRadians(60.0f); + Camera_Desc.fNear = 0.1f; + Camera_Desc.fFar = 200.f; + Camera_Desc.vEye = _float3(0.f, 10.f, -10.f); + Camera_Desc.vAt = _float3(0.f, 0.f, 0.f); + Camera_Desc.fSpeedPerSec = 5.f; + Camera_Desc.pCameraKey = CAMERA_DEBUG; + Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f); + Camera_Desc.fMouseSensor = 0.1f; + Camera_Desc.iPriority = 99; + Camera_Desc.pFollowTarget = { nullptr }; + Camera_Desc.pLookTarget = { nullptr }; + + CCamera_Debug* pCamera = { nullptr }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){ + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) { + return E_FAIL; + }*/ + return S_OK; } @@ -95,6 +130,34 @@ HRESULT CLevel_GamePlay::Ready_Layer_Effect(const _wstring& strLayerTag) return S_OK; } +HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) + return E_FAIL; + + return S_OK; +} + +HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))) + return E_FAIL; + + CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { 0.f, 0.f, 0.f }; + Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; + Desc.iSubKind = 23; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { + return E_FAIL; + } + + return S_OK; +} + pair> CLevel_GamePlay::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg) { CLevel_GamePlay* pInstance = new CLevel_GamePlay(pDevice, pContext, eLevelID); @@ -112,4 +175,5 @@ void CLevel_GamePlay::Free() { __super::Free(); + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Level_Loading.cpp b/Jusin154_Team3D/Client/Private/Level_Loading.cpp index fcc85f885..f68a13049 100644 --- a/Jusin154_Team3D/Client/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Loading.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_Loading.h" #include "Loader.h" @@ -6,6 +6,8 @@ #include "Layer.h" #include "Level_Logo.h" #include "Level_GamePlay.h" +#include "Level_Restart.h" +#include "Level_Field.h" CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -47,7 +49,17 @@ void CLevel_Loading::Update(_float fTimeDelta) { pairLevel = CLevel_GamePlay::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr); } break; + case LEVEL::FIELD: + { + pairLevel = CLevel_Field::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr); + } break; + case LEVEL::RESTART: + { + pairLevel = CLevel_Restart::Create(m_pDevice, m_pContext, m_eNextLevelID); + } break; + default: + assert(false); // E_IMPL break; } @@ -59,7 +71,7 @@ void CLevel_Loading::Update(_float fTimeDelta) return; } else /* FAILED */ { - assert(false); // ·¹º§ º¯°æ ½ÇÆÐ + assert(false); // 레벨 변경 실패 } } } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 7cd7f7049..6c6b50201 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -1,14 +1,16 @@ -#include "pch.h" +#include "pch.h" #include "Level_Logo.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "InfoInstance.h" CLevel_Logo::CLevel_Logo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_Logo::Initialize() @@ -23,6 +25,12 @@ void CLevel_Logo::Update(_float fTimeDelta) { if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) { + m_pGameInstance->Set_LevelToChange(); + } + + m_pInfoInstance->Update(fTimeDelta); + + if (true == m_pGameInstance->Check_LevelShouldChange()) { if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::GAMEPLAY)))) { return; } @@ -31,7 +39,7 @@ void CLevel_Logo::Update(_float fTimeDelta) HRESULT CLevel_Logo::Render() { - SetWindowText(g_hWnd, TEXT("·ΰí·¹º§ÀԴϴÙ")); + SetWindowText(g_hWnd, TEXT("로고레벨입니다")); return S_OK; } @@ -57,5 +65,5 @@ void CLevel_Logo::Free() { __super::Free(); - + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Level_Restart.cpp b/Jusin154_Team3D/Client/Private/Level_Restart.cpp new file mode 100644 index 000000000..91dc3500d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Level_Restart.cpp @@ -0,0 +1,63 @@ +#include "pch.h" +#include "Level_Restart.h" +#include "InfoInstance.h" +#include "GameInstance.h" +#include "Level_Loading.h" + + + +CLevel_Restart::CLevel_Restart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) + : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } +{ + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CLevel_Restart::Initialize() +{ + m_eNextLevel = m_pInfoInstance->Get_RestartLevel(); + + return S_OK; +} + +void CLevel_Restart::Update(_float fTimeDelta) +{ + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + m_pInfoInstance->Update(fTimeDelta); + + if (true == m_pGameInstance->Check_LevelShouldChange()) { + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, m_eNextLevel)))) { + return; + } + } +} + +HRESULT CLevel_Restart::Render() +{ + SetWindowText(g_hWnd, TEXT("리스타트레벨")); + return S_OK; +} + +pair> CLevel_Restart::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) +{ + CLevel_Restart* pInstance = new CLevel_Restart(pDevice, pContext, eLevelID); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CLevel_Restart"); + SAFE_RELEASE(pInstance); + } + + return { pInstance, nullptr }; +} + +void CLevel_Restart::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); +} diff --git a/Jusin154_Team3D/Client/Private/Light_Main.cpp b/Jusin154_Team3D/Client/Private/Light_Main.cpp new file mode 100644 index 000000000..7c279f486 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Light_Main.cpp @@ -0,0 +1,116 @@ +#include "pch.h" +#include "Light_Main.h" +#include "GameInstance.h" + +CLight_Main::CLight_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CLight_Main::CLight_Main(const CLight_Main& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CLight_Main::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CLight_Main::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 CLight_Main::Priority_Update(_float fTimeDelta) +{ + +} + +void CLight_Main::Update(_float fTimeDelta) +{ + +} + +void CLight_Main::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CLight_Main::Render() +{ + return S_OK; +} + +HRESULT CLight_Main::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 CLight_Main::Bind_ShaderResources() +{ + return S_OK; +} + +CLight_Main* CLight_Main::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CLight_Main* pInstance = new CLight_Main(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CLight_Main"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CLight_Main::Clone(void* pArg, CGameObject* pOwner) +{ + CLight_Main* pInstance = new CLight_Main(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CLight_Main"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CLight_Main::Free() +{ + __super::Free(); + + Safe_Release(m_pLightCom); +} + +void CLight_Main::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 4abe2e521..5afa6f641 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -2,6 +2,18 @@ #include "Loader.h" #include "GameInstance.h" #include "MainApp.h" +#include "Light_Main.h" +#include "Camera_Debug.h" + +#include "Player.h" +#include "Camera_Gaze.h" +#include "CamPosition_Player.h" +#include "CamPosition_Arm.h" +#include "Wand.h" +#include "SkyBox.h" +#include "Broom.h" +#include "Dummy_PhysXWall.h" +#include "Dummy_PhysXPlayable.h" CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } @@ -51,10 +63,18 @@ HRESULT CLoader::Loading() case LEVEL::GAMEPLAY: hr = Loading_For_GamePlay(); break; + case LEVEL::FIELD: + hr = Loading_For_Field(); + break; + case LEVEL::RESTART: + hr = Loading_For_Restart(); + break; default: break; } + CoUninitialize(); + if (FAILED(hr)){ return E_FAIL; } @@ -79,6 +99,14 @@ HRESULT CLoader::Loading_For_Logo() m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Debug::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLight_Main::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + m_strMessage = TEXT("로딩이 완료되었습니다.."); m_isFinished = true; @@ -90,6 +118,152 @@ HRESULT CLoader::Loading_For_GamePlay() { m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_MESH, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl"), + VTXMESH::Elements, VTXMESH::iNumElements)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_ANIMMESH, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl"), + VTXANIMMESH::Elements, VTXANIMMESH::iNumElements)))) { + return E_FAIL; + } + + m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); + + // Heavy Wall + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + { + Desc.eType = ACTOR::BOX; + Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ }; + Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; + Desc.vMatInfo = { 0.5f, 0.5f, 0.6f }; + Desc.fContactOffset = { 0.05f }; + Desc.vhalfGeometryInfo = { 2.5f, 4.5f, 3.5f }; + Desc.fDensity = 10.f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 100.f, 100.f }; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixIdentity())))) + return E_FAIL; + + /* For.Prototype_Component_SkyboxModel */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity())))) + return E_FAIL; + + + + + m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); + + /* For.Prototype_GameObject_SkyBox */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_Component_FSM */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Player */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Camera_Gaze */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Player */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Arm */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Arm::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Wand */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Broom */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + m_strMessage = TEXT("정보를 불러오는 중입니다."); + + m_strMessage = TEXT("로딩이 완료되었습니다.."); + + m_isFinished = true; + + return S_OK; +} + +HRESULT CLoader::Loading_For_Field() +{ + m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("정보를 불러오는 중입니다."); + + m_strMessage = TEXT("로딩이 완료되었습니다.."); + + m_isFinished = true; + + return S_OK; +} + +HRESULT CLoader::Loading_For_Restart() +{ + m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); + m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index b9c13c960..e6c5d9540 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -1,14 +1,14 @@ -#include "pch.h" +#include "pch.h" #include "MainApp.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "InfoInstance.h" #ifdef _DEBUG _float g_fTimeMult = 1.f; #endif // _DEBUG - CMainApp::CMainApp() : m_pGameInstance{ CGameInstance::GetInstance() } { @@ -74,7 +74,7 @@ HRESULT CMainApp::Render() m_pGameInstance->Draw(); GUI::Render(); - //m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("ÇǰïÇØ ¸ø ½á"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f)); + //m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("피곤해 못 써"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f)); ImGui_ImplDX11_RenderDrawData(GUI::GetDrawData()); m_pGameInstance->Render_End(); @@ -96,7 +96,14 @@ HRESULT CMainApp::Start_Level(LEVEL eLevelID) if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, eLevelID)))) { return E_FAIL; } - + m_pInfoInstance = CInfoInstance::GetInstance(); + if (nullptr == m_pInfoInstance) { + return E_FAIL; + } + SAFE_ADDREF(m_pInfoInstance); + if (FAILED(m_pInfoInstance->Initialize_Information(m_pDevice, m_pContext))) { + return E_FAIL; + } return S_OK; } @@ -157,6 +164,9 @@ void CMainApp::Free() { __super::Free(); + m_pInfoInstance->Release_Information(); + SAFE_RELEASE(m_pInfoInstance); + Release_IMGUI(); SAFE_RELEASE(m_pDevice); diff --git a/Jusin154_Team3D/Client/Private/MapInfo.cpp b/Jusin154_Team3D/Client/Private/MapInfo.cpp new file mode 100644 index 000000000..032d467fd --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MapInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "MapInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CMapInfo::CMapInfo() +{ +} + +void CMapInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CMapInfo* CMapInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CMapInfo* pInstance = new CMapInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp new file mode 100644 index 000000000..27d673a78 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "MonsterInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CMonsterInfo::CMonsterInfo() +{ +} + +void CMonsterInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CMonsterInfo* CMonsterInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CMonsterInfo* pInstance = new CMonsterInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMonsterInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp new file mode 100644 index 000000000..1c099c8b4 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -0,0 +1,504 @@ +#include "pch.h" +#include "Player.h" + +#include "GameInstance.h" +#include "CamPosition_Player.h" +#include "Camera_Gaze.h" +#include "CamPosition_Arm.h" +#include "Wand.h" +#include "Character_Controller.h" +#include "CallBack_Playable_Behavior.h" +#include "CallBack_Playable_HitReport.h" +#include "Character_Controller.h" + +#pragma region STATE +#include "State_Root.h" + +#include "State_Idle.h" +#include "State_Walk.h" +#include "State_Jog.h" +#include "State_Sprint.h" +#include "State_Dodge.h" +#include "State_Jump.h" +#include "State_Skill.h" +#include "State_Skill2.h" +#include "State_LightAttack.h" +#include "State_Land.h" +#include "State_Cast.h" +#include "State_Move.h" +#include "State_Combat.h" +#include "State_Idle_Turn.h" +#pragma endregion + +CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CUnit(pDevice, pContext) +{ +} + +CPlayer::CPlayer(const CPlayer& Prototype) + : CUnit(Prototype) +{ +} + +HRESULT CPlayer::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CPlayer::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components())) + return E_FAIL; + + + if (FAILED(Ready_Parts())) + return E_FAIL; + + Load_KeyFrame(); + + Add_FSM(); + + Set_FSM(); + + Set_Anim(); + + Setup_InputConditions(); + + m_pFSM->Change_State(FSMSTATE::ROOT); + + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + return S_OK; +} + +void CPlayer::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->RewindMomentum(); + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); + __super::Priority_Update(fTimeDelta); +} + +void CPlayer::Update(_float fTimeDelta) +{ + m_pModelCom->ComputeSkinning(); + + Key_Input(fTimeDelta); + + m_pFSM->Update(fTimeDelta); + + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + __super::Update(fTimeDelta); + Describe_Entity(); + m_pCharacter_Controller->Move(fTimeDelta); +} + +void CPlayer::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + + __super::Late_Update(fTimeDelta); +} + +HRESULT CPlayer::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_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + return E_FAIL; + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + +#ifdef _DEBUG + m_pCharacter_Controller->Render(); + //m_pRigidBody->Render(); +#endif + + return S_OK; +} + +HRESULT CPlayer::Ready_Components() +{ + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model"); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::CAPSULE; + Desc.fContactOffset = 0.1f; + Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.05f }; + Desc.fRadius = 0.5f; + Desc.fHeight = 1.0f; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Playable_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Playable_Behavior::Create(); + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + } + + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); + } + + return S_OK; +} + +HRESULT CPlayer::Ready_Parts() +{ + CWand::WAND_DESC WandDesc{}; + + WandDesc.pParentTransform = m_pTransformCom; + WandDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + + if (FAILED(Add_PartObject("Wand", g_iStaticLevel, nullptr, &WandDesc))) + { + return E_FAIL; + } + + CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{}; + + Desc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) + { + return E_FAIL; + } + + CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; + XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); + CameraArmDesc.pParentTransform = m_pTransformCom; + CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; + CameraArmDesc.fMouseSensor = 0.4f; + CameraArmDesc.fDistance = 4.f; + CameraArmDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { + return E_FAIL; + } + + CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 300.f; + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; + CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; + CameraDesc.iPriority = 51; + + CCamera_Gaze* pCamera = { nullptr }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) + { + return E_FAIL; + } + + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); + + return S_OK; +} + +HRESULT CPlayer::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; +} + +void CPlayer::Setup_InputConditions() +{ + m_InputConditions = + { + { FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }}, + { FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || + Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }}, + + + + { FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP) + /*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }}, + { FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }}, + { FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }}, + + { FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, + + { FSMSTATE::SPRINT, [&]() { return m_bSprintToggle + && m_pGameInstance->Key_Pressing(DIK_UP); }}, + { FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }}, + + { FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }}, + { FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }}, + { FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }}, + { FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }}, + { FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }}, + + { FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } } + }; +} + +void CPlayer::Key_Input(_float fTimeDelta) +{ + if (m_pFSM->Get_CurrState() == FSMSTATE::WALK || + m_pFSM->Get_CurrState() == FSMSTATE::SPRINT|| + m_pFSM->Get_CurrState() == FSMSTATE::DODGE|| + m_pFSM->Get_CurrState() == FSMSTATE::JOG) + { + if (m_pGameInstance->Key_Pressing(DIK_LEFT)) + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + + if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + + IsSprint(); + + IsWalk(); +} + +void CPlayer::Add_FSM() +{ +#pragma region MOVE + m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move()); + m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle()); + m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn()); + m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk()); + m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog()); + m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint()); + m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge()); +#pragma endregion + +#pragma region COMBAT + m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat()); + m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill()); + m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2()); + m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack()); + m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast()); +#pragma endregion + + m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump()); + m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land()); + + m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root()); + +} + +void CPlayer::Set_FSM() +{ +#pragma region ROOT + m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT); + m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT); + +#pragma endregion + +#pragma region MOVE + m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE); +#pragma endregion + +#pragma region COMBAT + m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT); + m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT); + m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT); + m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT); +#pragma endregion +} + +void CPlayer::Set_Anim() +{ + + m_Animation[STATEANIM::DODGE] = { 802,false }; + + m_Animation[STATEANIM::SKILL] = { 593,false }; + m_Animation[STATEANIM::SKILL2] = { 915,false }; + m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; + m_Animation[STATEANIM::LAND] = { 259,false }; + m_Animation[STATEANIM::CAST] = { 696,false }; + + m_Animation[STATEANIM::IDLE] = { 266,true }; + m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false }; + m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false }; + m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false }; + + m_Animation[STATEANIM::WALK_FWD] = { 625,true }; + m_Animation[STATEANIM::WALK_BWD] = { 166,true }; + m_Animation[STATEANIM::WALK_STOP] = { 344,false }; + + m_Animation[STATEANIM::JOG_FWD] = { 167,true }; + m_Animation[STATEANIM::JOG_STOP] = { 289,false }; + + m_Animation[STATEANIM::JUMP] = { 205,false }; + m_Animation[STATEANIM::JUMP_JOG] = { 203,false }; + m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false }; + + m_Animation[STATEANIM::SPRINT] = { 599,true }; + +} + +CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CPlayer* pInstance = new CPlayer(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CPlayer"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +CGameObject* CPlayer::Clone(void* pArg, CGameObject* pOwner) +{ + CPlayer* pInstance = new CPlayer(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CPlayer"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CPlayer::Free() +{ + __super::Free(); + + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + SAFE_RELEASE(m_pCharacter_Controller); + SAFE_RELEASE(m_pRigidBody); + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); + SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); + SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); +} + +void CPlayer::Describe_Entity() +{ + m_pCharacter_Controller->Describe_Entity(); + _float4 vMomentum = {}; + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + GUI::Text("%.1f %.1f %.1f %.1f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); + _char label[256]; + for (auto& iter : m_KeyFrames) + { + sprintf_s(label, "%s %.2f", iter.first.c_str(), iter.second); + + GUI::Text(label); + } + + _float3 Pos; + XMStoreFloat3(&Pos, Get_WorldPostion()); + + float Pos3[3] = { Pos.x, Pos.y, Pos.z }; + GUI::DragFloat3("Pos", Pos3); + + + _float RotR,RotU,RotL; + RotR = XMVectorGetX(m_pTransformCom->Get_State(STATE::RIGHT)); + RotU = XMVectorGetY(m_pTransformCom->Get_State(STATE::UP)); + RotL = XMVectorGetZ(m_pTransformCom->Get_State(STATE::LOOK)); + + float Rot3[3] = { RotR, RotU,RotL }; + GUI::DragFloat3("Rot", Rot3); + +} + +_bool CPlayer::Check(FSMSTATE::ESTATE state) +{ + for (auto& cond : m_InputConditions) + { + if (cond.state == state) + return cond.checker(); + } + return false; +} + +_bool CPlayer::IsSprint() +{ + if (m_pGameInstance->Key_Down(DIK_LSHIFT)) + { + return m_bSprintToggle = !m_bSprintToggle; + } + return false; +} + +_bool CPlayer::IsWalk() +{ + if (m_pGameInstance->Key_Down(DIK_C)) + { + return m_bWalkToggle = !m_bWalkToggle; + } + return false; +} diff --git a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp new file mode 100644 index 000000000..d355667a6 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "PlayerInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CPlayerInfo::CPlayerInfo() +{ +} + +void CPlayerInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CPlayerInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CPlayerInfo* CPlayerInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CPlayerInfo* pInstance = new CPlayerInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CPlayerInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Private/SkyBox.cpp b/Jusin154_Team3D/Client/Private/SkyBox.cpp new file mode 100644 index 000000000..e575e3870 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SkyBox.cpp @@ -0,0 +1,152 @@ +#include "pch.h" +#include "SkyBox.h" + +#include "GameInstance.h" +#include "Layer.h" +#include "Camera_Gaze.h" + +CSkyBox::CSkyBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CSkyBox::CSkyBox(const CSkyBox& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CSkyBox::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSkyBox::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + return S_OK; +} + +void CSkyBox::Priority_Update(_float fTimeDelta) +{ + +} + +void CSkyBox::Update(_float fTimeDelta) +{ + m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); +} + +void CSkyBox::Late_Update(_float fTimeDelta) +{ + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::PRIORITY, this); + } +} + +HRESULT CSkyBox::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))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + + return S_OK; +} + +HRESULT CSkyBox::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_SkyboxModel"), + 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 CSkyBox::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; +} + +CSkyBox* CSkyBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSkyBox* pInstance = new CSkyBox(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSkyBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSkyBox::Clone(void* pArg, CGameObject* pOwner) +{ + CSkyBox* pInstance = new CSkyBox(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSkyBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSkyBox::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); +} + +void CSkyBox::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Cast.cpp b/Jusin154_Team3D/Client/Private/State_Cast.cpp new file mode 100644 index 000000000..42c192faa --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Cast.cpp @@ -0,0 +1,67 @@ +#include "pch.h" +#include "State_Cast.h" +#include "Unit.h" + + +CState_Cast::CState_Cast() + :CState() +{ +} + +void CState_Cast::Enter() +{ + if (m_pFSM->Get_PrevState() == FSMSTATE::CAST) + return; + + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Cast::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Cast::Exit() +{ +} + +_bool CState_Cast::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::CAST)) + { + _uint combo = m_pOwner->Next_LightCombo(); + m_pOwner->Set_LightCombo(combo); + if (combo >= 3) + { + m_pOwner->Reset_LightCombo(); + return true; + } + + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST); + m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); + + m_pFSM->Change_State(FSMSTATE::CAST); + + return true; + } + + if (m_pOwner->Check(FSMSTATE::SKILL2)) + { + m_pOwner->Reset_LightCombo(); + m_pFSM->Change_State(FSMSTATE::SKILL2); + return true; + } + + return false; +} + +void CState_Cast::Free() +{ + __super::Free(); +} + +void CState_Cast::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Combat.cpp b/Jusin154_Team3D/Client/Private/State_Combat.cpp new file mode 100644 index 000000000..bdff385da --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Combat.cpp @@ -0,0 +1,60 @@ +#include "pch.h" +#include "State_Combat.h" +#include "Unit.h" + + +CState_Combat::CState_Combat() + :CState() +{ +} + +void CState_Combat::Enter() +{ + if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + + if (m_pOwner->Check(FSMSTATE::CAST)) + m_pFSM->Change_State(FSMSTATE::CAST); + + if (m_pOwner->Check(FSMSTATE::SKILL)) + m_pFSM->Change_State(FSMSTATE::SKILL); + + if (m_pOwner->Check(FSMSTATE::SKILL)) + m_pFSM->Change_State(FSMSTATE::SKILL); + + if (m_pOwner->Check(FSMSTATE::SKILL2)) + m_pFSM->Change_State(FSMSTATE::SKILL2); + +} + +void CState_Combat::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Combat::Exit() +{ +} + +_bool CState_Combat::CheckExitState() +{ + if (m_pOwner->IsCurrentKeyFrame("Jump")) + { + m_pOwner->Reset_LightCombo(); + m_pFSM->Change_State(FSMSTATE::MOVE); + return true; + } + + return false; +} + + +void CState_Combat::Free() +{ + __super::Free(); +} + +void CState_Combat::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Dodge.cpp b/Jusin154_Team3D/Client/Private/State_Dodge.cpp new file mode 100644 index 000000000..3c4ce4151 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Dodge.cpp @@ -0,0 +1,53 @@ +#include "pch.h" +#include "State_Dodge.h" +#include "Unit.h" + + +CState_Dodge::CState_Dodge() + :CState() +{ +} + +void CState_Dodge::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Dodge::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Dodge::Exit() +{ +} + +_bool CState_Dodge::CheckExitState() +{ + if (m_pModel->IsFinishedAnim()) + m_pFSM->Change_State(FSMSTATE::IDLE); + + if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge")) + m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge")) + m_pFSM->Change_State(FSMSTATE::JOG); + + + + return false; +} + +void CState_Dodge::Free() +{ + __super::Free(); +} + +void CState_Dodge::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Idle.cpp b/Jusin154_Team3D/Client/Private/State_Idle.cpp new file mode 100644 index 000000000..5f4140c0c --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Idle.cpp @@ -0,0 +1,71 @@ +#include "pch.h" +#include "State_Idle.h" +#include "Unit.h" + +CState_Idle::CState_Idle() + :CState() +{ +} + +void CState_Idle::Enter() +{ + if (m_pFSM->Get_PrevState() == FSMSTATE::JOG) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + return; + } + if (m_pFSM->Get_PrevState() == FSMSTATE::WALK) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + return; + } + else + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } +} + +void CState_Idle::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Idle::Exit() +{ +} + +_bool CState_Idle::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); + + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) + m_pFSM->Change_State(FSMSTATE::IDLE_TURN); + + if (m_pOwner->Check(FSMSTATE::JUMP)) + m_pFSM->Change_State(FSMSTATE::JUMP); + + return false; +} + +void CState_Idle::Free() +{ + __super::Free(); +} + +void CState_Idle::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp b/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp new file mode 100644 index 000000000..d0b9f1712 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Idle_Turn.cpp @@ -0,0 +1,88 @@ +#include "pch.h" +#include "State_Idle_Turn.h" +#include "Unit.h" + +CState_Idle_Turn::CState_Idle_Turn() + :CState() +{ +} + +void CState_Idle_Turn::Enter() +{ + if (m_pGameInstance->Key_Down(DIK_LEFT)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } + if (m_pGameInstance->Key_Down(DIK_RIGHT)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } + if (m_pGameInstance->Key_Down(DIK_DOWN)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } +} + +void CState_Idle_Turn::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Idle_Turn::Exit() +{ +} + +_bool CState_Idle_Turn::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::MOVE)) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + } + + if (m_pOwner->Check(FSMSTATE::COMBAT)) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + + if (m_pOwner->Check(FSMSTATE::SKILL)) + m_pFSM->Change_State(FSMSTATE::SKILL); + + if (m_pOwner->Check(FSMSTATE::SKILL2)) + m_pFSM->Change_State(FSMSTATE::SKILL2); + + if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + + if (m_pOwner->Check(FSMSTATE::CAST)) + m_pFSM->Change_State(FSMSTATE::CAST); + } + + if (m_pModel->IsFinishedAnim()) + m_pFSM->Change_State(FSMSTATE::IDLE); + + if (m_pOwner->Check(FSMSTATE::JUMP)) + m_pFSM->Change_State(FSMSTATE::JUMP); + + return false; +} + +void CState_Idle_Turn::Free() +{ + __super::Free(); +} + +void CState_Idle_Turn::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Jog.cpp b/Jusin154_Team3D/Client/Private/State_Jog.cpp new file mode 100644 index 000000000..b895ed11e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Jog.cpp @@ -0,0 +1,57 @@ +#include "pch.h" +#include "State_Jog.h" +#include "Unit.h" + +CState_Jog::CState_Jog() + :CState() +{ +} + +void CState_Jog::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + + m_pOwner->Reset_Sprint(); + m_pOwner->Reset_Walk(); +} + +void CState_Jog::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Jog::Exit() +{ +} + +_bool CState_Jog::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + + else if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + else if (!m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::IDLE); + + if (m_pOwner->Check(FSMSTATE::JUMP)) + m_pFSM->Change_State(FSMSTATE::JUMP); + + + return false; +} + +void CState_Jog::Free() +{ + __super::Free(); +} + +void CState_Jog::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Jump.cpp b/Jusin154_Team3D/Client/Private/State_Jump.cpp new file mode 100644 index 000000000..051f93fb0 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Jump.cpp @@ -0,0 +1,55 @@ +#include "pch.h" +#include "State_Jump.h" +#include "Unit.h" + + +CState_Jump::CState_Jump() + :CState() +{ +} + +void CState_Jump::Enter() +{ + if (m_pOwner->Check(FSMSTATE::SPRINT)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + return; + } + if (m_pOwner->Check(FSMSTATE::JOG)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + return; + } + + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Jump::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Jump::Exit() +{ +} + +_bool CState_Jump::CheckExitState() +{ + if (m_pOwner->IsCurrentKeyFrame("Jump")) + m_pFSM->Change_State(FSMSTATE::LAND); + + return false; +} + +void CState_Jump::Free() +{ + __super::Free(); +} + +void CState_Jump::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Land.cpp b/Jusin154_Team3D/Client/Private/State_Land.cpp new file mode 100644 index 000000000..7fda0cd37 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Land.cpp @@ -0,0 +1,49 @@ +#include "pch.h" +#include "State_Land.h" +#include "Unit.h" + + +CState_Land::CState_Land() + :CState() +{ +} + +void CState_Land::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Land::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Land::Exit() +{ +} + +_bool CState_Land::CheckExitState() +{ + if (m_pModel->IsFinishedAnim()) + m_pFSM->Change_State(FSMSTATE::IDLE); + + + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + return false; +} + +void CState_Land::Free() +{ + __super::Free(); +} + +void CState_Land::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_LightAttack.cpp b/Jusin154_Team3D/Client/Private/State_LightAttack.cpp new file mode 100644 index 000000000..aa2375570 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_LightAttack.cpp @@ -0,0 +1,69 @@ +#include "pch.h" +#include "State_LightAttack.h" +#include "Unit.h" + + +CState_LightAttack::CState_LightAttack() + :CState() +{ +} + +void CState_LightAttack::Enter() +{ + if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK) + return; + + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_LightAttack::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_LightAttack::Exit() +{ +} + +_bool CState_LightAttack::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) + { + _uint combo = m_pOwner->Next_LightCombo(); + m_pOwner->Set_LightCombo(combo); + if (combo >= 4) + { + m_pOwner->Reset_LightCombo(); + return true; + } + + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK); + m_pModel->Set_AnimationIndex(anim.first + combo, anim.second); + + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + + return true; + } + + + if (m_pOwner->Check(FSMSTATE::SKILL2)) + { + m_pOwner->Reset_LightCombo(); + m_pFSM->Change_State(FSMSTATE::SKILL2); + return true; + } + + return false; +} + + +void CState_LightAttack::Free() +{ + __super::Free(); +} + +void CState_LightAttack::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Move.cpp b/Jusin154_Team3D/Client/Private/State_Move.cpp new file mode 100644 index 000000000..cce8c760f --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Move.cpp @@ -0,0 +1,55 @@ +#include "pch.h" +#include "State_Move.h" +#include "Unit.h" + + +CState_Move::CState_Move() + :CState() +{ +} + +void CState_Move::Enter() +{ + + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) + m_pFSM->Change_State(FSMSTATE::IDLE_TURN); + + m_pFSM->Change_State(FSMSTATE::IDLE); +} + +void CState_Move::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Move::Exit() +{ +} + +_bool CState_Move::CheckExitState() +{ + return false; +} + + +void CState_Move::Free() +{ + __super::Free(); +} + +void CState_Move::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Root.cpp b/Jusin154_Team3D/Client/Private/State_Root.cpp new file mode 100644 index 000000000..efef8727b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Root.cpp @@ -0,0 +1,62 @@ +#include "pch.h" +#include "State_Root.h" +#include "Unit.h" + + +CState_Root::CState_Root() + :CState() +{ +} + +void CState_Root::Enter() +{ + if (m_pOwner->Check(FSMSTATE::COMBAT)) + m_pFSM->Change_State(FSMSTATE::COMBAT); + + else + m_pFSM->Change_State(FSMSTATE::MOVE); +} + +void CState_Root::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Root::Exit() +{ +} + +_bool CState_Root::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::COMBAT)) + { + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT) + m_pFSM->Change_State(FSMSTATE::COMBAT); + + return true; + } + + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT) + return false; + + if (m_pOwner->Check(FSMSTATE::MOVE)) + { + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE) + m_pFSM->Change_State(FSMSTATE::MOVE); + + return true; + } + + return false; +} + + +void CState_Root::Free() +{ + __super::Free(); +} + +void CState_Root::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Skill.cpp b/Jusin154_Team3D/Client/Private/State_Skill.cpp new file mode 100644 index 000000000..277606272 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Skill.cpp @@ -0,0 +1,40 @@ +#include "pch.h" +#include "State_Skill.h" +#include "Unit.h" + + +CState_Skill::CState_Skill() + :CState() +{ +} + +void CState_Skill::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Skill::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Skill::Exit() +{ +} + +_bool CState_Skill::CheckExitState() +{ + + return false; +} + +void CState_Skill::Free() +{ + __super::Free(); +} + +void CState_Skill::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Skill2.cpp b/Jusin154_Team3D/Client/Private/State_Skill2.cpp new file mode 100644 index 000000000..03704ac90 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Skill2.cpp @@ -0,0 +1,42 @@ +#include "pch.h" +#include "State_Skill2.h" +#include "Unit.h" + + +CState_Skill2::CState_Skill2() + :CState() +{ +} + +void CState_Skill2::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Skill2::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Skill2::Exit() +{ +} + +_bool CState_Skill2::CheckExitState() +{ + if (m_pModel->IsFinishedAnim()) + m_pFSM->Change_State(FSMSTATE::IDLE); + + return false; +} + +void CState_Skill2::Free() +{ + __super::Free(); +} + +void CState_Skill2::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Sprint.cpp b/Jusin154_Team3D/Client/Private/State_Sprint.cpp new file mode 100644 index 000000000..71efa2951 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Sprint.cpp @@ -0,0 +1,48 @@ +#include "pch.h" +#include "State_Sprint.h" +#include "Unit.h" + +CState_Sprint::CState_Sprint() + :CState() +{ +} + +void CState_Sprint::Enter() +{ + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT); + m_pModel->Set_AnimationIndex(anim.first, anim.second); +} + +void CState_Sprint::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; + +} + +void CState_Sprint::Exit() +{ +} + +_bool CState_Sprint::CheckExitState() +{ + if (!m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::JOG); + + else if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + if (m_pOwner->Check(FSMSTATE::JUMP)) + m_pFSM->Change_State(FSMSTATE::JUMP); + + return false; +} + +void CState_Sprint::Free() +{ + __super::Free(); +} + +void CState_Sprint::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Walk.cpp b/Jusin154_Team3D/Client/Private/State_Walk.cpp new file mode 100644 index 000000000..c49a5ee2b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Walk.cpp @@ -0,0 +1,54 @@ +#include "pch.h" +#include "State_Walk.h" +#include "Unit.h" + +CState_Walk::CState_Walk() + :CState() +{ +} + +void CState_Walk::Enter() +{ + if(m_pOwner->Check(FSMSTATE::FWD)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } + + if (m_pOwner->Check(FSMSTATE::BWD)) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + } +} + +void CState_Walk::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Walk::Exit() +{ +} + +_bool CState_Walk::CheckExitState() +{ + if (!m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::IDLE); + + else if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + + return false; +} + +void CState_Walk::Free() +{ + __super::Free(); +} + +void CState_Walk::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Wand.cpp b/Jusin154_Team3D/Client/Private/Wand.cpp new file mode 100644 index 000000000..5412960a8 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Wand.cpp @@ -0,0 +1,166 @@ +#include "pch.h" +#include "Wand.h" + +#include "GameInstance.h" + +CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject(pDevice, pContext) +{ +} + +CWand::CWand(const CWand& Prototype) + : CPartObject(Prototype) +{ +} + +HRESULT CWand::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CWand::Initialize(void* pArg) +{ + WAND_DESC* pDesc = static_cast (pArg); + m_pSocketMatrices = pDesc->pSocketMatrices; + + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CWand::Priority_Update(_float fTimeDelta) +{ + _matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + } + m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + + + //_float3 Scale = _float3(10.f, 10.f, 10.f); + //m_pTransformCom->Set_Scale(Scale); +} + +void CWand::Update(_float fTimeDelta) +{ +} + +void CWand::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); +} + +HRESULT CWand::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_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + 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 CWand::Ready_Components() +{ + __super::Ready_Components(nullptr); + + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Wand_Model"), + 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 CWand::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + 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; +} + + +CWand* CWand::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CWand* pInstance = new CWand(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CWand"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CWand::Clone(void* pArg, CGameObject* pOwner) +{ + CWand* pInstance = new CWand(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CWand"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CWand::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CWand::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Public/Broom.h b/Jusin154_Team3D/Client/Public/Broom.h new file mode 100644 index 000000000..621cc498e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Broom.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Client) + +class CBroom final : public CGameObject +{ +private: + CBroom(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CBroom(const CBroom& Prototype); + virtual ~CBroom() = 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: + 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 }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CBroom* 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 diff --git a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h new file mode 100644 index 000000000..3b4b4809e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_Behavior.h @@ -0,0 +1,47 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_EffectHitBox_Behavior final : public PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_EffectHitBox_Behavior(); +public: + ~CCallBack_EffectHitBox_Behavior(); + +public: + // 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; + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_EffectHitBox_Behavior* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h new file mode 100644 index 000000000..83080178e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_EffectHitBox_HitReport.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_EffectHitBox_HitReport final : public PSX::PxUserControllerHitReport +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_EffectHitBox_HitReport(); +public: + ~CCallBack_EffectHitBox_HitReport(); + +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; // 사용자 정의 장애물과 부딪힌 경우 + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_EffectHitBox_HitReport* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h new file mode 100644 index 000000000..fe3285125 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_Monster_Behavior.h @@ -0,0 +1,49 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_Monster_Behavior final : public PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_Monster_Behavior(); +public: + ~CCallBack_Monster_Behavior(); + + +public: + // 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; + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); + +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_Monster_Behavior* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h new file mode 100644 index 000000000..32211f294 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_Monster_HitReport.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_Monster_HitReport final : public PSX::PxUserControllerHitReport +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_Monster_HitReport(); +public: + ~CCallBack_Monster_HitReport(); + +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; // 사용자 정의 장애물과 부딪힌 경우 + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_Monster_HitReport* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h new file mode 100644 index 000000000..96c7a3715 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_Playable_Behavior.h @@ -0,0 +1,47 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_Playable_Behavior(); +public: + ~CCallBack_Playable_Behavior(); + +public: + // 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; + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_Playable_Behavior* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h new file mode 100644 index 000000000..f61ff974c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_Playable_HitReport.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CCallBack_Playable_HitReport final : public PSX::PxUserControllerHitReport +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_Playable_HitReport(); +public: + ~CCallBack_Playable_HitReport(); + +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; // 사용자 정의 장애물과 부딪힌 경우 + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_Playable_HitReport* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CamPosition.h b/Jusin154_Team3D/Client/Public/CamPosition.h new file mode 100644 index 000000000..6ebb2c5d4 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition.h @@ -0,0 +1,37 @@ +#pragma once + +#include "Client_Define.h" + +#include "PartObject.h" + +NS_BEGIN(Client) + +class CCamPosition abstract : public CPartObject +{ +public: + typedef struct tagCamPosition : public CPartObject::PARTOBJECT_DESC + { + + }CAMERAPOSITION_DESC; +protected: + CCamPosition(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition(const CCamPosition& rhs); + virtual ~CCamPosition() = default; + +protected: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; + + +public: + CGameObject* Clone(void* pArg, CGameObject* pOwner)PURE; + + virtual void Free() override; + + void Describe_Entity() override; + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Arm.h b/Jusin154_Team3D/Client/Public/CamPosition_Arm.h new file mode 100644 index 000000000..03d40cea9 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Arm.h @@ -0,0 +1,44 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Client) + +class CCamPosition_Arm final : public CCamPosition +{ +public: + typedef struct tagCameraArm_Desc : public CCamPosition::CAMERAPOSITION_DESC + { + _float3 fEye{}, fAt{}; + _float fMouseSensor{}; + _float fDistance{}; + }CameraArm_DESC; +private: + CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Arm(const CCamPosition_Arm& rhs); + virtual ~CCamPosition_Arm() = 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: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources(); + _bool m_bMovable = true; + _float m_fMouseSensor = {}; + _float m_fDistance = {}; + _float m_fAccDegreeY = { }; + +public: + static CCamPosition_Arm* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Arm* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Player.h b/Jusin154_Team3D/Client/Public/CamPosition_Player.h new file mode 100644 index 000000000..af5d2a68c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Player.h @@ -0,0 +1,39 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Client) + +class CCamPosition_Player final : public CCamPosition +{ +public: + typedef struct tagCamPosition_Player : public CCamPosition::CAMERAPOSITION_DESC + { + const _float4x4* pSocketMatrices = { }; + }CAMERAPOSITION_PLAYER_DESC; +private: + CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Player(const CCamPosition_Player& rhs); + virtual ~CCamPosition_Player() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; +private: + const _float4x4* m_pSocketMatrices = { }; + +public: + static CCamPosition_Player* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Player* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Camera_Debug.h b/Jusin154_Team3D/Client/Public/Camera_Debug.h new file mode 100644 index 000000000..0662b8e1e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Camera_Debug.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Client_Define.h" +#include "Camera.h" + +NS_BEGIN(Client) + +class CCamera_Debug final : public CCamera +{ +public: + typedef struct tagCamera_Debug : public CCamera::CAMERA_DESC + { + _float3 vEye{}, vAt{}; + _float fMouseSensor{}; + }CAMERA_DEBUG_DESC; + +private: + CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamera_Debug(const CCamera_Debug& rhs); + virtual ~CCamera_Debug() = 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: + _bool m_bMovable = true; + _float m_fMouseSensor = {}; + _float4x4 m_matInitial = {}; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Bind_ShaderResources() override; + void Set_InitialPos(); + +public: + static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamera_Debug* Clone(void* pArg, CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Camera_Gaze.h b/Jusin154_Team3D/Client/Public/Camera_Gaze.h new file mode 100644 index 000000000..0fbc8b059 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Camera_Gaze.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Client_Define.h" +#include "Camera.h" + +NS_BEGIN(Client) + +class CCamera_Gaze final : public CCamera +{ +public: + typedef struct tagCamera_Gaze : public CCamera::CAMERA_DESC + { + }CAMERA_GAZE_DESC; +private: + CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamera_Gaze(const CCamera_Gaze& rhs); + virtual ~CCamera_Gaze() = 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: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Bind_ShaderResources() override; + +public: + static CCamera_Gaze* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Client_Define.h b/Jusin154_Team3D/Client/Public/Client_Define.h index e369c022d..fdd0675aa 100644 --- a/Jusin154_Team3D/Client/Public/Client_Define.h +++ b/Jusin154_Team3D/Client/Public/Client_Define.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include "../Default/framework.h" @@ -7,8 +7,8 @@ namespace Client { - const unsigned int g_iWinSizeX = 1920; - const unsigned int g_iWinSizeY = 1080; + const unsigned int g_iWinSizeX = 1920; + const unsigned int g_iWinSizeY = 1080; } diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 1a7388311..1096d0d07 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -1,15 +1,19 @@ -#pragma once +#pragma once namespace Client { - enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, END }; + enum class LEVEL { STATIC, LOADING, LOGO, INTRO, GAMEPLAY, FIELD, RESTART, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; + enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; - enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, END }; + enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END }; -} \ No newline at end of file + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END }; + + enum class EFFECT_TYPE { EFFECT, TRAIL, END }; +} diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index b9f913fc8..074c0d74d 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -16,7 +16,9 @@ namespace Client { #define FX_NORTEX TEXT("FX_NORTEX") #define FX_CELL TEXT("FX_CELL") #define FX_PARTICLE TEXT("FX_PARTICLE") +#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL") #define FX_UIEDITOR TEXT("FX_UIEDITOR") +#define FX_UIINSTANCE TEXT("FX_UIINSTANCE") #pragma endregion #pragma region MACRO_PROTOTYPE @@ -26,6 +28,7 @@ namespace Client { #pragma endregion #pragma region OBJECT +#define CAMERA_DEBUG TEXT("CAMERA_DEBUG") #pragma endregion #pragma region COMPONENT @@ -48,7 +51,9 @@ namespace Client { #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") #pragma endregion #pragma region MACRO_TEXTURE diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h new file mode 100644 index 000000000..f1381cf4f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -0,0 +1,9 @@ +#pragma once + +NS_BEGIN(Engine) +class CTransform; +NS_END +NS_BEGIN(Client) + + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h new file mode 100644 index 000000000..4a929a9c7 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h @@ -0,0 +1,58 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" +#include "CallBack_Playable_Behavior.h" +#include "CallBack_Playable_HitReport.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Client) + +class CDummy_PhysXPlayable final : public CGameObject +{ +public: + typedef struct tagPhysXDummyDesc + { + _float3 vPos = { }; + _float3 vRotRPY = { }; + _uint iSubKind = { }; + }PHYSXDUMMY_DESC; +private: + CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs); + virtual ~CDummy_PhysXPlayable() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + + CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr }; + CCallBack_Playable_HitReport* m_pCallBack_HitReport = { 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_PhysXPlayable* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h new file mode 100644 index 000000000..54ddd9a08 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h @@ -0,0 +1,54 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Client) + +class CDummy_PhysXWall final : public CGameObject +{ +public: + typedef struct tagPhysXDummyDesc + { + _float3 vPos = { }; + _float3 vRotRPY = { }; + _uint iSubKind = { }; + }PHYSXDUMMY_DESC; +private: + CDummy_PhysXWall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXWall(const CDummy_PhysXWall& rhs); + virtual ~CDummy_PhysXWall() = 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: + CRigidBody* m_pRigidBody = { nullptr }; + const PSX::PxRigidDynamic* m_pActor = { nullptr }; + 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_PhysXWall* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h new file mode 100644 index 000000000..6fe77ff71 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CInfoInstance final : public CBase +{ + DECLARE_SINGLETON(CInfoInstance) +private: + CInfoInstance(); + virtual ~CInfoInstance() = default; +public: + HRESULT Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + void Release_Information(); + LEVEL Get_RestartLevel(); +public: + void Update(_float fTimeDelta); + + +private: + CGameInstance* m_pGameInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + + class CPlayerInfo* m_pPlayerInfo = { nullptr }; + class CMonsterInfo* m_pMonsterInfo = { nullptr }; + class CMapInfo* m_pMapInfo = { nullptr }; + +#ifdef _DEBUG + _string m_strLog = {}; +#endif // _DEBUG + +public: + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h new file mode 100644 index 000000000..58603e37f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -0,0 +1,37 @@ +#pragma once + +#include "Client_Define.h" +#include "Level.h" +NS_BEGIN(Engine) +NS_END +NS_BEGIN(Client) + +class CLevel_Field final : public CLevel +{ +private: + CLevel_Field(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual ~CLevel_Field() = default; + +public: + virtual void Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + +private: + virtual HRESULT Initialize() override; + HRESULT Initialize(void* pArg); + HRESULT Ready_Lights(); + HRESULT Ready_Markers(); + HRESULT Ready_Layer_UI(const _wstring& strLayerTag); + HRESULT Ready_Layer_Camera(); + HRESULT Ready_Layer_Sound(); + HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); + +public: + static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 877cdbbc0..d6a8103cc 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Level.h" @@ -16,6 +16,10 @@ class CLevel_GamePlay final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); @@ -25,10 +29,12 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Layer_Camera(); HRESULT Ready_Layer_Sound(); HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); + HRESULT Ready_Layer_Player(const _wstring& strLayerTag); + HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag); public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Logo.h b/Jusin154_Team3D/Client/Public/Level_Logo.h index da1546a74..7ace4888a 100644 --- a/Jusin154_Team3D/Client/Public/Level_Logo.h +++ b/Jusin154_Team3D/Client/Public/Level_Logo.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Level.h" @@ -15,6 +15,9 @@ class CLevel_Logo final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; HRESULT Ready_Layer_UI(const _wstring& strLayerTag); @@ -25,4 +28,4 @@ class CLevel_Logo final : public CLevel virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Restart.h b/Jusin154_Team3D/Client/Public/Level_Restart.h new file mode 100644 index 000000000..2b996f08c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Level_Restart.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Client_Define.h" +#include "Level.h" +NS_BEGIN(Engine) +NS_END +NS_BEGIN(Client) + + +class CLevel_Restart final : public CLevel +{ +private: + CLevel_Restart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual ~CLevel_Restart() = default; + +public: + virtual void Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + +private: + virtual HRESULT Initialize() override; + +private: + LEVEL m_eNextLevel = {}; +public: + static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Light_Main.h b/Jusin154_Team3D/Client/Public/Light_Main.h new file mode 100644 index 000000000..8b513af4d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Light_Main.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Client) + +class CLight_Main final : public CGameObject +{ +private: + CLight_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CLight_Main(const CLight_Main& Prototype); + virtual ~CLight_Main() = 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: + CLight* m_pLightCom = { nullptr }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CLight_Main* 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 diff --git a/Jusin154_Team3D/Client/Public/Loader.h b/Jusin154_Team3D/Client/Public/Loader.h index ab651f55d..fe9223f44 100644 --- a/Jusin154_Team3D/Client/Public/Loader.h +++ b/Jusin154_Team3D/Client/Public/Loader.h @@ -34,6 +34,8 @@ class CLoader final : public CBase HRESULT Initialize(LEVEL eNextLevelID); HRESULT Loading_For_Logo(); HRESULT Loading_For_GamePlay(); + HRESULT Loading_For_Field(); + HRESULT Loading_For_Restart(); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Client/Public/MainApp.h b/Jusin154_Team3D/Client/Public/MainApp.h index f65267e73..b168ae59f 100644 --- a/Jusin154_Team3D/Client/Public/MainApp.h +++ b/Jusin154_Team3D/Client/Public/MainApp.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Base.h" @@ -23,6 +23,7 @@ class CMainApp final : public CBase private: CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h new file mode 100644 index 000000000..51b82b9ff --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMapInfo final : public CBase +{ +private: + CMapInfo(); + ~CMapInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CMapInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h new file mode 100644 index 000000000..ab05fbb8f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMonsterInfo final : public CBase +{ +private: + CMonsterInfo(); + ~CMonsterInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CMonsterInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h new file mode 100644 index 000000000..9cab6a649 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -0,0 +1,75 @@ +#pragma once + +#include "Client_Define.h" +#include "Unit.h" + +NS_BEGIN(Client) + +class CPlayer final : public CUnit +{ +public: + struct InputCondition + { + FSMSTATE::ESTATE state; + function<_bool()> checker; + }; + +private: + CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CPlayer(const CPlayer& Prototype); + virtual ~CPlayer() = 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; + _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } + +private: + vector m_InputConditions; + _bool m_bSprintToggle = { false }; + _bool m_bWalkToggle = { false }; + class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; + class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; + + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + class CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr }; + class CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr }; +private: + HRESULT Ready_Components(); + HRESULT Ready_Parts(); + HRESULT Bind_ShaderResources(); + void Setup_InputConditions(); + void Key_Input(_float fTimeDelta); + +public: + static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; + +#pragma region STATE +private: + virtual void Add_FSM(); + virtual void Set_FSM(); + virtual void Set_Anim(); + _bool Check(FSMSTATE::ESTATE state); + _bool IsSprint(); + _bool IsWalk(); +public: + virtual void Reset_Sprint() { m_bSprintToggle = false; } + virtual void Reset_Walk() { m_bWalkToggle = false; } + + +#pragma endregion + + + + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h new file mode 100644 index 000000000..c76b406f2 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CPlayerInfo final : public CBase +{ +private: + CPlayerInfo(); + ~CPlayerInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CPlayerInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/SkyBox.h b/Jusin154_Team3D/Client/Public/SkyBox.h new file mode 100644 index 000000000..66fa6d6dd --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SkyBox.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Client) + +class CSkyBox final : public CGameObject +{ +private: + CSkyBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSkyBox(const CSkyBox& rhs); + virtual ~CSkyBox() = 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 CSkyBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Cast.h b/Jusin154_Team3D/Client/Public/State_Cast.h new file mode 100644 index 000000000..7e7dcc85b --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Cast.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Cast final : public CState +{ +public: + CState_Cast(); + virtual ~CState_Cast() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Combat.h b/Jusin154_Team3D/Client/Public/State_Combat.h new file mode 100644 index 000000000..b9359bf4b --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Combat.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Combat final : public CState +{ +public: + CState_Combat(); + virtual ~CState_Combat() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Dodge.h b/Jusin154_Team3D/Client/Public/State_Dodge.h new file mode 100644 index 000000000..4c171ee2f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Dodge.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Dodge final : public CState +{ +public: + CState_Dodge(); + virtual ~CState_Dodge() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Idle.h b/Jusin154_Team3D/Client/Public/State_Idle.h new file mode 100644 index 000000000..313baad80 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Idle.h @@ -0,0 +1,21 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Idle final : public CState +{ +public: + CState_Idle(); + virtual ~CState_Idle() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; + diff --git a/Jusin154_Team3D/Client/Public/State_Idle_Turn.h b/Jusin154_Team3D/Client/Public/State_Idle_Turn.h new file mode 100644 index 000000000..f06133aee --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Idle_Turn.h @@ -0,0 +1,21 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Idle_Turn final : public CState +{ +public: + CState_Idle_Turn(); + virtual ~CState_Idle_Turn() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; + diff --git a/Jusin154_Team3D/Client/Public/State_Jog.h b/Jusin154_Team3D/Client/Public/State_Jog.h new file mode 100644 index 000000000..66d093af5 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Jog.h @@ -0,0 +1,21 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + + +class CState_Jog final : public CState +{ +public: + CState_Jog(); + virtual ~CState_Jog() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Jump.h b/Jusin154_Team3D/Client/Public/State_Jump.h new file mode 100644 index 000000000..be66d9c71 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Jump.h @@ -0,0 +1,20 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Jump final : public CState +{ +public: + CState_Jump(); + virtual ~CState_Jump() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Land.h b/Jusin154_Team3D/Client/Public/State_Land.h new file mode 100644 index 000000000..df9c43b74 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Land.h @@ -0,0 +1,20 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Land final : public CState +{ +public: + CState_Land(); + virtual ~CState_Land() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_LightAttack.h b/Jusin154_Team3D/Client/Public/State_LightAttack.h new file mode 100644 index 000000000..38d74fc77 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_LightAttack.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_LightAttack final : public CState +{ +public: + CState_LightAttack(); + virtual ~CState_LightAttack() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Move.h b/Jusin154_Team3D/Client/Public/State_Move.h new file mode 100644 index 000000000..51fb9dcc6 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Move.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Move final : public CState +{ +public: + CState_Move(); + virtual ~CState_Move() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Root.h b/Jusin154_Team3D/Client/Public/State_Root.h new file mode 100644 index 000000000..6ecdcff7a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Root.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Root final : public CState +{ +public: + CState_Root(); + virtual ~CState_Root() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Skill.h b/Jusin154_Team3D/Client/Public/State_Skill.h new file mode 100644 index 000000000..0e9f53019 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Skill.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Skill final : public CState +{ +public: + CState_Skill(); + virtual ~CState_Skill() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Skill2.h b/Jusin154_Team3D/Client/Public/State_Skill2.h new file mode 100644 index 000000000..5d9b8d738 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Skill2.h @@ -0,0 +1,19 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + +class CState_Skill2 final : public CState +{ +public: + CState_Skill2(); + virtual ~CState_Skill2() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Sprint.h b/Jusin154_Team3D/Client/Public/State_Sprint.h new file mode 100644 index 000000000..55e015dc9 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Sprint.h @@ -0,0 +1,21 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + + +class CState_Sprint final : public CState +{ +public: + CState_Sprint(); + virtual ~CState_Sprint() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/State_Walk.h b/Jusin154_Team3D/Client/Public/State_Walk.h new file mode 100644 index 000000000..784d42f74 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Walk.h @@ -0,0 +1,21 @@ +#pragma once +#include "Client_Define.h" +#include "State.h" + + +class CState_Walk final : public CState +{ +public: + CState_Walk(); + virtual ~CState_Walk() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); + +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Client/Public/Wand.h b/Jusin154_Team3D/Client/Public/Wand.h new file mode 100644 index 000000000..88cd293f7 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Wand.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "PartObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Client) + +class CWand final : public CPartObject +{ +public: + typedef struct tagWand : public CPartObject::PARTOBJECT_DESC + { + const _float4x4* pSocketMatrices = { }; + }WAND_DESC; +private: + CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CWand(const CWand& Prototype); + virtual ~CWand() = 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: + const _float4x4* m_pSocketMatrices = { }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CWand* 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 diff --git a/Jusin154_Team3D/Editor/Bin/Bina.bin b/Jusin154_Team3D/Editor/Bin/Bina.bin index e69de29bb..f9086fc08 100644 --- a/Jusin154_Team3D/Editor/Bin/Bina.bin +++ b/Jusin154_Team3D/Editor/Bin/Bina.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:483245daa52fb9f1d759ba4af27e3ec148562da0a51b072518f256c1a9f78320 +size 2097152 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BaiscParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BaiscParticle.bin deleted file mode 100644 index 918c30892..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BaiscParticle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f97e1272ef22cebdc2bbc672b1267c98c6433aa7ffdf77ce3c34f71bd7c4cbd -size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle.bin deleted file mode 100644 index 4ea0d36a9..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97fe8d6e4c7c1b2461a92639a4683f746ff55dc7a821ce119ebe0d8a09373bfd -size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin index c9b54ca60..6183fa29e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:11bdf139c24c2065b691be072e6483f68870ab3a0a980f7c10aaf012a5ac75a0 +oid sha256:2555c12dba2f21a7e6665e808215b101554346d4d4188a0492e820092cb14977 size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin index 11d068b9d..a846374c5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:632fe36b935690a2838c92bb8be312d5d763a171423cae41e99dcfd8ba0bd445 +oid sha256:78c6852c3ec3ad9c51c2d509e16ec3304fbd98540971931caeab1f1bc68c0697 size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ConfingoTest.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ConfingoTest.bin deleted file mode 100644 index bc239d5c1..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ConfingoTest.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:016da9c4fc0e164f3914a6d45abfaf0a45f2a421e90b8c360c0581fa5be78023 -size 555 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin index 382829e76..200c53dfb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ded4807087aa32efaf780f2466e9bcd25dbf771c61e58eeb30b4ec1fbc9f451 +oid sha256:bdb7c592a817c35876780fe2dab7490ec8c5849e3e952abe27a67da358111e0e size 636 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin index 7523b1838..edd508f8f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba8f4656956e753b0378a2d8f6ce2f8dfa73014e885a59e8890cdedfd28daad2 +oid sha256:35cd480b8bfa4770b41f97451a691de39f33b5a985890648f18daacf4cc348c7 size 529 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin new file mode 100644 index 000000000..105617a53 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:828c5c1282287b21341ca4cc866b70f4507da74bcfef21e80f56c1ed0c97a327 +size 659 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin new file mode 100644 index 000000000..c5fcd5952 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4a18da098b58c4f873061ac055c96293ea49b224c2399554f6b66e75fed9e8a +size 642 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin index c15925e85..d0836eddc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:937ae454ea27b326ccc519afd84314adab8c658009e609f8217c525d26cdfb72 +oid sha256:0176747fde1a4de3b5993b84176737660b36aec02e85c4e17a14ce87cfd30f5e size 595 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin index 5225655a0..40b1db580 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:51af73356e47c2cfed59bd5d09728335e3cee1311e0790610c68cf86d8f32f83 +oid sha256:be6c55af6431d3dc243574715c75817a5e42690c33bc08fbf72f692cf0de4fb7 size 605 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin index 759a4f369..35a738020 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d81d1f57e021bd726103dbc896bca49c1cfcadac7366ca055b1067b9361132c1 +oid sha256:66d01cfcb231ffc12115f17e77894ddfe1cd179c5d16c7613fd689a7ddc05cb2 size 550 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin index 68b463e39..9c6a67e85 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26f5717dbfd5055a0b606134b5dd343e3f77bc02c3acfb3bbf50d3ecc1015bfd +oid sha256:0e75c29761f461e275e42fb74cf608a11b31c76d0e1d504cf7926a1b9211db74 size 607 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin index ce9742895..78a0bf3a2 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7806c0cc6f06d1b5dde93aeb8da7b7e36ead2684b56d9697d445c4e1781bd975 +oid sha256:1a6a790f7299ea457a56c0c9a711e3b10ed2905eb86a10946be78704305a09cc size 634 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/1.bin deleted file mode 100644 index be9aa71f0..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/1.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dafba43009b3809b1cf3b2886f9453f1fba5ad7c1c6551afd1dfc5634a4a245a -size 262 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin new file mode 100644 index 000000000..6fe41b744 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb36372372bf2af8134a67602cbfcb12d59453bd9de39d84dd5f6ca28e14e684 +size 178 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Projectile0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Projectile0.bin deleted file mode 100644 index 9119bfe76..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Projectile0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b72b06e1ce45740d09f46a051b0f99a4aaa53f057af0bc8ffbd74b78cd18b6f -size 633 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin new file mode 100644 index 000000000..070ef03e6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:642666d3fbe73ddb73f32e1d8647b81b79d90fe2cd00fbb315f117b546194fc8 +size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/SpreadRing.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/SpreadRing.bin deleted file mode 100644 index b74cb9d5d..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/SpreadRing.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:23ceeb532383f6a0506647edb2497de4827ac9d931e14be41ded9e5a77064dc6 -size 644 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin index ea52d381c..f12d2d4ac 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b80f4d457c7d8ce25daf73aa960db5d1a46b491d700a40f35e91a253546b0407 -size 588 +oid sha256:a9e94f9b76f314c1d3b6537ac73ab2035247c6cff7cca94ba355313569eba2d3 +size 642 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test2.bin deleted file mode 100644 index 74e029c11..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b7e9b058b855b5c589651bd350a4af99b30664bd1ff684d4d2a96d34e683d36f -size 586 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/TrailTest.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/TrailTest.bin deleted file mode 100644 index a727116fa..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/TrailTest.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a855f032a53ad0b5a1efd023bb02e4ffa10df3deeced2e5fd049a15615adfefc -size 550 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BaiscParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BaiscParticle.bin deleted file mode 100644 index 64103f049..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BaiscParticle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e51157f496aa53487d5ff04f60d1b871a4be3773ddc43cf36895d79f4ba2f27e -size 598 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle.bin deleted file mode 100644 index 1b1e9059f..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:99cde9fe783c6e2c4cad26263ae72294e0c87784961cdc69953467ae08ace0de -size 598 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin index 0e4cd0d00..d3e2ee6f1 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c047e6c3570b1d26e85ebdd12617172b050be798fb4ed1ec40b9335fff94e769 -size 598 +oid sha256:a1b8dbceb9ca07dc22e4737226a682a7a8db90860fe75ee7451d90ba30941797 +size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin index 396ed3956..11d068b9d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f640193ab520cf9c49e9c987cbe0f506d353d27e8a01a67a7e2c049af32cb421 -size 598 +oid sha256:632fe36b935690a2838c92bb8be312d5d763a171423cae41e99dcfd8ba0bd445 +size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin index 96653610c..382829e76 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:59daade7d260f4a7cf9af81a3f09b2a00f6155b786ac7d30552a6d8376fdf5de -size 628 +oid sha256:7ded4807087aa32efaf780f2466e9bcd25dbf771c61e58eeb30b4ec1fbc9f451 +size 636 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin index 5708bf8d4..7523b1838 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:448d9913e85573500e2b86c046b8711a342f28597b9fa63048adf92cf7e458b1 -size 521 +oid sha256:ba8f4656956e753b0378a2d8f6ce2f8dfa73014e885a59e8890cdedfd28daad2 +size 529 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin new file mode 100644 index 000000000..105617a53 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:828c5c1282287b21341ca4cc866b70f4507da74bcfef21e80f56c1ed0c97a327 +size 659 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin new file mode 100644 index 000000000..049eb352e --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b219de38477c95013742c4d3110c679380c3e147589a067ab8d2aceaeaf0c440 +size 642 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin index 3e9ac4786..c15925e85 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82890f11a1561ca32e8504d5dec11a18ef3dae00f490f70a9581a529b0ca2304 -size 587 +oid sha256:937ae454ea27b326ccc519afd84314adab8c658009e609f8217c525d26cdfb72 +size 595 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin index 55291ea6b..5225655a0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:69c6354c06138ef2b34377e13964d14412600eb5b0f88b21d55e6571b34890c1 -size 597 +oid sha256:51af73356e47c2cfed59bd5d09728335e3cee1311e0790610c68cf86d8f32f83 +size 605 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin index cd81664d3..759a4f369 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:022d6dcae155a8a1c369aa275ed56e533d5a3afb417b5fed9d6b9345ec05b008 -size 542 +oid sha256:d81d1f57e021bd726103dbc896bca49c1cfcadac7366ca055b1067b9361132c1 +size 550 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin index 41a49338d..68b463e39 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cab580f863401e8351fda8c05e5accb6c02b0424d678d65de802b7827ebdad5d -size 599 +oid sha256:26f5717dbfd5055a0b606134b5dd343e3f77bc02c3acfb3bbf50d3ecc1015bfd +size 607 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin index 2bdbb53ff..ce9742895 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44e2ce0bc50ae9ef56e8b48444ee2d3795925e1776086701f9be47b9cb09ad0f -size 626 +oid sha256:7806c0cc6f06d1b5dde93aeb8da7b7e36ead2684b56d9697d445c4e1781bd975 +size 634 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin new file mode 100644 index 000000000..070ef03e6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:642666d3fbe73ddb73f32e1d8647b81b79d90fe2cd00fbb315f117b546194fc8 +size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/SpreadRing.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/SpreadRing.bin deleted file mode 100644 index b74cb9d5d..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/SpreadRing.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:23ceeb532383f6a0506647edb2497de4827ac9d931e14be41ded9e5a77064dc6 -size 644 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Texture2D_0.png b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Texture2D_0.png new file mode 100644 index 000000000..08b901ec1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Texture2D_0.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin index 12f29295b..5ca18c2a5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f0e6a868bc07861d4cb0e0cd80ab163ac81805701331463b5401bf74c71e86d -size 29 +oid sha256:8b12395ad9cb7848a23935a1241595b4a1a2ffbcde890ba0d2e04a3d7fda7478 +size 43 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom.fbx index 9bb677d77..1b2b3a395 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d071b22f597d86953d9e1751b79a9ae97fffdd2367856ee03f6bf3c500c7b40 -size 3138924 +oid sha256:3960d6a8980bd6332d69d85052d43a7ec1114b0c374b17217c4f7f65e8335e1f +size 3140380 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom1.fbx new file mode 100644 index 000000000..9bb677d77 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d071b22f597d86953d9e1751b79a9ae97fffdd2367856ee03f6bf3c500c7b40 +size 3138924 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom2.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom2.fbx new file mode 100644 index 000000000..097c78d1c --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/Broom2.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f6b93e36368852a0fa56c73e6ec2d0d17a5339cc78961fb865b73c25da46e4e +size 3122780 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/T_FlightClassBroom_01_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/T_FlightClassBroom_01_MRO.png new file mode 100644 index 000000000..c3a2ac1b8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Broom/T_FlightClassBroom_01_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_D.png new file mode 100644 index 000000000..5f61579a5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_N.png new file mode 100644 index 000000000..2b8226301 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/T_Wands_Wand11_Var3_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin new file mode 100644 index 000000000..1152ce122 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dae722244305fb3823d451fed4da562203acc0ab8fb0c8b7453e86957cd34091 +size 68813 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx new file mode 100644 index 000000000..26368a479 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e697d4c19ca0e1ca9218635ee93a5dd9b758003778ab2809df5f17e5cee46076 +size 41420 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 8c6fbe9e9..3b37f3b2c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -134,8 +134,8 @@ BlendState BS_WB_Acc DestBlend[0] = one; BlendOp[0] = Add; - SrcBlend[1] = Zero; - DestBlend[1] = Inv_Src_Alpha; + SrcBlend[1] = Inv_Src_Alpha; + DestBlend[1] = zero; BlendOp[1] = Add; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 1a8c94894..b8aba5069 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -119,7 +119,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; - float fRoughness = 0.5f; + float fRoughness = 0.f; float fOcclusion = 1.f; float fAttenuation = 1.f; @@ -146,12 +146,12 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fOcclusion = vSRO.b; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); PBR_Out.vShade *= fDiffuseAOStrength; - + saturate(PBR_Out.vShade); Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -355,6 +355,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f); Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static)); + //float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x; //float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x; //bool IsShadow = { false }; @@ -389,6 +390,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) //} //[loop] // 변수로 루프돌리려면 반드시 필요함 + for (int i = -15; i < 16; ++i) { vTexcoord.x = In.vTexcoord.x; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 5c8f5c81a..cb79ebc0b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -50,7 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); if (0.f == vColorTexture.a) { diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl new file mode 100644 index 000000000..31276135c --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -0,0 +1,64 @@ +float PI = 3.141592; + +struct Mesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; + + uint4 vBlendIndex; + float4 vBlendWeight; +}; + +struct SkinngMesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; + +}; + +StructuredBuffer g_MeshBufferInput : register(t0); +RWStructuredBuffer gSkinngMeshOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) +{ + row_major float4x4 BoneMatrix[512]; +}; + +//[numthreads(256, 1, 1)] +[numthreads(256, 1, 1)] +void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) +{ + uint iIndex = DispatchThreadID.x; + + Mesh mesh = g_MeshBufferInput[iIndex]; + + float fWeightW = 1.f - + (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + + matrix SkinMatrix = + BoneMatrix[mesh.vBlendIndex.x] * mesh.vBlendWeight.x + + BoneMatrix[mesh.vBlendIndex.y] * mesh.vBlendWeight.y + + BoneMatrix[mesh.vBlendIndex.z] * mesh.vBlendWeight.z + + BoneMatrix[mesh.vBlendIndex.w] * fWeightW; + + float4 vPosition = mul(float4(mesh.vPosition, 1), SkinMatrix); + float4 vNormal = mul(float4(mesh.vNormal, 0), SkinMatrix); + float4 vBinormal = mul(float4(mesh.vBinormal, 0), SkinMatrix); + float4 vTangent = mul(float4(mesh.vTangent, 0), SkinMatrix); + + + SkinngMesh outv; + outv.vPosition = vPosition.xyz; + outv.vNormal = vNormal.xyz; + outv.vTangent = vTangent.xyz; + outv.vBinormal = vBinormal.xyz; + outv.vTexcoord = mesh.vTexcoord; + + gSkinngMeshOutput[iIndex] = outv; +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 7f503e59b..e614342ce 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -287,24 +287,24 @@ PS_OUT PS_NineSlice(PS_IN In) float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 Color = float4(1.f, 1.f, 1.f, 1.f); float2 uv = In.vTexcoord; - float2 CurrentPixelPosition = uv * g_fCurrent_Size; - float OriginLeft = g_fNine_Slice.x; - float OriginRight = g_fNine_Slice.y; - float OriginTop = g_fNine_Slice.z; - float OriginBottom = g_fNine_Slice.w; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; - float CurrentLeft = OriginLeft; - float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); - float CurrentTop = OriginTop; - float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); float2 Finaluv = In.vTexcoord; - if(CurrentPixelPosition.x < CurrentLeft) + if (CurrentPixelPosition.x < CurrentLeft) { Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; } - else if(CurrentPixelPosition.x >CurrentRight) + else if (CurrentPixelPosition.x > CurrentRight) { float dist = CurrentPixelPosition.x - CurrentRight; Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; @@ -315,11 +315,11 @@ PS_OUT PS_NineSlice(PS_IN In) Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); } - if(CurrentPixelPosition.y < CurrentTop) + if (CurrentPixelPosition.y < CurrentTop) { Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; } - else if(CurrentPixelPosition.y > CurrentBottom) + else if (CurrentPixelPosition.y > CurrentBottom) { float dist = CurrentPixelPosition.y - CurrentBottom; Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; @@ -360,82 +360,21 @@ PS_OUT PS_Rotation(PS_IN In) Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); Rotation += center; - if (g_iSpellType == 0) - { - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - - color.a *= Alpha; - - Out.vColor = color; - return Out; - } - //int iTotalFrame = g_iImageCountX * g_iImageCountY; - //int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; - //int iFrameX = iCurrentFrame % g_iImageCountX; - //int iFrameY = iCurrentFrame / g_iImageCountX; - //float fFreamWidth = 1.0 / g_iImageCountX; - //float fFreamHeight = 1.0 / g_iImageCountY; - - //float2 UV = In.vTexcoord; - //UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; - //UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; - - //float4 tex3 = g_Texture2.Sample(DefaultSampler, UV); - //if (tex3.r <= 0.5f) - // discard; - float3 BGColor = float3(1.f, 1.f, 1.f); - - switch (g_iSpellType) - { - case 1: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; - break; - case 2: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; - break; - case 3: - BGColor = float3(190.f, 46., 34.f) / 255.f; - break; - case 4: - BGColor = float3(37.f, 129.f, 162.f) / 255.f; - break; - case 5: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; - break; - case 6: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; - break; - case 7: - BGColor = float3(0.f, 0.f, 0.f); - break; - } - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - tex1.rgb *= BGColor; float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - if (tex2.a >= 0.9f) - tex1 = tex2; + + tex1.rgb *= 0.4f; color = tex1; - //color = tex3; - - float CoolTime = 1.f - g_fDeltaV; - if (In.vTexcoord.y <= CoolTime) - { - color.a = 0.f; - } - - + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + color.a *= Alpha; + Out.vColor = color; return Out; + } PS_OUT PS_Slot(PS_IN In) @@ -463,23 +402,73 @@ PS_OUT PS_Slot(PS_IN In) PS_OUT PS_SpellAnim(PS_IN In) { PS_OUT Out; - float4 color = float4(1.f, 1.f, 1.f, 1.f); - //float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - //float2 center = float2(0.5f, 0.5f); - //float2 uv = In.vTexcoord - center; - //uv *= sqrt(2.0f); - //float2 Rotation = In.vTexcoord; - //Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - //Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - //Rotation += center; + float4 color = float4(1.f, 1.f, 1.f, 1.f); + + float3 BGColor = float3(1.f, 1.f, 1.f); - //float4 color = g_Texture.Sample(ClampSampler, Rotation); + switch (g_iSpellType) + { + case 0: + BGColor = float3(208.f, 179.f, 54.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(37.f, 129.f, 162.f) / 255.f; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + case 5: + BGColor = float3(0.f, 80.f, 55.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } - //color.a *= Alpha; + float2 uv = In.vTexcoord; + float CoolTime = 1.f - g_fDeltaV; + float CoolTime2 = 1.f - g_fDeltaV + 0.05; + + float4 tex1 = g_Texture.Sample(ClampSampler, uv); + tex1.rgb *= BGColor; + float4 tex2 = g_Texture1.Sample(DefaultSampler, uv); + + if (tex2.a >= 0.9f) + tex1 = tex2; + + color = tex1; + + float wave1 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + + float waveThreshold1 = CoolTime + wave1; + float waveThreshold2 = CoolTime2 + wave2; - Out.vColor = color; + if (g_fDeltaV <= 1.f) + { + if (uv.y >= waveThreshold1 && uv.y <= waveThreshold2) + { + color.rgb = float3(1.f, 1.f, 1.f); + } + } + if (uv.y <= CoolTime) + { + color.a = 0.f; + } + + color.a *= Alpha; + + Out.vColor = color; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index db2d298b1..029accc32 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -29,14 +29,17 @@ VS_OUT VS_MAIN(VS_IN In) { VS_OUT Out; - matrix matWV = mul(g_WorldMatrix, g_ViewMatrix); - matrix matWVP = mul(matWV, g_ProjMatrix); + matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); - float3 scaledPos = In.vPosition; - scaledPos.xy *= In.vSize; // 인스턴스 스케일 적용 - scaledPos.xy += In.Pos; // 인스턴스 위치 적용 + float3 vLocalPos = In.vPosition; + vLocalPos.xy *= In.vSize; + vLocalPos.xy += In.Pos; - Out.vPosition = mul(float4(scaledPos, 1.f), matWVP); + float3 vParentPos = float3(g_WorldMatrix._41, g_WorldMatrix._42, g_WorldMatrix._43); + + float3 vFinalWorldPos = vLocalPos + vParentPos; + + Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); Out.vTexcoord = In.vTexcoord; return Out; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index b09ad0258..e0fd8e188 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -1,6 +1,17 @@ #include "Engine_Shader_Defines.hlsli" +struct SkinngMesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; +}; + + + matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; bool g_bRimLight; @@ -14,11 +25,13 @@ float3 g_vRimColor; float4 g_TestColor; vector g_vCamPosition; -Texture2D g_DiffuseTexture; -Texture2D g_NormalTexture; -Texture2D g_DAOTexture; -Texture2D g_THVTexture; -Texture2D g_SurfaceParamsTexture; +Texture2D g_DiffuseTexture : register(t0); +Texture2D g_NormalTexture : register(t1); +Texture2D g_DAOTexture : register(t2); +Texture2D g_THVTexture : register(t3); +Texture2D g_SurfaceParamsTexture : register(t4); + +StructuredBuffer g_SkinngMesh : register(t5); float3 g_RootColor; float3 g_TipColor; @@ -54,26 +67,31 @@ struct VS_OUT float4 vWorldPos : TEXCOORD1; float4 vProjPos : TEXCOORD2; }; - -VS_OUT VS_MAIN(VS_IN In) +VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID) { VS_OUT Out; - float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + //float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); - matrix BoneMatrix = - mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + - mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + - mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + - mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + //matrix BoneMatrix = + // mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + // mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + // mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + // mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); - vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); - vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); - vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); - vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); + //vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + //vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + //vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); + //vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); - matrix matWV, matWVP; + + vector vPosition = float4(g_SkinngMesh[vertexID].vPosition, 1.f); + + vector vNormal = float4(g_SkinngMesh[vertexID].vNormal, 0.f); + vector vBinormal = float4(g_SkinngMesh[vertexID].vBinormal, 0.f); + vector vTangent = float4(g_SkinngMesh[vertexID].vTangent, 0.f); + matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -81,7 +99,8 @@ VS_OUT VS_MAIN(VS_IN In) Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; - Out.vTexcoord = In.vTexcoord; + Out.vTexcoord = g_SkinngMesh[vertexID].vTexcoord; + //In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; return Out; @@ -200,7 +219,7 @@ struct PS_OUT PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); if (vMtrlDiffuse.a < 0.2f) { discard; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 59f96a378..01cc9d648 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -82,6 +82,7 @@ bool g_isMaskUVMove; bool g_isNoiseUVMove; bool g_isReverseDissolve; +bool g_isEmissiveDissolve; float g_fFar; @@ -158,11 +159,11 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) { VS_OUT Out = (VS_OUT) 0; - row_major matrix matW, matWV, matWVP; + matrix matW, matWV, matWVP; - row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); - matW = mul(g_WorldMatrix, TransformMatrix); + matW = mul(TransformMatrix, g_WorldMatrix); matWV = mul(matW, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -427,15 +428,23 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) discard; Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); + - if (vMtrlDiffuse.a / g_fDiffuseAlpha > g_fEmissiveCutAlpha) + float fEmissiveCutAlpha = g_fEmissiveCutAlpha; + + if (g_isEmissiveDissolve == true) { - float3 vEmissiveColor= g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); - Out.vColorTarget = vector(vEmissiveColor, vMtrlDiffuse.a); + fEmissiveCutAlpha += (In.vLifeTime.x / In.vLifeTime.y) / 2; } - - else - Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + + float fSmoothAlpha = smoothstep(fEmissiveCutAlpha - 0.1f, fEmissiveCutAlpha + 0.1f, vMtrlDiffuse.a); + + + + float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); + + Out.vColorTarget = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); + return Out; } @@ -456,7 +465,7 @@ VS_BLUR_OUT VS_BLUR(VS_IN In, uint iGPUIndex : SV_InstanceID) row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); - matW = mul(g_WorldMatrix, TransformMatrix); + matW = mul(TransformMatrix, g_WorldMatrix); matWV = mul(matW, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); @@ -483,7 +492,6 @@ struct PS_BLUR_IN struct PS_BLUR_OUT { float4 vDiffuse : SV_TARGET0; - float4 vBlurWeight : SV_TARGET1; }; @@ -492,7 +500,6 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) PS_BLUR_OUT Out; - vector vMtrlDiffuse; vector vMtrlMask; vector vMtrlNoise; @@ -540,6 +547,8 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) /* 최종 색깔 */ vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); + + if (g_vColor.a > 0) vMtrlDiffuse += g_vColor; @@ -582,8 +591,6 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity; - - } if (g_isMaskUVMove) @@ -599,9 +606,13 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { vMtrlMask.r = 1.f; } + + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); + + if (vMtrlDiffuse.a <= 0.f) discard; @@ -619,23 +630,24 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) discard; } + } vMtrlDiffuse.a *= g_fDiffuseAlpha; // 색깔 추가할 처리 (이미시브) + vector vEmissive; + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); - if (g_isEmissive == true) - { - vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); - } - + float fSmoothAlpha = smoothstep(g_fEmissiveCutAlpha - 0.02f, g_fEmissiveCutAlpha + 0.02f, vMtrlDiffuse.a); + float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); - Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity; - Out.vBlurWeight.r = g_iBlurWeight / 32.f; + vEmissive = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); + + Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity + vEmissive; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png new file mode 100644 index 000000000..f59fd8019 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png differ diff --git a/Jusin154_Team3D/Editor/Default/.bin b/Jusin154_Team3D/Editor/Default/.bin deleted file mode 100644 index 2b6446a32..000000000 --- a/Jusin154_Team3D/Editor/Default/.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ac60a0f0ae19993b3f65f8baf2d3333e47fe9372d7fed070e6a40e347278033 -size 372 diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 04b874e45..8d2b7722f 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -167,10 +167,16 @@ + + + + + + @@ -182,10 +188,14 @@ true true + true true + + true + false @@ -207,7 +217,6 @@ - @@ -226,6 +235,7 @@ false + @@ -236,6 +246,7 @@ + @@ -277,6 +288,7 @@ + @@ -287,10 +299,16 @@ + + + + + + @@ -302,10 +320,14 @@ true true + true true + + true + false @@ -327,7 +349,6 @@ - @@ -346,6 +367,7 @@ false + @@ -356,6 +378,7 @@ + @@ -398,6 +421,7 @@ Create + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 4237eaa35..253f9506f 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -16,9 +16,6 @@ {79dcc46a-5ae9-48bb-962b-8984b15e4f5a} - - {fc210c4d-b8a6-4ed4-b19c-4bd175232e5f} - {47a1f529-dd0e-4f37-9ada-5aa6731dea0b} @@ -315,7 +312,7 @@ {8882358e-c8eb-4222-a87e-01d902533b8f} - + {3614836d-9988-4ec0-95a8-f8ebc25a9a13} @@ -328,6 +325,36 @@ {a9862861-6eaa-4e04-b7f6-217a32db7db4} + + {80f4e763-20bb-47c1-b1de-ac11bc28bad8} + + + {d35cf4c8-1838-4cf3-80ff-69ef27435792} + + + {1b1b3388-cfea-4d6a-b93d-aa174317f573} + + + {7b7439b1-f2e5-4233-bf26-4db2b41307b7} + + + {0db597d8-c4e7-479a-9b7e-9014b79a5e03} + + + {072a4e85-ba07-4ffd-bdb1-ddac02558242} + + + {4982a8ed-d04a-4d4d-804f-3f45ca1d9dd2} + + + {1c11a2a1-ad0a-4f0b-8a86-5ab9fc68a69f} + + + {b899b53a-c8cf-451a-ab5d-6945cac88276} + + + {92110a48-81d0-4e98-be06-05dd078d0488} + @@ -522,9 +549,6 @@ 02.GameObjects\Dummys\DummySkyBox - - 03.Information - 02.GameObjects\MainLight @@ -632,8 +656,7 @@ 02.GameObjects\Layer_Effect\Effect\05.NomalJap - - + 80.State\State_Combat\State_Skill2 @@ -645,7 +668,39 @@ 02.GameObjects\Broom - + + + 02.GameObjects\Dummys\DummyPhysX\PhysXHitBox + + + 02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\HitBox + + + 02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\HitBox + + + 02.GameObjects\Dummys\DummyPhysX\PhysXEffectHitBox + + + 50.UI\GamePlay_Canvas\Action_Panel\Slot_Number + + + 02.GameObjects\Camera\Camera_Gaze + + + 02.GameObjects\Camera\CameraPosition + + + 02.GameObjects\Camera\CameraPosition\Player + + + 02.GameObjects\Camera + + + 80.State + + + 02.GameObjects\Wand @@ -837,9 +892,6 @@ 02.GameObjects\Dummys\DummySkyBox - - 03.Information - 02.GameObjects\MainLight @@ -959,7 +1011,39 @@ 02.GameObjects\Broom - + + + 02.GameObjects\Dummys\DummyPhysX\PhysXHitBox + + + 02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\HitBox + + + 02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\HitBox + + + 02.GameObjects\Dummys\DummyPhysX\PhysXEffectHitBox + + + 50.UI\GamePlay_Canvas\Action_Panel\Slot_Number + + + 02.GameObjects\Camera\Camera_Gaze + + + 02.GameObjects\Camera\CameraPosition + + + 02.GameObjects\Camera\CameraPosition\Player + + + 02.GameObjects\Camera + + + 80.State + + + 02.GameObjects\Wand diff --git a/Jusin154_Team3D/Editor/Private/Broom.cpp b/Jusin154_Team3D/Editor/Private/Broom.cpp index 0381be466..d31202546 100644 --- a/Jusin154_Team3D/Editor/Private/Broom.cpp +++ b/Jusin154_Team3D/Editor/Private/Broom.cpp @@ -59,10 +59,6 @@ HRESULT CBroom::Render() for (_uint i = 0; i < iNumMeshes; i++) { - if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { - return E_FAIL; - } - if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } @@ -70,6 +66,9 @@ HRESULT CBroom::Render() return E_FAIL; } + if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + return E_FAIL; + if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp new file mode 100644 index 000000000..140eb3454 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp @@ -0,0 +1,97 @@ +#include "pch.h" +#include "CallBack_EffectHitBox_Behavior.h" +#include "GameInstance.h" + + +CCallBack_EffectHitBox_Behavior::CCallBack_EffectHitBox_Behavior() +{ +} + +CCallBack_EffectHitBox_Behavior::~CCallBack_EffectHitBox_Behavior() +{ +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + if (nullptr == actor.userData) { + return PSX::PxControllerBehaviorFlags(0); + } + PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); + PhsXUserData* pActorData = static_cast(actor.userData); + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case PHYSX_KIND::BODY_DYNAMIC: + switch (pActorData->iSubKind) + { + case 20: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + break; + case 21: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 22: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 23: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 24: + eResults = PSX::PxControllerBehaviorFlags(0); + break; + default: + break; + } + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + + return eResults; +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 + return PSX::PxControllerBehaviorFlags(0); +} + +PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacle이 움직이는 발판이다? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(0); +} + +HRESULT CCallBack_EffectHitBox_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_EffectHitBox_Behavior::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_EffectHitBox_Behavior* CCallBack_EffectHitBox_Behavior::Create() +{ + return new CCallBack_EffectHitBox_Behavior(); +} diff --git a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp new file mode 100644 index 000000000..f4d5a5677 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp @@ -0,0 +1,148 @@ +#include "pch.h" +#include "CallBack_EffectHitBox_HitReport.h" +#include "GameInstance.h" +#include "GameObject.h" + +CCallBack_EffectHitBox_HitReport::CCallBack_EffectHitBox_HitReport() +{ +} + +CCallBack_EffectHitBox_HitReport::~CCallBack_EffectHitBox_HitReport() +{ +} + +void CCallBack_EffectHitBox_HitReport::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; + + + ON_COLLISION_INFO CollisionDesc = {}; + + if (nullptr != pController && nullptr != pActor) { + PhsXUserData* pTargetActorData = static_cast(pActor->userData); + PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + if (nullptr == pTargetActorData) { // missing user data + return; + } + + switch (pTargetActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + // action + break; + case PHYSX_KIND::BODY_DYNAMIC: + { + switch (pTargetActorData->iSubKind) + { + case 23: // 무거운데 올라갈 수 있는 벽 + + /* OnCollision 함수에 넘길 값 */ + + + CollisionDesc.vWorldPos = XMVectorSet( (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); + memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); + CollisionDesc.fLength = fLength; + + pOwnerActorData->pOwner->Get_Owner()->OnCollision(pTargetActorData->pOwner , &CollisionDesc); + + break; + default: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + } + break; + } + } break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_EffectHitBox_HitReport::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 != pActorData); // 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 CCallBack_EffectHitBox_HitReport::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; + //} +} + +HRESULT CCallBack_EffectHitBox_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +{ + m_pController = pController; + m_pPartDynamicBody = pPartDynamicObject; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pPartDynamicBody); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_EffectHitBox_HitReport::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pPartDynamicBody); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_EffectHitBox_HitReport* CCallBack_EffectHitBox_HitReport::Create() +{ + return new CCallBack_EffectHitBox_HitReport(); +} diff --git a/Jusin154_Team3D/Editor/Private/CamPosition.cpp b/Jusin154_Team3D/Editor/Private/CamPosition.cpp new file mode 100644 index 000000000..7b2fce6ba --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/CamPosition.cpp @@ -0,0 +1,49 @@ +#include "pch.h" + +#include "CamPosition.h" + + +CCamPosition::CCamPosition(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPartObject(pDevice, pContext) +{ +} +CCamPosition::CCamPosition(const CCamPosition& rhs) + :CPartObject(rhs) +{ +} +HRESULT CCamPosition::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + return S_OK; +} +HRESULT CCamPosition::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + return S_OK; +} +void CCamPosition::Free() +{ + __super::Free(); +} + +HRESULT CCamPosition::Bind_ShaderResources() +{ + return E_NOTIMPL; +} + +CGameObject* CCamPosition::Clone(void* pArg, CGameObject* pOwner) +{ + return nullptr; +} + +void CCamPosition::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Arm.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Arm.cpp new file mode 100644 index 000000000..14c06801f --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Arm.cpp @@ -0,0 +1,107 @@ +#include "pch.h" +#include "CamPosition_Arm.h" +#include "GameInstance.h" + +CCamPosition_Arm::CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamPosition(pDevice, pContext) +{ +} + +CCamPosition_Arm::CCamPosition_Arm(const CCamPosition_Arm& rhs) + : CCamPosition(rhs) +{ +} + +HRESULT CCamPosition_Arm::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamPosition_Arm::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + CameraArm_DESC* pDesc = static_cast(pArg); + m_fMouseSensor = pDesc->fMouseSensor; + m_fDistance = pDesc->fDistance; + + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVectorSetW(XMLoadFloat3(&pDesc->fEye), 0.f)); + m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->fAt), 1.f)); + + return S_OK; +} + +void CCamPosition_Arm::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->Set_State(STATE::LOOK, XMVector3Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f))); + m_pTransformCom->Rotation(XMConvertToRadians(60.f), XMConvertToRadians(m_fAccDegreeY), 0.f); + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) - XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)) * m_fDistance); +} + +void CCamPosition_Arm::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Arm::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamPosition_Arm::Render() +{ + return S_OK; +} + +HRESULT CCamPosition_Arm::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC DescTransfrom = {}; + DescTransfrom.fRadius = 30.f; + DescTransfrom.fRotationPerSec = 0.f; + DescTransfrom.fSpeedPerSec = 0.f; + if (FAILED(__super::Ready_Components(&DescTransfrom))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CCamPosition_Arm::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Arm* CCamPosition_Arm::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Arm* pInstance = new CCamPosition_Arm(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Arm"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Arm* CCamPosition_Arm::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Arm* pInstance = new CCamPosition_Arm(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Arm"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamPosition_Arm::Free() +{ + __super::Free(); +} + +void CCamPosition_Arm::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp new file mode 100644 index 000000000..074fdc97e --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp @@ -0,0 +1,105 @@ +#include "pch.h" + +#include "CamPosition_Player.h" + +CCamPosition_Player::CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCamPosition(pDevice, pContext) +{ +} + +CCamPosition_Player::CCamPosition_Player(const CCamPosition_Player& rhs) + :CCamPosition(rhs) +{ +} + +void CCamPosition_Player::Priority_Update(_float fTimeDelta) +{ + /*_matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + }*/ + m_pTransformCom->Set_WorldMatrix(/*socketMatrix * */XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); +} + +void CCamPosition_Player::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Player::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamPosition_Player::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamPosition_Player::Initialize(void* pArg) +{ + CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast (pArg); + //m_pSocketMatrices = pDesc->pSocketMatrices; + if (FAILED(__super::Initialize(pArg))) + { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Player::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Player::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Player* pInstance = new CCamPosition_Player(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Player"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Player* pInstance = new CCamPosition_Player(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Player"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamPosition_Player::Free() +{ + __super::Free(); +} + +void CCamPosition_Player::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Camera_Gaze.cpp b/Jusin154_Team3D/Editor/Private/Camera_Gaze.cpp new file mode 100644 index 000000000..a7eeb9049 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Camera_Gaze.cpp @@ -0,0 +1,103 @@ +#include "pch.h" +#include "Camera_Gaze.h" + +CCamera_Gaze::CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamera(pDevice, pContext) +{ +} + +CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs) + : CCamera(rhs) +{ +} + +void CCamera_Gaze::Priority_Update(_float fTimeDelta) +{ + if (false == m_bIsCurrentTransition) { + m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component()->Get_State(STATE::POSITION)); + m_pTransformCom->LookAt(m_pLookTarget->Get_Component()->Get_State(STATE::POSITION)); + } + m_bActive = true; + __super::Bind_Matrices(); +} + +void CCamera_Gaze::Update(_float fTimeDelta) +{ +} + +void CCamera_Gaze::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CCamera_Gaze::Render() +{ + return S_OK; +} + +HRESULT CCamera_Gaze::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamera_Gaze::Initialize(void* pArg) +{ + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamera_Gaze::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamera_Gaze::Bind_ShaderResources() +{ + return S_OK; +} + +CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamera_Gaze* pInstance = new CCamera_Gaze(pDevice, pContext); + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamera_Gaze"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner) +{ + CCamera_Gaze* pInstance = new CCamera_Gaze(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamera_Gaze"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamera_Gaze::Free() +{ + __super::Free(); +} + +void CCamera_Gaze::Describe_Entity() +{ + +} diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 47faacc3a..45d67b060 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -50,7 +50,11 @@ void CDummyObject::Priority_Update(_float fTimeDelta) void CDummyObject::Update(_float fTimeDelta) { + m_pModelCom->ComputeSkinning(); + m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); + + } void CDummyObject::Late_Update(_float fTimeDelta) @@ -79,6 +83,9 @@ HRESULT CDummyObject::Render() if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { return E_FAIL; } + + if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + return E_FAIL; if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp index 579456d49..4067e0a07 100644 --- a/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp +++ b/Jusin154_Team3D/Editor/Private/DummySkyBox.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "DebugCamera.h" #include "Layer.h" +#include "Camera_Gaze.h" CDummySkyBox::CDummySkyBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject{ pDevice, pContext } @@ -39,7 +40,7 @@ void CDummySkyBox::Priority_Update(_float fTimeDelta) void CDummySkyBox::Update(_float fTimeDelta) { - m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); + m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object()->Get_WorldPostion()); } void CDummySkyBox::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp index 42f0f3b85..7c38a9b85 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp @@ -42,9 +42,9 @@ void CDummy_Cube::Update(_float fTimeDelta) void CDummy_Cube::Late_Update(_float fTimeDelta) { - //if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - // m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); - //} + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + } } HRESULT CDummy_Cube::Render() diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp new file mode 100644 index 000000000..e8be405fa --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp @@ -0,0 +1,200 @@ +#include "pch.h" +#include "Dummy_PhysXEffectHitBox.h" + +#include "GameInstance.h" + + +CDummy_PhysXEffectHitBox::CDummy_PhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_PhysXEffectHitBox::CDummy_PhysXEffectHitBox(const CDummy_PhysXEffectHitBox& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_PhysXEffectHitBox::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXEffectHitBox::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CDummy_PhysXEffectHitBox::Priority_Update(_float fTimeDelta) +{ + m_pTransformCom->RewindMomentum(); +} + +void CDummy_PhysXEffectHitBox::Update(_float fTimeDelta) +{ + m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos)); + m_vLifeTime.x += fTimeDelta; + if (m_vLifeTime.x > m_vLifeTime.y) { + m_bDead = true; + } +} + +void CDummy_PhysXEffectHitBox::Late_Update(_float fTimeDelta) +{ + if (true == m_pCharacter_Controller->IsActive()) { + m_pCharacter_Controller->Move(fTimeDelta); + } + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + } +} + +HRESULT CDummy_PhysXEffectHitBox::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Render(0))) { + // return E_FAIL; + //} +#ifdef _DEBUG + if (FAILED(m_pCharacter_Controller->Render())) { + return E_FAIL; + } +#endif // _DEBUG + + + return S_OK; +} + +HRESULT CDummy_PhysXEffectHitBox::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + PHYSXDUMMY_DESC* pDesc = static_cast(pArg); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f)); + m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z); + m_vDeltaPos = pDesc->vDeltaPos; + m_vLifeTime = pDesc->vLifeTime; + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = pDesc->iSubKind; + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::BOX; + Desc.fContactOffset = 0.1f; + Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.05f }; + Desc.fRadius = 0.5f; + Desc.fHeight = 1.0f; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_EffectHitBox_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_EffectHitBox_Behavior::Create(); + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + } + m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CDummy_PhysXEffectHitBox::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_PhysXEffectHitBox* CDummy_PhysXEffectHitBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXEffectHitBox* pInstance = new CDummy_PhysXEffectHitBox(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXEffectHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXEffectHitBox::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXEffectHitBox* pInstance = new CDummy_PhysXEffectHitBox(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXEffectHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXEffectHitBox::Free() +{ + if (nullptr == m_pGameInstance) { + m_pCharacter_Controller->SetActive(false); + PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); + PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); + m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); + m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor()); + + + } + __super::Free(); + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + SAFE_RELEASE(m_pCharacter_Controller); + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CDummy_PhysXEffectHitBox::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXHitBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXHitBox.cpp new file mode 100644 index 000000000..e251d7ed5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXHitBox.cpp @@ -0,0 +1,170 @@ +#include "pch.h" +#include "Dummy_PhysXHitBox.h" + +#include "GameInstance.h" + + +CDummy_PhysXHitBox::CDummy_PhysXHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_PhysXHitBox::CDummy_PhysXHitBox(const CDummy_PhysXHitBox& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_PhysXHitBox::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXHitBox::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CDummy_PhysXHitBox::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_PhysXHitBox::Update(_float fTimeDelta) +{ + +} + +void CDummy_PhysXHitBox::Late_Update(_float fTimeDelta) +{ + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + } +} + +HRESULT CDummy_PhysXHitBox::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pModelCom->Render(0))) { + // return E_FAIL; + //} +#ifdef _DEBUG + if (FAILED(m_pRigidBody->Render())) { + return E_FAIL; + } +#endif // _DEBUG + + + return S_OK; +} + +HRESULT CDummy_PhysXHitBox::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast(pArg); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f)); + m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z); + + + { // RIGID_BODY + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = pPhysXDummyDesc->iSubKind; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + } + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CDummy_PhysXHitBox::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_PhysXHitBox* CDummy_PhysXHitBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXHitBox* pInstance = new CDummy_PhysXHitBox(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXHitBox::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXHitBox* pInstance = new CDummy_PhysXHitBox(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXHitBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXHitBox::Free() +{ + if (nullptr != m_pRigidBody) { + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); + } + + __super::Free(); + + SAFE_RELEASE(m_pRigidBody); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CDummy_PhysXHitBox::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp index 8c1ad4266..3939b3eef 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "Dummy_PhysXPlayable.h" +#include "Dummy_PhysXEffectHitBox.h" #include "GameInstance.h" +#include "NomalJap.h" CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext): CGameObject(pDevice, pContext) @@ -48,6 +50,14 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta) m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor()); } } + if (m_pGameInstance->Key_Up(DIK_O)) { + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { + assert(false); + return; + } + } + } m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); m_pCharacter_Controller->Move(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp index 85c84511a..f04b02540 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Plane.cpp @@ -44,7 +44,7 @@ void CDummy_Plane::Update(_float fTimeDelta) void CDummy_Plane::Late_Update(_float fTimeDelta) { if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); } } diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 84e573507..b0b1bd29d 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -27,6 +27,8 @@ HRESULT CEditEffect::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; + + Set_Visible(false); return S_OK; } @@ -39,6 +41,9 @@ void CEditEffect::Priority_Update(_float fTimeDelta) void CEditEffect::Update(_float fTimeDelta) { + if (m_bVisible == false) + return; + if (m_pInstance_ModelCom == nullptr) return; @@ -53,11 +58,11 @@ void CEditEffect::Update(_float fTimeDelta) void CEditEffect::Late_Update(_float fTimeDelta) { - if (m_pInstance_ModelCom == nullptr) + if (m_bVisible == false) return; - - XMStoreFloat4x4(&m_CombinedWorldMatrix , m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); + if (m_pInstance_ModelCom == nullptr) + return; if (m_EffectInfo.isBlur == true) @@ -385,6 +390,8 @@ void CEditEffect::Describe_Entity() { m_EffectInfo.eRenderOrder = static_cast(iCurrentItem); } + + GUI::Checkbox("Visible", &m_bVisible); m_pTransformCom->Describe_Entity(); @@ -432,6 +439,7 @@ void CEditEffect::Describe_Entity() GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive); GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive); + GUI::Checkbox("EmissiveDissolve", &m_EffectInfo.isEmissiveDissolve); if (m_EffectInfo.isEmissive) { @@ -609,7 +617,7 @@ void CEditEffect::Describe_Entity() GUI::Checkbox("Reverse Dissolve", &m_EffectInfo.isReverseDissolve); - _string strName = m_strDissolveName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this); + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this); if (strName != "") { m_strDissolveName = strName; @@ -715,6 +723,21 @@ void CEditEffect::Describe_Entity() } + ImGui::Begin("Simple Plot"); + + // samples.data()와 개수, optional offset 인덱스 등 넘길 수 있음 + ImGui::PlotLines("Value", m_ValueVector.data(), (int)m_ValueVector.size(), 0, nullptr, FLT_MAX, FLT_MAX, ImVec2(0, 100)); + + GUI::InputFloat("InputValue", &m_fInputValue); + + if (GUI::Button("AddValue")) + { + m_ValueVector.push_back(m_fInputValue); + } + + ImGui::End(); + + GUI::Separator(); GUI::Spacing(); diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 230246b42..e5e85b552 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -139,6 +139,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) DWORD dwByte(0); if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -149,6 +150,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) { if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc))) { + CloseHandle(hFile); return E_FAIL; } } @@ -159,6 +161,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) size_t iComponentLength = {}; if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -167,16 +170,22 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strDiffuseName = szName; + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), + reinterpret_cast(&m_pDiffuse_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), - reinterpret_cast(&m_pDiffuse_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isNoise) @@ -185,6 +194,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -193,15 +203,18 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strNoiseName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), + reinterpret_cast(&m_pNoise_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), - reinterpret_cast(&m_pNoise_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isMasking) @@ -219,15 +232,21 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strMaskingName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), + reinterpret_cast(&m_pMasking_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), - reinterpret_cast(&m_pMasking_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isDissolve) @@ -235,6 +254,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) size_t iComponentLength = {}; if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -243,15 +263,23 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strDissolveName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), + reinterpret_cast(&m_pDissolve_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } + + } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), - reinterpret_cast(&m_pDissolve_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isEmissive) @@ -259,6 +287,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) size_t iComponentLength = {}; if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -267,15 +296,21 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strEmissiveName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), + reinterpret_cast(&m_pEmissive_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), - reinterpret_cast(&m_pEmissive_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isDistortion) @@ -283,6 +318,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) size_t iComponentLength = {}; if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -291,21 +327,28 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strDistortionName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName), + reinterpret_cast(&m_pDistortion_TextureCom)))) + { + CloseHandle(hFile); + return E_FAIL; + } } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName), - reinterpret_cast(&m_pDistortion_TextureCom)))) - return E_FAIL; + } size_t iComponentLength = {}; if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -314,22 +357,27 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) _char szName[MAX_PATH] = {}; if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } m_strModelName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName), + reinterpret_cast(&m_pInstance_ModelCom)))) + { + CloseHandle(hFile); + return E_FAIL;; + } } - 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); - MessageBox(NULL, L"이펙트 로드 성공", L"System Message", MB_OK); return S_OK; } @@ -561,9 +609,8 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) HRESULT CEffectObject::Bind_ShaderResources() { - if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) { + 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; @@ -612,8 +659,12 @@ HRESULT CEffectObject::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_isReverseDissolve", &m_EffectInfo.isReverseDissolve, sizeof(_bool)))) { return E_FAIL; } - + if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolve", &m_EffectInfo.isEmissiveDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp index bfe1d9cb2..1cb0fe226 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp @@ -34,8 +34,6 @@ HRESULT CEffect_Container::Initialize(void* pArg) if (FAILED(Ready_Child())) return E_FAIL; - - return S_OK; } @@ -55,6 +53,10 @@ void CEffect_Container::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); } +void CEffect_Container::OnCollision(CGameObject* pOther, void* pDesc) +{ +} + #ifdef _DEBUG HRESULT CEffect_Container::Save_Package(const _char* pPath) @@ -141,6 +143,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) _int iObjectCount = {}; if (!ReadFile(hFile, &iObjectCount, sizeof(_int), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -149,12 +152,14 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) EFFECT_TYPE eEffectType = {}; if (!ReadFile(hFile, &eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } size_t iFilePathLength = {}; if (!ReadFile(hFile, &iFilePathLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } @@ -163,6 +168,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) if (iFilePathLength != 0) { if (!ReadFile(hFile, szFilePath, sizeof(_char) * ((DWORD)iFilePathLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); return E_FAIL; } } @@ -188,6 +194,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) if (FAILED(Add_PartObject("EffectObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pEditEffect, &PartsDesc))) { + CloseHandle(hFile); return E_FAIL; } @@ -204,6 +211,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) if (FAILED(Add_PartObject("TrailObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pTrailEffect, &PartsDesc))) { + CloseHandle(hFile); return E_FAIL; } @@ -222,7 +230,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) CloseHandle(hFile); - MessageBox(NULL, L"패키징 로드 성공", L"System Message", MB_OK); + return S_OK; } @@ -265,7 +273,7 @@ void CEffect_Container::Update_Event(_float fTimeDelta) m_fPreAccTime = m_fAccTime; m_fAccTime += fTimeDelta; - if (m_fAccTime >= m_fDelay && m_isDelayed == false) // 아직 딜레이되지 않았고 딜레이를 넘어섰다면 + if (m_fAccTime >= m_fDelay || m_isDelayed == false) // 아직 딜레이되지 않았고 딜레이를 넘어섰다면 { m_isDelayed = true; } @@ -283,6 +291,10 @@ void CEffect_Container::Update_Event(_float fTimeDelta) m_fPreAccTime = 0.f; m_isDelayed = false; } + else + { + m_bVisible = false; + } } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 90fc4eb93..dd458cfff 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -81,6 +81,7 @@ void CEffect_Editor::Update(_float fTimeDelta) if (m_pGameInstance->Key_Pressing(DIK_Z)) m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fTimeDelta); + Update_Event(fTimeDelta); } void CEffect_Editor::Late_Update(_float fTimeDelta) @@ -387,6 +388,8 @@ HRESULT CEffect_Editor::Load_Edit(const _char* pPath) Safe_Release(m_pEditEffect); return E_FAIL; } + else + MessageBox(NULL, L"이펙트 로드 성공", L"System Message", MB_OK); Safe_Release(m_pEditEffect); @@ -629,7 +632,11 @@ void CEffect_Editor::Describe_Entity() if (GUI::Button("LOAD PACKAGE")) { - Load_Package(m_strPackageSavePath.c_str()); + + if (SUCCEEDED(Load_Package(m_strPackageSavePath.c_str()))) + { + MessageBox(NULL, L"패키징 로드 성공", L"System Message", MB_OK); + } } GUI::InputTextMultiline("TRAIL FILE PATH", m_szTrailBuffer, sizeof(m_szTrailBuffer), ImVec2(250, 25)); diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index b7b8bb047..35a0f34eb 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -40,6 +40,8 @@ void CGoblin::Priority_Update(_float fTimeDelta) void CGoblin::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + m_pModelCom->ComputeSkinning(); } void CGoblin::Late_Update(_float fTimeDelta) @@ -69,6 +71,9 @@ HRESULT CGoblin::Render() return E_FAIL; } + if (FAILED(m_pModelCom->Bind_CS_Output(5, 0))) + return E_FAIL; + if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 66176d5cd..b57ac7eab 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -326,7 +326,12 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->SizeUpY(m_fSize.y); } - if (GUI::SliderFloat("Size", &m_fSizeXY.x, 1.f, 1980.f)) + if (GUI::SliderFloat("Size", &m_fSize.x, 1.f, 1980.f)) + { + m_fSize.y = m_fSize.x; + static_cast(m_pElementObject)->SizeUpdate(m_fSize.x, m_fSize.y); + } + if (GUI::SliderFloat("Size_vector3", &m_fSizeXY.x, 1.f, 1980.f)) { m_fSizeXY.y = m_fSizeXY.x; static_cast(m_pElementObject)->SizeUpdate_float(m_fSizeXY); diff --git a/Jusin154_Team3D/Editor/Private/Information.cpp b/Jusin154_Team3D/Editor/Private/Information.cpp deleted file mode 100644 index 35c5c8a6e..000000000 --- a/Jusin154_Team3D/Editor/Private/Information.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "pch.h" - -#include "Information.h" - -IMPLEMENT_SINGLETON(CInformation) - - -HRESULT CInformation::Initialize_Info(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - m_pDevice = pDevice; - m_pContext = pContext; - SAFE_ADDREF(m_pDevice); - SAFE_ADDREF(m_pContext); - - - - return S_OK; -} - -HRESULT CInformation::Release_Info() -{ - if (nullptr == s_pInstance) { - return S_OK; - } - DestroyInstance(); - - //SAFE_RELEASE(); - //SAFE_RELEASE(); - - return S_OK; -} - -_bool CInformation::strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents) -{ - assert(iCurrentIndex < contents.size()); - assert(iCurrentIndex >= 0); - return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char* - { - auto vec = static_cast*>(data); - return (*vec)[iIndex].c_str(); - }, &contents, (_int)(contents.size()) - ); -} - -_bool CInformation::wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents) -{ - assert(iCurrentIndex < contents.size()); - assert(iCurrentIndex >= 0); - return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char* - { - auto vec = static_cast*>(data); - return CMyTools::ToString((*vec)[iIndex]).c_str(); - }, &contents, (_int)(contents.size()) - ); -} - -void CInformation::Log_Render() -{ - GUI::Begin("Log"); - GUI::Text(m_strLog.c_str()); - GUI::End(); -} - -void CInformation::Log_Push(const _char* pContents) -{ - m_strLog.append(_string("\n") + pContents); -} - -void CInformation::Log_Clear() -{ - m_strLog.clear(); -} - -CInformation::CInformation() -{ -} - -void CInformation::Free() -{ - __super::Free(); - - - - SAFE_RELEASE(m_pDevice); - SAFE_RELEASE(m_pContext); -} diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index 69dfa26cb..61f00c69d 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -8,6 +8,11 @@ #include "Dummy_Cube.h" #include "MainLight.h" #include "Dummy_Plane.h" +#include "DummySkyBox.h" +#include "Dummy_PhysXBox.h" +#include "Dummy_PhysXPlayable.h" +#include "Dummy_PhysXMonster.h" +#include "Dummy_PhysXWall.h" CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -21,6 +26,10 @@ HRESULT CLevel_EffectViewer::Initialize() return E_FAIL; } + if (FAILED(Ready_Layer_PhysX(TEXT("Layer_PhysX")))) + { + return E_FAIL; + } if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) { return E_FAIL; @@ -34,11 +43,14 @@ HRESULT CLevel_EffectViewer::Initialize() if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, TEXT("Layer_Editor")))) return E_FAIL; + /*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; - 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(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Sky")))) + // return E_FAIL; return S_OK; @@ -99,6 +111,49 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Effect(const _wstring& strLayerTag) return S_OK; } +HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag) +{ + for (int i = 0; i < 10; ++i) { + CDummy_PhysXBox::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) }; + Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) }; + Desc.iSubKind = 0; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { + return E_FAIL; + } + } + { + CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { -15.f, 3.f, 15.f }; + Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; + Desc.iSubKind = 23; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { + return E_FAIL; + } + } + { + CDummy_PhysXPlayable::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { 0.f, 100.f, 0.f }; + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 10; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) { + return E_FAIL; + } + } + { + CDummy_PhysXMonster::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { 0.f, 150.f, 5.f }; + Desc.vRotRPY = { 12.f, 0.f, 0.f }; + Desc.iSubKind = 10; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Desc))) { + return E_FAIL; + } + } + return S_OK; +} + CLevel_EffectViewer* CLevel_EffectViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 2ae091489..42781e230 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -30,10 +30,10 @@ HRESULT CLevel_ObjectViewer::Initialize() return E_FAIL; } - if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) + /*if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) { return E_FAIL; - } + }*/ if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) { @@ -691,20 +691,22 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag) HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test))) + return E_FAIL; + 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; + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) + return E_FAIL;*/ + - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag,nullptr,nullptr, &m_Test))) - return E_FAIL; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) return E_FAIL; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) - return E_FAIL; + /*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 c779726cf..5312c8fe2 100644 --- a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp @@ -45,10 +45,6 @@ HRESULT CLevel_PhysXLab::Initialize() return E_FAIL; } - if (FAILED(Ready_Layer_Terrain(TEXT("Layer_Terrain")))) { - return E_FAIL; - } - if (FAILED(Ready_Layer_PhysXObjects(TEXT("Layer_PhysXObject")))) { return E_FAIL; } @@ -84,19 +80,6 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag) return S_OK; } -HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag) -{ - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){ - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MAPOBJECTMANAGER))){ - return E_FAIL; - } - - return S_OK; -} - HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag) { for (int i = 0; i < 10; ++i) { diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index fc290fef1..9501d9667 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -23,6 +23,11 @@ #include "Player.h" #include "Goblin.h" #include "Broom.h" +#include +#include "Camera_Gaze.h" +#include "CamPosition_Player.h" +#include "CamPosition_Arm.h" +#include "Wand.h" #pragma endregion @@ -90,6 +95,7 @@ #include "Dummy_PhysXPlatform.h" #include "Dummy_PhysXFreeDoor.h" #include "Dummy_PhysXWall.h" +#include "Dummy_PhysXEffectHitBox.h" //#include "Dummy_PhysXDoorFrame.h" //#include "Dummy_PhysXFixedDoor.h" //#include "Dummy_PhysXDoorSet.h" @@ -175,6 +181,8 @@ HRESULT CLoader::Loading() } + CoUninitialize(); + if (FAILED(hr)) return E_FAIL; @@ -398,16 +406,23 @@ HRESULT CLoader::Loading_For_UI() m_strMessage = TEXT("Model Loading.."); - CVIBuffer_UI_Instance::UI_INSTANCE_DESC UIDesc{}; + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SpellSlotUIDesc{}; - UIDesc.iNum = 4; - UIDesc.vSize = _float2(1.f,1.f); - UIDesc.fPositionOffSetX = 75.f; - UIDesc.fPositionOffSetY = 0.f; - UIDesc.vPsition = _float2(100.f, 100.f); + SpellSlotUIDesc.iNum = 4; + SpellSlotUIDesc.vPsition = _float2(100.f, 100.f); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), - CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &UIDesc)))) { + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SpellSlotUIDesc)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; + + SlotNumberUIDesc.iNum = 4; + SlotNumberUIDesc.vPsition = _float2(100.f, 100.f); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SlotNumberUIDesc)))) { return E_FAIL; } @@ -524,6 +539,55 @@ HRESULT CLoader::Loading_For_UI() } HRESULT CLoader::Loading_For_Effect() { + + m_strMessage = TEXT("PhysX Meshes Loading.."); + { // Dumping Box + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + { + Desc.eType = ACTOR::BOX; + Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ }; + Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; + Desc.vMatInfo = { 0.5f, 0.5f, 0.6f }; + Desc.fContactOffset = { 0.05f }; + Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f }; + Desc.fDensity = 10.f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { }; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + } { // Heavy Wall + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + { + Desc.eType = ACTOR::BOX; + Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ }; + Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; + Desc.vMatInfo = { 0.5f, 0.5f, 0.6f }; + Desc.fContactOffset = { 0.05f }; + Desc.vhalfGeometryInfo = { 2.5f, 4.5f, 3.5f }; + Desc.fDensity = 10.f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 100.f, 100.f }; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + } + + { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) { + return E_FAIL; + } m_strMessage = TEXT("Texture Loading.."); @@ -589,6 +653,11 @@ HRESULT CLoader::Loading_For_Effect() m_strMessage = TEXT("Model Loading.."); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity())))) + return E_FAIL; + Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) { if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), wstrFileName, @@ -642,6 +711,21 @@ HRESULT CLoader::Loading_For_Effect() m_strMessage = TEXT("Prototype Loading.."); + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXEffectHitBox::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXMonster::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDebugCamera::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -658,9 +742,6 @@ HRESULT CLoader::Loading_For_Effect() return E_FAIL; } - 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; @@ -673,6 +754,14 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CNomalJap::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_DummySkyBox */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDummy_Cube::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + m_strMessage = TEXT("Loading Success!"); @@ -878,15 +967,6 @@ HRESULT CLoader::Loading_For_PhysXLevel() m_strMessage = TEXT("Prototype Loading.."); - 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; - } - - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext)))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -1067,7 +1147,64 @@ HRESULT CLoader::MapFolderLoad(const _char* pDirectoryPath, const _char* pFileEx return S_OK; } +void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents) +{ + if (FAILED(CoInitializeEx(nullptr, 0))) { + return ; + } + *OutContents = new vector; + for (const auto& file : filesystem::directory_iterator(pDirectoryPath)) + { + if (file.is_directory()){ continue; } + if (strcmp(file.path().extension().string().c_str(), pFileExt)) { continue; } + + FOLDER_LOAD* pContents = new FOLDER_LOAD; + { // FOLDER_LOAD + _char szFilePath[MAX_PATH] = {}; + strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); + + _wstring wstrFileName = L"Prototype_GameObject_" + file.path().stem().wstring(); + + CModel* pModel = CModel::Create(pDevice, pContext, MODEL::ENVIROMENT, szFilePath); + + _uint iNumMesh = pModel->Get_NumMeshes(); + + { + pContents->pModelTag = wstrFileName; + pContents->pathModel = file.path(); + pContents->pLoadedModel = pModel; + + pContents->pRigidBodyTags.reserve(iNumMesh); + pContents->LoadedRigidBody.reserve(iNumMesh); + } + + CRigidBody_Static::RIGIDBODY_STATIC_PROTOTYPEDESC Desc{}; + for (_uint i = 0; i < iNumMesh; ++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; + } + pContents->pRigidBodyTags.emplace_back(CMyTools::ToWstring(pModel->Get_MeshName(i) + to_string(i)).c_str()); + pContents->LoadedRigidBody.emplace_back(CRigidBody_Static::Create(pDevice, pContext, Desc)); + } + } + (*OutContents)->emplace_back(pContents); + } + (*OutContents)->shrink_to_fit(); + + CoUninitialize(); + return; +} + +future CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents) +{ + return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents); +} HRESULT CLoader::Loading_For_ObjectViewer() { @@ -1166,6 +1303,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixIdentity())))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) + return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"), CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) return E_FAIL; @@ -1189,10 +1330,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() 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_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)))) @@ -1218,9 +1359,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; + + ///* For.Prototype_GameObject_Terrain */ + //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext)))) + // return E_FAIL; /* For.Prototype_Component_FSM */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext)))) @@ -1234,11 +1376,26 @@ HRESULT CLoader::Loading_For_ObjectViewer() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin::Create(m_pDevice, m_pContext)))) return E_FAIL; - /* For.Prototype_GameObject_Broom */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Camera_Gaze */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Player */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Arm */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Arm::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Wand */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext)))) + return E_FAIL; + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; @@ -1281,192 +1438,505 @@ HRESULT CLoader::Loading_For_MapViewer() vector ModelPrototypePath = {}; #pragma region HOGSMEADE + ///* Terrain*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* TScrolls*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* 3BroomStick*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* Ollivanders*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* Gatehouse*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_QuidditchShop */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_HogsheadInn */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_Honeydukes */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_OwlPost */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_TeaShop */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_Zonkos */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_DB_GR */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_Potions */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* BLDG_Salon */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* Hengist_Tree */ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", // ".bin", true, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", // ".bin", true, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN A*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN B*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN C*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN E*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN F*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN G*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN H*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; ///* GEN J*/ - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\Users\\82103\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", + //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; #pragma endregion +#ifdef 기무리 + +vector> jobFutures; + +_uint iLoadCount = 46; +vector*> Contents(iLoadCount); + +{ + { /* Terrain */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", + ".fbx", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", + ".fbx", false, + &Contents[jobFutures.size()] + )); + } + { /* TScrolls */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", + ".fbx", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* 3BroomStick*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Ollivanders*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Gatehouse*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_QuidditchShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_HogsheadInn */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Honeydukes */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_OwlPost */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_TeaShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Zonkos */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_DB_GR */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Potions */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Salon */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Hengist_Tree */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN A*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN B*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN C*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN E*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN F*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN G*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN H*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN J*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } +} + +for (auto& jobFuture : jobFutures) +{ + jobFuture.get(); +} + +for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + FOLDER_LOAD* pContents = (*Contents[i])[j]; + ModelPrototypeTags.push_back(pContents->pModelTag); + ModelPrototypePath.push_back(pContents->pathModel); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + return E_FAIL; + } + + for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { + return E_FAIL; + } + } + + } +} + +#endif // 기무리 + m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -1528,6 +1998,13 @@ HRESULT CLoader::Loading_For_MapViewer() m_isFinished = true; + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + Safe_Delete((*Contents[i])[j]); + } + Safe_Delete(Contents[i]); + } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MapObject.cpp b/Jusin154_Team3D/Editor/Private/MapObject.cpp index 0580f9f73..cde869e7c 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject.cpp @@ -69,7 +69,12 @@ HRESULT CMapObject::Initialize_Prototype() HRESULT CMapObject::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + MAPOBJECT_LOD_DESC* pDesc = static_cast(pArg); + + PARTOBJECT_DESC Desc = {}; + Desc.pParentTransform = pDesc->pParentTransform; + + if (FAILED(__super::Initialize(&Desc))) return E_FAIL; #ifdef _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp index 37140c4d1..ecb9744ca 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp @@ -30,6 +30,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg) { MAPOBJECT_LOD_DESC* pDesc = static_cast(pArg); + //m_Type = static_cast(pDesc->iRenderType); m_iMaxLodLevel = pDesc->iMaxLodLevel; for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) @@ -55,15 +56,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg) m_vScale = pDesc->vScale; m_vRotation = pDesc->vRotation; - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); - m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); - - XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); - - _float3 vOffset = m_pModelComs[0]->Get_RadiusOffset(); - _matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix); - XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]); + @@ -87,17 +80,27 @@ void CMapObject_LOD::Update(_float fTimeDelta) { //if (0 == m_iLodIndex) // m_bSelected = true; + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + + XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); + + _float3 vOffset = m_pModelComs[0]->Get_RadiusOffset(); + _matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix); + XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]); } void CMapObject_LOD::Late_Update(_float fTimeDelta) { #ifdef _DEBUG - /*if (m_bSelected) + if (m_bSelected) { m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); m_pTransformCom->Set_Scale(m_vScale); m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); - }*/ + } #endif _float fRaius = m_pModelComs[0]->Get_Radius(); if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), fRaius)) { @@ -111,7 +114,20 @@ void CMapObject_LOD::Late_Update(_float fTimeDelta) if (m_pGameInstance->Key_Pressing(DIK_Z)) m_iLodIndex = 0; - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + switch (m_Type) + { + case Editor::MAPOBJECT_RENDER_TYPE::NORMAL: + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + break; + + case Editor::MAPOBJECT_RENDER_TYPE::DECAL: + m_pGameInstance->Add_RenderGroup(RENDER::DECAL, this); + break; + case Editor::MAPOBJECT_RENDER_TYPE::GLASS: + break; + default: + break; + } } } diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 0f27a25ad..33d5eafe9 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -474,11 +474,22 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch PartObject->SetAttribute("Lod_Level", iLodLvel); PartObject->SetAttribute("Key_Index", pMapObject->Get_iKeyIndex()); + + /* Set Render Type*/ + _wstring ProrotypeTag = pMapObject->Get_PrototypeTag(0); + + if(_wstring::npos != ProrotypeTag.find(L"decal") || _wstring::npos != ProrotypeTag.find(L"Decal")) + PartObject->SetAttribute("Render_Type", 1); + else if(_wstring::npos != ProrotypeTag.find(L"glass") || _wstring::npos != ProrotypeTag.find(L"Glass")) + PartObject->SetAttribute("Render_Type", 2); + else + PartObject->SetAttribute("Render_Type", 0); + container->InsertEndChild(PartObject); for (_uint i = 0; i < pMapObject->Get_LodLevel() + 1; ++i) { - // ÅØ½ºÆ® + // ProrotypeTag tinyxml2::XMLElement* proto = doc.NewElement("PrototypeTag"); proto->SetText(CMyTools::ToString(pMapObject->Get_PrototypeTag(i)).c_str()); PartObject->InsertEndChild(proto); diff --git a/Jusin154_Team3D/Editor/Private/NomalJap.cpp b/Jusin154_Team3D/Editor/Private/NomalJap.cpp index 959be1168..6f32e0139 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJap.cpp @@ -3,6 +3,7 @@ #include "GameInstance.h" #include "EditEffect.h" +#include "Dummy_PhysXEffectHitBox.h" CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -34,9 +35,14 @@ HRESULT CNomalJap::Initialize(void* pArg) if (FAILED(Ready_Child())) return E_FAIL; + Load_Package("../Bin/Resources/Data/Effect/Package/Jap"); m_wstrEffectName = L"Nomal_Jap"; + m_PartObjects.begin()->second->Set_Visible(true); + m_PartObjects.begin()->second->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + m_fDuration = 5.f; return S_OK; } @@ -48,12 +54,19 @@ void CNomalJap::Priority_Update(_float fTimeDelta) void CNomalJap::Update(_float fTimeDelta) { + if (m_bVisible == false) + return; + __super::Update(fTimeDelta); + Update_Event(fTimeDelta); } void CNomalJap::Late_Update(_float fTimeDelta) { + if (m_bVisible == false) + return; + __super::Late_Update(fTimeDelta); } @@ -68,13 +81,21 @@ HRESULT CNomalJap::Ready_Components(void* pArg) HRESULT CNomalJap::Ready_Child() { + CDummy_PhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; - //CPartObject::PARTOBJECT_DESC PartsDesc{}; + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - //PartsDesc.pParentTransform = m_pTransformCom; + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); - //if (FAILED(Add_PartObject("EffectObject" + to_string(m_iNumPart++), ENUM_CLASS(LEVEL::EFFECT), &m_pEditEffect, &PartsDesc))) - // return E_FAIL; + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = { 0.f, 0.f, 1.f }; + Desc.vLifeTime = { 0.f, 2.f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } return S_OK; } @@ -92,11 +113,6 @@ CNomalJap* CNomalJap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex return pInstance; } -void CNomalJap::Free() -{ - __super::Free(); - -} CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) { @@ -111,6 +127,32 @@ CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) return pInstance; } +void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + } + + m_PartObjects.begin()->second->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); +} + +void CNomalJap::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + +} + void CNomalJap::Describe_Entity() { @@ -120,3 +162,5 @@ HRESULT CNomalJap::Bind_ShaderResources() { return S_OK; } + + diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 419e5e6f9..fe0ae3ece 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -2,9 +2,14 @@ #include "Player.h" #include "GameInstance.h" -#include "DebugCamera.h" +#include "CamPosition_Player.h" +#include "Camera_Gaze.h" +#include "CamPosition_Arm.h" +#include "Wand.h" #pragma region STATE +#include "State_Root.h" + #include "State_Idle.h" #include "State_Walk.h" #include "State_Jog.h" @@ -44,6 +49,10 @@ HRESULT CPlayer::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + + if (FAILED(Ready_Parts())) + return E_FAIL; + Load_KeyFrame(); Add_FSM(); @@ -54,28 +63,34 @@ HRESULT CPlayer::Initialize(void* pArg) Setup_InputConditions(); - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Change_State(FSMSTATE::ROOT); return S_OK; } void CPlayer::Priority_Update(_float fTimeDelta) { - + __super::Priority_Update(fTimeDelta); } void CPlayer::Update(_float fTimeDelta) { + m_pModelCom->ComputeSkinning(); + Key_Input(fTimeDelta); m_pFSM->Update(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + __super::Update(fTimeDelta); } void CPlayer::Late_Update(_float fTimeDelta) { m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + + __super::Late_Update(fTimeDelta); } HRESULT CPlayer::Render() @@ -99,6 +114,9 @@ HRESULT CPlayer::Render() return E_FAIL; } + if (FAILED(m_pModelCom->Bind_CS_Output(5, i))) + return E_FAIL; + if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } @@ -132,6 +150,62 @@ HRESULT CPlayer::Ready_Components() return S_OK; } +HRESULT CPlayer::Ready_Parts() +{ + CWand::WAND_DESC WandDesc{}; + + WandDesc.pParentTransform = m_pTransformCom; + WandDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + + if (FAILED(Add_PartObject("Wand", g_iStaticLevel, nullptr, &WandDesc))) + { + return E_FAIL; + } + + CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{}; + + Desc.pParentTransform = m_pTransformCom; + //Desc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_HeadCamera"); + + if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) + { + return E_FAIL; + } + + CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; + XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); + CameraArmDesc.pParentTransform = m_pTransformCom; + CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; + CameraArmDesc.fMouseSensor = 0.4f; + CameraArmDesc.fDistance = 4.f; + CameraArmDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { + return E_FAIL; + } + + CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 300.f; + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; + CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; + CameraDesc.iPriority = 51; + + CCamera_Gaze* pCamera = { nullptr }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) + { + return E_FAIL; + } + + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); + + return S_OK; +} + HRESULT CPlayer::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -155,11 +229,18 @@ void CPlayer::Setup_InputConditions() m_InputConditions = { { FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }}, - { FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || Check(FSMSTATE::DODGE); }}, - { FSMSTATE::WALK, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP) + { FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) || + Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }}, + + + + { FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP) /*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }}, - { FSMSTATE::WALK_FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }}, - { FSMSTATE::WALK_BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }}, + { FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }}, + { FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }}, + + { FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, + { FSMSTATE::SPRINT, [&]() { return m_bSprintToggle && m_pGameInstance->Key_Pressing(DIK_UP); }}, { FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }}, @@ -167,7 +248,7 @@ void CPlayer::Setup_InputConditions() { FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }}, { FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }}, { FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }}, - { FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(ENUM_CLASS(MOUSEKEYSTATE::LBUTTON)); }}, + { FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }}, { FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }}, { FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } } @@ -178,7 +259,8 @@ void CPlayer::Key_Input(_float fTimeDelta) { if (m_pFSM->Get_CurrState() == FSMSTATE::WALK || m_pFSM->Get_CurrState() == FSMSTATE::SPRINT|| - m_pFSM->Get_CurrState() == FSMSTATE::DODGE) + m_pFSM->Get_CurrState() == FSMSTATE::DODGE|| + m_pFSM->Get_CurrState() == FSMSTATE::JOG) { if (m_pGameInstance->Key_Pressing(DIK_LEFT)) m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); @@ -188,12 +270,16 @@ void CPlayer::Key_Input(_float fTimeDelta) } IsSprint(); + + IsWalk(); } void CPlayer::Add_FSM() { #pragma region MOVE m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move()); + m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle()); + m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn()); m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk()); m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog()); m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint()); @@ -207,19 +293,28 @@ void CPlayer::Add_FSM() m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack()); m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast()); #pragma endregion - m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle()); - m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn()); + m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump()); m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land()); + + m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root()); } void CPlayer::Set_FSM() { +#pragma region ROOT + m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT); + m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT); + +#pragma endregion + #pragma region MOVE + m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE); m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::WALK_BWD, FSMSTATE::MOVE); - m_pFSM->Set_Parent(FSMSTATE::WALK_FWD, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE); + m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE); m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE); m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE); m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE); @@ -238,8 +333,6 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::DODGE] = { 802,false }; - m_Animation[STATEANIM::JOG] = { 166,true }; - m_Animation[STATEANIM::SKILL] = { 593,false }; m_Animation[STATEANIM::SKILL2] = { 915,false }; m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; @@ -251,15 +344,19 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false }; m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false }; - m_Animation[STATEANIM::WALK_FWD] = { 167,true }; + m_Animation[STATEANIM::WALK_FWD] = { 625,true }; m_Animation[STATEANIM::WALK_BWD] = { 166,true }; - m_Animation[STATEANIM::WALK_STOP] = { 289,false }; + m_Animation[STATEANIM::WALK_STOP] = { 344,false }; + + m_Animation[STATEANIM::JOG_FWD] = { 167,true }; + m_Animation[STATEANIM::JOG_STOP] = { 289,false }; m_Animation[STATEANIM::JUMP] = { 205,false }; - m_Animation[STATEANIM::JUMP_WALK] = { 203,false }; + m_Animation[STATEANIM::JUMP_JOG] = { 203,false }; m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false }; m_Animation[STATEANIM::SPRINT] = { 599,true }; + } CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -289,6 +386,9 @@ CGameObject* CPlayer::Clone(void* pArg, CGameObject* pOwner) void CPlayer::Free() { __super::Free(); + + SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); + SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); } void CPlayer::Describe_Entity() @@ -336,3 +436,12 @@ _bool CPlayer::IsSprint() } return false; } + +_bool CPlayer::IsWalk() +{ + if (m_pGameInstance->Key_Down(DIK_C)) + { + return m_bWalkToggle = !m_bWalkToggle; + } + return false; +} diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp new file mode 100644 index 000000000..5c78a5345 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -0,0 +1,255 @@ +#include "pch.h" +#include "Slot_Number.h" +#include "GameInstance.h" + +CSlot_Number::CSlot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSlot_Number::CSlot_Number(const CSlot_Number& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSlot_Number::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSlot_Number::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 98.f; + Desc.fSizeX = 150.f; + Desc.fSizeY = 150.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) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAngle = XMConvertToRadians(-135); + m_fAlphaTime = 1.f; + m_fOffSetX = 101.f; + m_fOffSetY = 101.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(m_fX, m_fY, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSlot_Number::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSlot_Number::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSlot_Number::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSlot_Number::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSlot_Number::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSlot_Number::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSlot_Number::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSlot_Number::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSlot_Number::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSlot_Number::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSlot_Number* pInstance = new CSlot_Number(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSlot_Number::Clone(void* pArg, CGameObject* pOwner) +{ + CSlot_Number* pInstance = new CSlot_Number(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSlot_Number::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSlot_Number::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Image.cpp b/Jusin154_Team3D/Editor/Private/Spell_Image.cpp index 2fb1a9823..36b98df32 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Image.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Image.cpp @@ -21,10 +21,10 @@ HRESULT CSpell_Image::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = -160.f; - Desc.fY = 50.f; - Desc.fSizeX = 140.f; - Desc.fSizeY = 140.f; + Desc.fX = -1.f; + Desc.fY = 0.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.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) }; @@ -42,7 +42,6 @@ HRESULT CSpell_Image::Initialize(void* pArg) m_fAlpha = 1.f; m_fAlphaTime = 1.f; m_fSortZ = 1.f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::SHADOW); return S_OK; } @@ -161,10 +160,6 @@ HRESULT CSpell_Image::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) - { - return E_FAIL; - } if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 9c7d3c578..f400767aa 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -21,10 +21,10 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = -160.f; - Desc.fY = 50.f; - Desc.fSizeX = 140.f; - Desc.fSizeY = 140.f; + Desc.fX = -1.f; + Desc.fY = 0.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.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) }; @@ -129,7 +129,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ROTATION)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) { return E_FAIL; } @@ -233,7 +233,7 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index 2ceededea..6efea7de5 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -23,8 +23,8 @@ HRESULT CSpell_Slot::Initialize(void* pArg) Desc.fX = 0.f; Desc.fY = 98.f; - Desc.fSizeX = 140.f; - Desc.fSizeY = 140.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.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) }; @@ -41,9 +41,12 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; + m_fOffSetX = 101.f; + m_fOffSetY = 101.f; + m_iCols = 4; m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(m_fX, m_fY, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_Pos(m_fX, m_fY, 150.f,0.f,4); return S_OK; } @@ -133,6 +136,25 @@ _vector CSpell_Slot::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } +void CSpell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + HRESULT CSpell_Slot::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -171,6 +193,7 @@ HRESULT CSpell_Slot::Bind_ShaderResources() { return E_FAIL; } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/State_Cast.cpp b/Jusin154_Team3D/Editor/Private/State_Cast.cpp index 3915da0eb..42c192faa 100644 --- a/Jusin154_Team3D/Editor/Private/State_Cast.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Cast.cpp @@ -29,13 +29,6 @@ void CState_Cast::Exit() _bool CState_Cast::CheckExitState() { - if (m_pModel->IsFinishedAnim()) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::IDLE); - return true; - } - if (m_pOwner->Check(FSMSTATE::CAST)) { _uint combo = m_pOwner->Next_LightCombo(); @@ -43,7 +36,6 @@ _bool CState_Cast::CheckExitState() if (combo >= 3) { m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::IDLE); return true; } diff --git a/Jusin154_Team3D/Editor/Private/State_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Combat.cpp index 932fe1f57..bdff385da 100644 --- a/Jusin154_Team3D/Editor/Private/State_Combat.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Combat.cpp @@ -10,7 +10,21 @@ CState_Combat::CState_Combat() void CState_Combat::Enter() { + if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + if (m_pOwner->Check(FSMSTATE::CAST)) + m_pFSM->Change_State(FSMSTATE::CAST); + + if (m_pOwner->Check(FSMSTATE::SKILL)) + m_pFSM->Change_State(FSMSTATE::SKILL); + + if (m_pOwner->Check(FSMSTATE::SKILL)) + m_pFSM->Change_State(FSMSTATE::SKILL); + + if (m_pOwner->Check(FSMSTATE::SKILL2)) + m_pFSM->Change_State(FSMSTATE::SKILL2); + } void CState_Combat::Update(_float fTimeDelta) @@ -25,20 +39,10 @@ void CState_Combat::Exit() _bool CState_Combat::CheckExitState() { - if (m_pOwner->Check(FSMSTATE::MOVE) && - !m_pOwner->Check(FSMSTATE::COMBAT)) + if (m_pOwner->IsCurrentKeyFrame("Jump")) { + m_pOwner->Reset_LightCombo(); m_pFSM->Change_State(FSMSTATE::MOVE); - - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); - - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); - - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - return true; } diff --git a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp index e2052ad0b..3c4ce4151 100644 --- a/Jusin154_Team3D/Editor/Private/State_Dodge.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Dodge.cpp @@ -29,9 +29,17 @@ _bool CState_Dodge::CheckExitState() if (m_pModel->IsFinishedAnim()) m_pFSM->Change_State(FSMSTATE::IDLE); + if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge")) + m_pFSM->Change_State(FSMSTATE::SPRINT); + if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge")) m_pFSM->Change_State(FSMSTATE::WALK); + if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge")) + m_pFSM->Change_State(FSMSTATE::JOG); + + + return false; } diff --git a/Jusin154_Team3D/Editor/Private/State_Idle.cpp b/Jusin154_Team3D/Editor/Private/State_Idle.cpp index fc24940e1..5f4140c0c 100644 --- a/Jusin154_Team3D/Editor/Private/State_Idle.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Idle.cpp @@ -9,6 +9,12 @@ CState_Idle::CState_Idle() void CState_Idle::Enter() { + if (m_pFSM->Get_PrevState() == FSMSTATE::JOG) + { + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP); + m_pModel->Set_AnimationIndex(anim.first, anim.second); + return; + } if (m_pFSM->Get_PrevState() == FSMSTATE::WALK) { auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP); @@ -34,36 +40,17 @@ void CState_Idle::Exit() _bool CState_Idle::CheckExitState() { - if (m_pOwner->Check(FSMSTATE::MOVE)) - { - m_pFSM->Change_State(FSMSTATE::MOVE); + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); - if (m_pOwner->Check(FSMSTATE::DODGE)) - m_pFSM->Change_State(FSMSTATE::DODGE); - } - - if (m_pOwner->Check(FSMSTATE::COMBAT)) - { - m_pFSM->Change_State(FSMSTATE::COMBAT); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - } + if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) m_pFSM->Change_State(FSMSTATE::IDLE_TURN); diff --git a/Jusin154_Team3D/Editor/Private/State_Jog.cpp b/Jusin154_Team3D/Editor/Private/State_Jog.cpp index 3831f9943..b895ed11e 100644 --- a/Jusin154_Team3D/Editor/Private/State_Jog.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Jog.cpp @@ -9,17 +9,11 @@ CState_Jog::CState_Jog() void CState_Jog::Enter() { - if (m_pOwner->Check(FSMSTATE::WALK_FWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD); + m_pModel->Set_AnimationIndex(anim.first, anim.second); - if (m_pOwner->Check(FSMSTATE::WALK_BWD)) - { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD); - m_pModel->Set_AnimationIndex(anim.first, anim.second); - } + m_pOwner->Reset_Sprint(); + m_pOwner->Reset_Walk(); } void CState_Jog::Update(_float fTimeDelta) @@ -37,12 +31,19 @@ _bool CState_Jog::CheckExitState() if (m_pOwner->Check(FSMSTATE::SPRINT)) m_pFSM->Change_State(FSMSTATE::SPRINT); + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + else if (m_pOwner->Check(FSMSTATE::DODGE)) m_pFSM->Change_State(FSMSTATE::DODGE); else if (!m_pOwner->Check(FSMSTATE::JOG)) m_pFSM->Change_State(FSMSTATE::IDLE); + if (m_pOwner->Check(FSMSTATE::JUMP)) + m_pFSM->Change_State(FSMSTATE::JUMP); + + return false; } diff --git a/Jusin154_Team3D/Editor/Private/State_Jump.cpp b/Jusin154_Team3D/Editor/Private/State_Jump.cpp index c2c175863..051f93fb0 100644 --- a/Jusin154_Team3D/Editor/Private/State_Jump.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Jump.cpp @@ -16,9 +16,9 @@ void CState_Jump::Enter() m_pModel->Set_AnimationIndex(anim.first, anim.second); return; } - if (m_pOwner->Check(FSMSTATE::WALK)) + if (m_pOwner->Check(FSMSTATE::JOG)) { - auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_WALK); + auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG); m_pModel->Set_AnimationIndex(anim.first, anim.second); return; } diff --git a/Jusin154_Team3D/Editor/Private/State_Land.cpp b/Jusin154_Team3D/Editor/Private/State_Land.cpp index d6fb4ea3c..7fda0cd37 100644 --- a/Jusin154_Team3D/Editor/Private/State_Land.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Land.cpp @@ -29,8 +29,12 @@ _bool CState_Land::CheckExitState() if (m_pModel->IsFinishedAnim()) m_pFSM->Change_State(FSMSTATE::IDLE); - if (m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); return false; } diff --git a/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp b/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp index ed27639b4..aa2375570 100644 --- a/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp +++ b/Jusin154_Team3D/Editor/Private/State_LightAttack.cpp @@ -29,13 +29,6 @@ void CState_LightAttack::Exit() _bool CState_LightAttack::CheckExitState() { - if (m_pModel->IsFinishedAnim()) - { - m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::IDLE); - return true; - } - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) { _uint combo = m_pOwner->Next_LightCombo(); @@ -43,7 +36,6 @@ _bool CState_LightAttack::CheckExitState() if (combo >= 4) { m_pOwner->Reset_LightCombo(); - m_pFSM->Change_State(FSMSTATE::IDLE); return true; } diff --git a/Jusin154_Team3D/Editor/Private/State_Move.cpp b/Jusin154_Team3D/Editor/Private/State_Move.cpp index 351df59db..cce8c760f 100644 --- a/Jusin154_Team3D/Editor/Private/State_Move.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Move.cpp @@ -11,6 +11,22 @@ CState_Move::CState_Move() void CState_Move::Enter() { + if (m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::WALK); + + if (m_pOwner->Check(FSMSTATE::JOG)) + m_pFSM->Change_State(FSMSTATE::JOG); + + if (m_pOwner->Check(FSMSTATE::SPRINT)) + m_pFSM->Change_State(FSMSTATE::SPRINT); + + if (m_pOwner->Check(FSMSTATE::DODGE)) + m_pFSM->Change_State(FSMSTATE::DODGE); + + if (m_pOwner->Check(FSMSTATE::IDLE_TURN)) + m_pFSM->Change_State(FSMSTATE::IDLE_TURN); + + m_pFSM->Change_State(FSMSTATE::IDLE); } void CState_Move::Update(_float fTimeDelta) @@ -25,26 +41,6 @@ void CState_Move::Exit() _bool CState_Move::CheckExitState() { - if (m_pOwner->Check(FSMSTATE::COMBAT) && - !m_pOwner->Check(FSMSTATE::MOVE)) - { - m_pFSM->Change_State(FSMSTATE::COMBAT); - - if (m_pOwner->Check(FSMSTATE::SKILL)) - m_pFSM->Change_State(FSMSTATE::SKILL); - - if (m_pOwner->Check(FSMSTATE::SKILL2)) - m_pFSM->Change_State(FSMSTATE::SKILL2); - - if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK)) - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - - if (m_pOwner->Check(FSMSTATE::CAST)) - m_pFSM->Change_State(FSMSTATE::CAST); - - return true; - } - return false; } diff --git a/Jusin154_Team3D/Editor/Private/State_Root.cpp b/Jusin154_Team3D/Editor/Private/State_Root.cpp new file mode 100644 index 000000000..efef8727b --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Root.cpp @@ -0,0 +1,62 @@ +#include "pch.h" +#include "State_Root.h" +#include "Unit.h" + + +CState_Root::CState_Root() + :CState() +{ +} + +void CState_Root::Enter() +{ + if (m_pOwner->Check(FSMSTATE::COMBAT)) + m_pFSM->Change_State(FSMSTATE::COMBAT); + + else + m_pFSM->Change_State(FSMSTATE::MOVE); +} + +void CState_Root::Update(_float fTimeDelta) +{ + if (CheckExitState()) + return; +} + +void CState_Root::Exit() +{ +} + +_bool CState_Root::CheckExitState() +{ + if (m_pOwner->Check(FSMSTATE::COMBAT)) + { + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT) + m_pFSM->Change_State(FSMSTATE::COMBAT); + + return true; + } + + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT) + return false; + + if (m_pOwner->Check(FSMSTATE::MOVE)) + { + if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE) + m_pFSM->Change_State(FSMSTATE::MOVE); + + return true; + } + + return false; +} + + +void CState_Root::Free() +{ + __super::Free(); +} + +void CState_Root::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Skill.cpp b/Jusin154_Team3D/Editor/Private/State_Skill.cpp index d842e203d..277606272 100644 --- a/Jusin154_Team3D/Editor/Private/State_Skill.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Skill.cpp @@ -26,8 +26,6 @@ void CState_Skill::Exit() _bool CState_Skill::CheckExitState() { - if (m_pModel->IsFinishedAnim()) - m_pFSM->Change_State(FSMSTATE::IDLE); return false; } diff --git a/Jusin154_Team3D/Editor/Private/State_Sprint.cpp b/Jusin154_Team3D/Editor/Private/State_Sprint.cpp index eccc2dd30..71efa2951 100644 --- a/Jusin154_Team3D/Editor/Private/State_Sprint.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Sprint.cpp @@ -27,10 +27,7 @@ void CState_Sprint::Exit() _bool CState_Sprint::CheckExitState() { if (!m_pOwner->Check(FSMSTATE::SPRINT)) - { - m_pOwner->Reset_Sprint(); - m_pFSM->Change_State(FSMSTATE::WALK); - } + m_pFSM->Change_State(FSMSTATE::JOG); else if (m_pOwner->Check(FSMSTATE::DODGE)) m_pFSM->Change_State(FSMSTATE::DODGE); diff --git a/Jusin154_Team3D/Editor/Private/State_Walk.cpp b/Jusin154_Team3D/Editor/Private/State_Walk.cpp index 967bbbeba..c49a5ee2b 100644 --- a/Jusin154_Team3D/Editor/Private/State_Walk.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Walk.cpp @@ -9,13 +9,13 @@ CState_Walk::CState_Walk() void CState_Walk::Enter() { - if(m_pOwner->Check(FSMSTATE::WALK_FWD)) + if(m_pOwner->Check(FSMSTATE::FWD)) { auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD); m_pModel->Set_AnimationIndex(anim.first, anim.second); } - if (m_pOwner->Check(FSMSTATE::WALK_BWD)) + if (m_pOwner->Check(FSMSTATE::BWD)) { auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD); m_pModel->Set_AnimationIndex(anim.first, anim.second); @@ -34,17 +34,12 @@ void CState_Walk::Exit() _bool CState_Walk::CheckExitState() { - if (m_pOwner->Check(FSMSTATE::SPRINT)) - m_pFSM->Change_State(FSMSTATE::SPRINT); + if (!m_pOwner->Check(FSMSTATE::WALK)) + m_pFSM->Change_State(FSMSTATE::IDLE); else if (m_pOwner->Check(FSMSTATE::DODGE)) m_pFSM->Change_State(FSMSTATE::DODGE); - else if (!m_pOwner->Check(FSMSTATE::WALK)) - m_pFSM->Change_State(FSMSTATE::IDLE); - - if (m_pOwner->Check(FSMSTATE::JUMP)) - m_pFSM->Change_State(FSMSTATE::JUMP); return false; } diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index a4978c348..7ed849299 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -28,6 +28,9 @@ HRESULT CTerrain::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + m_vRotation = _float3{ 0.f, 0.f, 0.f }; + //m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-128.f, -100.f, -128.f, 1.f)); + return S_OK; } @@ -41,15 +44,28 @@ void CTerrain::Priority_Update(_float fTimeDelta) m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_vPickingPosition.y); } } + + GUI::InputFloat("Height Ratio", &m_fHeightRatio); + max(0.01f, m_fHeightRatio); - GUI::DragFloat3("Pos", (_float*)(&m_vPickingPosition)); + //m_pVIBufferCom->Change_HeigthRatio(m_fHeightRatio); + GUI::DragFloat3("Picking", (_float*)(&m_vPickingPosition)); + _float4 vPos = {}; + _float3 vRotation = {}; + XMStoreFloat4(&vPos, m_pTransformCom->Get_State(STATE::POSITION)); + GUI::DragFloat3("Pos", (_float*)(&vPos)); + GUI::DragFloat3("Rota", (_float*)(&m_vRotation)); + + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat4(&vPos)); GUI::End(); } void CTerrain::Update(_float fTimeDelta) { - //m_pVIBufferCom->Culling(XMMatrixIdentity()); + m_pVIBufferCom->Culling(XMMatrixIdentity()); + } void CTerrain::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Wand.cpp b/Jusin154_Team3D/Editor/Private/Wand.cpp new file mode 100644 index 000000000..5412960a8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Wand.cpp @@ -0,0 +1,166 @@ +#include "pch.h" +#include "Wand.h" + +#include "GameInstance.h" + +CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject(pDevice, pContext) +{ +} + +CWand::CWand(const CWand& Prototype) + : CPartObject(Prototype) +{ +} + +HRESULT CWand::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CWand::Initialize(void* pArg) +{ + WAND_DESC* pDesc = static_cast (pArg); + m_pSocketMatrices = pDesc->pSocketMatrices; + + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CWand::Priority_Update(_float fTimeDelta) +{ + _matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + } + m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + + + //_float3 Scale = _float3(10.f, 10.f, 10.f); + //m_pTransformCom->Set_Scale(Scale); +} + +void CWand::Update(_float fTimeDelta) +{ +} + +void CWand::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); +} + +HRESULT CWand::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_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + 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 CWand::Ready_Components() +{ + __super::Ready_Components(nullptr); + + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Wand_Model"), + 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 CWand::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + 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; +} + + +CWand* CWand::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CWand* pInstance = new CWand(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CWand"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CWand::Clone(void* pArg, CGameObject* pOwner) +{ + CWand* pInstance = new CWand(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CWand"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CWand::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); +} + +void CWand::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Public/Broom.h b/Jusin154_Team3D/Editor/Public/Broom.h index caebcc248..9aa0fbb71 100644 --- a/Jusin154_Team3D/Editor/Public/Broom.h +++ b/Jusin154_Team3D/Editor/Public/Broom.h @@ -1,7 +1,7 @@ #pragma once #include "Editor_Define.h" -#include "PartObject.h" +#include "GameObject.h" NS_BEGIN(Engine) class CShader; diff --git a/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_Behavior.h b/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_Behavior.h new file mode 100644 index 000000000..45111b908 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_Behavior.h @@ -0,0 +1,47 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CCallBack_EffectHitBox_Behavior final : public PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_EffectHitBox_Behavior(); +public: + ~CCallBack_EffectHitBox_Behavior(); + +public: + // 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; + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_EffectHitBox_Behavior* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_HitReport.h b/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_HitReport.h new file mode 100644 index 000000000..8b32963ae --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/CallBack_EffectHitBox_HitReport.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CCallBack_EffectHitBox_HitReport final : public PSX::PxUserControllerHitReport +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_EffectHitBox_HitReport(); +public: + ~CCallBack_EffectHitBox_HitReport(); + +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; // 사용자 정의 장애물과 부딪힌 경우 + +public: + HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_EffectHitBox_HitReport* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Editor/Public/CamPosition.h b/Jusin154_Team3D/Editor/Public/CamPosition.h new file mode 100644 index 000000000..d4f8bc9f4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/CamPosition.h @@ -0,0 +1,37 @@ +#pragma once + +#include "Editor_Define.h" + +#include "PartObject.h" + +NS_BEGIN(Editor) + +class CCamPosition abstract : public CPartObject +{ +public: + typedef struct tagCamPosition : public CPartObject::PARTOBJECT_DESC + { + + }CAMERAPOSITION_DESC; +protected: + CCamPosition(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition(const CCamPosition& rhs); + virtual ~CCamPosition() = default; + +protected: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; + + +public: + CGameObject* Clone(void* pArg, CGameObject* pOwner)PURE; + + virtual void Free() override; + + void Describe_Entity() override; + +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/CamPosition_Arm.h b/Jusin154_Team3D/Editor/Public/CamPosition_Arm.h new file mode 100644 index 000000000..f1bee5f84 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/CamPosition_Arm.h @@ -0,0 +1,44 @@ +#pragma once +#include "Editor_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Editor) + +class CCamPosition_Arm final : public CCamPosition +{ +public: + typedef struct tagCameraArm_Desc : public CCamPosition::CAMERAPOSITION_DESC + { + _float3 fEye{}, fAt{}; + _float fMouseSensor{}; + _float fDistance{}; + }CameraArm_DESC; +private: + CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Arm(const CCamPosition_Arm& rhs); + virtual ~CCamPosition_Arm() = 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: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources(); + _bool m_bMovable = true; + _float m_fMouseSensor = {}; + _float m_fDistance = {}; + _float m_fAccDegreeY = { }; + +public: + static CCamPosition_Arm* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Arm* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/CamPosition_Player.h b/Jusin154_Team3D/Editor/Public/CamPosition_Player.h new file mode 100644 index 000000000..3b8f8ce59 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/CamPosition_Player.h @@ -0,0 +1,39 @@ +#pragma once +#include "Editor_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Editor) + +class CCamPosition_Player final : public CCamPosition +{ +public: + typedef struct tagCamPosition_Player : public CCamPosition::CAMERAPOSITION_DESC + { + const _float4x4* pSocketMatrices = { }; + }CAMERAPOSITION_PLAYER_DESC; +private: + CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Player(const CCamPosition_Player& rhs); + virtual ~CCamPosition_Player() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; +private: + const _float4x4* m_pSocketMatrices = { }; + +public: + static CCamPosition_Player* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Player* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Camera_Gaze.h b/Jusin154_Team3D/Editor/Public/Camera_Gaze.h new file mode 100644 index 000000000..9836c8045 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Camera_Gaze.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Editor_Define.h" +#include "Camera.h" + +NS_BEGIN(Editor) + +class CCamera_Gaze final : public CCamera +{ +public: + typedef struct tagCamera_Gaze : public CCamera::CAMERA_DESC + { + }CAMERA_GAZE_DESC; +private: + CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamera_Gaze(const CCamera_Gaze& rhs); + virtual ~CCamera_Gaze() = 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: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Bind_ShaderResources() override; + +public: + static CCamera_Gaze* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXEffectHitBox.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXEffectHitBox.h new file mode 100644 index 000000000..eaca4fb15 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXEffectHitBox.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" +#include "CallBack_EffectHitBox_Behavior.h" +#include "CallBack_EffectHitBox_HitReport.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Editor) + +class CDummy_PhysXEffectHitBox final : public CGameObject +{ +public: + typedef struct tagPhysXDummyDesc + { + _float3 vPos = {}; + _float3 vRotRPY = {}; + _uint iSubKind = {}; + _float3 vDeltaPos = {}; + _float2 vLifeTime = {}; + }PHYSXDUMMY_DESC; +private: + CDummy_PhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXEffectHitBox(const CDummy_PhysXEffectHitBox& rhs); + virtual ~CDummy_PhysXEffectHitBox() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CModel* m_pModelCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CCallBack_EffectHitBox_Behavior* m_pCallBack_Behavior = { nullptr }; + CCallBack_EffectHitBox_HitReport* m_pCallBack_HitReport = { nullptr }; + _float3 m_vDeltaPos = {}; + _float2 m_vLifeTime = { }; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CDummy_PhysXEffectHitBox* 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/Dummy_PhysXHitBox.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXHitBox.h new file mode 100644 index 000000000..300cb8182 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXHitBox.h @@ -0,0 +1,54 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Editor) + +class CDummy_PhysXHitBox final : public CGameObject +{ +public: + typedef struct tagPhysXDummyDesc + { + _float3 vPos = {}; + _float3 vRotRPY = {}; + _uint iSubKind = {}; + }PHYSXDUMMY_DESC; +private: + CDummy_PhysXHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXHitBox(const CDummy_PhysXHitBox& rhs); + virtual ~CDummy_PhysXHitBox() = 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: + CRigidBody* m_pRigidBody = { nullptr }; + const PSX::PxRigidDynamic* m_pActor = { nullptr }; + 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_PhysXHitBox* 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 af347487a..57f04c84f 100644 --- a/Jusin154_Team3D/Editor/Public/EditEffect.h +++ b/Jusin154_Team3D/Editor/Public/EditEffect.h @@ -34,7 +34,8 @@ class CEditEffect final : public CEffectObject private: _int m_iSelectTextureNum = {}; - + vector<_float> m_ValueVector = {}; + _float m_fInputValue = {}; public: static CEditEffect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index f4b5f2335..8a5545adc 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -16,6 +16,7 @@ namespace Editor enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, BLOOM, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; + enum class MAPOBJECT_RENDER_TYPE {NORMAL, DECAL, GLASS}; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; @@ -24,9 +25,9 @@ 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, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, END }; - enum class EFFECT_TYPE { EFFECT , TRAIL , END}; + enum class EFFECT_TYPE { EFFECT, TRAIL, END }; } using namespace Editor; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Struct.h b/Jusin154_Team3D/Editor/Public/Editor_Struct.h index f7cec534e..0e82f879d 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Struct.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Struct.h @@ -1,13 +1,15 @@ -#pragma once - +#pragma once NS_BEGIN(Engine) class CTransform; +class CModel; +class CRigidBody_Static; NS_END NS_BEGIN(Editor) typedef struct tagMapObject_Desc { - CTransform* pParentTransform = { nullptr }; + _uint iRenderType{}; + CTransform* pParentTransform = { nullptr }; _float3 vScale; _float3 vRotation; _float3 vPosition; @@ -27,4 +29,15 @@ typedef struct tagMapObjectLodDesc : public tagMapObject_Desc vector<_uint>* pModelPathIndices = { nullptr }; }MAPOBJECT_LOD_DESC; -NS_END \ No newline at end of file + +typedef struct tagFolderLoad { + _wstring pModelTag; + CModel* pLoadedModel; + filesystem::path pathModel; + + vector pRigidBodyTags; + vector LoadedRigidBody; +}FOLDER_LOAD; + + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index e25614983..ec1d91554 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -56,7 +56,7 @@ class CEffectObject abstract : public CPartObject _float fDiffuseAlpha = { 1.f }; _float fBlurIntensity = {}; _float fNoiseDistortionIntensity = {}; - _float fEmissiveCutAlpha = {}; + _float fEmissiveCutAlpha = { 0.f }; LIGHT_DESC LightDesc = {}; RENDER eRenderOrder = { RENDER::EFFECT }; @@ -65,6 +65,8 @@ class CEffectObject abstract : public CPartObject EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; + _bool isEmissiveDissolve = { false }; + }EFFECT_INFO; typedef struct tagPreEffectInfo @@ -111,10 +113,9 @@ class CEffectObject abstract : public CPartObject LIGHT_DESC LightDesc = {}; RENDER eRenderOrder = { RENDER::EFFECT }; - _bool isReverseDissolve = {}; - - + EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; + _bool isEmissiveDissolve = { false }; }PRE_EFFECT_INFO; diff --git a/Jusin154_Team3D/Editor/Public/Effect_Container.h b/Jusin154_Team3D/Editor/Public/Effect_Container.h index f875f2383..2d635b102 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Container.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Container.h @@ -19,7 +19,7 @@ class CEffect_Container abstract : public CContainerObject virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; - + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; public: #ifdef _DEBUG HRESULT Save_Package(const _char* pPath); diff --git a/Jusin154_Team3D/Editor/Public/Information.h b/Jusin154_Team3D/Editor/Public/Information.h deleted file mode 100644 index dc4c393dd..000000000 --- a/Jusin154_Team3D/Editor/Public/Information.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -#include "Base.h" -#include "Editor_Define.h" - -NS_BEGIN(Editor) - -typedef class CInformation final : public CBase -{ - DECLARE_SINGLETON(CInformation) -public: - HRESULT Initialize_Info(ID3D11Device* pDevice = nullptr, ID3D11DeviceContext* pContext = nullptr); - HRESULT Release_Info(); -#pragma region WHOLEPART - _bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents); - _bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents); - -#pragma endregion // 전역 - -#pragma region OBJECTVIEWER - -#pragma endregion -#pragma region MAPVIEWER - -#pragma endregion -#pragma region EFFECTVIEWER - -#pragma endregion -#pragma region UIVIEWER - -#pragma endregion -#pragma region PHYSXVIEWER - -#pragma endregion -#pragma region COMBINEDVIEWER - -#pragma endregion - -public: -#pragma region LOG - void Log_Render(); - void Log_Push(const _char* pContents); - void Log_Clear(); -#pragma endregion - -private: - ID3D11Device* m_pDevice = { nullptr }; - ID3D11DeviceContext* m_pContext = { nullptr }; - class CGameInstance* m_pGameInstance = { nullptr }; - - _string m_strLog = {}; - - -private: - CInformation(); - virtual ~CInformation() = default; - virtual void Free() override; -}INFO; - -NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h index fc83d6863..9d32f6815 100644 --- a/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h +++ b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "Level.h" @@ -16,16 +16,17 @@ class CLevel_EffectViewer final : public CLevel virtual HRESULT Render() override; private: - /* ÀÌ ·¹º§¿¡¼­ ¾²±âÀ§ÇÑ °´üµéÀ» »ý¼ºÇѴÙ. */ + /* 이 레벨에서 쓰기위한 객체들을 생성한다. */ virtual HRESULT Initialize() override; HRESULT Ready_Layer_Camera(const _wstring& strLayerTag); HRESULT Ready_Layer_Light(); HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); + HRESULT Ready_Layer_PhysX(const _wstring& strLayerTag); public: static CLevel_EffectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h b/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h index 2bca2fc94..277feddd1 100644 --- a/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h +++ b/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "Level.h" @@ -19,7 +19,6 @@ class CLevel_PhysXLab final : public CLevel virtual HRESULT Initialize() override; HRESULT Ready_Layer_Light(); HRESULT Ready_Layer_Camera(const _wstring& strLayerTag); - HRESULT Ready_Layer_Terrain(const _wstring& strLayerTag); HRESULT Ready_Layer_PhysXObjects(const _wstring& strLayerTag); @@ -29,4 +28,4 @@ class CLevel_PhysXLab final : public CLevel virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Loader.h b/Jusin154_Team3D/Editor/Public/Loader.h index 6f49a2ef5..107edcf2c 100644 --- a/Jusin154_Team3D/Editor/Public/Loader.h +++ b/Jusin154_Team3D/Editor/Public/Loader.h @@ -50,6 +50,7 @@ class CLoader final : public CBase private: HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); HRESULT MapFolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<_wstring>& ModelPrototypeTags, vector& ModelPrototypePath); + future Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Collision.h b/Jusin154_Team3D/Editor/Public/MapObject_Collision.h index 759b026a0..f7b62419f 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Collision.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Collision.h @@ -9,7 +9,7 @@ NS_END NS_BEGIN(Editor) -class CMapObject_Collision final : public CMapObject // LOD 모델이 없는 애들 +class CMapObject_Collision final : public CMapObject // 충돌용 Mesh { private: CMapObject_Collision(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/MapObject_LOD.h b/Jusin154_Team3D/Editor/Public/MapObject_LOD.h index b70c09f6a..937ded489 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_LOD.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_LOD.h @@ -32,14 +32,15 @@ class CMapObject_LOD final : public CMapObject // LOD 있는 애들 } private: - CShader* m_pShaderCom = { nullptr }; - vector m_pModelComs; + MAPOBJECT_RENDER_TYPE m_Type = {}; + CShader* m_pShaderCom = { nullptr }; + vector m_pModelComs; - _uint m_iLodIndex = {}; - _uint m_iShaderPass = {}; + _uint m_iLodIndex = {}; + _uint m_iShaderPass = {}; - vector<_wstring> m_ModelPrototypeTags; - vector<_uint> m_ModelPathIndices = { }; + vector<_wstring> m_ModelPrototypeTags; + vector<_uint> m_ModelPathIndices = { }; private: HRESULT Ready_Components(); diff --git a/Jusin154_Team3D/Editor/Public/NomalJap.h b/Jusin154_Team3D/Editor/Public/NomalJap.h index 8873292dd..bf19461b7 100644 --- a/Jusin154_Team3D/Editor/Public/NomalJap.h +++ b/Jusin154_Team3D/Editor/Public/NomalJap.h @@ -27,10 +27,10 @@ class CNomalJap final : public CEffect_Container virtual HRESULT Ready_Components(void* pArg) override; HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; - + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: - _wstring m_wstrEffectName = {}; - + _wstring m_wstrEffectName = {}; + class CDummy_PhysXEffectHitBox* m_pPhysHitBox = {}; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 66b3edc6c..6e42215ed 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -27,12 +27,16 @@ class CPlayer final : public CUnit virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } + private: vector m_InputConditions; _bool m_bSprintToggle = { false }; - + _bool m_bWalkToggle = { false }; + class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; + class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; private: HRESULT Ready_Components(); + HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); void Setup_InputConditions(); void Key_Input(_float fTimeDelta); @@ -50,8 +54,10 @@ class CPlayer final : public CUnit virtual void Set_Anim(); _bool Check(FSMSTATE::ESTATE state); _bool IsSprint(); + _bool IsWalk(); public: virtual void Reset_Sprint() { m_bSprintToggle = false; } + virtual void Reset_Walk() { m_bWalkToggle = false; } #pragma endregion diff --git a/Jusin154_Team3D/Editor/Public/Slot_Number.h b/Jusin154_Team3D/Editor/Public/Slot_Number.h new file mode 100644 index 000000000..9321002e1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Slot_Number.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSlot_Number final : public CElementObject +{ +private: + CSlot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSlot_Number(const CSlot_Number& rhs); + virtual ~CSlot_Number() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSlot_Number* 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/Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Spell_Slot.h index 8cc18fdc0..e09d7aea9 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Slot.h @@ -19,6 +19,9 @@ class CSpell_Slot final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; private: virtual HRESULT Bind_ShaderResources() override; @@ -31,6 +34,10 @@ class CSpell_Slot final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + public: static CSpell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/State_Root.h b/Jusin154_Team3D/Editor/Public/State_Root.h new file mode 100644 index 000000000..9b02d4449 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Root.h @@ -0,0 +1,19 @@ +#pragma once +#include "Editor_Define.h" +#include "State.h" + +class CState_Root final : public CState +{ +public: + CState_Root(); + virtual ~CState_Root() = default; + +public: + virtual void Enter(); + virtual void Update(_float fTimeDelta); + virtual void Exit(); + virtual _bool CheckExitState(); +public: + virtual void Free() override; + virtual void Describe_Entity(); +}; diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index 7ece54b48..ce217bc64 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -27,11 +27,13 @@ class CTerrain final : public CGameObject virtual HRESULT Render() override; private: - CShader* m_pShaderCom = { nullptr }; - CVIBuffer_Terrain* m_pVIBufferCom = { nullptr }; - CTexture* m_pTextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Terrain* m_pVIBufferCom = { nullptr }; + CTexture* m_pTextureCom = { nullptr }; + _float m_fHeightRatio = {1.f}; _float3 m_vPickingPosition = {}; + _float3 m_vRotation = {}; private: HRESULT Ready_Components(); @@ -44,4 +46,4 @@ class CTerrain 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/Wand.h b/Jusin154_Team3D/Editor/Public/Wand.h new file mode 100644 index 000000000..0bfdd513b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Wand.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Editor_Define.h" +#include "PartObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CWand final : public CPartObject +{ +public: + typedef struct tagWand : public CPartObject::PARTOBJECT_DESC + { + const _float4x4* pSocketMatrices = { }; + }WAND_DESC; +private: + CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CWand(const CWand& Prototype); + virtual ~CWand() = 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: + const _float4x4* m_pSocketMatrices = { }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CWand* 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 diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 8c6fbe9e9..3b37f3b2c 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -134,8 +134,8 @@ BlendState BS_WB_Acc DestBlend[0] = one; BlendOp[0] = Add; - SrcBlend[1] = Zero; - DestBlend[1] = Inv_Src_Alpha; + SrcBlend[1] = Inv_Src_Alpha; + DestBlend[1] = zero; BlendOp[1] = Add; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 1a8c94894..b8aba5069 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -119,7 +119,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; - float fRoughness = 0.5f; + float fRoughness = 0.f; float fOcclusion = 1.f; float fAttenuation = 1.f; @@ -146,12 +146,12 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fOcclusion = vSRO.b; } - float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); PBR_Out.vShade *= fDiffuseAOStrength; - + saturate(PBR_Out.vShade); Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -355,6 +355,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f); Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static)); + //float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x; //float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x; //bool IsShadow = { false }; @@ -389,6 +390,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) //} //[loop] // 변수로 루프돌리려면 반드시 필요함 + for (int i = -15; i < 16; ++i) { vTexcoord.x = In.vTexcoord.x; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 5c8f5c81a..cb79ebc0b 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -50,7 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); if (0.f == vColorTexture.a) { diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl new file mode 100644 index 000000000..31276135c --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -0,0 +1,64 @@ +float PI = 3.141592; + +struct Mesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; + + uint4 vBlendIndex; + float4 vBlendWeight; +}; + +struct SkinngMesh +{ + float3 vPosition; + float3 vNormal; + float3 vTangent; + float3 vBinormal; + float2 vTexcoord; + +}; + +StructuredBuffer g_MeshBufferInput : register(t0); +RWStructuredBuffer gSkinngMeshOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) +{ + row_major float4x4 BoneMatrix[512]; +}; + +//[numthreads(256, 1, 1)] +[numthreads(256, 1, 1)] +void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID) +{ + uint iIndex = DispatchThreadID.x; + + Mesh mesh = g_MeshBufferInput[iIndex]; + + float fWeightW = 1.f - + (mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z); + + matrix SkinMatrix = + BoneMatrix[mesh.vBlendIndex.x] * mesh.vBlendWeight.x + + BoneMatrix[mesh.vBlendIndex.y] * mesh.vBlendWeight.y + + BoneMatrix[mesh.vBlendIndex.z] * mesh.vBlendWeight.z + + BoneMatrix[mesh.vBlendIndex.w] * fWeightW; + + float4 vPosition = mul(float4(mesh.vPosition, 1), SkinMatrix); + float4 vNormal = mul(float4(mesh.vNormal, 0), SkinMatrix); + float4 vBinormal = mul(float4(mesh.vBinormal, 0), SkinMatrix); + float4 vTangent = mul(float4(mesh.vTangent, 0), SkinMatrix); + + + SkinngMesh outv; + outv.vPosition = vPosition.xyz; + outv.vNormal = vNormal.xyz; + outv.vTangent = vTangent.xyz; + outv.vBinormal = vBinormal.xyz; + outv.vTexcoord = mesh.vTexcoord; + + gSkinngMeshOutput[iIndex] = outv; +} diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index f8b3aaf3f..b2d93c15b 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -611,6 +611,7 @@ call Update_Lib.bat + Effect 5.0 diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 7a10b87be..b617e076e 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -1245,5 +1245,8 @@ 99.Define\01.SHADER\Inc + + 99.Define\01.SHADER + \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Private/Base.cpp b/Jusin154_Team3D/Engine/Private/Base.cpp index 9bae93d12..8d31f70c0 100644 --- a/Jusin154_Team3D/Engine/Private/Base.cpp +++ b/Jusin154_Team3D/Engine/Private/Base.cpp @@ -8,11 +8,36 @@ CBase::CBase() _uint CBase::AddRef() { - return ++m_iRefCnt; + return m_iRefCnt.fetch_add(1, memory_order_relaxed) + 1; // +1 한 이후의 갯수를 출력 } _uint CBase::Release() { + for (;;) + { + _uint iOldRefCount = m_iRefCnt.load(memory_order_acquire); + + if (iOldRefCount == 0u) // -1 할 때 갯수가 0이면 소멸 + { + Free(); + + delete this; + + return 0u; + } + + _uint iNewRefCount = iOldRefCount - 1u; + + if (m_iRefCnt.compare_exchange_weak( + iOldRefCount, + iNewRefCount, + memory_order_acq_rel, + memory_order_acquire)) + { + return iNewRefCount; // -1 한 이후의 갯수를 출력함을 보장 + } + } + if (0 == m_iRefCnt) { Free(); diff --git a/Jusin154_Team3D/Engine/Private/Bone.cpp b/Jusin154_Team3D/Engine/Private/Bone.cpp index 3a621f426..b76abcbec 100644 --- a/Jusin154_Team3D/Engine/Private/Bone.cpp +++ b/Jusin154_Team3D/Engine/Private/Bone.cpp @@ -5,6 +5,16 @@ CBone::CBone() { } +CBone::CBone(const CBone& other): + CBase() +{ + memcpy_s(m_szName, sizeof(_char) * MAX_PATH, other.m_szName, sizeof(_char) * MAX_PATH); + m_TransformationMatrix = other.m_TransformationMatrix; + m_CombinedTransformationMatrix = other.m_CombinedTransformationMatrix; + m_iParentBoneIndex = other.m_iParentBoneIndex; + m_matInitial = other.m_matInitial; +} + void CBone::Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame) { _vector vScale = {}; diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index bc1043d15..b60d9c6a1 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -171,7 +171,8 @@ void CChannel::Update_TransformationMatirx(const vector& Bones, _float f _vector vCurrentPos = pTransform->Get_State(STATE::POSITION); _vector vTargetPos = vCurrentPos + vDeltaWorld; - pTransform->Set_State(STATE::POSITION, vTargetPos); + //pTransform->Set_State(STATE::POSITION, vTargetPos); + pTransform->AccumulateMomentum(vDeltaWorld); m_vPrevRootPos = vCurRootPos; vTranslation = XMVectorZero(); diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 223e115b0..8be681b12 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -319,6 +319,9 @@ CComponent* CCharacter_Controller::Clone(void* pArg, class CGameObject* pOwner) void CCharacter_Controller::Free() { + if (nullptr != m_pController) { + m_pController->release(); + } __super::Free(); } diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index ddbd98b00..076225662 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -113,9 +113,14 @@ void CComputeShader::Bind_UAV(_uint iIndex) void CComputeShader::Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex) { - m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호 - 1, // 버퍼 개수 - &m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주소 + //m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호 + // 1, // 버퍼 개수 + // &m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주소 + + ID3D11ShaderResourceView* pSRV = m_pOutputSRV[iBufferIndex]; + + // VS에 바인딩 + m_pContext->VSSetShaderResources(iIndex, 1, &pSRV); } diff --git a/Jusin154_Team3D/Engine/Private/FSM.cpp b/Jusin154_Team3D/Engine/Private/FSM.cpp index f09d5d689..193a4a8d8 100644 --- a/Jusin154_Team3D/Engine/Private/FSM.cpp +++ b/Jusin154_Team3D/Engine/Private/FSM.cpp @@ -82,7 +82,6 @@ void CFSM::Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent) pChild->Set_Parent(pParent); } - CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CFSM* pInstance = new CFSM(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 6fe14a25c..c3f2ac1a2 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -145,7 +145,6 @@ void CGameInstance::Clear_Resources(_uint iLevelIndex) m_pCamera_Manager->Clear_Cameras(iLevelIndex); m_pObject_Manager->Clear(iLevelIndex); m_pLight_Manager->Light_Clear(iLevelIndex); - } _float CGameInstance::Random_Normal() @@ -307,7 +306,7 @@ void CGameInstance::Present_TimeCost() const GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("Timer_Occupancy %d", int(m_fTimer_Present / fTotal * 100.f)); } - GUI::Text("GameInstance RefCNT : %d", m_iRefCnt); + GUI::Text("GameInstance RefCNT : %d", m_iRefCnt.load()); static float values[60] = {}; static int values_offset = 0; static double refresh_time = 0.0; diff --git a/Jusin154_Team3D/Engine/Private/GameObject.cpp b/Jusin154_Team3D/Engine/Private/GameObject.cpp index 0415223fd..0c5d52f2f 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject.cpp @@ -53,7 +53,7 @@ void CGameObject::Late_Update(_float fTimeDelta) { } -void CGameObject::OnCollision(CGameObject* pOther) +void CGameObject::OnCollision(CGameObject* pOther , void* pDesc) { } void CGameObject::OnHit(CGameObject* pOther, CGameObject* pCaller) diff --git a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp index 601ccdf56..19f6380eb 100644 --- a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Light_Manager.h" #include "Light.h" @@ -74,10 +74,9 @@ const LIGHT_DESC* CLight_Manager::Get_Light_Info(_uint _iCurrentLevel, _uint _iL } -HRESULT CLight_Manager::Render_Lights(_uint _iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) +HRESULT CLight_Manager::Render_Lights(_uint iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) { - - for (auto& pLight : m_Lights[_iCurrentLevel]) + for (auto& pLight : m_Lights[iCurrentLevel]) { pLight->Render(pShader, pVIBuffer); } diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 5f24755c0..e3a751f77 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -353,33 +353,33 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType strTexturePath = CMyTools::ToString(szTextureFilePath); } - _string strPrefix = "../Bin/Resources/Models/MapMesh/"; - _string strSearchString = "MeshTable"; - _string strResultPath = {}; + //_string strPrefix = "C:"; + //_string strSearchString = "MeshTable"; + //_string strResultPath = {}; - size_t mapRePos = strTexturePath.find(strSearchString); + //size_t mapRePos = strTexturePath.find(strSearchString); - if (mapRePos != std::string::npos) - { - size_t startPos = mapRePos + strSearchString.length(); + //if (mapRePos != std::string::npos) + //{ + // size_t startPos = mapRePos + strSearchString.length(); - // 'MapRe' 뒤에 오는 경로 건너뛰기 - if (startPos < strTexturePath.length() && - (strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) { - startPos++; - } + // // 'MapRe' 뒤에 오는 경로 건너뛰기 + // if (startPos < strTexturePath.length() && + // (strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) { + // startPos++; + // } - // 'MapRe' 이후의 나머지 경로를 추출 - strResultPath = strPrefix + strTexturePath.substr(startPos); - } - else - { - MSG_BOX("FAILED to Find Path"); - } + // // 'MapRe' 이후의 나머지 경로를 추출 + // strResultPath = strTexturePath;//.substr(startPos); + //} + //else + //{ + // MSG_BOX("FAILED to Find Path"); + //} - replace(strResultPath.begin(), strResultPath.end(), '\\', '/'); + //replace(strResultPath.begin(), strResultPath.end(), '\\', '/'); - m_SaveMaterial.Path[ENUM_CLASS(eTexture)].push_back(strResultPath); + m_SaveMaterial.Path[ENUM_CLASS(eTexture)].push_back(strTexturePath); m_SRVs[ENUM_CLASS(eTexture)].push_back(pSRV); return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 6861970b3..d36182e10 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -3,7 +3,7 @@ #include "Model.h" #include "Bone.h" #include "Shader.h" - +#include "ComputeShader.h" CMesh::CMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CVIBuffer{ pDevice, pContext } { @@ -113,8 +113,6 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, vector& Bones, co #pragma endregion - - return S_OK; } #endif @@ -291,7 +289,7 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* #pragma endregion - + Create_RawVB(m_RawVertices); return S_OK; } @@ -509,11 +507,82 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) return E_FAIL; + + m_RawVertices.resize(m_iNumVertices); + + for (_uint i = 0; i < m_iNumVertices; i++) + { + m_RawVertices[i].vPosition = pVertices[i].vPosition; + m_RawVertices[i].vNormal = pVertices[i].vNormal; + m_RawVertices[i].vTangent = pVertices[i].vTangent; + m_RawVertices[i].vBinormal = pVertices[i].vBinormal; + m_RawVertices[i].vTexcoord = pVertices[i].vTexcoord; + + m_RawVertices[i].vBlendIndex = pVertices[i].vBlendIndex; + m_RawVertices[i].vBlendWeight = pVertices[i].vBlendWeight; + } + Safe_Delete_Array(pVertices); return S_OK; } + +HRESULT CMesh::Create_RawVB(vector& RawVertices) +{ + m_iRawVertexStride = sizeof(MESH_DESC); + + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = m_iRawVertexStride *m_iNumVertices; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = m_iRawVertexStride; + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = RawVertices.data(); + + m_pDevice->CreateBuffer(&desc, &init, &m_pVBMesh); + + + return S_OK; +} + + +void CMesh::ComputSkinning(CComputeShader* ComputeShader, ID3D11Buffer* ConstantBuffer) +{ + if (ComputeShader == nullptr) + return; + + _uint iGroupCountX = (m_iNumVertices + 255) / 256; + + ID3D11Buffer* CSBuffers[] = { + m_pVBMesh + }; + + vector OutSubResources = {}; + D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {}; + + OutSubResources = ComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, ConstantBuffer); +} + +void CMesh::FillBoneDesc(const vector<_float4x4>& CombinedMatrices, BONE_DESC* pOut) +{ + for (size_t i = 0; i < m_iNumBones; ++i) + { + const _float4x4& offset = m_offsetMatrices[i]; + const _float4x4& combined = CombinedMatrices[m_BoneIndices[i]]; + + _matrix matOffset = XMLoadFloat4x4(&offset); + _matrix matCombined = XMLoadFloat4x4(&combined); + + XMStoreFloat4x4(&pOut->BoneMatrix[i], matOffset * matCombined); + } +} + + + HRESULT CMesh::Initialize(void* pArg) { return S_OK; @@ -822,6 +891,7 @@ void CMesh::Free() __super::Free(); Safe_Delete_Array(m_pBoneMatrices); + SAFE_RELEASE(m_pVBMesh); } void CMesh::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 098703f27..5d94f3d9f 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -7,6 +7,7 @@ #include "LerpAnim.h" #include "GameObject.h" #include "Transform.h" +#include "ComputeShader.h" CModel::CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } @@ -23,7 +24,9 @@ CModel::CModel(const CModel& rhs) m_Materials(rhs.m_Materials), m_iNumMaterials(rhs.m_iNumMaterials), m_iNumAnimations(rhs.m_iNumAnimations), - m_pLerpAnim(rhs.m_pLerpAnim) + m_pLerpAnim(rhs.m_pLerpAnim), + m_fRadius(rhs.m_fRadius), + m_vRadiusOffset(rhs.m_vRadiusOffset) { _uint iNumBones = (_uint)(rhs.m_Bones.size()); m_Bones.reserve(iNumBones); @@ -479,6 +482,29 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p m_Materials.push_back(pMaterial); } m_Materials.shrink_to_fit(); + + while (true) + { + getline(file, strText); + if (string::npos != strText.find("Origin")) + { + size_t iXPos = strText.find_first_of("X"); + size_t iYPos = strText.find_first_of("Y"); + size_t iZPos = strText.find_first_of("Z"); + size_t iEndPos = strText.find_first_of("}"); + + m_vRadiusOffset.x = stof(strText.substr(iXPos + 2, iYPos - 2)) * 0.01f; + m_vRadiusOffset.z = stof(strText.substr(iYPos + 2, iZPos - 2)) * -0.01f; + m_vRadiusOffset.y = stof(strText.substr(iZPos + 2, iEndPos)) * 0.01f; + } + if (string::npos != strText.find("SphereRadius")) + { + size_t iBeginIndex = strText.find_first_of("="); + m_fRadius = stof(strText.substr(iBeginIndex + 1)) / 100.f; + break; + } + } + return S_OK; } @@ -779,6 +805,12 @@ _bool CModel::SaveAssimpModel(const _char* filename) } } + if (MODEL::ENVIROMENT == m_eType) + { + fwrite(&m_fRadius, sizeof(_float), 1, fp); + fwrite(&m_vRadiusOffset, sizeof(_float3), 1, fp); + } + fclose(fp); return true; @@ -868,6 +900,96 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma #endif // EDITOR_PROJECT +HRESULT CModel::Create_CS() +{ + _uint vertexCount = 0; + _uint MaxvertexCount = 0; + for (_uint i = 0; i < m_Meshes.size(); ++i) + { + vertexCount = m_Meshes[i]->Get_Vertex(); + if (MaxvertexCount < vertexCount) + MaxvertexCount = vertexCount; + } + + _uint CS_InputStrides[] = { + sizeof(MESH_DESC) + }; + + size_t meshCount = m_Meshes.size(); + + _uint* CS_OutputStrides = new _uint[meshCount]; + + for (size_t i = 0; i < meshCount; i++) + { + CS_OutputStrides[i] = sizeof(SKINNG_MESH_DESC)*(_uint)meshCount; + } + + + m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, + L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", "CS_MAIN", MaxvertexCount, 1, (_uint)meshCount, CS_InputStrides,CS_OutputStrides); + + if (m_pComputeShader == nullptr) + return E_FAIL; + + Safe_Delete_Array(CS_OutputStrides); + + return S_OK; +} + +void CModel::ComputeSkinning() +{ + Get_BoneMatrix(); + for (_uint i = 0; i < m_iNumMeshes; ++i) + { + D3D11_MAPPED_SUBRESOURCE ConstantSubResource{}; + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, + D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) + { + CMesh::BONE_DESC* pDesc = + static_cast(ConstantSubResource.pData); + + m_Meshes[i]->FillBoneDesc(m_BoneMatrix,pDesc); + + m_pContext->Unmap(m_pConstantBuffer, 0); + } + + m_Meshes[i]->ComputSkinning(m_pComputeShader, m_pConstantBuffer); + } +} + +void CModel::Create_Con() +{ + D3D11_BUFFER_DESC cbDesc = {}; + cbDesc.Usage = D3D11_USAGE_DYNAMIC; + cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbDesc.ByteWidth = sizeof(BONE_DESC); + + if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) + return; +} + +HRESULT CModel::Bind_CS_Output(_uint Index, _uint iBufferIndex) +{ + if (m_pComputeShader == nullptr) + return E_FAIL; + + m_pComputeShader->Bind_OutPut_SRV(Index, iBufferIndex); + + return S_OK; +} + +void CModel::Get_BoneMatrix() +{ + m_BoneMatrix.resize(m_Bones.size()); + for (size_t i =0; i < m_Bones.size(); i++) + { + m_BoneMatrix[i] = (*m_Bones[i]->Get_CombinedTransformationMatrixPtr()); + } +} + + + HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { m_eType = eType; @@ -913,16 +1035,6 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ if (FAILED(Ready_Animations())) { return E_FAIL; } - -#ifdef 기무리 - if (MODEL::ENVIROMENT == m_eType) { - m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes); - for (_uint i = 0; i < m_iNumMeshes; ++i) { - m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]); - } - } -#endif // - return S_OK; } @@ -1079,6 +1191,11 @@ _bool CModel::LoadData(const _char* filename) NewModel.Materials.push_back(mat); } + if (MODEL::ENVIROMENT == m_eType) + { + fread(&m_fRadius, sizeof(_float), 1, fp); + fread(&m_vRadiusOffset, sizeof(_float3), 1, fp); + } fclose(fp); @@ -1200,6 +1317,13 @@ HRESULT CModel::Initialize(void* pArg) m_pTransform = m_pOwner->Get_Component(); SAFE_ADDREF(m_pTransform); + Create_Con(); + + if (FAILED(Create_CS())) + return E_FAIL; + + + return S_OK; } @@ -1323,8 +1447,11 @@ void CModel::Free() SAFE_RELEASE(m_pLerpAnim); m_SaveModel.clear(); -} + SAFE_RELEASE(m_pComputeShader); + SAFE_RELEASE(m_pConstantBuffer); + +} void CModel::Describe_Entity() { //GUI::Begin("Model_Desc"); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 6bb1707e3..b62be3c26 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -38,7 +38,7 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; case ACTOR::SPHERE: - geoHolder = PSX::PxCapsuleGeometry(vVolume.x); + geoHolder = PSX::PxSphereGeometry(vVolume.x); pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; default: @@ -274,7 +274,6 @@ void CPhysX_Manager::Update(_float fTimeDelta) //Update_Dynamic_AllActors(); } } - void CPhysX_Manager::Update_Dynamic_ActiveActors() { PSX::PxU32 iNumActiveActor = {}; @@ -406,6 +405,7 @@ HRESULT CPhysX_Manager::Initialize() if (FAILED(Connect_DebugServer())) { //ASSERT_NURI(false); + //ASSERT_JINWOO(false); } { // 씬 세팅 @@ -474,7 +474,7 @@ HRESULT CPhysX_Manager::Initialize() } // m_pScene->overlap();?????? - +#ifdef EDITOR_PROJECT #ifdef 기무리 PlaneData.eKind = PHYSX_KIND::BODY_STATIC; PlaneData.iSubKind = UINT_MAX; @@ -506,6 +506,69 @@ HRESULT CPhysX_Manager::Initialize() //} #endif // 기무리 + +#ifdef 진우 + PlaneData.eKind = PHYSX_KIND::BODY_STATIC; + PlaneData.iSubKind = UINT_MAX; + PlaneData.pOwner = nullptr; + PlaneData.pBody = nullptr; + + 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)]); + pGroundPlane->userData = &PlaneData; + pGroundPlane->setName("PHYSX_MANAGER_PLANE"); + m_pScene->addActor(*pGroundPlane);; + + //{ + // float halfExtent = .5f; + // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); + // physx::PxU32 size = 30; + // physx::PxTransform pxTransform(physx::PxVec3(0)); + + // for (physx::PxU32 i = 0; i < size; i++) { + // for (physx::PxU32 j = 0; j < size - i; j++) { + // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); + // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); + // body->attachShape(*shape); + // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); + // m_pScene->addActor(*body); + // } + // } + //} +#endif // 진우 +#endif // EDITOR_PROJECT + +#ifdef Bin + PlaneData.eKind = PHYSX_KIND::BODY_STATIC; + PlaneData.iSubKind = UINT_MAX; + PlaneData.pOwner = nullptr; + PlaneData.pBody = nullptr; + + 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)]); + pGroundPlane->userData = &PlaneData; + pGroundPlane->setName("PHYSX_MANAGER_PLANE"); + m_pScene->addActor(*pGroundPlane);; + + //{ + // float halfExtent = .5f; + // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); + // physx::PxU32 size = 30; + // physx::PxTransform pxTransform(physx::PxVec3(0)); + + // for (physx::PxU32 i = 0; i < size; i++) { + // for (physx::PxU32 j = 0; j < size - i; j++) { + // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); + // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); + // body->attachShape(*shape); + // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); + // m_pScene->addActor(*body); + // } + // } + //} +#endif // 진우 return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 7de2341bf..07f23ed5d 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -65,9 +65,9 @@ void CRenderer::Render() Render_Blur(); Render_Combined(); Render_Effect(); - Render_WeightBlend(); Render_NonLight(); Render_Blend(); + Render_WeightBlend(); Render_LastColor(); Render_UI(); @@ -264,9 +264,6 @@ void CRenderer::Render_Combined() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurXTexture"))) { return; } - if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_Weight"), m_pShader, "g_BlurWeightTexture"))) { - return; - } } @@ -370,11 +367,6 @@ void CRenderer::Render_Blur() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur"), m_pShader, "g_BlurTexture"))) { return; } - - if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_Weight"), m_pShader, "g_BlurWeightTexture"))) { - return; - } - m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::BLUR)); @@ -657,10 +649,6 @@ HRESULT CRenderer::Initialize() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur"), TEXT("Target_Blur_Weight")))) { - return E_FAIL; - } - /* MRT_Blur_X */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur_X"), TEXT("Target_Blur_X")))) { return E_FAIL; diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 1d4672861..34519931f 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -4,12 +4,12 @@ #include "GameInstance.h" CUnit::CUnit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - : CGameObject(pDevice, pContext) + : CContainerObject(pDevice, pContext) { } CUnit::CUnit(const CUnit& Prototype) - : CGameObject(Prototype) + : CContainerObject(Prototype) { } @@ -30,15 +30,17 @@ HRESULT CUnit::Initialize(void* pArg) void CUnit::Priority_Update(_float fTimeDelta) { - + __super::Priority_Update(fTimeDelta); } void CUnit::Update(_float fTimeDelta) { + __super::Update(fTimeDelta); } void CUnit::Late_Update(_float fTimeDelta) { + __super::Late_Update(fTimeDelta); } HRESULT CUnit::Render() diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp index c439ebfeb..f0e7454e6 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp @@ -16,39 +16,13 @@ CVIBuffer_Terrain::CVIBuffer_Terrain(const CVIBuffer_Terrain& rhs) , m_iNumVerticesX{ rhs.m_iNumVerticesX } , m_iNumVerticesZ{ rhs.m_iNumVerticesZ } , m_pQuadTree{ rhs.m_pQuadTree } + , m_HeigthValues{ rhs.m_HeigthValues } { Safe_AddRef(m_pQuadTree); } HRESULT CVIBuffer_Terrain::Initialize_Prototype(const _char* pFilePath, _uint iSizeX, _uint iSizeZ) { - - - //_ulong dwByte = {}; - //HANDLE hFile = CreateFile(CMyTools::ToWstring(pFilePath).c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - - //BITMAPFILEHEADER fh{}; - //BITMAPINFOHEADER ih{}; - // - //ReadFile(hFile, &fh, sizeof fh, &dwByte, nullptr); - //ReadFile(hFile, &ih, sizeof ih, &dwByte, nullptr); - - - - - //ReadFile(hFile, pPixels, sizeof(_uint) * ih.biHeight * ih.biWidth, &dwByte, nullptr); - - HANDLE hFile = CreateFile(TEXT("../Bin/Bina.bin"), - 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; - } - _int iWidth = {}; _int iHeight = {}; _int iComp = {}; @@ -61,41 +35,29 @@ HRESULT CVIBuffer_Terrain::Initialize_Prototype(const _char* pFilePath, _uint iS return E_FAIL; } - m_iNumVerticesX = iWidth + 1;//iSizeX; - m_iNumVerticesZ = iHeight + 1;//iSizeZ; + m_iNumVerticesX = iWidth + 1; + m_iNumVerticesZ = iHeight + 1; m_iNumVertices = m_iNumVerticesX * m_iNumVerticesZ; _float* pPixels = new _float[m_iNumVertices]; ZeroMemory(pPixels, sizeof(_float) * m_iNumVertices); - _uint iIndex = {}; + _uint iPixelIndex = {}; for (int i = 0; i < iHeight; ++i) { for (int j = 0; j < iWidth; ++j) { - int index = - iComp * (i * iWidth + j); + int iTexureindex = iComp * ((iHeight - 1 - i) * iWidth + j); + iPixelIndex = i * m_iNumVerticesX + j; if (iComp < 3) { - // 흑백 - int grey = - (int)pTexture[index + 0]; - - // 알파 채널 - int alpha; - if (iComp > 1) { - int alpha = - (int)pTexture[index + 1]; - } - else { - alpha = 255; - } + // 흑백 } else { // RGB 컬러 - _uint height16 = ((int)pTexture[index + 0]<< 8) | (int)pTexture[index + 1]; // 0 ~ 65535 - pPixels[iIndex++] = height16 / 65535.0f; + _uint height16 = ((int)pTexture[iTexureindex + 0]<< 8) + (int)pTexture[iTexureindex + 1]; // 0 ~ 65535 + pPixels[iPixelIndex] = height16 / 65535.0f; - int color_r = (int)pTexture[index + 0]; - int color_g = (int)pTexture[index + 1]; - int color_b = (int)pTexture[index + 2]; + int color_r = (int)pTexture[iTexureindex + 0]; + int color_g = (int)pTexture[iTexureindex + 1]; + int color_b = (int)pTexture[iTexureindex + 2]; // 알파 채널 int alpha; @@ -106,23 +68,20 @@ HRESULT CVIBuffer_Terrain::Initialize_Prototype(const _char* pFilePath, _uint iS else { alpha = 255; } - - if (!WriteFile(hFile, &pPixels[iIndex - 1], sizeof(size_t), nullptr, nullptr)) { - return E_FAIL; - } } } + iPixelIndex = i * m_iNumVerticesX + iWidth; + pPixels[iPixelIndex] = 0.0f; + } + + _uint iLastRowStart = iHeight * m_iNumVerticesX; + for (_uint j = 0; j < m_iNumVerticesX; ++j) // m_iNumVerticesX == iWidth + 1 + { + pPixels[iLastRowStart + j] = 0.0f; } stbi_image_free(pTexture); - - - - - CloseHandle(hFile); - - - + m_iNumVertexBuffers = 1; m_iVertexStride = sizeof(VTXNORTEX); @@ -148,17 +107,20 @@ HRESULT CVIBuffer_Terrain::Initialize_Prototype(const _char* pFilePath, _uint iS m_pVertexPositions = new _float3[m_iNumVertices]; ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); - for (_uint i = 0; i < m_iNumVerticesZ; i++) + for (_uint i = 0; i < m_iNumVerticesZ - 1; i++) { - for (_uint j = 0; j < m_iNumVerticesX; j++) + for (_uint j = 0; j < m_iNumVerticesX - 1; j++) { _uint iIndex = i * m_iNumVerticesX + j; - m_pVertexPositions[iIndex] = pVertices[iIndex].vPosition = _float3((_float)j, (_float)(pPixels[iIndex]) * 5 * 256.f, (_float)i); + m_pVertexPositions[iIndex] = pVertices[iIndex].vPosition = _float3( + (_float)j * m_iNumVerticesX / (m_iNumVerticesX - 1.f), + (_float)(pPixels[iIndex]) * 5 * 256.f, + (_float)i * m_iNumVerticesZ / (m_iNumVerticesZ -1.f) + ); + pVertices[iIndex].vNormal = _float3(0.f, 0.f, 0.f); - pVertices[iIndex].vTexcoord = _float2((_float)j / (m_iNumVerticesX - 1.f) /32.f, (_float)i / (m_iNumVerticesZ - 1.f) / 32.f); - //pVertices[iIndex].vTexcoord = _float2(1.f - ((float)i / (m_iNumVerticesZ - 1.f)) / 32.f, - //((float)j / (m_iNumVerticesX - 1.f)) / 32.f); + pVertices[iIndex].vTexcoord = _float2((_float)j / (m_iNumVerticesX - 1.f) / 32.f, (_float)i / (m_iNumVerticesZ - 1.f) / 32.f); } } @@ -181,7 +143,7 @@ HRESULT CVIBuffer_Terrain::Initialize_Prototype(const _char* pFilePath, _uint iS _uint iNumIndices = {}; - for (_uint i = 0; i < m_iNumVerticesZ - 1; i++) + for (_uint i = 0; i < m_iNumVerticesZ - 1 ; i++) { for (_uint j = 0; j < m_iNumVerticesX - 1; j++) { @@ -303,6 +265,22 @@ void CVIBuffer_Terrain::FitY(_fmatrix WorldMatrix, _float fY) m_pContext->Unmap(m_pVB, 0); } +void CVIBuffer_Terrain::Change_HeigthRatio(_float fRatio) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVB, 0, D3D11_MAP_WRITE, 0, &SubResource); + + VTXNORTEX* pVertices = static_cast(SubResource.pData); + + for (_uint i = 0; i < m_iNumVertices; ++i) + { + pVertices[i].vPosition.y = m_HeigthValues[i] * fRatio; + } + + m_pContext->Unmap(m_pVB, 0); +} + CVIBuffer_Terrain* CVIBuffer_Terrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pFilePath, _uint iSizeX, _uint iSizeZ) { CVIBuffer_Terrain* pInstance = new CVIBuffer_Terrain(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 43d7c688a..24638f611 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -10,9 +10,6 @@ CVIBuffer_UI_Instance::CVIBuffer_UI_Instance(ID3D11Device* pDevice, ID3D11Device CVIBuffer_UI_Instance::CVIBuffer_UI_Instance(const CVIBuffer_UI_Instance& Prototype) : CVIBuffer_Instance{ Prototype } , m_pInstanceVertices{ Prototype.m_pInstanceVertices } - , m_fSize{ Prototype.m_fSize } - , m_fPositionOffSetX{ Prototype.m_fPositionOffSetX } - , m_fPositionOffSetY{ Prototype.m_fPositionOffSetY } , m_fPosition{ Prototype.m_fPosition } { } @@ -114,21 +111,12 @@ HRESULT CVIBuffer_UI_Instance::Initialize_Prototype(const INSTANCE_DESC* pInstan m_pInstanceVertices = new VTX_INSTANCE_UI[m_iNumInstance]; ZeroMemory(m_pInstanceVertices, sizeof(VTX_INSTANCE_UI) * m_iNumInstance); - m_fSize = new _float2[m_iNumInstance]; - ZeroMemory(m_fSize, sizeof(_float2) * m_iNumInstance); - m_fPosition = new _float2[m_iNumInstance]; ZeroMemory(m_fPosition, sizeof(_float2) * m_iNumInstance); - m_fPositionOffSetX = new _float[m_iNumInstance]; - ZeroMemory(m_fPositionOffSetX, sizeof(_float) * m_iNumInstance); - - m_fPositionOffSetY = new _float[m_iNumInstance]; - ZeroMemory(m_fPositionOffSetY, sizeof(_float) * m_iNumInstance); for (size_t i = 0; i < m_iNumInstance; ++i) { - m_pInstanceVertices[i].fSize = (pDesc->vSize); m_pInstanceVertices[i].fPos = _float2(pDesc->vPsition.x, pDesc->vPsition.y); } @@ -180,7 +168,38 @@ void CVIBuffer_UI_Instance::Set_Size(_float fSizeX, _float fSizeY) { pVertices[i].fSize.x = fSizeX; pVertices[i].fSize.y = fSizeY; + } + m_pContext->Unmap(m_pVBInstance, 0); +} + +void CVIBuffer_UI_Instance::Set_SizeX(_float fSizeX) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (size_t i = 0; i < m_iNumInstance; i++) + { + pVertices[i].fSize.x = fSizeX; + } + + m_pContext->Unmap(m_pVBInstance, 0); +} + +void CVIBuffer_UI_Instance::Set_SizeY(_float fSizeY) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (size_t i = 0; i < m_iNumInstance; i++) + { + pVertices[i].fSize.y = fSizeY; } m_pContext->Unmap(m_pVBInstance, 0); diff --git a/Jusin154_Team3D/Engine/Public/Base.h b/Jusin154_Team3D/Engine/Public/Base.h index df272ea38..bb1f818a1 100644 --- a/Jusin154_Team3D/Engine/Public/Base.h +++ b/Jusin154_Team3D/Engine/Public/Base.h @@ -16,10 +16,10 @@ class ENGINE_DLL CBase abstract _uint Release(); protected: - _uint m_iRefCnt = {}; + atomic<_uint> m_iRefCnt = { 0 }; public: virtual void Free(); }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 12b408475..8543693b8 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -8,6 +8,7 @@ class ENGINE_DLL CBone final : public CBase { private: CBone(); + CBone(const CBone& other); virtual ~CBone() = default; public: _matrix Get_CombinedTransformationMatrix() const { @@ -59,4 +60,4 @@ class ENGINE_DLL CBone final : public CBase }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index 0f179343f..595221ea3 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -6,7 +6,6 @@ NS_BEGIN(Engine) class ENGINE_DLL CComputeShader final : public CBase { - private: CComputeShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual ~CComputeShader() = default; @@ -17,6 +16,7 @@ class ENGINE_DLL CComputeShader final : public CBase public: vector Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr); void Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex); + ID3D11ComputeShader* Get_Compute() { return m_pComputeShader; } private: void Bind_SRV(_uint iIndex); void Bind_UAV(_uint iIndex); @@ -43,7 +43,7 @@ class ENGINE_DLL CComputeShader final : public CBase vector m_pOutputStagingBuffer = {}; ID3D11ComputeShader* m_pComputeShader = nullptr; - + private: diff --git a/Jusin154_Team3D/Engine/Public/ContainerObject.h b/Jusin154_Team3D/Engine/Public/ContainerObject.h index 0c9339555..f0d2f8f06 100644 --- a/Jusin154_Team3D/Engine/Public/ContainerObject.h +++ b/Jusin154_Team3D/Engine/Public/ContainerObject.h @@ -26,6 +26,20 @@ class ENGINE_DLL CContainerObject abstract : public CGameObject return nullptr; } + template + T* Get_PartObject() { + + for (auto& pPart : m_PartObjects) + { + if (typeid((*pPart.second)) == typeid(T)) + { + return dynamic_cast(pPart.second); + } + + } + return nullptr; + } + protected: unordered_map<_string, class CPartObject*> m_PartObjects; @@ -61,4 +75,4 @@ class ENGINE_DLL CContainerObject abstract : public CGameObject virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 6ab74b1a2..444130735 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -5,7 +5,7 @@ NS_BEGIN(Engine) enum class STATE { RIGHT, UP, LOOK, POSITION, END }; enum class LIGHT { DIRECTIONAL, POINT, SPOT, END }; enum class COLLIDER { AABB, OBB, SPHERE, END }; -enum class RENDER { PRIORITY, SHADOW, NONBLEND, BLUR, NONLIGHT, EFFECT ,BLEND, UI, END }; +enum class RENDER { PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, UI, END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Function.h b/Jusin154_Team3D/Engine/Public/Engine_Function.h index 6ce4121da..64086a61a 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; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index f75a7a74c..4096e43a0 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -19,10 +19,10 @@ #ifdef 기무리 #undef ASSERT_NURI #define ASSERT_NURI(expression) assert(expression) -#elif kim05 +#elif 진우 #undef ASSERT_JINWOO #define ASSERT_JINWOO(expression) assert(expression) -#elif 82103 +#elif gimch #undef ASSERT_JINHO #define ASSERT_JINHO(expression) assert(expression) #elif Bin diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index 287c5071d..f2cc2edd5 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -349,4 +349,13 @@ typedef struct tagPhsXUserData { }PhsXUserData; +typedef struct tagOnCollsionInfo +{ + _vector vWorldPos = {}; // 접촉지점 + _vector vWorldNomal = {}; // 접촉노말 + _vector vHitDir = {}; // 시도한 move 방향 + _float fLength = {}; // 작용된 힘 + +}ON_COLLISION_INFO; + NS_END diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 736f2c6ca..4ce544413 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -3,8 +3,9 @@ NS_BEGIN(FSMSTATE) enum ESTATE { + ROOT, IDLE,IDLE_TURN, - MOVE, WALK, WALK_FWD, WALK_BWD, JOG, SPRINT, + MOVE, WALK, FWD, BWD, JOG, SPRINT, JUMP, LAND, DODGE, @@ -29,6 +30,7 @@ class ENGINE_DLL CFSM final : public CComponent void Change_State(_uint iIndex); void Update(_float fTimeDelta); + CState* Get_Current() { return m_pCurrent; } _uint Get_CurrState(); _uint Get_PrevState(); void Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent); diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index f4d6b9e3f..6ba99ef38 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -26,7 +26,7 @@ class ENGINE_DLL CGameObject abstract virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨 // 내가 맞음 ( Collider_Manager가 부름 ) - virtual void OnCollision(CGameObject* pOther = nullptr); + virtual void OnCollision(CGameObject* pOther = nullptr ,void* pDesc = nullptr); // 내가 때림 ( 히트박스가 부름 ) virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr); @@ -40,7 +40,7 @@ class ENGINE_DLL CGameObject abstract _uint Get_CollisionID() const { return m_iCollisionID; } _bool Get_Visible() const { return m_bVisible; } void Set_Visible(_bool bValue) { m_bVisible = bValue; } - const CGameObject* Get_Owner() const { return m_pOwner; } + CGameObject* Get_Owner() const { return m_pOwner; } public: HRESULT Add_Asset_Component(_uint iTargetLevel, const _wstring strPrototypeTag, CComponent** ppOut, void* pArg = nullptr); diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index 201eaa47f..dee49ef0f 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -1,8 +1,6 @@ #pragma once #include "Component.h" -#include "Assimp/scene.h" - NS_BEGIN(Engine) class ENGINE_DLL CInstance_Model final : public CComponent diff --git a/Jusin154_Team3D/Engine/Public/Light_Manager.h b/Jusin154_Team3D/Engine/Public/Light_Manager.h index c028d0752..fad3c9aa8 100644 --- a/Jusin154_Team3D/Engine/Public/Light_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Light_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -9,8 +9,6 @@ class CLight_Manager final : public CBase private: CLight_Manager(); virtual ~CLight_Manager() = default; - - public: void Add_Light(_uint _iCurrentLevel, class CLight* _pLight); void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); @@ -18,7 +16,7 @@ class CLight_Manager final : public CBase const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel ,_uint _iLightIndex); public: - HRESULT Render_Lights(_uint _iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); + HRESULT Render_Lights(_uint iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); private: HRESULT Initialize(_uint iNumLevels); @@ -31,4 +29,4 @@ class CLight_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/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 8bcd5149a..9c88c1dfb 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -6,6 +6,36 @@ NS_BEGIN(Engine) class ENGINE_DLL CMesh final : public CVIBuffer { +public: + typedef struct tagMeshDesc + { + _float3 vPosition = {}; + _float3 vNormal = {}; + _float3 vTangent = {}; + _float3 vBinormal = {}; + _float2 vTexcoord = {}; + + XMUINT4 vBlendIndex = {}; + _float4 vBlendWeight = {}; + + }MESH_DESC; + + typedef struct tagSkinngMeshDesc + { + _float3 vPosition = {}; + _float3 vNormal = {}; + _float3 vTangent = {}; + _float3 vBinormal = {}; + _float2 vTexcoord = {}; + + }SKINNG_MESH_DESC; + + typedef struct tagBoneDesc + { + _float4x4 BoneMatrix[512]; + }BONE_DESC; + + private: CMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CMesh(const CMesh& rhs); @@ -36,6 +66,11 @@ class ENGINE_DLL CMesh final : public CVIBuffer virtual HRESULT Bind_Resources_Instance(ID3D11Buffer* pVBInstance, _uint iInstanceStride, _uint iBufferCount); virtual HRESULT Render_Instance(_uint iNumInstance); + void ComputSkinning(class CComputeShader* ComputeShader, ID3D11Buffer* ConstantBuffer); + + void FillBoneDesc(const vector<_float4x4>& CombinedMatrices, BONE_DESC* pOut); + + _uint Get_Vertex() { return m_iNumVertices; } private: virtual HRESULT Initialize_Prototype(HANDLE hFile, DWORD& dwByte); virtual HRESULT Initialize(void* pArg) override; @@ -45,11 +80,15 @@ class ENGINE_DLL CMesh final : public CVIBuffer virtual HRESULT Initialize_Prototype(MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, SaveMesh* _SaveMesh); + + HRESULT Create_RawVB(vector& RawVertices); + // private: _char m_szName[MAX_PATH] = {}; _uint m_iMaterialIndex = {}; _uint m_iNumBones = { }; + _uint m_iStartIndex = {}; vector<_int> m_BoneIndices; _float4x4* m_pBoneMatrices = { nullptr }; @@ -59,6 +98,18 @@ class ENGINE_DLL CMesh final : public CVIBuffer std::vector<_float3> m_Vertices; // +private: + MESH_DESC m_MeshDesc = {}; + BONE_DESC m_BoneDesc = {}; + _uint m_iNumBuffer = {}; + _uint m_iNumMeshes = {}; + _int m_iRootBoneIndex = { -1 }; + _int m_iRawVertexStride = {}; + + vector m_RawVertices; + + ID3D11Buffer* m_pVBMesh = { nullptr }; + public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte); // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index b214af79f..1bfe26d31 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -6,6 +6,34 @@ NS_BEGIN(Engine) class ENGINE_DLL CModel final : public CComponent { +public: + typedef struct tagMeshDesc + { + _float3 vPosition = {}; + _float3 vNormal = {}; + _float3 vTangent = {}; + _float3 vBinormal = {}; + _float2 vTexcoord = {}; + + XMUINT4 vBlendIndex = {}; + _float4 vBlendWeight = {}; + }MESH_DESC; + + typedef struct tagSkinngMeshDesc + { + _float3 vPosition = {}; + _float3 vNormal = {}; + _float3 vTangent = {}; + _float3 vBinormal = {}; + _float2 vTexcoord = {}; + + }SKINNG_MESH_DESC; + + typedef struct tagBoneDesc + { + _float4x4 BoneMatrix[512]; + }BONE_DESC; + private: CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CModel(const CModel& rhs); @@ -60,12 +88,16 @@ class ENGINE_DLL CModel final : public CComponent static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); + #pragma endregion #pragma region Material HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader); #pragma endregion - + void ComputeSkinning(); + void Create_Con(); + HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); + void Get_BoneMatrix(); public: #ifdef EDITOR_PROJECT @@ -127,11 +159,24 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / _matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션 class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 - // 바이너리 SaveModel* m_pSaveModel = { nullptr }; list m_SaveModel; // + + vector<_float4x4> m_BoneMatrix; + +private: + HRESULT Create_CS(); + + MESH_DESC m_MeshDesc = {}; + BONE_DESC m_BoneDesc = {}; + _uint m_iNumBuffer = {}; + + class CComputeShader* m_pComputeShader = {}; + ID3D11Buffer* m_pConstantBuffer = { nullptr }; + _uint AccumulatedVertexCount = {}; + private: // 바이너리 virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index c8b405f5c..e933b8123 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -83,6 +83,15 @@ class CPhysX_Manager final : public CBase #ifdef 기무리 PhsXUserData PlaneData = {}; +#endif // 기무리 +#ifdef 진우 + PhsXUserData PlaneData = {}; + +#endif // 기무리 + +#ifdef Bin + PhsXUserData PlaneData = {}; + #endif // 기무리 diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 13abe1d97..477012e87 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -6,10 +6,10 @@ enum ESTATE { IDLE, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, MOVE, - WALK, WALK_FWD, WALK_BWD, WALK_STOP, - JOG, + WALK, WALK_FWD, WALK_BWD,WALK_STOP, + JOG,JOG_FWD, JOG_STOP, SPRINT, - JUMP,JUMP_WALK,JUMP_SPRINT, + JUMP,JUMP_JOG,JUMP_SPRINT, LAND, DODGE, COMBAT, LIGHT_ATTACK, CAST, SKILL, SKILL2, @@ -40,7 +40,6 @@ class ENGINE_DLL CState abstract : public CBase _uint Get_State() { return m_eState; } void Set_Parent(CState* State) { m_pParent = State; } CState* Get_Parent() { return m_pParent; } - protected: CUnit* m_pOwner = { nullptr }; CModel* m_pModel = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/ThreadHolder.h b/Jusin154_Team3D/Engine/Public/ThreadHolder.h index 9b31cc6a8..16b5a8f24 100644 --- a/Jusin154_Team3D/Engine/Public/ThreadHolder.h +++ b/Jusin154_Team3D/Engine/Public/ThreadHolder.h @@ -30,8 +30,6 @@ class ENGINE_DLL CThreadHolder final : public CBase return job_result_future; } - - private: _uint m_iNumThreads = {}; vector m_Workers = {}; diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 1a7ca0bb8..17e9a636f 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -8,7 +8,7 @@ class ENGINE_DLL CUIObject abstract : public CGameObject { public: enum class SKILLTYPE { - SHADOW, CONTROL, POWER, DAMAGE, +CONTROL, POWER, DAMAGE, UTILITY ,TRANSFORM, CURSE, ESSENTIAL }; typedef struct tagUIObjectDesc diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 45bc73380..ed63ed5b1 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -1,14 +1,14 @@ #pragma once #include "Engine_Define.h" -#include "GameObject.h" +#include "ContainerObject.h" NS_BEGIN(Engine) class CShader; class CModel; class CFSM; -class ENGINE_DLL CUnit abstract : public CGameObject +class ENGINE_DLL CUnit abstract : public CContainerObject { public: typedef struct tagObjectDesc @@ -30,6 +30,7 @@ class ENGINE_DLL CUnit abstract : public CGameObject _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } void Load_KeyFrame(); public: + #pragma region STATE pair<_uint, _bool> Get_AnimInfo(_uint iIndex) { return m_Animation[iIndex]; } virtual _bool Check(FSMSTATE::ESTATE state) { return false; } @@ -40,6 +41,7 @@ class ENGINE_DLL CUnit abstract : public CGameObject _float Get_KeyFrame(_string FrameName); _bool IsCurrentKeyFrame(_string FrameName); virtual void Reset_Sprint() {}; + virtual void Reset_Walk() {}; #pragma endregion protected: diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h b/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h index e936ff428..781750454 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h @@ -25,6 +25,8 @@ class ENGINE_DLL CVIBuffer_Terrain final : public CVIBuffer _bool Picking(_fmatrix WorldMatrix, _float3* pOut); void Culling(_fmatrix WorldMatrix); void FitY(_fmatrix WorldMatrix, _float fY); + void Change_HeigthRatio(_float fRatio); + private: _bool m_bChange = {}; _uint m_iNumVerticesX = {}; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index bd82f5c1f..40dcfb8ae 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -22,14 +22,14 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance public: virtual void Set_Pos(_float fX, _float fY, _float OffSetX, _float OffSetY, _uint iCols); virtual void Set_Size(_float fSizeX, _float fSizeY); + virtual void Set_SizeX(_float fSizeX); + virtual void Set_SizeY(_float fSizeY); virtual void Set_Cloned(_bool isCloned) { m_isCloned = isCloned; } private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr }; _bool m_isCloned = { false }; _float2* m_fSize{ nullptr }; - _float* m_fPositionOffSetX{}; - _float* m_fPositionOffSetY{}; _float2* m_fPosition{ nullptr }; _float m_fAddPosition{};