[merge commit]

This commit is contained in:
kimnuri
2025-11-21 15:56:47 +09:00
281 changed files with 11077 additions and 1165 deletions
@@ -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;
@@ -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)
{
@@ -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();
}
}
@@ -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<SkinngMesh> 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);
@@ -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();
@@ -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<ParticleValue> 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;
@@ -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;
}
Binary file not shown.
+84 -2
View File
@@ -110,7 +110,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>EDITOR_PROJECT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -136,7 +136,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>EDITOR_PROJECT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -157,29 +157,111 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Public\Broom.h" />
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h" />
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h" />
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h" />
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h" />
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h" />
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h" />
<ClInclude Include="..\Public\Camera_Debug.h" />
<ClInclude Include="..\Public\Camera_Gaze.h" />
<ClInclude Include="..\Public\CamPosition.h" />
<ClInclude Include="..\Public\CamPosition_Arm.h" />
<ClInclude Include="..\Public\CamPosition_Player.h" />
<ClInclude Include="..\Public\Client_Define.h" />
<ClInclude Include="..\Public\Client_Enum.h" />
<ClInclude Include="..\Public\Client_Macro.h" />
<ClInclude Include="..\Public\Client_Struct.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
<ClInclude Include="..\Public\Dummy_PhysXWall.h" />
<ClInclude Include="..\Public\SkyBox.h" />
<ClInclude Include="..\Public\InfoInstance.h" />
<ClInclude Include="..\Public\Level_Field.h" />
<ClInclude Include="..\Public\Level_GamePlay.h" />
<ClInclude Include="..\Public\Level_Loading.h" />
<ClInclude Include="..\Public\Level_Logo.h" />
<ClInclude Include="..\Public\Level_Restart.h" />
<ClInclude Include="..\Public\Light_Main.h" />
<ClInclude Include="..\Public\Loader.h" />
<ClInclude Include="..\Public\MainApp.h" />
<ClInclude Include="..\Public\MapInfo.h" />
<ClInclude Include="..\Public\MonsterInfo.h" />
<ClInclude Include="..\Public\Player.h" />
<ClInclude Include="..\Public\PlayerInfo.h" />
<ClInclude Include="..\Public\State_Cast.h" />
<ClInclude Include="..\Public\State_Combat.h" />
<ClInclude Include="..\Public\State_Dodge.h" />
<ClInclude Include="..\Public\State_Idle.h" />
<ClInclude Include="..\Public\State_Idle_Turn.h" />
<ClInclude Include="..\Public\State_Jog.h" />
<ClInclude Include="..\Public\State_Jump.h" />
<ClInclude Include="..\Public\State_Land.h" />
<ClInclude Include="..\Public\State_LightAttack.h" />
<ClInclude Include="..\Public\State_Move.h" />
<ClInclude Include="..\Public\State_Root.h" />
<ClInclude Include="..\Public\State_Skill.h" />
<ClInclude Include="..\Public\State_Skill2.h" />
<ClInclude Include="..\Public\State_Sprint.h" />
<ClInclude Include="..\Public\State_Walk.h" />
<ClInclude Include="..\Public\Wand.h" />
<ClInclude Include="Client.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Broom.cpp" />
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp" />
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp" />
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp" />
<ClCompile Include="..\Private\Camera_Debug.cpp" />
<ClCompile Include="..\Private\Camera_Gaze.cpp" />
<ClCompile Include="..\Private\CamPosition.cpp" />
<ClCompile Include="..\Private\CamPosition_Arm.cpp" />
<ClCompile Include="..\Private\CamPosition_Player.cpp" />
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp" />
<ClCompile Include="..\Private\Dummy_PhysXWall.cpp" />
<ClCompile Include="..\Private\SkyBox.cpp" />
<ClCompile Include="..\Private\InfoInstance.cpp" />
<ClCompile Include="..\Private\Level_Field.cpp" />
<ClCompile Include="..\Private\Level_GamePlay.cpp" />
<ClCompile Include="..\Private\Level_Loading.cpp" />
<ClCompile Include="..\Private\Level_Logo.cpp" />
<ClCompile Include="..\Private\Level_Restart.cpp" />
<ClCompile Include="..\Private\Light_Main.cpp" />
<ClCompile Include="..\Private\Loader.cpp" />
<ClCompile Include="..\Private\MainApp.cpp" />
<ClCompile Include="..\Private\MapInfo.cpp" />
<ClCompile Include="..\Private\MonsterInfo.cpp" />
<ClCompile Include="..\Private\pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\Private\Player.cpp" />
<ClCompile Include="..\Private\PlayerInfo.cpp" />
<ClCompile Include="..\Private\State_Cast.cpp" />
<ClCompile Include="..\Private\State_Combat.cpp" />
<ClCompile Include="..\Private\State_Dodge.cpp" />
<ClCompile Include="..\Private\State_Idle.cpp" />
<ClCompile Include="..\Private\State_Idle_Turn.cpp" />
<ClCompile Include="..\Private\State_Jog.cpp" />
<ClCompile Include="..\Private\State_Jump.cpp" />
<ClCompile Include="..\Private\State_Land.cpp" />
<ClCompile Include="..\Private\State_LightAttack.cpp" />
<ClCompile Include="..\Private\State_Move.cpp" />
<ClCompile Include="..\Private\State_Root.cpp" />
<ClCompile Include="..\Private\State_Skill.cpp" />
<ClCompile Include="..\Private\State_Skill2.cpp" />
<ClCompile Include="..\Private\State_Sprint.cpp" />
<ClCompile Include="..\Private\State_Walk.cpp" />
<ClCompile Include="..\Private\Wand.cpp" />
<ClCompile Include="Client.cpp" />
</ItemGroup>
<ItemGroup>
@@ -37,6 +37,126 @@
<ClInclude Include="..\Public\Level_GamePlay.h">
<Filter>01.Levels\02.GamePlay</Filter>
</ClInclude>
<ClInclude Include="..\Public\Client_Struct.h">
<Filter>99.Define</Filter>
</ClInclude>
<ClInclude Include="..\Public\InfoInstance.h">
<Filter>03.InfoInstance</Filter>
</ClInclude>
<ClInclude Include="..\Public\Level_Field.h">
<Filter>01.Levels\10.Field</Filter>
</ClInclude>
<ClInclude Include="..\Public\Level_Restart.h">
<Filter>01.Levels\99.Restart</Filter>
</ClInclude>
<ClInclude Include="..\Public\Camera_Debug.h">
<Filter>02.GameObjects\Cameras\Debug</Filter>
</ClInclude>
<ClInclude Include="..\Public\Light_Main.h">
<Filter>02.GameObjects\Environment\Lights\Main</Filter>
</ClInclude>
<ClInclude Include="..\Public\PlayerInfo.h">
<Filter>03.InfoInstance\00.PlayerInfo</Filter>
</ClInclude>
<ClInclude Include="..\Public\MonsterInfo.h">
<Filter>03.InfoInstance\01.MonsterInfo</Filter>
</ClInclude>
<ClInclude Include="..\Public\MapInfo.h">
<Filter>03.InfoInstance\02.MapInfo</Filter>
</ClInclude>
<ClInclude Include="..\Public\Player.h">
<Filter>02.GameObjects\Player</Filter>
</ClInclude>
<ClInclude Include="..\Public\Wand.h">
<Filter>02.GameObjects\Item\Wand</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Root.h">
<Filter>80.State</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Combat.h">
<Filter>80.State\State_Combat</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Cast.h">
<Filter>80.State\State_Combat\State_Cast</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_LightAttack.h">
<Filter>80.State\State_Combat\State_LightAttack</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Skill.h">
<Filter>80.State\State_Combat\State_Skill</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Skill2.h">
<Filter>80.State\State_Combat\State_Skill2</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Move.h">
<Filter>80.State\State_Move</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Idle.h">
<Filter>80.State\State_Move\State_Idle</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Jog.h">
<Filter>80.State\State_Move\State_Jog</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Walk.h">
<Filter>80.State\State_Move\State_Walk</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Sprint.h">
<Filter>80.State\State_Move\State_Sprint</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Dodge.h">
<Filter>80.State\State_Move\State_Dodge</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Idle_Turn.h">
<Filter>80.State\State_Move\State_Idle_Turn</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Jump.h">
<Filter>80.State\State_Jump</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Land.h">
<Filter>80.State\State_Land</Filter>
</ClInclude>
<ClInclude Include="..\Public\CamPosition_Player.h">
<Filter>02.GameObjects\Cameras\CameraPosition\Player</Filter>
</ClInclude>
<ClInclude Include="..\Public\CamPosition_Arm.h">
<Filter>02.GameObjects\Cameras\CameraPosition\Arm</Filter>
</ClInclude>
<ClInclude Include="..\Public\CamPosition.h">
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
</ClInclude>
<ClInclude Include="..\Public\Camera_Gaze.h">
<Filter>02.GameObjects\Cameras</Filter>
</ClInclude>
<ClInclude Include="..\Public\SkyBox.h">
<Filter>02.GameObjects\SkyBox</Filter>
</ClInclude>
<ClInclude Include="..\Public\Broom.h">
<Filter>02.GameObjects\Item\Broom</Filter>
</ClInclude>
<ClInclude Include="..\Public\Dummy_PhysXWall.h">
<Filter>02.GameObjects\PhysX</Filter>
</ClInclude>
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h">
<Filter>02.GameObjects\PhysX</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Client.ico">
@@ -74,9 +194,6 @@
<Filter Include="02.GameObjects">
<UniqueIdentifier>{27434478-691e-42a8-83c7-ecd1a60f46ce}</UniqueIdentifier>
</Filter>
<Filter Include="03.Information">
<UniqueIdentifier>{cdfbb346-6cae-4094-93cd-b82685efa68e}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras">
<UniqueIdentifier>{7efd65d5-eb4d-4331-a746-f0fa2de6275b}</UniqueIdentifier>
</Filter>
@@ -98,6 +215,150 @@
<Filter Include="02.GameObjects\NPC\Ally">
<UniqueIdentifier>{a7d0a3fa-b3dc-40c6-b258-ffcde49b05c1}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic">
<UniqueIdentifier>{b5bef783-5315-4488-ac64-cb98d16a84a9}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic\Item">
<UniqueIdentifier>{31681680-d5de-43c9-bc2d-2c91ca58a593}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic\State">
<UniqueIdentifier>{1bfec6dc-f008-4d18-87d6-be38824b1272}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic\State\NPC">
<UniqueIdentifier>{3eb21e8e-e01c-47fe-828e-800212456eb5}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic\State\PLAYER">
<UniqueIdentifier>{9f952e5a-835c-4de9-b7b5-9a731912774d}</UniqueIdentifier>
</Filter>
<Filter Include="04.Mechanic\Skill">
<UniqueIdentifier>{c5b61cb3-bc5f-4429-8715-b309dcf054b2}</UniqueIdentifier>
</Filter>
<Filter Include="01.Levels\10.Field">
<UniqueIdentifier>{2b209526-b728-4fba-a184-b9224d72903a}</UniqueIdentifier>
</Filter>
<Filter Include="01.Levels\99.Restart">
<UniqueIdentifier>{e12b3048-dd6d-41bf-b346-e4abdaa4f215}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Lights">
<UniqueIdentifier>{74f21f9b-30bf-412e-ba4e-526958ab2a52}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras\Debug">
<UniqueIdentifier>{8d89a59c-fbd2-4a4a-ab01-a70abb80cc49}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras\Shoulder">
<UniqueIdentifier>{708bbc88-47fb-42c5-b060-14cec7d646f2}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Lights\Main">
<UniqueIdentifier>{b24c78ef-dccc-41f0-a086-053ae6b7fbf4}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Plane">
<UniqueIdentifier>{603938cc-e4fe-44d8-890b-784174a86161}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Player">
<UniqueIdentifier>{11250d84-e19c-4999-a5d6-d9f89123e7ae}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
<UniqueIdentifier>{b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Prop">
<UniqueIdentifier>{2814c935-13d9-4b9a-94ba-c9e470219a18}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Prop\SkyBox">
<UniqueIdentifier>{19ee2ea4-2d79-46bd-b857-c759e3ec6cf4}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Environment\Prop\SkyBox\TriggerBox">
<UniqueIdentifier>{2561df42-3dfa-4045-a30c-85f44cd65e09}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras\CameraPosition">
<UniqueIdentifier>{25ad4a41-5b06-4659-bd29-c0c4265a3277}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras\CameraPosition\Player">
<UniqueIdentifier>{5a667a7b-6c90-44f6-9c9f-aac3108b6561}</UniqueIdentifier>
</Filter>
<Filter Include="03.InfoInstance">
<UniqueIdentifier>{cdfbb346-6cae-4094-93cd-b82685efa68e}</UniqueIdentifier>
</Filter>
<Filter Include="03.InfoInstance\00.PlayerInfo">
<UniqueIdentifier>{1cfdfc05-0b0d-4c58-8c2d-58090efea4fd}</UniqueIdentifier>
</Filter>
<Filter Include="03.InfoInstance\01.MonsterInfo">
<UniqueIdentifier>{621b87a7-54b8-4d90-84b2-fa8cd26cc396}</UniqueIdentifier>
</Filter>
<Filter Include="03.InfoInstance\02.MapInfo">
<UniqueIdentifier>{413e6692-6e4a-4b00-8306-edf652bd876a}</UniqueIdentifier>
</Filter>
<Filter Include="80.State">
<UniqueIdentifier>{be963729-ed65-4506-82f2-24213f5ecf5a}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat">
<UniqueIdentifier>{fb0a8b8b-5376-4606-8e6e-b020abf2d476}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat\State_Cast">
<UniqueIdentifier>{5e4bd8c2-9ace-4617-880b-9c7fa826dfd4}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat\State_LightAttack">
<UniqueIdentifier>{28b2cdcb-e307-4da5-a222-24a77480605c}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat\State_Skill">
<UniqueIdentifier>{8f9ce518-cd40-4a0c-ac4f-f77459a13cfd}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat\State_Skill2">
<UniqueIdentifier>{68ec69bb-6697-42aa-abf4-cd6d148a1648}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move">
<UniqueIdentifier>{99f16910-04c8-44e2-84ff-17321d94d1f0}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Idle">
<UniqueIdentifier>{e2599ab3-3d02-420c-b29c-0f87b4263429}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Jog">
<UniqueIdentifier>{3110d3d0-422e-42eb-a045-c8c784528165}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Walk">
<UniqueIdentifier>{cd90a5f0-2428-4537-801f-a65b7273c3be}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Sprint">
<UniqueIdentifier>{5f5abe29-f43a-4de7-8955-b21ca1c6fb94}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Dodge">
<UniqueIdentifier>{03cf23a9-5c0f-4cb1-a32b-5807a612c039}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Move\State_Idle_Turn">
<UniqueIdentifier>{b3fdd366-2689-49c9-b1c1-6843772e9661}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Jump">
<UniqueIdentifier>{309d0593-507f-484c-92aa-7c8fc483941b}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Land">
<UniqueIdentifier>{a3ab0237-10b3-4699-a39d-63c625024f67}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Cameras\CameraPosition\Arm">
<UniqueIdentifier>{f0da95a0-107f-42ff-9e77-3503bb48aa12}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\SkyBox">
<UniqueIdentifier>{e83f88ec-c414-43b4-b437-52288cee431a}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Item">
<UniqueIdentifier>{9cc88058-bda3-4ed0-9ec9-1968963fdda4}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Item\Broom">
<UniqueIdentifier>{aac01a47-304a-4319-8bd8-fdd9020ddf18}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Item\Wand">
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\PhysX">
<UniqueIdentifier>{ddf8c8e6-ca51-42e0-b08f-13ae0fd9d842}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\PhysX\CallBack">
<UniqueIdentifier>{5fd99d60-e641-4229-9a72-8f5d7744c6b0}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\PhysX\CallBack\Behavior">
<UniqueIdentifier>{ad7a67bd-df18-4c03-85eb-960881922128}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport">
<UniqueIdentifier>{dc05dfc9-22e5-4a2a-b016-c55b215c0c68}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Client.cpp">
@@ -121,6 +382,123 @@
<ClCompile Include="..\Private\Level_GamePlay.cpp">
<Filter>01.Levels\02.GamePlay</Filter>
</ClCompile>
<ClCompile Include="..\Private\InfoInstance.cpp">
<Filter>03.InfoInstance</Filter>
</ClCompile>
<ClCompile Include="..\Private\Level_Field.cpp">
<Filter>01.Levels\10.Field</Filter>
</ClCompile>
<ClCompile Include="..\Private\Level_Restart.cpp">
<Filter>01.Levels\99.Restart</Filter>
</ClCompile>
<ClCompile Include="..\Private\Camera_Debug.cpp">
<Filter>02.GameObjects\Cameras\Debug</Filter>
</ClCompile>
<ClCompile Include="..\Private\Light_Main.cpp">
<Filter>02.GameObjects\Environment\Lights\Main</Filter>
</ClCompile>
<ClCompile Include="..\Private\PlayerInfo.cpp">
<Filter>03.InfoInstance\00.PlayerInfo</Filter>
</ClCompile>
<ClCompile Include="..\Private\MonsterInfo.cpp">
<Filter>03.InfoInstance\01.MonsterInfo</Filter>
</ClCompile>
<ClCompile Include="..\Private\MapInfo.cpp">
<Filter>03.InfoInstance\02.MapInfo</Filter>
</ClCompile>
<ClCompile Include="..\Private\Player.cpp">
<Filter>02.GameObjects\Player</Filter>
</ClCompile>
<ClCompile Include="..\Private\Wand.cpp">
<Filter>02.GameObjects\Item\Wand</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Root.cpp">
<Filter>80.State</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Combat.cpp">
<Filter>80.State\State_Combat</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Cast.cpp">
<Filter>80.State\State_Combat\State_Cast</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_LightAttack.cpp">
<Filter>80.State\State_Combat\State_LightAttack</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Skill.cpp">
<Filter>80.State\State_Combat\State_Skill</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Skill2.cpp">
<Filter>80.State\State_Combat\State_Skill2</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Move.cpp">
<Filter>80.State\State_Move</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Idle.cpp">
<Filter>80.State\State_Move\State_Idle</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Jog.cpp">
<Filter>80.State\State_Move\State_Jog</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Walk.cpp">
<Filter>80.State\State_Move\State_Walk</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Sprint.cpp">
<Filter>80.State\State_Move\State_Sprint</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Dodge.cpp">
<Filter>80.State\State_Move\State_Dodge</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Idle_Turn.cpp">
<Filter>80.State\State_Move\State_Idle_Turn</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Jump.cpp">
<Filter>80.State\State_Jump</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Land.cpp">
<Filter>80.State\State_Land</Filter>
</ClCompile>
<ClCompile Include="..\Private\CamPosition_Player.cpp">
<Filter>02.GameObjects\Cameras\CameraPosition\Player</Filter>
</ClCompile>
<ClCompile Include="..\Private\CamPosition_Arm.cpp">
<Filter>02.GameObjects\Cameras\CameraPosition\Arm</Filter>
</ClCompile>
<ClCompile Include="..\Private\CamPosition.cpp">
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
</ClCompile>
<ClCompile Include="..\Private\Camera_Gaze.cpp">
<Filter>02.GameObjects\Cameras</Filter>
</ClCompile>
<ClCompile Include="..\Private\SkyBox.cpp">
<Filter>02.GameObjects\SkyBox</Filter>
</ClCompile>
<ClCompile Include="..\Private\Broom.cpp">
<Filter>02.GameObjects\Item\Broom</Filter>
</ClCompile>
<ClCompile Include="..\Private\Dummy_PhysXWall.cpp">
<Filter>02.GameObjects\PhysX</Filter>
</ClCompile>
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp">
<Filter>02.GameObjects\PhysX</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp">
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Client.rc">
+165
View File
@@ -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<CComponent**>(&m_pModelCom))))
return E_FAIL;
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
reinterpret_cast<CComponent**>(&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()
{
}
@@ -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<PhsXUserData*>(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();
}
@@ -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<PhsXUserData*>(pActor->userData);
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(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<PSX::PxRigidDynamic*>(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<PhsXUserData*>(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();
}
@@ -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<PhsXUserData*>(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();;
}
@@ -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<PhsXUserData*>(pActor->userData);
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(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<PhsXUserData*>(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();
}
@@ -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<PhsXUserData*>(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();
}
@@ -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<PhsXUserData*>(pActor->userData);
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(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<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
}
else if (m_pGameInstance->Key_Pressing(DIK_R)) {
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
}
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
break;
case 24: // 문짝
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(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<PSX::PxRigidDynamic*>(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<PSX::PxRigidDynamic*>(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<PhsXUserData*>(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();
}
@@ -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()
{
}
@@ -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<CameraArm_DESC*>(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()
{
}
@@ -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<CAMERAPOSITION_PLAYER_DESC*> (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()
{
}
@@ -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<CAMERA_DEBUG_DESC*>(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()
{
}
@@ -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<CTransform>()->Get_State(STATE::POSITION));
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->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()
{
}
@@ -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<PHYSXDUMMY_DESC*>(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<CComponent**>(&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();
}
@@ -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<PHYSXDUMMY_DESC*>(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<CComponent**>(&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()
{
}
@@ -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();
}
@@ -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<CLight_Main>(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*, function<void()>> 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);
}
@@ -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<CLight_Main>(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<CCamera_Debug>(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<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(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<CSkyBox>(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<CDummy_PhysXWall>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
return E_FAIL;
}
return S_OK;
}
pair<CLevel*, function<void()>> 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);
}
@@ -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); // 레벨 변경 실패
}
}
}
+12 -4
View File
@@ -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);
}
@@ -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*, function<void()>> 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);
}
@@ -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<CLight>(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()
{
}
+174
View File
@@ -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<CCamera_Debug>(g_iStaticLevel, CCamera_Debug::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CLight_Main>(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<CSkyBox>(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_Component_FSM */
if (FAILED(m_pGameInstance->Add_Prototype<CFSM>(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Player */
if (FAILED(m_pGameInstance->Add_Prototype<CPlayer>(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Camera_Gaze */
if (FAILED(m_pGameInstance->Add_Prototype<CCamera_Gaze>(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Player */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Player>(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Arm */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Arm>(g_iStaticLevel, CCamPosition_Arm::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Wand */
if (FAILED(m_pGameInstance->Add_Prototype<CWand>(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Broom */
if (FAILED(m_pGameInstance->Add_Prototype<CBroom>(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXWall>(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXPlayable>(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("셰이더를(을) 로딩 중 입니다.");
+14 -4
View File
@@ -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);
@@ -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);
}
@@ -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);
}
+504
View File
@@ -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<CComponent**>(&m_pModelCom))))
return E_FAIL;
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
reinterpret_cast<CComponent**>(&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<CWand>("Wand", g_iStaticLevel, nullptr, &WandDesc)))
{
return E_FAIL;
}
CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{};
Desc.pParentTransform = m_pTransformCom;
if (FAILED(Add_PartObject<CCamPosition_Player>("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<CCamPosition_Arm>("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<CCamera_Gaze>(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;
}
@@ -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);
}
+152
View File
@@ -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<CCamera_Gaze>()->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<CComponent**>(&m_pModelCom))))
return E_FAIL;
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
reinterpret_cast<CComponent**>(&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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
@@ -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()
{
}
+166
View File
@@ -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<WAND_DESC*> (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<CComponent**>(&m_pModelCom))))
return E_FAIL;
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
reinterpret_cast<CComponent**>(&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()
{
}
+48
View File
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <process.h>
#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;
}
+9 -5
View File
@@ -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 };
}
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 };
}
@@ -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
@@ -0,0 +1,9 @@
#pragma once
NS_BEGIN(Engine)
class CTransform;
NS_END
NS_BEGIN(Client)
NS_END
@@ -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
@@ -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
@@ -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
@@ -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<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
virtual void Free() override;
};
NS_END
@@ -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<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
virtual void Free() override;
};
NS_END
NS_END
+5 -2
View File
@@ -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
NS_END
@@ -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<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
virtual void Free() override;
};
NS_END
@@ -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
+2
View File
@@ -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);
+2 -1
View File
@@ -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 };
+35
View File
@@ -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
@@ -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
+75
View File
@@ -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<InputCondition> 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
@@ -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
+44
View File
@@ -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
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
+21
View File
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};
@@ -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();
};

Some files were not shown because too many files have changed in this diff Show More