diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 50a0e70de..078768916 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -42,7 +42,7 @@ Application true - v145 + v143 Unicode true diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 3c2e1336d..9856316b2 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -85,6 +85,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Sound() HRESULT CLevel_GamePlay::Ready_Markers() { + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 1f79e4294..6ad1c0b6f 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -97,7 +97,6 @@ HRESULT CLoader::Loading_For_GamePlay() { m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); - m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Fox.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Fox.fbx new file mode 100644 index 000000000..59df87b62 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Fox.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91033ee9cf3c1af4c44a2ef730e0800e137294f7f3810876d560a040f59eb7b1 +size 26270032 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger emit.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger emit.png new file mode 100644 index 000000000..9db79aacf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger emit.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger spec.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger spec.png new file mode 100644 index 000000000..8eba8035d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger spec.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger.png new file mode 100644 index 000000000..7b557185d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/Scavenger.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/black.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/black.png new file mode 100644 index 000000000..894f241a8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/black.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/bow.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/bow.png new file mode 100644 index 000000000..0c2607b43 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/bow.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/cathedral flame noise.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/cathedral flame noise.png new file mode 100644 index 000000000..8a7a8f5d2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/cathedral flame noise.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/caustic.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/caustic.png new file mode 100644 index 000000000..65f6d0a33 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/caustic.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/clouds_normal.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/clouds_normal.png new file mode 100644 index 000000000..0ab37efa2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/clouds_normal.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/detail texture noise.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/detail texture noise.png new file mode 100644 index 000000000..f835c27d6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/detail texture noise.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/distorted particle ramp.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/distorted particle ramp.png new file mode 100644 index 000000000..39e8c5611 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/distorted particle ramp.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/door matcap 1.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/door matcap 1.png new file mode 100644 index 000000000..0066c80e4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/door matcap 1.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime.png new file mode 100644 index 000000000..816c9e9c6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime1.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime1.png new file mode 100644 index 000000000..fb1a3e070 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/fox palette - runtime1.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/hexagon plinth matcap.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/hexagon plinth matcap.png new file mode 100644 index 000000000..02536fa65 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/hexagon plinth matcap.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/ice detail tex.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/ice detail tex.png new file mode 100644 index 000000000..9a18dbe14 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/ice detail tex.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_aura.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_aura.png new file mode 100644 index 000000000..35a0022bb Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_aura.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring.png new file mode 100644 index 000000000..68d61a314 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring_spikes.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring_spikes.png new file mode 100644 index 000000000..736e03e06 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_ring_spikes.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_traces.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_traces.png new file mode 100644 index 000000000..d0b43a9bd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/icedagger_traces.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/key.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/key.png new file mode 100644 index 000000000..a9c238579 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/key.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lantern arc.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lantern arc.png new file mode 100644 index 000000000..e5976229e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lantern arc.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger albedo.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger albedo.png new file mode 100644 index 000000000..0d675d873 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger albedo.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger emit.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger emit.png new file mode 100644 index 000000000..379863b6d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger emit.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger spec.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger spec.png new file mode 100644 index 000000000..a0d663f41 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/lanterndagger spec.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion spec.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion spec.png new file mode 100644 index 000000000..769e3bd0a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion spec.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion.png new file mode 100644 index 000000000..0ab9f8893 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/potion.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/prayersmoke textures.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/prayersmoke textures.png new file mode 100644 index 000000000..3db7d1441 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/prayersmoke textures.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux spec.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux spec.png new file mode 100644 index 000000000..b24c241c5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux spec.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux.png new file mode 100644 index 000000000..a4e95832b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shield redux.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shockwave effect.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shockwave effect.png new file mode 100644 index 000000000..2420d8491 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/shockwave effect.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/spearbeam.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/spearbeam.png new file mode 100644 index 000000000..7e1f50d4b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/spearbeam.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/stick.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/stick.png new file mode 100644 index 000000000..c69e8d3b4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/stick.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword spec.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword spec.png new file mode 100644 index 000000000..74d6b8aa9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword spec.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword.png new file mode 100644 index 000000000..77fb39756 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/sword.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/wand tentacle noise.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/wand tentacle noise.png new file mode 100644 index 000000000..430702fd7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Fox/wand tentacle noise.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.fbx new file mode 100644 index 000000000..97a31fa83 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a49d1ffea2e4743cdb6f6520d4cf6103ee1aeccd4e1da6fbd39eb75aacdeeb18 +size 2030252 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx new file mode 100644 index 000000000..68c14b84f --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b28b1bd940c28a2f562c18e52de5ef01914d588ab221194374105513fa90f62c +size 1054604 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png new file mode 100644 index 000000000..f0c80df1e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png new file mode 100644 index 000000000..6ed2c9ebf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png new file mode 100644 index 000000000..4669b020d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png new file mode 100644 index 000000000..de2e4abf6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png new file mode 100644 index 000000000..c89e83d64 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png new file mode 100644 index 000000000..5dbbe2dc7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png new file mode 100644 index 000000000..035ceb7c3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png new file mode 100644 index 000000000..d3112d6e0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png new file mode 100644 index 000000000..34ddde4a1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png new file mode 100644 index 000000000..42132cafe Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png new file mode 100644 index 000000000..855cefc69 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png new file mode 100644 index 000000000..39b18306d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png new file mode 100644 index 000000000..5ff7e66a6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png new file mode 100644 index 000000000..9f9c0704f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png new file mode 100644 index 000000000..b8c7a6e9e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png new file mode 100644 index 000000000..73a27fef9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/TombProtector.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/TombProtector.fbx new file mode 100644 index 000000000..28a4cecb1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/TombProtector.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e8ab9ac98cc040e967bfae8c42e2d57be4957844399b245973f08c7eda6c82d +size 48326476 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/Sword.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/Sword.fbx new file mode 100644 index 000000000..01f7eb9bb --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/Sword.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51f2fbdcd11d1d456b0d790b055890bff8c304f11cf18b7550ca77d25011b229 +size 30732 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/sword.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/sword.png new file mode 100644 index 000000000..77fb39756 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Sword/sword.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index e52694633..5feb45a2c 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -42,7 +42,7 @@ Application true - v145 + v143 Unicode true @@ -150,11 +150,13 @@ + + @@ -164,8 +166,10 @@ + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 5d81e940b..6eacfe0fe 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -58,6 +58,9 @@ {a9a30c22-af8f-421a-8901-edfb8146f59d} + + {0ebb9c08-69b0-49b6-bac3-c827ca13319a} + @@ -96,6 +99,12 @@ 02.GameObjects\Dummys\DebugCamera + + 02.GameObjects\Dummy_Goblin + + + 01.Level\20.ObjectViewer + @@ -127,6 +136,12 @@ 99.Define\DEFAULT + + 02.GameObjects\Dummy_Goblin + + + 01.Level\20.ObjectViewer + diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp new file mode 100644 index 000000000..3fa570643 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp @@ -0,0 +1,159 @@ +#include "pch.h" +#include "Dummy_Goblin.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CDummy_Goblin::CDummy_Goblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject( pDevice, pContext ) +{ +} + +CDummy_Goblin::CDummy_Goblin(const CDummy_Goblin& Prototype) + : CGameObject( Prototype ) +{ +} + +HRESULT CDummy_Goblin::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_Goblin::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CDummy_Goblin::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_Goblin::Update(_float fTimeDelta) +{ + m_pModelCom->Set_AnimationIndex(0); + + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CDummy_Goblin::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CDummy_Goblin::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, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) + return E_FAIL; + + if (FAILED(m_pShaderCom->Begin(0))) + return E_FAIL; + + if (FAILED(m_pModelCom->Render(i))) + return E_FAIL; + } + + return S_OK; +} + +HRESULT CDummy_Goblin::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::OBJECT), TEXT("Prototype_Component_GoblinBody_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::STATIC), FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 500.f; + CameraDesc.vEye = _float3(0.f, 10.f, -10.f); + CameraDesc.vAt = _float3(0.f, 0.f, 0.f); + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); + CameraDesc.fMouseSensor = 0.1f; + CameraDesc.pFollowTarget = this; + CameraDesc.pLookTarget = this; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), ENUM_CLASS(LEVEL::OBJECT), + TEXT("Layer_Camera"), &CameraDesc))) + return E_FAIL; + + return S_OK; +} + +HRESULT CDummy_Goblin::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; + + return S_OK; +} + +CDummy_Goblin* CDummy_Goblin::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_Goblin* pInstance = new CDummy_Goblin(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_Goblin"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_Goblin::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_Goblin* pInstance = new CDummy_Goblin(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_Goblin"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CDummy_Goblin::Free() +{ + __super::Free(); + + Safe_Release(m_pShaderCom); + Safe_Release(m_pModelCom); +} + +void CDummy_Goblin::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp index 73d95ad28..95a6e2f3c 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "Level_Logo.h" +#include "Level_ObjectViewer.h" CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -41,9 +42,9 @@ void CLevel_Loading::Update(_float fTimeDelta) //case LEVEL::MAP: // pNewLevel = CLevel_MapViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); // break; - //case LEVEL::OBJECT: - // pNewLevel = CLevel_ObjectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); - // break; + case LEVEL::OBJECT: + pNewLevel = CLevel_ObjectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); + break; //case LEVEL::COMBINED: // pNewLevel = CLevel_LevelViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); // break; diff --git a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp index f6f6adba4..9906f3485 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp @@ -22,10 +22,10 @@ void CLevel_Logo::Update(_float fTimeDelta) // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::MAP)))) // return; //} - //else if (GUI::Button("Object Editor", { 100, 100 })) { - // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT)))) - // return; - //} + /*else */if (GUI::Button("Object Editor", { 100, 100 })) { + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT)))) + return; + } //else if (GUI::Button("Combined Editor", { 100, 100 })) { // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::COMBINED)))) // return; diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp new file mode 100644 index 000000000..ce9529218 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -0,0 +1,98 @@ +#include "pch.h" +#include "Level_ObjectViewer.h" +#include "GameInstance.h" +#include "Level_Loading.h" +#include "Dummy_Goblin.h" +#include "DebugCamera.h" + +CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) + : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } +{ + +} + +HRESULT CLevel_ObjectViewer::Initialize() +{ + + if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) + { + return E_FAIL; + } + + + if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) + { + return E_FAIL; + } + + + return S_OK; +} + +void CLevel_ObjectViewer::Update(_float fTimeDelta) +{ + +} + +HRESULT CLevel_ObjectViewer::Render() +{ + SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다")); + GUI::ShowDemoWindow(); + return S_OK; +} + + + +HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) +{ + //CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; + //CameraDesc.fFovy = XMConvertToRadians(60.0f); + //CameraDesc.fNear = 0.1f; + //CameraDesc.fFar = 500.f; + //CameraDesc.vEye = _float3(0.f, 10.f, -10.f); + //CameraDesc.vAt = _float3(0.f, 0.f, 0.f); + //CameraDesc.fSpeedPerSec = 5.f; + //CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); + //CameraDesc.fMouseSensor = 0.1f; + + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC),ENUM_CLASS(LEVEL::OBJECT), + // strLayerTag, &CameraDesc))) + // return E_FAIL; + + return S_OK; +} + +HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag) +{ + return S_OK; +} + +HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::OBJECT), ENUM_CLASS(LEVEL::OBJECT), TEXT("Layer_Dummy")))) + return E_FAIL; + + return S_OK; +} + +CLevel_ObjectViewer* CLevel_ObjectViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) +{ + CLevel_ObjectViewer* pInstance = new CLevel_ObjectViewer(pDevice, pContext, eLevelID); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CLevel_ObjectViewer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + + +void CLevel_ObjectViewer::Free() +{ + __super::Free(); + + +} diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index b847bf622..9c3edd55e 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -3,6 +3,7 @@ #include "DebugCamera.h" #include "GameInstance.h" #include "MainApp.h" +#include "Dummy_Goblin.h" CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } @@ -58,9 +59,9 @@ HRESULT CLoader::Loading() //case LEVEL::MAP: // hr = Loading_For_MapViewer(); // break; - //case LEVEL::OBJECT: - // hr = Loading_For_ObjectViewer(); - // break; + case LEVEL::OBJECT: + hr = Loading_For_ObjectViewer(); + break; //case LEVEL::COMBINED: // hr = Loading_For_CombinedViewer(); // break; @@ -141,6 +142,36 @@ HRESULT CLoader::Loading_For_Logo() return S_OK; } +HRESULT CLoader::Loading_For_ObjectViewer() +{ + m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); + + /* For.Prototype_Component_GoblinBody_Model */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::OBJECT), TEXT("Prototype_Component_GoblinBody_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Sword/Sword.fbx")))) + return E_FAIL; + + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); + + /* For.Prototype_GameObject_Dummy_Goblin */ + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::OBJECT), CDummy_Goblin::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + m_strMessage = TEXT("정보를 불러오는 중입니다."); + + m_strMessage = TEXT("로딩이 완료되었습니다.."); + + m_isFinished = true; + + return S_OK; +} + CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID) { CLoader* pInstance = new CLoader(pDevice, pContext); diff --git a/Jusin154_Team3D/Editor/Public/Dummy_Goblin.h b/Jusin154_Team3D/Editor/Public/Dummy_Goblin.h new file mode 100644 index 000000000..f9a3d0c21 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_Goblin.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CDummy_Goblin final : public CGameObject +{ +private: + CDummy_Goblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_Goblin(const CDummy_Goblin& Prototype); + virtual ~CDummy_Goblin() = 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 }; + + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CDummy_Goblin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 7aabd1dc5..3e982a79e 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -11,7 +11,7 @@ namespace Editor const unsigned int g_iWinSizeX = 1920; const unsigned int g_iWinSizeY = 1080; - enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, END }; + enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; diff --git a/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h new file mode 100644 index 000000000..593674c38 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h @@ -0,0 +1,30 @@ +#pragma once + +#include "Editor_Define.h" +#include "Level.h" + +NS_BEGIN(Editor) + +class CLevel_ObjectViewer final : public CLevel +{ +private: + CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual ~CLevel_ObjectViewer() = default; + +public: + virtual void Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + /* 이 레벨에서 쓰기위한 객체들을 생성한다. */ + virtual HRESULT Initialize() override; + HRESULT Ready_Layer_Camera(const _wstring& strLayerTag); + HRESULT Ready_Layer_UI(const _wstring& strLayerTag); + HRESULT Ready_Layer_Dummy(const _wstring& strLayerTag); + +public: + static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual void Free() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Loader.h b/Jusin154_Team3D/Editor/Public/Loader.h index 5664e86d6..6a7bd6158 100644 --- a/Jusin154_Team3D/Editor/Public/Loader.h +++ b/Jusin154_Team3D/Editor/Public/Loader.h @@ -41,6 +41,7 @@ class CLoader final : public CBase private: HRESULT Initialize(LEVEL eNextLevelID); HRESULT Loading_For_Logo(); + HRESULT Loading_For_ObjectViewer(); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index cea2ca109..0882042df 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -42,7 +42,7 @@ DynamicLibrary true - v145 + v143 Unicode true @@ -151,7 +151,9 @@ + + @@ -169,6 +171,7 @@ + @@ -230,6 +233,8 @@ + + @@ -256,6 +261,7 @@ + @@ -341,6 +347,7 @@ + @@ -358,6 +365,7 @@ + @@ -422,6 +430,8 @@ + + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index c8d412cb9..958b92995 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -7,36 +7,6 @@ {0c9df74d-79e3-4ca1-87cd-22b0789afc1c} - - {2cb454c9-e390-4f2e-8cf5-b5c6325543ed} - - - {0e35cd1b-88f6-46b9-b72e-b46eeaacd4e0} - - - {32ca0c26-d3e2-49c5-8dc6-cc67e5291214} - - - {17dcadfe-e4cd-46c6-8122-e5e02bb73e57} - - - {c3e7b75b-ec8b-4071-8b52-e5c356febfa6} - - - {57dd171f-f788-4918-aae2-85c20794b3cb} - - - {40758cb1-0f91-4db9-bad7-7c77eb8002da} - - - {bbf3ec67-56f5-4e67-b6cf-8eb1eb4400ff} - - - {30c382b4-2ac9-4355-b3a5-c1b3622c2982} - - - {1622af23-8aca-43cd-8250-b289e363e613} - {de88c47e-55e3-4c50-8b4c-7dd94c0c837f} @@ -202,6 +172,39 @@ {52994263-6339-4d57-97b3-7bb3c6dca479} + + {2cb454c9-e390-4f2e-8cf5-b5c6325543ed} + + + {0e35cd1b-88f6-46b9-b72e-b46eeaacd4e0} + + + {32ca0c26-d3e2-49c5-8dc6-cc67e5291214} + + + {17dcadfe-e4cd-46c6-8122-e5e02bb73e57} + + + {c3e7b75b-ec8b-4071-8b52-e5c356febfa6} + + + {57dd171f-f788-4918-aae2-85c20794b3cb} + + + {40758cb1-0f91-4db9-bad7-7c77eb8002da} + + + {bbf3ec67-56f5-4e67-b6cf-8eb1eb4400ff} + + + {30c382b4-2ac9-4355-b3a5-c1b3622c2982} + + + {1622af23-8aca-43cd-8250-b289e363e613} + + + {3625aad6-89b2-490e-bd9c-3cff284605e4} + @@ -354,6 +357,21 @@ 02.Element\02.Component\02.VIBuffer\Cell + + 02.Element\02.Component\06.Model\Mesh + + + 02.Element\02.Component\06.Model\Material + + + 02.Element\02.Component\06.Model\Bone + + + 02.Element\02.Component\06.Model\Animation + + + 02.Element\02.Component\06.Model\Animation\Channel + @@ -872,6 +890,21 @@ 02.Element\02.Component\02.VIBuffer\Cell + + 02.Element\02.Component\06.Model\Mesh + + + 02.Element\02.Component\06.Model\Material + + + 02.Element\02.Component\06.Model\Bone + + + 02.Element\02.Component\06.Model\Animation + + + 02.Element\02.Component\06.Model\Animation\Channel + diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp new file mode 100644 index 000000000..9ae232f1d --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -0,0 +1,152 @@ +#include "pch.h" +#include "Animation.h" +#include "Channel.h" +#include "Model.h" +#include "Bone.h" + +CAnimation::CAnimation() +{ +} + +CAnimation::CAnimation(const CAnimation& Prototype) + : m_fCurrentTrackPosition{ Prototype.m_fCurrentTrackPosition } + , m_fDuration{ Prototype.m_fDuration } + , m_fTickPerSecond{ Prototype.m_fTickPerSecond } + , m_iNumChannels{ Prototype.m_iNumChannels } + , m_Channels{ Prototype.m_Channels } + , m_CurrentKeyFrameIndices{ Prototype.m_CurrentKeyFrameIndices } + , m_pAIAnimation{ Prototype.m_pAIAnimation } +{ + for (auto& pChannel : m_Channels) + Safe_AddRef(pChannel); + +} + + +HRESULT CAnimation::Initialize(const CModel* pModel, const aiAnimation* pAIAnimation) +{ + m_pAIAnimation = pAIAnimation; + m_fDuration = pAIAnimation->mDuration; + m_fTickPerSecond = (_float)pAIAnimation->mTicksPerSecond; + + m_iNumChannels = pAIAnimation->mNumChannels; + + m_CurrentKeyFrameIndices.resize(m_iNumChannels); + + for (size_t i = 0; i < m_iNumChannels; i++) + { + CChannel* pChannel = CChannel::Create(pModel, pAIAnimation->mChannels[i]); + if (nullptr == pChannel) + return E_FAIL; + + m_Channels.push_back(pChannel); + } + + return S_OK; +} + +_bool CAnimation::Update_TransformationMatrices(_float fTimeDelta, _bool isLoop, vector& Bones) +{ + m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta; + + if (m_fCurrentTrackPosition >= m_fDuration) + { + if (isLoop) + m_fCurrentTrackPosition = 0.f; + else + return true; + } + + _uint iIndex = {}; + m_vBoneTransformationMatrix.clear(); + + for (auto& pChannel : m_Channels) + { + pChannel->Update_TransformationMatrix(m_fCurrentTrackPosition, Bones, &m_CurrentKeyFrameIndices[iIndex++]); + m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix()); + } + return false; +} + +void CAnimation::InterpAnim(CAnimation* pPreAnim, vector& Bones, float fRatio) +{ + + for (size_t i = 0; i < m_Channels.size(); i++) + { + if (m_vBoneTransformationMatrix.size() > pPreAnim->m_vBoneTransformationMatrix.size()) + { + for (size_t j = 0; j < pPreAnim->m_Channels.size(); j++) + { + if (strcmp(m_pAIAnimation->mChannels[i]->mNodeName.C_Str(), pPreAnim->m_pAIAnimation->mChannels[j]->mNodeName.C_Str()) == 0) + { + break; + } + else + { + if (j == pPreAnim->m_Channels.size() - 1) + { + pPreAnim->m_vBoneTransformationMatrix.push_back(m_vBoneTransformationMatrix[i]); + break; + } + } + } + } + } + for (size_t i = 0; i < m_Channels.size(); i++) + { + for (size_t j = 0; j < pPreAnim->m_pAIAnimation->mNumChannels; j++) + { + if (strcmp(m_pAIAnimation->mChannels[i]->mNodeName.C_Str(), pPreAnim->m_pAIAnimation->mChannels[j]->mNodeName.C_Str()) == 0) + { + _matrix CurMat = m_vBoneTransformationMatrix[i]; + _matrix PreMat = pPreAnim->m_vBoneTransformationMatrix[j]; + + _vector CurScale, CurRot, CurPos; + _vector PreScale, PreRot, PrePos; + XMMatrixDecompose(&CurScale, &CurRot, &CurPos, CurMat); + XMMatrixDecompose(&PreScale, &PreRot, &PrePos, PreMat); + + _vector FinalScale = XMVectorLerp(PreScale, CurScale, fRatio); + _vector FinalRot = XMQuaternionSlerp(PreRot, CurRot, fRatio); + _vector FinalPos = XMVectorLerp(PrePos, CurPos, fRatio); + + m_vBoneTransformationMatrix[i] = XMMatrixAffineTransformation(FinalScale, XMVectorZero(), FinalRot, FinalPos); + _int BoneIndex = m_Channels[i]->Get_BoneIndex(); + if (BoneIndex < Bones.size()) + { + Bones[BoneIndex]->Set_Transformation(m_vBoneTransformationMatrix[i]); + } + } + } + } +} + +CAnimation* CAnimation::Create(const CModel* pModel, const aiAnimation* pAIAnimation) +{ + CAnimation* pInstance = new CAnimation(); + + if (FAILED(pInstance->Initialize(pModel, pAIAnimation))) + { + MSG_BOX("Failed to Created : CAnimation"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CAnimation* CAnimation::Clone() +{ + return new CAnimation(*this); +} + +void CAnimation::Free() +{ + __super::Free(); + + for (auto& pChannel : m_Channels) + Safe_Release(pChannel); + + m_Channels.clear(); + + m_CurrentKeyFrameIndices.clear(); +} diff --git a/Jusin154_Team3D/Engine/Private/Bone.cpp b/Jusin154_Team3D/Engine/Private/Bone.cpp new file mode 100644 index 000000000..c12f5cd84 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Bone.cpp @@ -0,0 +1,60 @@ +#include "pch.h" +#include "Bone.h" + +CBone::CBone() +{ + +} + +HRESULT CBone::Initialize(const aiNode* pAINode, _int iParentIndex) +{ + strcpy_s(m_szName, pAINode->mName.data); + + m_iParentBoneIndex = iParentIndex; + + memcpy(&m_TransformationMatrix, &pAINode->mTransformation, sizeof(_float4x4)); + XMStoreFloat4x4(&m_TransformationMatrix, XMMatrixTranspose(XMLoadFloat4x4(&m_TransformationMatrix))); + + XMStoreFloat4x4(&m_CombinedTransformationMatrix, XMMatrixIdentity()); + + return S_OK; +} + +void CBone::Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix) +{ + if (-1 == m_iParentBoneIndex) + XMStoreFloat4x4(&m_CombinedTransformationMatrix, + XMLoadFloat4x4(&m_TransformationMatrix) * PreTransformMatrix); + + else + XMStoreFloat4x4(&m_CombinedTransformationMatrix, + XMLoadFloat4x4(&m_TransformationMatrix) * Bones[m_iParentBoneIndex]->Get_CombinedTransformationMatrix()); +} + +void CBone::Set_Transformation(_fmatrix BoneTransformationMatrix) +{ + XMStoreFloat4x4(&m_TransformationMatrix, BoneTransformationMatrix); +} + +CBone* CBone::Create(const aiNode* pAINode, _int iParentIndex) +{ + CBone* pInstance = new CBone(); + + if (FAILED(pInstance->Initialize(pAINode, iParentIndex))) + { + MSG_BOX("Failed to Created : CBone"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CBone* CBone::Clone() +{ + return new CBone(*this); +} + +void CBone::Free() +{ + __super::Free(); +} diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp new file mode 100644 index 000000000..ef8f6b298 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -0,0 +1,134 @@ +#include "pch.h" +#include "Channel.h" +#include "Model.h" +#include "Bone.h" + +CChannel::CChannel() +{ +} + +HRESULT CChannel::Initialize(const CModel* pModel, const aiNodeAnim* pAIChannel) +{ + strcpy_s(m_szName, pAIChannel->mNodeName.data); + + m_iBoneIndex = pModel->Get_BoneIndex(m_szName); + if (-1 == m_iBoneIndex) + return E_FAIL; + + m_iNumKeyFrames = max(pAIChannel->mNumScalingKeys, pAIChannel->mNumRotationKeys); + m_iNumKeyFrames = max(m_iNumKeyFrames, pAIChannel->mNumPositionKeys); + + _float3 vScale{}; + _float4 vRotation{}; + _float3 vTranslation{}; + + for (size_t i = 0; i < m_iNumKeyFrames; i++) + { + KEYFRAME KeyFrame{}; + + if (i < pAIChannel->mNumScalingKeys) + { + memcpy(&vScale, &pAIChannel->mScalingKeys[i].mValue, sizeof(_float3)); + KeyFrame.fTrackPosition = (_float)pAIChannel->mScalingKeys[i].mTime; + } + + if (i < pAIChannel->mNumRotationKeys) + { + vRotation.x = pAIChannel->mRotationKeys[i].mValue.x; + vRotation.y = pAIChannel->mRotationKeys[i].mValue.y; + vRotation.z = pAIChannel->mRotationKeys[i].mValue.z; + vRotation.w = pAIChannel->mRotationKeys[i].mValue.w; + + KeyFrame.fTrackPosition = (_float)pAIChannel->mRotationKeys[i].mTime; + } + + if (i < pAIChannel->mNumPositionKeys) + { + memcpy(&vTranslation, &pAIChannel->mPositionKeys[i].mValue, sizeof(_float3)); + KeyFrame.fTrackPosition = (_float)pAIChannel->mPositionKeys[i].mTime; + } + + KeyFrame.vScale = vScale; + KeyFrame.vRotation = vRotation; + KeyFrame.vTranslation = vTranslation; + + m_KeyFrames.push_back(KeyFrame); + } + + + + return S_OK; +} + +void CChannel::Update_TransformationMatrix(_float fCurrentTrackPosition, vector& Bones, _uint* pCurrentKeyFrameIndex) +{ + if (0.f == fCurrentTrackPosition) + *pCurrentKeyFrameIndex = 0; + + KEYFRAME LastKeyFrame = m_KeyFrames.back(); + + _vector vScale{}; + _vector vRotation{}; + _vector vTranslation{}; + + if (fCurrentTrackPosition >= LastKeyFrame.fTrackPosition) + { + vScale = XMLoadFloat3(&LastKeyFrame.vScale); + vRotation = XMLoadFloat4(&LastKeyFrame.vRotation); + vTranslation = XMVectorSetW(XMLoadFloat3(&LastKeyFrame.vTranslation), 1.f); + } + + else + { + while (fCurrentTrackPosition >= m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition) + ++*pCurrentKeyFrameIndex; + + _float3 vSourScale{}, vDestScale{}; + _float4 vSourRotation{}, vDestRotation{}; + _float3 vSourTranslation{}, vDestTranslation{}; + + vSourScale = m_KeyFrames[*pCurrentKeyFrameIndex].vScale; + vDestScale = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vScale; + + vSourRotation = m_KeyFrames[*pCurrentKeyFrameIndex].vRotation; + vDestRotation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vRotation; + + vSourTranslation = m_KeyFrames[*pCurrentKeyFrameIndex].vTranslation; + vDestTranslation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vTranslation; + + _float fRatio = (fCurrentTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition) / + (m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition); + + vScale = XMVectorLerp(XMLoadFloat3(&vSourScale), XMLoadFloat3(&vDestScale), fRatio); + vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSourRotation), XMLoadFloat4(&vDestRotation), fRatio); + vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSourTranslation), XMLoadFloat3(&vDestTranslation), fRatio), 1.f); + + } + + m_BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); + + Bones[m_iBoneIndex]->Set_Transformation(m_BoneTransformationMatrix); + + +} + +CChannel* CChannel::Create(const CModel* pModel, const aiNodeAnim* pAIChannel) +{ + CChannel* pInstance = new CChannel(); + + if (FAILED(pInstance->Initialize(pModel, pAIChannel))) + { + MSG_BOX("Failed to Created : CChannel"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CChannel::Free() +{ + __super::Free(); + + m_KeyFrames.clear(); + +} diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp new file mode 100644 index 000000000..fbb7b6c33 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -0,0 +1,103 @@ +#include "pch.h" +#include "Material.h" + +#include "Shader.h" + +CMaterial::CMaterial(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : m_pDevice{ pDevice } + , m_pContext{ pContext } +{ + Safe_AddRef(m_pDevice); + Safe_AddRef(m_pContext); +} + +HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAIMaterial) +{ + for (_uint i = 0; i < AI_TEXTURE_TYPE_MAX; i++) + { + m_iNumSRVs = pAIMaterial->GetTextureCount(static_cast(i)); + + m_SRVs[i].reserve(m_iNumSRVs); + + for (_uint j = 0; j < m_iNumSRVs; j++) + { + aiString strTexturePath; + + + char szDrive[MAX_PATH] = {}; + char szDir[MAX_PATH] = {}; + char szFileName[MAX_PATH] = {}; + char szEXT[MAX_PATH] = {}; + + if (FAILED(pAIMaterial->GetTexture(static_cast(i), j, &strTexturePath))) + continue; + + _char szTextureFilePath[MAX_PATH] = {}; + _splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, nullptr, 0, nullptr, 0); + _splitpath_s(strTexturePath.data, nullptr, 0, nullptr, 0, szFileName, MAX_PATH, szEXT, MAX_PATH); + + strcpy_s(szTextureFilePath, szDrive); + strcat_s(szTextureFilePath, szDir); + strcat_s(szTextureFilePath, szFileName); + strcat_s(szTextureFilePath, szEXT); + + _tchar szPerfectPath[MAX_PATH] = {}; + MultiByteToWideChar(CP_ACP, 0, szTextureFilePath, (_int)strlen(szTextureFilePath), + szPerfectPath, MAX_PATH); + + ID3D11ShaderResourceView* pSRV = { nullptr }; + + HRESULT hr = {}; + + if (false == strcmp(".dds", szEXT)) + hr = CreateDDSTextureFromFile(m_pDevice, szPerfectPath, nullptr, &pSRV); + else if (false == strcmp(".tga", szEXT)) + hr = S_OK; + else + hr = CreateWICTextureFromFile(m_pDevice, szPerfectPath, nullptr, &pSRV); + + if (FAILED(hr)) + return E_FAIL; + + m_SRVs[i].push_back(pSRV); + } + } + + return S_OK; +} + +HRESULT CMaterial::Bind_SRV(CShader* pShader, const _char* pConstantName, aiTextureType eType, _uint iTextureIndex) +{ + if (m_SRVs[eType].empty()) + { + return S_OK; + } + return pShader->Bind_SRV(pConstantName, m_SRVs[eType][iTextureIndex]); +} + +CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const aiMaterial* pAIMaterial) +{ + CMaterial* pInstance = new CMaterial(pDevice, pContext); + + if (FAILED(pInstance->Initialize(pModelFilePath, pAIMaterial))) + { + MSG_BOX("Failed to Created : CMaterial"); + Safe_Release(pInstance); + } + + return pInstance; +} +void CMaterial::Free() +{ + __super::Free(); + + Safe_Release(m_pDevice); + Safe_Release(m_pContext); + + for (auto& SRVs : m_SRVs) + { + for (auto& pSRV : SRVs) + Safe_Release(pSRV); + SRVs.clear(); + } +} diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp new file mode 100644 index 000000000..0410a67e1 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -0,0 +1,359 @@ +#include "pch.h" +#include "Mesh.h" + +#include "Bone.h" +#include "Model.h" +#include "Shader.h" + + +CMesh::CMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CVIBuffer( pDevice, pContext ) +{ +} + +CMesh::CMesh(const CMesh& Prototype) + : CVIBuffer( Prototype ) +{ +} + +HRESULT CMesh::Initialize_Prototype(MODEL eType, const class CModel* pModel, const aiMesh* pAIMesh, _fmatrix PreTransformMatrix) +{ + strcpy_s(m_szName, pAIMesh->mName.data); + + m_iMaterialIndex = pAIMesh->mMaterialIndex; + m_iNumVertexBuffers = 1; + m_iNumVertices = pAIMesh->mNumVertices; + + m_iNumIndices = pAIMesh->mNumFaces * 3; + m_iIndexStride = 4; + + m_eIndexFormat = DXGI_FORMAT_R32_UINT; + m_ePrimitive = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + + + m_Indices.clear(); + m_Indices.reserve(pAIMesh->mNumFaces * 3); + for (unsigned int f = 0; f < pAIMesh->mNumFaces; ++f) + { + const aiFace& face = pAIMesh->mFaces[f]; + if (face.mNumIndices == 3) + { + m_Indices.push_back(face.mIndices[0]); + m_Indices.push_back(face.mIndices[1]); + m_Indices.push_back(face.mIndices[2]); + } + } + + m_Vertices.clear(); + m_Vertices.reserve(pAIMesh->mNumVertices); + + XMMATRIX matPre = PreTransformMatrix; + for (size_t i = 0; i < pAIMesh->mNumVertices; ++i) + { + _float3 pos{ pAIMesh->mVertices[i].x, + pAIMesh->mVertices[i].y, + pAIMesh->mVertices[i].z }; + XMVECTOR v = XMLoadFloat3(&pos); + v = XMVector3TransformCoord(v, matPre); + XMFLOAT3 tp; + XMStoreFloat3(&tp, v); + m_Vertices.push_back(tp); + } + +#pragma region VERTEX_BUFFER + + HRESULT hr = MODEL::NONANIM == eType ? + Ready_VertexBuffer_For_NonAnim(pAIMesh, PreTransformMatrix) : + Ready_VertexBuffer_For_Anim(pModel, pAIMesh); + + if (FAILED(hr)) + return E_FAIL; + +#pragma endregion + +#pragma region INDEX_BUFFER + D3D11_BUFFER_DESC IBDesc{}; + IBDesc.ByteWidth = m_iIndexStride * m_iNumIndices; + IBDesc.Usage = D3D11_USAGE_DEFAULT; + IBDesc.BindFlags = D3D11_BIND_INDEX_BUFFER; + IBDesc.StructureByteStride = m_iIndexStride; + IBDesc.CPUAccessFlags = 0; + IBDesc.MiscFlags = 0; + + + _uint* pIndices = new _uint[m_iNumIndices]; + ZeroMemory(pIndices, sizeof(_uint) * m_iNumIndices); + + _uint iNumIndices = {}; + + for (size_t i = 0; i < pAIMesh->mNumFaces; i++) + { + pIndices[iNumIndices++] = pAIMesh->mFaces[i].mIndices[0]; + pIndices[iNumIndices++] = pAIMesh->mFaces[i].mIndices[1]; + pIndices[iNumIndices++] = pAIMesh->mFaces[i].mIndices[2]; + } + + + D3D11_SUBRESOURCE_DATA InitialIBData{}; + InitialIBData.pSysMem = pIndices; + + if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB))) + return E_FAIL; + + Safe_Delete_Array(pIndices); + +#pragma endregion + + + + return S_OK; +} + +HRESULT CMesh::Initialize(void* pArg) +{ + return S_OK; +} + +HRESULT CMesh::Bind_BoneMatrices(const vector& Bones, CShader* pShader, const _char* pConstantName) +{ + if (m_iNumBones >= 512) + return E_FAIL; + + + for (size_t i = 0; i < m_iNumBones; i++) + { + XMStoreFloat4x4(&m_pBoneMatrices[i], XMLoadFloat4x4(&m_OffsetMatrices[i]) * Bones[m_BoneIndices[i]]->Get_CombinedTransformationMatrix()); + } + + if (0 == m_iNumBones) + return S_OK; + + return pShader->Bind_Matrices(pConstantName, m_pBoneMatrices, m_iNumBones); + +} + +HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(const aiMesh* pAIMesh, _fmatrix PreTransformMatrix) +{ + m_iVertexStride = sizeof(VTXMESH); + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DEFAULT; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.StructureByteStride = m_iVertexStride; + VBDesc.CPUAccessFlags = 0; + VBDesc.MiscFlags = 0; + + VTXMESH* pVertices = new VTXMESH[m_iNumVertices]; + ZeroMemory(pVertices, sizeof(VTXMESH) * m_iNumVertices); + + m_pVertexPositions = new _float3[m_iNumVertices]; + ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); + + for (_uint i = 0; i < m_iNumVertices; ++i) + { + memcpy(&pVertices[i].vPosition, &pAIMesh->mVertices[i], sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vPosition, XMVector3TransformCoord(XMLoadFloat3(&pVertices[i].vPosition), PreTransformMatrix)); + + if (pAIMesh->HasNormals()) + { + memcpy(&pVertices[i].vNormal, &pAIMesh->mNormals[i], sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vNormal, + XMVector3Normalize(XMVector3TransformNormal(XMLoadFloat3(&pVertices[i].vNormal), PreTransformMatrix))); + } + else + { + pVertices[i].vNormal = _float3(0.f, 1.f, 0.f); + } + + if (pAIMesh->HasTangentsAndBitangents()) + { + memcpy(&pVertices[i].vTangent, &pAIMesh->mTangents[i], sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vTangent, + XMVector3Normalize(XMVector3TransformNormal(XMLoadFloat3(&pVertices[i].vTangent), PreTransformMatrix))); + } + else + { + pVertices[i].vTangent = _float3(1.f, 0.f, 0.f); + } + + if (pAIMesh->HasTextureCoords(0)) + { + memcpy(&pVertices[i].vTexcoord, &pAIMesh->mTextureCoords[0][i], sizeof(_float2)); + } + else + { + pVertices[i].vTexcoord = _float2(0.f, 0.f); + } + } + + D3D11_SUBRESOURCE_DATA InitialVBData{}; + InitialVBData.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) + return E_FAIL; + + Safe_Delete_Array(pVertices); + + return S_OK; +} + +HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, const aiMesh* pAIMesh) +{ + m_iVertexStride = sizeof(VTXANIMMESH); + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DEFAULT; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.StructureByteStride = m_iVertexStride; + VBDesc.CPUAccessFlags = 0; + VBDesc.MiscFlags = 0; + + VTXANIMMESH* pVertices = new VTXANIMMESH[m_iNumVertices]; + ZeroMemory(pVertices, sizeof(VTXANIMMESH) * m_iNumVertices); + + m_pVertexPositions = new _float3[m_iNumVertices]; + ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); + + for (_uint i = 0; i < m_iNumVertices; ++i) + { + memcpy(&pVertices[i].vPosition, &pAIMesh->mVertices[i], sizeof(_float3)); + if (pAIMesh->HasNormals()) + { + memcpy(&pVertices[i].vNormal, &pAIMesh->mNormals[i], sizeof(_float3)); + } + else + { + pVertices[i].vNormal = _float3(0.f, 1.f, 0.f); + } + + if (pAIMesh->HasTangentsAndBitangents()) + { + memcpy(&pVertices[i].vTangent, &pAIMesh->mTangents[i], sizeof(_float3)); + } + else + { + pVertices[i].vTangent = _float3(1.f, 0.f, 0.f); + } + + if (pAIMesh->HasTextureCoords(0)) + { + memcpy(&pVertices[i].vTexcoord, &pAIMesh->mTextureCoords[0][i], sizeof(_float2)); + } + else + { + pVertices[i].vTexcoord = _float2(0.f, 0.f); + } + } + + m_iNumBones = pAIMesh->mNumBones; + + m_OffsetMatrices.reserve(m_iNumBones); + + m_pBoneMatrices = new _float4x4[0 == m_iNumBones ? 1 : m_iNumBones]; + ZeroMemory(m_pBoneMatrices, sizeof(_float4x4) * m_iNumBones); + + _float4x4 OffsetMatrix; + XMStoreFloat4x4(&OffsetMatrix, XMMatrixIdentity()); + + for (_uint i = 0; i < m_iNumBones; i++) + { + aiBone* pAIBone = pAIMesh->mBones[i]; + + memcpy(&OffsetMatrix, &pAIBone->mOffsetMatrix, sizeof(_float4x4)); + XMStoreFloat4x4(&OffsetMatrix, XMMatrixTranspose(XMLoadFloat4x4(&OffsetMatrix))); + + _int iBoneIndex = pModel->Get_BoneIndex(pAIBone->mName.data); + + if (-1 == iBoneIndex) + return E_FAIL; + + m_OffsetMatrices.push_back(OffsetMatrix); + m_BoneIndices.push_back(iBoneIndex); + + for (_uint j = 0; j < pAIBone->mNumWeights; j++) + { + aiVertexWeight AIWeight = pAIBone->mWeights[j]; + + if (0.f == pVertices[AIWeight.mVertexId].vBlendWeight.x) + { + pVertices[AIWeight.mVertexId].vBlendIndex.x = i; + pVertices[AIWeight.mVertexId].vBlendWeight.x = AIWeight.mWeight; + } + + else if (0.f == pVertices[AIWeight.mVertexId].vBlendWeight.y) + { + pVertices[AIWeight.mVertexId].vBlendIndex.y = i; + pVertices[AIWeight.mVertexId].vBlendWeight.y = AIWeight.mWeight; + } + + else if (0.f == pVertices[AIWeight.mVertexId].vBlendWeight.z) + { + pVertices[AIWeight.mVertexId].vBlendIndex.z = i; + pVertices[AIWeight.mVertexId].vBlendWeight.z = AIWeight.mWeight; + } + + else + { + pVertices[AIWeight.mVertexId].vBlendIndex.w = i; + pVertices[AIWeight.mVertexId].vBlendWeight.w = AIWeight.mWeight; + } + } + } + + if (0 == m_iNumBones) + { + m_iNumBones = 1; + + m_BoneIndices.push_back(pModel->Get_BoneIndex(m_szName)); + + m_OffsetMatrices.push_back(OffsetMatrix); + } + + D3D11_SUBRESOURCE_DATA InitialVBData{}; + InitialVBData.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) + return E_FAIL; + + Safe_Delete_Array(pVertices); + + return S_OK; +} + +CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const CModel* pModel, const aiMesh* pAIMesh, _fmatrix PreTransformMatrix) +{ + CMesh* pInstance = new CMesh(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(eType, pModel, pAIMesh, PreTransformMatrix))) + { + MSG_BOX("Failed to Created : CMesh"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CComponent* CMesh::Clone(void* pArg, CGameObject* pOwner) +{ + CMesh* pInstance = new CMesh(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMesh"); + Safe_Release(pInstance); + } + + return pInstance; +} +void CMesh::Free() +{ + __super::Free(); + + Safe_Delete_Array(m_pBoneMatrices); + + +} + +void CMesh::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index bda236832..674822186 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -1,2 +1,301 @@ #include "pch.h" -#include "Model.h" \ No newline at end of file +#include "Model.h" +#include "Mesh.h" +#include "Shader.h" +#include "Material.h" +#include "Bone.h" +#include "Animation.h" + +CModel::CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CComponent( pDevice, pContext ) +{ +} + +CModel::CModel(const CModel& Prototype) + : CComponent( Prototype ) + , m_eType{ Prototype.m_eType } + , m_iNumMeshes{ Prototype.m_iNumMeshes } + , m_Meshes{ Prototype.m_Meshes } + , m_iNumMaterials{ Prototype.m_iNumMaterials } + , m_Materials{ Prototype.m_Materials } + , m_PreTransformMatrix{ Prototype.m_PreTransformMatrix } + , m_iNumAnimations{ Prototype.m_iNumAnimations } +{ + for (auto& pPrototypeBone : Prototype.m_Bones) + m_Bones.push_back(pPrototypeBone->Clone()); + + for (auto& pMesh : m_Meshes) + Safe_AddRef(pMesh); + + for (auto& pMaterial : m_Materials) + Safe_AddRef(pMaterial); + + for (auto& pPrototypeAnim : Prototype.m_Animations) + m_Animations.push_back(pPrototypeAnim->Clone()); +} + +_int CModel::Get_BoneIndex(const _char* pBoneName) const +{ + _int iBoneIndex = {}; + + auto iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool + { + if (true == pBone->Compare_Name(pBoneName)) + return true; + + ++iBoneIndex; + + return false; + }); + + if (iter == m_Bones.end()) + return -1; + + return iBoneIndex; +} + +const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) const +{ + auto iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool + { + if (true == pBone->Compare_Name(pBoneName)) + return true; + + return false; + }); + + + return (*iter)->Get_CombinedTransformationMatrixPtr(); +} + +HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) +{ + _uint iFlag = {}; + + iFlag = aiProcess_ConvertToLeftHanded | aiProcessPreset_TargetRealtime_Fast; + + if (MODEL::NONANIM == eType) + iFlag |= aiProcess_PreTransformVertices; + + m_pAIScene = m_Importer.ReadFile(pModelFilePath, iFlag); + if (nullptr == m_pAIScene) + return E_FAIL; + + m_eType = eType; + XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix); + + Ready_Bones(m_pAIScene->mRootNode, -1); + + if (FAILED(Ready_Meshes())) + return E_FAIL; + + if (FAILED(Ready_Materials(pModelFilePath))) + return E_FAIL; + + if (FAILED(Ready_Animations())) + return E_FAIL; + + return S_OK; +} + +HRESULT CModel::Initialize(void* pArg) +{ + return S_OK; +} + +HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _char* pConstantName) +{ + if (iMeshIndex >= m_iNumMeshes) + return E_FAIL; + + return m_Meshes[iMeshIndex]->Bind_BoneMatrices(m_Bones, pShader, pConstantName); +} + +HRESULT CModel::Bind_Material(_uint iMeshIndex, CShader* pShader, const _char* pConstantName, aiTextureType eType, _uint iTextureIndex) +{ + if (iMeshIndex >= m_iNumMeshes) + return E_FAIL; + + _uint iMaterialIndex = m_Meshes[iMeshIndex]->Get_MaterialIndex(); + + if (iMaterialIndex >= m_iNumMaterials) + return E_FAIL; + + return m_Materials[iMaterialIndex]->Bind_SRV(pShader, pConstantName, eType, iTextureIndex); + +} + +_bool CModel::Play_Animation(_float fTimeDelta) +{ + if (-1 == m_iCurrentAnimIndex || + m_iCurrentAnimIndex >= m_iNumAnimations) + return false; + + if (m_iPreAnimIndex != m_iCurrentAnimIndex) + { + m_fBlendTime += fTimeDelta; + _float fRatio = m_fBlendTime / m_fBlendDuration; + fRatio = min(fRatio, 1.f); + + m_Animations[m_iPreAnimIndex]->Update_TransformationMatrices(fTimeDelta, m_isLoop, m_Bones); + m_isFinish = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(fTimeDelta, m_isLoop, m_Bones); + m_Animations[m_iCurrentAnimIndex]->InterpAnim(m_Animations[m_iPreAnimIndex], m_Bones, fRatio); + + if (fRatio >= 1.f) + { + m_iPreAnimIndex = m_iCurrentAnimIndex; + m_fBlendTime = 0.f; + } + } + else + { + m_isFinish = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(fTimeDelta, m_isLoop, m_Bones); + } + + + for (auto& pBone : m_Bones) + { + pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix)); + } + + return m_isFinish; +} + +void CModel::Set_AnimationIndex(_int iIndex, _bool isLoop) +{ + if (iIndex >= 0 && iIndex < m_iNumAnimations) + { + m_iCurrentAnimIndex = iIndex; + m_isLoop = isLoop; + } + else + m_iCurrentAnimIndex = -1; +} + +HRESULT CModel::Render(_uint iMeshIndex) +{ + m_Meshes[iMeshIndex]->Bind_Resources(); + m_Meshes[iMeshIndex]->Render(); + + return S_OK; +} + +HRESULT CModel::Ready_Meshes() +{ + m_iNumMeshes = m_pAIScene->mNumMeshes; + + for (size_t i = 0; i < m_iNumMeshes; i++) + { + CMesh* pMesh = CMesh::Create(m_pDevice, m_pContext, m_eType, this, m_pAIScene->mMeshes[i], XMLoadFloat4x4(&m_PreTransformMatrix)); + if (nullptr == pMesh) + return E_FAIL; + + m_Meshes.push_back(pMesh); + } + + return S_OK; +} + +HRESULT CModel::Ready_Materials(const _char* pModelFilePath) +{ + m_iNumMaterials = m_pAIScene->mNumMaterials; + + for (size_t i = 0; i < m_iNumMaterials; i++) + { + CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, pModelFilePath, m_pAIScene->mMaterials[i]); + if (nullptr == pMaterial) + return E_FAIL; + + m_Materials.push_back(pMaterial); + } + + return S_OK; +} + +HRESULT CModel::Ready_Bones(const aiNode* pAINode, _int iParentIndex) +{ + CBone* pBone = CBone::Create(pAINode, iParentIndex); + if (nullptr == pBone) + return E_FAIL; + + m_Bones.push_back(pBone); + + _int iParent = (_int)m_Bones.size() - 1; + + for (_uint i = 0; i < pAINode->mNumChildren; i++) + { + Ready_Bones(pAINode->mChildren[i], iParent); + } + + return S_OK; +} + +HRESULT CModel::Ready_Animations() +{ + m_iNumAnimations = m_pAIScene->mNumAnimations; + + for (size_t i = 0; i < m_iNumAnimations; i++) + { + CAnimation* pAnimation = CAnimation::Create(this, m_pAIScene->mAnimations[i]); + if (nullptr == pAnimation) + return E_FAIL; + + m_Animations.push_back(pAnimation); + } + + return S_OK; +} + +CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) +{ + CModel* pInstance = new CModel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(eType, pModelFilePath, PreTransformMatrix))) + { + MSG_BOX("Failed to Created : CModel"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CComponent* CModel::Clone(void* pArg, CGameObject* pOwner) +{ + CModel* pInstance = new CModel(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CModel"); + Safe_Release(pInstance); + } + + return pInstance; +} + + +void CModel::Free() +{ + __super::Free(); + + for (auto& pMaterial : m_Materials) + Safe_Release(pMaterial); + m_Materials.clear(); + + for (auto& pMesh : m_Meshes) + Safe_Release(pMesh); + m_Meshes.clear(); + + for (auto& pBone : m_Bones) + Safe_Release(pBone); + m_Bones.clear(); + + for (auto& pAnim : m_Animations) + Safe_Release(pAnim); + m_Animations.clear(); + + m_Importer.FreeScene(); +} + +void CModel::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h new file mode 100644 index 000000000..9e962fa5a --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -0,0 +1,38 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CAnimation final : public CBase +{ +private: + CAnimation(); + CAnimation(const CAnimation& Prototype); + virtual ~CAnimation() = default; + +public: + HRESULT Initialize(const class CModel* pModel, const aiAnimation* pAIAnimation); + _bool Update_TransformationMatrices(_float fTimeDelta, _bool isLoop, vector& Bones); + void InterpAnim(CAnimation* pPreAnim, vector& Bones, float fRatio); + +private: + const aiAnimation* m_pAIAnimation = { nullptr }; + + _float m_fCurrentTrackPosition = {}; + _double m_fDuration = {}; + _float m_fTickPerSecond = {}; + + vector m_Channels; + _uint m_iNumChannels = {}; + vector<_uint> m_CurrentKeyFrameIndices; + vector<_matrix> m_vBoneTransformationMatrix = {}; + +public: + static CAnimation* Create(const class CModel* pModel, const aiAnimation* pAIAnimation); + CAnimation* Clone(); + virtual void Free() override; +}; + +NS_END + diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h new file mode 100644 index 000000000..4a87f3b62 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CBone final : public CBase +{ +private: + CBone(); + virtual ~CBone() = default; + +public: + _matrix Get_CombinedTransformationMatrix() const { + return XMLoadFloat4x4(&m_CombinedTransformationMatrix); + } + + const _float4x4* Get_CombinedTransformationMatrixPtr() const { + return &m_CombinedTransformationMatrix; + } + _bool Compare_Name(const _char* pBoneName) const { + return !strcmp(pBoneName, m_szName); + } +public: + HRESULT Initialize(const aiNode* pAINode, _int iParentIndex); + void Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix); + void Set_Transformation(_fmatrix BoneTransformationMatrix); +private: + _char m_szName[MAX_PATH] = {}; + _float4x4 m_TransformationMatrix = {}; + _float4x4 m_CombinedTransformationMatrix = {}; + _int m_iParentBoneIndex = { -1 }; + +public: + static CBone* Create(const aiNode* pAINode, _int iParentIndex); + CBone* Clone(); + virtual void Free() override; +}; +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h new file mode 100644 index 000000000..245fd13dc --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CChannel final : public CBase +{ +private: + CChannel(); + virtual ~CChannel() = default; + +public: + HRESULT Initialize(const class CModel* pModel, const aiNodeAnim* pAIChannel); + void Update_TransformationMatrix(_float fCurrentTrackPosition, vector& Bones, _uint* pCurrentKeyFrameIndex); + _matrix Get_BoneTransformationMatrix() { return m_BoneTransformationMatrix; } + _int Get_BoneIndex() { return m_iBoneIndex; } +private: + _char m_szName[MAX_PATH] = {}; + _int m_iBoneIndex = { -1 }; + + _uint m_iNumKeyFrames = {}; + vector m_KeyFrames; + + _uint m_iCurrentKeyFrameIndex = { 0 }; + _matrix m_BoneTransformationMatrix = {}; + +public: + static CChannel* Create(const class CModel* pModel, const aiNodeAnim* pAIChannel); + virtual void Free() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index f0483dfff..e6b715625 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -12,6 +12,15 @@ typedef struct tagEngineDesc _uint iWinSizeX, iWinSizeY; }ENGINE_DESC; +typedef struct tagKeyFrame +{ + XMFLOAT3 vScale; + XMFLOAT4 vRotation; + XMFLOAT3 vTranslation; + float fTrackPosition; + +}KEYFRAME; + typedef struct tagLightDesc { LIGHT eType; diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index d8ee799b7..2748a01d0 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -42,7 +42,7 @@ class ENGINE_DLL CGameObject abstract const CGameObject* Get_Owner() const { return m_pOwner; } public: - HRESULT Add_Asset_Component(_uint iTargetLevel, const _wstring strPrototypeTag, CComponent** ppOut, void* pArg); + HRESULT Add_Asset_Component(_uint iTargetLevel, const _wstring strPrototypeTag, CComponent** ppOut, void* pArg = nullptr); template HRESULT Add_Component(_uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) { T* pComponent = m_pGameInstance->Clone_Prototype(iPrototypeLevelIndex, pArg, this); diff --git a/Jusin154_Team3D/Engine/Public/Material.h b/Jusin154_Team3D/Engine/Public/Material.h new file mode 100644 index 000000000..951d76b51 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Material.h @@ -0,0 +1,27 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CMaterial final : public CBase +{ +private: + CMaterial(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual ~CMaterial() = default; + +public: + HRESULT Initialize(const _char* pModelFilePath, const aiMaterial* pAIMaterial); + HRESULT Bind_SRV(class CShader* pShader, const _char* pConstantName, aiTextureType eType, _uint iTextureIndex); +private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + + _uint m_iNumSRVs = {}; + vector m_SRVs[AI_TEXTURE_TYPE_MAX]; +public: + static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const aiMaterial* pAIMaterial); + virtual void Free() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h new file mode 100644 index 000000000..6db6fbe00 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -0,0 +1,45 @@ +#pragma once + +#include "VIBuffer.h" + +NS_BEGIN(Engine) + +class ENGINE_DLL CMesh final : public CVIBuffer +{ +private: + CMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMesh(const CMesh& Prototype); + virtual ~CMesh() = default; + +public: + _uint Get_MaterialIndex() const { + return m_iMaterialIndex; + } +public: + virtual HRESULT Initialize_Prototype(MODEL eType, const class CModel* pModel, const aiMesh* pAIMesh, _fmatrix PreTransformMatrix); + virtual HRESULT Initialize(void* pArg) override; + HRESULT Bind_BoneMatrices(const vector& Bones, class CShader* pShader, const _char* pConstantName); + +private: + _char m_szName[MAX_PATH] = {}; + _uint m_iMaterialIndex = {}; + _uint m_iNumBones = { }; + _float4x4* m_pBoneMatrices = { nullptr }; + vector<_float4x4> m_OffsetMatrices; + vector<_int> m_BoneIndices; + vector<_uint> m_Indices; + vector<_float3> m_Vertices; + +private: + HRESULT Ready_VertexBuffer_For_NonAnim(const aiMesh* pAIMesh, _fmatrix PreTransformMatrix); + HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, const aiMesh* pAIMesh); + + +public: + static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const class CModel* pModel, const aiMesh* pAIMesh, _fmatrix PreTransformMatrix); + virtual CComponent* Clone(void* pArg, CGameObject* pOwner = nullptr)override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 31c7f6dda..69e472642 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -6,6 +6,69 @@ NS_BEGIN(Engine) class ENGINE_DLL CModel final : public CComponent { +private: + CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CModel(const CModel& Prototype); + virtual ~CModel() = default; + + +public: + _uint Get_NumMeshes() const { + return m_iNumMeshes; + } + + _int Get_BoneIndex(const _char* pBoneName) const; + const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; + const vector& Get_Meshes() const { return m_Meshes; } +public: + virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); + virtual HRESULT Initialize(void* pArg) override; + HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); + HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName, aiTextureType eType, _uint iTextureIndex); + _bool Play_Animation(_float fTimeDelta); + void Set_AnimationIndex(_int iIndex, _bool isLoop = true); + HRESULT Render(_uint iMeshIndex); + +private: + const aiScene* m_pAIScene = { nullptr }; + Assimp::Importer m_Importer; + +private: + MODEL m_eType = {}; + _float4x4 m_PreTransformMatrix = {}; + + vector m_Meshes; + _uint m_iNumMeshes = {}; + + vector m_Materials; + _uint m_iNumMaterials = {}; + + vector m_Bones; + + vector m_Animations; + _int m_iCurrentAnimIndex = { -1 }; + _int m_iPreAnimIndex = { 0 }; + _int m_iNumAnimations = {}; + _bool m_isLoop = { false }; + _bool m_isFinish = { false }; + + _float m_fBlendTime = { 0.f }; + _float m_fBlendDuration = { 0.3f }; + +private: + HRESULT Ready_Meshes(); + HRESULT Ready_Materials(const _char* pModelFilePath); + HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex); + HRESULT Ready_Animations(); + +public: + static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix = XMMatrixIdentity()); + virtual CComponent* Clone(void* pArg, CGameObject* pOwner = nullptr)override; + virtual void Free(); +#ifdef _DEBUG + virtual void Describe_Entity() override; +#endif + }; NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Texture.h b/Jusin154_Team3D/Engine/Public/Texture.h index aded37c8e..bb0d5f17f 100644 --- a/Jusin154_Team3D/Engine/Public/Texture.h +++ b/Jusin154_Team3D/Engine/Public/Texture.h @@ -28,7 +28,7 @@ class ENGINE_DLL CTexture final : HRESULT ParseTexturePathToSRVs(const _tchar* pTextureFolderPath); private: - vector m_pSRVs = { nullptr }; + vector m_pSRVs = { }; public: static CTexture* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, TEXTURE_LOAD_TYPE eType, const _tchar* pTextureFilePath, const _wstring& wstrTextureKey, _uint iNumTextures);