Merge pull request #119 from SpicyGangjeong/Effect_Follow_1114_2
follow
@@ -1,5 +1,18 @@
|
||||
#sln
|
||||
|
||||
# h 저장형식 지정
|
||||
[*.h]
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
# cpp 저장형식 지정
|
||||
[*.cpp]
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
|
||||
# hlsl 저장형식 지정
|
||||
[*.hlsl]
|
||||
charset = utf-8
|
||||
|
||||
|
After Width: | Height: | Size: 6.0 MiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 8.2 MiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 7.5 MiB |
|
After Width: | Height: | Size: 4.6 MiB |
|
After Width: | Height: | Size: 8.7 MiB |
|
After Width: | Height: | Size: 6.6 MiB |
|
After Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 6.8 MiB |
@@ -8,6 +8,7 @@ int g_iImageCountY;
|
||||
|
||||
float g_fFar;
|
||||
float g_fTime;
|
||||
float g_fTimeMult;
|
||||
float g_fFrame;
|
||||
float g_fAlpha;
|
||||
float g_fOwnerAlpha;
|
||||
@@ -16,8 +17,11 @@ float g_fDeltaU;
|
||||
float g_fDeltaV;
|
||||
uint g_iIndexU;
|
||||
uint g_iIndexV;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
float2 g_fOrigin_Size;
|
||||
float2 g_fCurrent_Size;
|
||||
uint g_iQuestType;
|
||||
float g_fPI;
|
||||
|
||||
Texture2D g_Texture;
|
||||
Texture2D g_Texture1;
|
||||
@@ -64,7 +68,7 @@ struct PS_OUT
|
||||
float4 vColor : SV_Target0;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In) // ?쇰컲 UI
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
@@ -142,19 +146,31 @@ PS_OUT PS_Cursor(PS_IN In)
|
||||
|
||||
Color = White;
|
||||
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Key_Hold_Rotation(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (Color.a <= 0.1f)
|
||||
discard;
|
||||
|
||||
Out.vColor = Color;
|
||||
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float4 tex = g_Texture.Sample(DefaultSampler, uv);
|
||||
|
||||
float2 center = float2(0.5f, 0.5f);
|
||||
float2 dir = uv - center;
|
||||
|
||||
float angle = atan2(dir.x, -dir.y);
|
||||
if (angle < 0)
|
||||
angle += g_fPI;
|
||||
|
||||
float rotation = saturate(g_fTime * g_fTimeMult) * g_fPI;
|
||||
|
||||
tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb;
|
||||
|
||||
Out.vColor = tex;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -224,6 +240,52 @@ PS_OUT PS_UVMult(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_NineSlice(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Left = g_fNine_Slice.x / g_fOrigin_Size.x;
|
||||
float Right = (g_fOrigin_Size.x - g_fNine_Slice.y) / g_fOrigin_Size.x;
|
||||
float Top = g_fNine_Slice.z / g_fOrigin_Size.y;
|
||||
float Bottom = (g_fOrigin_Size.y - g_fNine_Slice.w) / g_fOrigin_Size.y;
|
||||
|
||||
float2 ratio = g_fCurrent_Size / g_fOrigin_Size;
|
||||
|
||||
float2 UV = In.vTexcoord * 0.5f + 0.5f;
|
||||
float2 ScaledUV = UV;
|
||||
|
||||
if(UV.x < Left)
|
||||
{
|
||||
ScaledUV.x = UV.x;
|
||||
}
|
||||
else if(UV.x > Right)
|
||||
{
|
||||
ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScaledUV.x = Left + (UV.x - Left) / ratio.x;
|
||||
}
|
||||
|
||||
if(UV.y < Top)
|
||||
{
|
||||
ScaledUV.y = UV.y;
|
||||
}
|
||||
else if(UV.y > Bottom)
|
||||
{
|
||||
ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScaledUV.y = Top + (UV.y - Top) / ratio.y;
|
||||
}
|
||||
|
||||
float4 color = g_Texture.Sample(ClampSampler, ScaledUV);
|
||||
|
||||
Out.vColor = color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 PosTexTechnique11
|
||||
{
|
||||
pass Default
|
||||
@@ -305,4 +367,15 @@ technique11 PosTexTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_UVMult();
|
||||
}
|
||||
|
||||
pass NineSlice
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_NineSlice();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -304,9 +304,6 @@ PS_OUT PS_MAIN_TEST(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
technique11 DefaultTechnique
|
||||
{
|
||||
pass Default
|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -129,6 +129,12 @@
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<FxCompile>
|
||||
<ShaderType>Effect</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile>
|
||||
<ShaderModel>5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
@@ -172,6 +178,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Effect_Editor.h" />
|
||||
<ClInclude Include="..\Public\EditEffect.h" />
|
||||
<ClInclude Include="..\Public\Information.h" />
|
||||
<ClInclude Include="..\public\Level_MapViewer.h" />
|
||||
<ClInclude Include="..\Public\LoadingWidget.h" />
|
||||
<ClInclude Include="..\public\MapContainer.h" />
|
||||
@@ -189,8 +196,6 @@
|
||||
<ClInclude Include="..\Public\EffectObject.h" />
|
||||
<ClInclude Include="..\Public\DummyRect.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Cube.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Goblin.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Goblin_Head.h" />
|
||||
<ClInclude Include="..\Public\Editor_Define.h" />
|
||||
<ClInclude Include="..\Public\Editor_Macro.h" />
|
||||
<ClInclude Include="..\Public\Editor_Struct.h" />
|
||||
@@ -239,6 +244,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Effect_Editor.cpp" />
|
||||
<ClCompile Include="..\Private\EditEffect.cpp" />
|
||||
<ClCompile Include="..\Private\Information.cpp" />
|
||||
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
||||
<ClCompile Include="..\Private\LoadingWidget.cpp" />
|
||||
<ClCompile Include="..\private\MapContainer.cpp" />
|
||||
@@ -256,7 +262,6 @@
|
||||
<ClCompile Include="..\Private\EffectObject.cpp" />
|
||||
<ClCompile Include="..\Private\DummyRect.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Hair.cpp" />
|
||||
<ClCompile Include="..\Private\Loader.cpp" />
|
||||
<ClCompile Include="..\Private\Level_EffectViewer.cpp" />
|
||||
@@ -265,7 +270,6 @@
|
||||
<ClCompile Include="..\private\Loading_Panel.cpp" />
|
||||
<ClCompile Include="..\private\MiniMap_Panel.cpp" />
|
||||
<ClCompile Include="..\private\MiniMap_TrimBorder.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Goblin_Head.cpp" />
|
||||
<ClCompile Include="..\Private\Head.cpp" />
|
||||
<ClCompile Include="..\private\Mission_Panel.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Loading.cpp" />
|
||||
|
||||
@@ -67,12 +67,6 @@
|
||||
<Filter Include="50.UI\Mouse_Cursor">
|
||||
<UniqueIdentifier>{b5d188ff-5925-40bd-8da4-2ed00c89f730}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummy_Goblin">
|
||||
<UniqueIdentifier>{0ebb9c08-69b0-49b6-bac3-c827ca13319a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head">
|
||||
<UniqueIdentifier>{69af10ea-e8f1-4455-9435-93857b7eb198}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\ModelParts">
|
||||
<UniqueIdentifier>{a04e88c3-dabb-4a91-8b9f-ce7f5562def6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -255,18 +249,12 @@
|
||||
<ClInclude Include="..\public\Mouse_Cursor.h">
|
||||
<Filter>50.UI\Mouse_Cursor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Goblin.h">
|
||||
<Filter>02.GameObjects\Dummy_Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_ObjectViewer.h">
|
||||
<Filter>01.Level\20.ObjectViewer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Cube.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyCube</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Goblin_Head.h">
|
||||
<Filter>02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Body.h">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClInclude>
|
||||
@@ -408,6 +396,9 @@
|
||||
<ClInclude Include="..\public\DummySkyBox.h">
|
||||
<Filter>02.GameObjects\Dummys\DummySkyBox</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Information.h">
|
||||
<Filter>03.Information</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\MainLight.h">
|
||||
<Filter>02.GameObjects\MainLight</Filter>
|
||||
</ClInclude>
|
||||
@@ -451,18 +442,12 @@
|
||||
<ClCompile Include="..\private\Mouse_Cursor.cpp">
|
||||
<Filter>50.UI\Mouse_Cursor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Goblin.cpp">
|
||||
<Filter>02.GameObjects\Dummy_Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Level_ObjectViewer.cpp">
|
||||
<Filter>01.Level\20.ObjectViewer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Cube.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyCube</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Goblin_Head.cpp">
|
||||
<Filter>02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Body.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClCompile>
|
||||
@@ -610,6 +595,9 @@
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummySkyBox</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Information.cpp">
|
||||
<Filter>03.Information</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\MainLight.cpp">
|
||||
<Filter>02.GameObjects\MainLight</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Shader.h"
|
||||
|
||||
@@ -95,6 +95,9 @@ HRESULT CDebugCamera::Initialize(void* pArg)
|
||||
m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f));
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
#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->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();
|
||||
|
||||
//m_pShaderCom->Bind_SRV("g_NormalTexture", nullptr);
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (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 CDummy_Goblin::Ready_Components()
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_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;
|
||||
|
||||
m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) {
|
||||
// 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()
|
||||
{
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_Goblin_Head.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
|
||||
CDummy_Goblin_Head::CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_Goblin_Head::CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pOwner->Get_Component<CModel>()->Play_Animation(fTimeDelta);
|
||||
m_pModelCom->Play_Animation(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::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_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
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 CDummy_Goblin_Head::Ready_Components()
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinHead_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;
|
||||
|
||||
m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::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;
|
||||
}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_Goblin_Head* CDummy_Goblin_Head::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_Goblin_Head");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_Goblin_Head::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_Goblin_Head");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -43,8 +43,9 @@ void CDummy_PhysXBox::Update(_float fTimeDelta)
|
||||
|
||||
void CDummy_PhysXBox::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
//_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXBox::Render()
|
||||
@@ -53,26 +54,21 @@ HRESULT CDummy_PhysXBox::Render()
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
|
||||
//_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//for (_uint i = 0; i < iNumMeshes; i++)
|
||||
//{
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// if (FAILED(m_pModelCom->Render(i))) {
|
||||
// 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;
|
||||
@@ -91,39 +87,40 @@ HRESULT CDummy_PhysXBox::Ready_Components(void* pArg)
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.tRigidDynamicDesc.bIsKinematic = false;
|
||||
Desc.tRigidDynamicDesc.fDensity = 1000.f;
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pActor = m_pGameInstance->Add_DynamicActor(*m_pRigidBody);
|
||||
if (nullptr == m_pActor) {
|
||||
assert(false);
|
||||
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_PhysXBox::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_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;
|
||||
//}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -158,8 +155,8 @@ void CDummy_PhysXBox::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
//SAFE_RELEASE(m_pModelCom);
|
||||
//SAFE_RELEASE(m_pShaderCom);
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXBox::Describe_Entity()
|
||||
|
||||
@@ -34,32 +34,6 @@ HRESULT CDummy_PhysXMesh::Initialize(void* pArg)
|
||||
|
||||
void CDummy_PhysXMesh::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F2)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes("../Bin/Resources/Models/River/River.bin");
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXMesh::Update(_float fTimeDelta)
|
||||
|
||||
@@ -16,29 +16,32 @@ CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& 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_W)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f));
|
||||
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_A)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f));
|
||||
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_S)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f));
|
||||
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_D)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f));
|
||||
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_SPACE)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f));
|
||||
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_Pressing(DIK_C)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f));
|
||||
}
|
||||
//m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY, 0.f, 0.f));
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -52,34 +55,25 @@ void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
//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;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//m_pShaderCom->Bind_SRV("g_NormalTexture", nullptr);
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
//if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -104,9 +98,16 @@ HRESULT CDummy_PhysXPlayable::Initialize(void* pArg)
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
CTransform::TRANSFORM_DESC TransformDesc{};
|
||||
TransformDesc.fRadius = 100.f;
|
||||
TransformDesc.fRotationPerSec = XMConvertToRadians(60.f);
|
||||
TransformDesc.fSpeedPerSec = 30.f;
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PlayableSTARTPOS_DESC* pDesc = static_cast<PlayableSTARTPOS_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);
|
||||
{
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
@@ -116,22 +117,24 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.tCapsuleInfo.fRadius = 1.5f;
|
||||
Desc.tCapsuleInfo.fHeight = 3.0f;
|
||||
Desc.tCapsuleInfo.fRadius = 0.5f;
|
||||
Desc.tCapsuleInfo.fHeight = 1.0f;
|
||||
Desc.tCapsuleInfo.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
//m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,11 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
m_bElementFadeOut = static_cast<CElementObject*>(m_pElementObject)->Get_FadeOut();
|
||||
m_fAlphaTime = static_cast<CElementObject*>(m_pElementObject)->Get_AlphaTime();
|
||||
m_UV = static_cast<CElementObject*>(m_pElementObject)->Get_UV();
|
||||
|
||||
m_fLeft = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Left();
|
||||
m_fRight = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Right();
|
||||
m_fTop = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Top();
|
||||
m_fBottom = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Bottom();
|
||||
}
|
||||
GUI::Begin("Current_PanelObject_Info");
|
||||
if (m_pGamePlay_Canvas != nullptr)
|
||||
@@ -306,6 +311,7 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate_float(m_fSizeXY);
|
||||
}
|
||||
|
||||
GUI::Text("Time");
|
||||
if (GUI::DragFloat("EndTime", &m_fEndTime, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fEndTime);
|
||||
@@ -326,6 +332,7 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_AlphaTime(m_fAlphaTime);
|
||||
}
|
||||
|
||||
GUI::Text("UV");
|
||||
if (GUI::DragFloat("U", &m_UV.x, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_U(m_UV.x);
|
||||
@@ -335,6 +342,28 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_V(m_UV.y);
|
||||
}
|
||||
|
||||
GUI::Text("Nine_Slice");
|
||||
if (GUI::DragFloat("Left", &m_fLeft, 0.1f, 0, m_fSize.x))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Left(m_fLeft);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("Right", &m_fRight, 0.1f,0.5f, m_fSize.x))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Right(m_fRight);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("Top", &m_fTop, 0.1f, 0, m_fSize.y))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Top(m_fTop);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("Bottom", &m_fBottom, 0.1f,0, m_fSize.y))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Bottom(m_fBottom);
|
||||
}
|
||||
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "Information.h"
|
||||
|
||||
IMPLEMENT_SINGLETON(CInformation)
|
||||
|
||||
|
||||
HRESULT CInformation::Initialize_Info(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContext;
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInformation::Release_Info()
|
||||
{
|
||||
if (nullptr == s_pInstance) {
|
||||
return S_OK;
|
||||
}
|
||||
DestroyInstance();
|
||||
|
||||
//SAFE_RELEASE();
|
||||
//SAFE_RELEASE();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_bool CInformation::strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents)
|
||||
{
|
||||
assert(iCurrentIndex < contents.size());
|
||||
assert(iCurrentIndex >= 0);
|
||||
return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char*
|
||||
{
|
||||
auto vec = static_cast<vector<_string>*>(data);
|
||||
return (*vec)[iIndex].c_str();
|
||||
}, &contents, (_int)(contents.size())
|
||||
);
|
||||
}
|
||||
|
||||
_bool CInformation::wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents)
|
||||
{
|
||||
assert(iCurrentIndex < contents.size());
|
||||
assert(iCurrentIndex >= 0);
|
||||
return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char*
|
||||
{
|
||||
auto vec = static_cast<vector<_wstring>*>(data);
|
||||
return CMyTools::ToString((*vec)[iIndex]).c_str();
|
||||
}, &contents, (_int)(contents.size())
|
||||
);
|
||||
}
|
||||
|
||||
void CInformation::Log_Render()
|
||||
{
|
||||
GUI::Begin("Log");
|
||||
GUI::Text(m_strLog.c_str());
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CInformation::Log_Push(const _char* pContents)
|
||||
{
|
||||
m_strLog.append(_string("\n") + pContents);
|
||||
}
|
||||
|
||||
void CInformation::Log_Clear()
|
||||
{
|
||||
m_strLog.clear();
|
||||
}
|
||||
|
||||
CInformation::CInformation()
|
||||
{
|
||||
}
|
||||
|
||||
void CInformation::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_EffectViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -47,7 +47,7 @@ void CLevel_EffectViewer::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_EffectViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -63,6 +63,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_ObjectViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -11,8 +11,11 @@
|
||||
#include "Layer.h"
|
||||
#include "GameObject.h"
|
||||
#include "DummyObject.h"
|
||||
|
||||
#include "DummySkyBox.h"
|
||||
#include "MainLight.h"
|
||||
|
||||
|
||||
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
@@ -47,12 +50,14 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
||||
|
||||
Show_AnimList();
|
||||
|
||||
Object_Setting();
|
||||
Dummy_Object_Setting();
|
||||
|
||||
Parts_Object_Setting();
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("¿ÀºêÁ§Æ® ·¹º§ÀÔ´Ï´Ù"));
|
||||
SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다"));
|
||||
//GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -77,19 +82,20 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
if (GUI::BeginTabBar("##MaleTabBar"))
|
||||
{
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
{
|
||||
Category_PartsModelList("Human/Head/Male", "Head");
|
||||
Category_PartsModelList("Human/Body/Male", "Body");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
|
||||
_bool bDisabled = {};
|
||||
if (m_HumanRoot)
|
||||
bDisabled = (m_HumanRoot->Get_MainModel());
|
||||
if (!bDisabled) GUI::BeginDisabled();
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
{
|
||||
Category_PartsModelList("Human/Body/Male", "Body");
|
||||
Category_PartsModelList("Human/Head/Male", "Head");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
@@ -98,6 +104,9 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
Category_PartsModelList("Human/Hair/Male", "Hair");
|
||||
|
||||
if (m_HumanRoot)
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
if (!bDisabled) GUI::EndDisabled();
|
||||
@@ -110,19 +119,20 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
if (GUI::BeginTabBar("##FeMaleTabBar"))
|
||||
{
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
{
|
||||
Category_PartsModelList("Human/Head/FeMale", "Head");
|
||||
Category_PartsModelList("Human/Body/FeMale", "Body");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
|
||||
_bool bDisabled = {};
|
||||
if (m_HumanRoot)
|
||||
bDisabled = (m_HumanRoot->Get_MainModel());
|
||||
if (!bDisabled) GUI::BeginDisabled();
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
{
|
||||
Category_PartsModelList("Human/Body/FeMale", "Body");
|
||||
Category_PartsModelList("Human/Head/FeMale", "Head");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
@@ -131,6 +141,9 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
Category_PartsModelList("Human/Hair/FeMale", "Hair");
|
||||
|
||||
if (m_HumanRoot)
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
if (!bDisabled) GUI::EndDisabled();
|
||||
@@ -150,6 +163,8 @@ void CLevel_ObjectViewer::Show_ModelFilePath()
|
||||
Category_ModelList("Monster");
|
||||
|
||||
Category_ModelList("Human");
|
||||
|
||||
Category_ModelList("Object");
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
GUI::End();
|
||||
@@ -215,8 +230,6 @@ void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _
|
||||
{
|
||||
if (GUI::Button(szCategory))
|
||||
{
|
||||
Save_LayerName(Layer);
|
||||
|
||||
CGameObject* pTempObject = { nullptr };
|
||||
|
||||
CDummyObject::PARTS_OBJECT_DESC Desc = {};
|
||||
@@ -226,10 +239,10 @@ void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _
|
||||
m_HumanRoot->Set_ModelName(szCategory);
|
||||
|
||||
_uint iIndex = 0;
|
||||
if (strstr(szCategory,"Head"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HEAD);
|
||||
else if (strstr(szCategory,"Body"))
|
||||
if (strstr(szCategory,"Body"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::BODY);
|
||||
else if (strstr(szCategory,"Head"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HEAD);
|
||||
else if (strstr(szCategory,"Hair"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR);
|
||||
|
||||
@@ -251,6 +264,7 @@ void CLevel_ObjectViewer::Show_AnimList()
|
||||
if (GUI::Button(pModel->Get_AnimList(i)))
|
||||
{
|
||||
pModel->Set_AnimationIndex(i);
|
||||
pModel->Set_CurrentTrackPosition(0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +296,7 @@ void CLevel_ObjectViewer::Show_ObjectList()
|
||||
}
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Object_Setting()
|
||||
void CLevel_ObjectViewer::Dummy_Object_Setting()
|
||||
{
|
||||
GUI::Begin("Object_Info");
|
||||
if (!m_Objects.empty())
|
||||
@@ -309,15 +323,20 @@ void CLevel_ObjectViewer::Object_Setting()
|
||||
}
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Parts_Object_Setting()
|
||||
{
|
||||
GUI::Begin("PartsObject_Info");
|
||||
if (m_HumanRoot)
|
||||
{
|
||||
CModel* pModel = m_HumanRoot->Get_MainModel();
|
||||
if (pModel)
|
||||
{
|
||||
_float AnimTrack = pModel->Get_CurrentTrackPosition();
|
||||
GUI::DragFloat("AnimTrack", &AnimTrack);
|
||||
GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex()));
|
||||
|
||||
_float KeyFrame = pModel->Get_CurrentTrackPosition();
|
||||
GUI::DragFloat("KeyFrame", &KeyFrame);
|
||||
|
||||
_float AnimSpeed = pModel->Get_AnimSpeed();
|
||||
GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f);
|
||||
@@ -329,36 +348,64 @@ void CLevel_ObjectViewer::Object_Setting()
|
||||
pModel->Set_PlayAnim(bPlayAnim);
|
||||
}
|
||||
|
||||
if (GUI::Button("Add Event"))
|
||||
if (GUI::Button("Load KeyFrame"))
|
||||
{
|
||||
m_fAnimFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
||||
Load_KeyFrame();
|
||||
}
|
||||
|
||||
GUI::DragFloat("Anim Frame", &m_fAnimFrame);
|
||||
GUI::SameLine();
|
||||
if(GUI::Button("Event"))
|
||||
{
|
||||
static _char EventName[64] = {};
|
||||
|
||||
GUI::InputText("EventName", EventName, sizeof(EventName));
|
||||
GUI::SameLine();
|
||||
|
||||
if (GUI::Button("Save KeyFrame"))
|
||||
{
|
||||
if (m_HumanRoot && m_HumanRoot->Get_MainModel())
|
||||
{
|
||||
_float fKeyFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
||||
m_KeyFrame.push_back(fKeyFrame);
|
||||
m_Events.emplace_back(EventName);
|
||||
|
||||
FILE* fp = nullptr;
|
||||
fopen_s(&fp, "../Bin/Resources/Models/KeyFrame.bin", "wb");
|
||||
if (!fp) return;
|
||||
|
||||
_uint KeyFrameSize = (_uint)m_KeyFrame.size();
|
||||
|
||||
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
||||
|
||||
for (size_t i = 0; i < m_KeyFrame.size(); i++)
|
||||
{
|
||||
_uint EventSize = (_uint)m_Events[i].size();
|
||||
fwrite(&m_KeyFrame[i], sizeof(_float), 1, fp);
|
||||
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
||||
fwrite(&m_Events[i], sizeof(_string), 1, fp);
|
||||
}
|
||||
|
||||
|
||||
fclose(fp);
|
||||
|
||||
EventName[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_KeyFrame.size(); ++i)
|
||||
{
|
||||
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||
float scale = 50.f;
|
||||
|
||||
draw->AddLine(center, ImVec2(center.x + scale, center.y), IM_COL32(255, 0, 0, 255), 2.0f);
|
||||
draw->AddLine(center, ImVec2(center.x, center.y - scale), IM_COL32(0, 255, 0, 255), 2.0f);
|
||||
draw->AddLine(center, ImVec2(center.x + scale * 0.5f, center.y + scale * 0.5f), IM_COL32(0, 0, 255, 255), 2.0f);
|
||||
GUI::DragFloat(m_Events[i].c_str(), &m_KeyFrame[i]);
|
||||
}
|
||||
|
||||
|
||||
if (GUI::Button("Delete"))
|
||||
{
|
||||
m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Root"))->Clear_Layer();
|
||||
m_HumanRoot = nullptr;
|
||||
m_KeyFrame.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_HumanRoot)
|
||||
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
@@ -387,6 +434,30 @@ _wchar* CLevel_ObjectViewer::Save_ModelName(const _char* Category)
|
||||
return m_wszName;
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Load_KeyFrame()
|
||||
{
|
||||
FILE* fp = nullptr;
|
||||
fopen_s(&fp, "../Bin/Resources/Models/KeyFrame.bin", "rb");
|
||||
if (!fp) return;
|
||||
|
||||
_uint KeyFameSize = {};
|
||||
_uint EventLen = {};
|
||||
|
||||
fread(&KeyFameSize, sizeof(_uint), 1, fp);
|
||||
|
||||
for (size_t i = 0; i < KeyFameSize; i++)
|
||||
{
|
||||
fread(&m_fKeyFrame, sizeof(_float), 1, fp);
|
||||
fread(&EventLen, sizeof(_uint), 1, fp);
|
||||
fread(&m_strEvent, sizeof(_string), 1, fp);
|
||||
|
||||
m_Events.push_back(m_strEvent);
|
||||
m_KeyFrame.push_back(m_fKeyFrame);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
@@ -396,6 +467,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CameraDesc.vEye = _float3(0.f, 30.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
@@ -421,7 +493,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_PhysXLab.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -25,7 +25,7 @@ void CLevel_PhysXLab::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_PhysXLab::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("PhysXEditor·¹º§ÀÔ´Ï´Ù"));
|
||||
SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -63,10 +63,11 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 5000.f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 2.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
@@ -90,24 +91,24 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
{
|
||||
//for (int i = 0; i < 50; ++i) {
|
||||
// CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
|
||||
// Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
|
||||
// Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
|
||||
for (int i = 0; i < 50; ++i) {
|
||||
CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
|
||||
Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
|
||||
Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
|
||||
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//{
|
||||
// CDummy_PhysXPlayable::BOXSTARTPOS_DESC Desc{};
|
||||
// Desc.vPos = { 0.f, 10.f, 0.f };
|
||||
// Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
CDummy_PhysXPlayable::PlayableSTARTPOS_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 100.f, 0.f };
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
//{
|
||||
// CDummy_PhysXMesh::BOXSTARTPOS_DESC Desc{};
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "Head.h"
|
||||
#include "Body.h"
|
||||
#include "Hair.h"
|
||||
#include "Dummy_Goblin.h"
|
||||
#include "DummySkyBox.h"
|
||||
#include "DummyObject.h"
|
||||
#include <filesystem>
|
||||
@@ -247,41 +246,42 @@ HRESULT CLoader::Loading_For_UI()
|
||||
|
||||
m_strMessage = TEXT("Texture Loading..");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Keyboard"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Keyboard/Keyboard_%d.png"), 10)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LodingWidget1"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Mission", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Border"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Border.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Key"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Key.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Finishi_Rect"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Finishi_Rect.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Main"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Mission_Main.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Mission_Icon"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/Mission_Icon_%d.png"), 2)))) {
|
||||
@@ -303,6 +303,22 @@ HRESULT CLoader::Loading_For_UI()
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Loading", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
@@ -506,23 +522,23 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
|
||||
{
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
Desc.tRigidDynamicDesc.bExclusive = false;
|
||||
Desc.tRigidDynamicDesc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f };
|
||||
Desc.tRigidDynamicDesc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.tRigidDynamicDesc.ePxShapeFlag = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
|
||||
{
|
||||
Desc.eType = ACTOR::BOX;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f };
|
||||
Desc.fDensity = 10.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"),
|
||||
// //CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
// CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
// 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;
|
||||
}
|
||||
@@ -537,17 +553,17 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
|
||||
//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.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_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;
|
||||
}
|
||||
|
||||
#ifdef 기무리
|
||||
vector<_wstring> ModelPrototypeTags = {};
|
||||
vector<filesystem::path> ModelPrototypePath = {};
|
||||
|
||||
//for (const auto& file : filesystem::directory_iterator("..\\Bin\\Resources\\Models\\MapMesh"))
|
||||
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\Hogwart\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
|
||||
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
|
||||
{
|
||||
if (file.is_directory()){
|
||||
continue;
|
||||
@@ -574,19 +590,29 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
}
|
||||
|
||||
ModelPrototypeTags.push_back(strFileName);
|
||||
ModelPrototypePath.push_back(file.path());
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
{ /* cache rigidbody */ // More Info In 리지드바디, CCT, 엔진이넘
|
||||
ModelPrototypePath.push_back(file.path());
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
Desc.tRigidStaticDesc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{ // basic static RIGIDBODY
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))){
|
||||
return E_FAIL;
|
||||
@@ -719,16 +745,9 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Hair1_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinHead_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/GoblinHead.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/GoblinBody.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
#pragma region MONSTER
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
@@ -738,6 +757,21 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Dragon_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0005f, 0.0005f, 0.0005f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_SkyboxModel */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity()))))
|
||||
@@ -773,8 +807,8 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummyObject>(g_iStaticLevel, CDummyObject::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Dummy_Cube */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext))))
|
||||
/* For.Prototype_GameObject_DummySkyBox */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
@@ -837,12 +871,19 @@ HRESULT CLoader::Loading_For_MapViewer()
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
Desc.tRigidStaticDesc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,22 +284,21 @@ void CMapObject_LOD::Describe_Entity()
|
||||
GUI::SameLine();
|
||||
if (GUI::Button("Bake!!!")) {
|
||||
CMapObject_Manager* pManager = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_MAPOBJECTMANAGER)->Get_Object<CMapObject_Manager>();
|
||||
for (_uint i = 0; i < (_uint)m_ModelPrototypeTags.size(); ++i) {
|
||||
for (_uint i = 0; i < (_uint)m_ModelPathIndices.size(); ++i) {
|
||||
filesystem::path filePath = pManager->Get_PrototypePath(m_ModelPathIndices[i]);
|
||||
|
||||
CModel* pModel = m_pModelComs[i];
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes(filePath.string().c_str());
|
||||
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
Desc.szMeshName = strDestName.c_str();
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), nullptr, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "MapObject_Manager.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -374,7 +374,7 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
|
||||
#pragma endregion
|
||||
|
||||
|
||||
// 저장
|
||||
// ?ú?å
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
MSG_BOX("Failed to Save File");
|
||||
}
|
||||
@@ -451,7 +451,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
|
||||
|
||||
for (_uint i = 0; i < pMapObject->Get_LodLevel() + 1; ++i)
|
||||
{
|
||||
// <PrototypeTag>텍스트</PrototypeTag>
|
||||
// <PrototypeTag>ÅØ½ºÆ®</PrototypeTag>
|
||||
tinyxml2::XMLElement* proto = doc.NewElement("PrototypeTag");
|
||||
proto->SetText(CMyTools::ToString(pMapObject->Get_PrototypeTag(i)).c_str());
|
||||
PartObject->InsertEndChild(proto);
|
||||
@@ -498,7 +498,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
|
||||
m_pSelectObject = nullptr;
|
||||
#pragma endregion
|
||||
|
||||
// 저장
|
||||
// ?ú?å
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
MSG_BOX("Failed to Save File");
|
||||
}
|
||||
@@ -1117,4 +1117,4 @@ void CMapObject_Manager::Free()
|
||||
|
||||
void CMapObject_Manager::Describe_Entity()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,13 +254,11 @@ void CMapObject_Static::Describe_Entity()
|
||||
_uint iNumMesh = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = m_pModelCom->Get_MeshName(i);
|
||||
Desc.szMeshName = _string(m_pModelCom->Get_MeshName(i) + to_string(i)).c_str();
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(m_pModelCom->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(Desc.szMeshName).c_str(), nullptr, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ HRESULT CMissionBanner_Border::Initialize(void* pArg)
|
||||
|
||||
Desc.fX = -248.f;
|
||||
Desc.fY = 100.f;
|
||||
Desc.fSizeX = 480.f;
|
||||
Desc.fSizeY = 240.f;
|
||||
Desc.fSizeX = 256.f;
|
||||
Desc.fSizeY = 128.f;
|
||||
|
||||
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
|
||||
|
||||
@@ -110,7 +110,7 @@ HRESULT CMissionBanner_Border::Render()
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::UVMULT)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
|
||||
@@ -170,6 +170,18 @@ HRESULT CMissionBanner_Border::Bind_ShaderResources()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_fCurrent_Posigion, sizeof(_float2))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ HRESULT CMission_KeyHold::Initialize(void* pArg)
|
||||
m_fTimeMult = 1.f;
|
||||
m_fAlpha = 1.f;
|
||||
m_fAlphaTime = 3.f;
|
||||
m_fPI = AI_MATH_TWO_PI_F;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -159,7 +160,11 @@ HRESULT CMission_KeyHold::Bind_ShaderResources()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float))))
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fTimeMult", &m_fTimeMult, sizeof(_float))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fPI", &m_fPI, sizeof(_float))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ HRESULT CModelParts::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,17 +101,18 @@ void CRootModelPart::Change_Model(_uint iIndex)
|
||||
pModel->Set_CurrentTrackPosition(m_fTrackPosition);
|
||||
pModel->Play_Animation(0.f);
|
||||
|
||||
|
||||
if (iIndex == ENUM_CLASS(PARTSTYPE::HEAD))
|
||||
if (iIndex == ENUM_CLASS(PARTSTYPE::BODY))
|
||||
{
|
||||
Set_MainModel(m_ModelParts[iIndex]->Get_Component<CModel>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
m_pMainModel->Set_AnimationIndex(iAnimIndex);
|
||||
|
||||
m_pMainModel->Set_CurrentTrackPosition(0.f);
|
||||
m_pMainModel->Play_Animation(0.f);
|
||||
for (auto& PartObject : m_ModelParts)
|
||||
{
|
||||
CModel* pModel = PartObject->Get_Component<CModel>();
|
||||
@@ -119,6 +120,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex());
|
||||
pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition());
|
||||
pModel->Play_Animation(0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,12 +141,12 @@ HRESULT CRootModelPart::Ready_PartObjects()
|
||||
|
||||
CModelParts* pModelPartsObject = { nullptr };
|
||||
|
||||
if (FAILED(Add_PartObject<CHead>("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHead**>(&pModelPartsObject), &PartsDesc)))
|
||||
if (FAILED(Add_PartObject<CBody>("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CBody**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
if (FAILED(Add_PartObject<CBody>("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CBody**>(&pModelPartsObject), &PartsDesc)))
|
||||
if (FAILED(Add_PartObject<CHead>("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHead**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#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 };
|
||||
_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 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
|
||||
@@ -1,47 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_Goblin_Head final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype);
|
||||
virtual ~CDummy_Goblin_Head() = 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 CDummy_Goblin_Head* 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
|
||||
@@ -33,8 +33,8 @@ class CDummy_PhysXBox final : public CGameObject
|
||||
private:
|
||||
CRigidBody* m_pRigidBody = { nullptr };
|
||||
const PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
//CModel* m_pModelCom = { nullptr };
|
||||
//CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -14,11 +14,11 @@ NS_BEGIN(Editor)
|
||||
class CDummy_PhysXPlayable final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagBoxStartPos
|
||||
typedef struct tagPlayableStartPos
|
||||
{
|
||||
_float3 vPos = {};
|
||||
_float3 vRotRPY = {};
|
||||
}BOXSTARTPOS_DESC;
|
||||
}PlayableSTARTPOS_DESC;
|
||||
private:
|
||||
CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Editor
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR ,END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, NINECLICE , END };
|
||||
}
|
||||
|
||||
using namespace Editor;
|
||||
|
||||
@@ -46,6 +46,12 @@ class CIMGUIUI final : public CGameObject
|
||||
_float m_fAlpha{};
|
||||
_float2 m_UV{};
|
||||
|
||||
_float m_fLeft{};
|
||||
_float m_fRight{};
|
||||
_float m_fTop{};
|
||||
_float m_fBottom{};
|
||||
_float4 m_fNineSlice{};
|
||||
|
||||
_float2 m_fPanelPos{};
|
||||
_float2 m_fPanelSize{};
|
||||
_float3 m_fPanelSizeXY{};
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
#include "Editor_Define.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
typedef class CInformation final : public CBase
|
||||
{
|
||||
DECLARE_SINGLETON(CInformation)
|
||||
public:
|
||||
HRESULT Initialize_Info(ID3D11Device* pDevice = nullptr, ID3D11DeviceContext* pContext = nullptr);
|
||||
HRESULT Release_Info();
|
||||
#pragma region WHOLEPART
|
||||
_bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents);
|
||||
_bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents);
|
||||
|
||||
#pragma endregion // Àü¿ª
|
||||
|
||||
#pragma region OBJECTVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MAPVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region EFFECTVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region UIVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region PHYSXVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region COMBINEDVIEWER
|
||||
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
#pragma region LOG
|
||||
void Log_Render();
|
||||
void Log_Push(const _char* pContents);
|
||||
void Log_Clear();
|
||||
#pragma endregion
|
||||
|
||||
private:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
class CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
_string m_strLog = {};
|
||||
|
||||
|
||||
private:
|
||||
CInformation();
|
||||
virtual ~CInformation() = default;
|
||||
virtual void Free() override;
|
||||
}INFO;
|
||||
|
||||
NS_END
|
||||
@@ -34,9 +34,12 @@ class CLevel_ObjectViewer final : public CLevel
|
||||
void Category_PartsModelList(const _char* Category, const _char* Layer);
|
||||
void Show_AnimList();
|
||||
void Show_ObjectList();
|
||||
void Object_Setting();
|
||||
void Dummy_Object_Setting();
|
||||
void Parts_Object_Setting();
|
||||
void Save_LayerName(const _char* Layer);
|
||||
_wchar* Save_ModelName(const _char* Category);
|
||||
void Load_KeyFrame();
|
||||
|
||||
|
||||
private:
|
||||
vector<CGameObject*> m_Objects;
|
||||
@@ -44,8 +47,10 @@ class CLevel_ObjectViewer final : public CLevel
|
||||
class CRootModelPart* m_HumanRoot = { nullptr };
|
||||
_int m_iObjectIndex = { 0 };
|
||||
_int m_iPartsObjectIndex = { 0 };
|
||||
|
||||
_float m_fAnimFrame = {};
|
||||
_float m_fKeyFrame = {};
|
||||
vector<_float> m_KeyFrame;
|
||||
vector<_string> m_Events;
|
||||
_string m_strEvent;
|
||||
_char m_szName[MAX_PATH];
|
||||
_wchar m_wszName[MAX_PATH];
|
||||
_wchar m_wszLayer[MAX_PATH];
|
||||
|
||||
@@ -31,6 +31,7 @@ class CMission_KeyHold final : public CElementObject
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
|
||||
_float m_fPI{};
|
||||
|
||||
public:
|
||||
static CMission_KeyHold* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -12,8 +12,7 @@ class CRootModelPart final : public CContainerObject
|
||||
{
|
||||
|
||||
public:
|
||||
enum class PARTSTYPE{HEAD,BODY,HAIR,END};
|
||||
|
||||
enum class PARTSTYPE{ BODY,HEAD,HAIR,END};
|
||||
public:
|
||||
void Set_PrototypeModelName(const _wchar* PrototypeModelName) { m_PrototypeModelName = PrototypeModelName; }
|
||||
void Set_ModelName(const _char* Name) { m_ModelName = Name; }
|
||||
|
||||
@@ -135,6 +135,12 @@
|
||||
call Update_Lib.bat
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<FxCompile>
|
||||
<ShaderType>Effect</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile>
|
||||
<ShaderModel>5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
|
||||
@@ -220,9 +220,6 @@
|
||||
<Filter Include="01.Utility\06.ComputeShader">
|
||||
<UniqueIdentifier>{96600587-16b1-4627-914d-7fc413c501ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Utility\06. Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="99.Define\99.THIRDPARTY\PHYSX">
|
||||
<UniqueIdentifier>{5948985e-f67e-4627-aca4-09b8e9edc359}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -244,6 +241,9 @@
|
||||
<Filter Include="02.Element\01.GameObject\50.UI\ElementObject">
|
||||
<UniqueIdentifier>{1eafb189-2d0c-4ad7-8690-10a517668206}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Utility\06.Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\09.Light">
|
||||
<UniqueIdentifier>{7c82051e-19af-4284-8156-16f504db30b6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -439,7 +439,7 @@
|
||||
<Filter>02.Element\02.Component\06.Model\Instance_Model</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Picking.cpp">
|
||||
<Filter>01.Utility\06. Picking</Filter>
|
||||
<Filter>01.Utility\06.Picking</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp">
|
||||
<Filter>01.Utility\06.ComputeShader</Filter>
|
||||
@@ -1017,7 +1017,7 @@
|
||||
<Filter>01.Utility\06.ComputeShader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Picking.h">
|
||||
<Filter>01.Utility\06. Picking</Filter>
|
||||
<Filter>01.Utility\06.Picking</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\VIBuffer_Terrain.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Terrain</Filter>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Camera.h"
|
||||
|
||||
CCamera::CCamera(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -32,6 +32,7 @@ HRESULT CCamera::Initialize(void* pArg)
|
||||
m_fFar = pDesc->fFar;
|
||||
m_bActive = false;
|
||||
m_iPriority = pDesc->iPriority;
|
||||
m_pCameraKey = pDesc->pCameraKey;
|
||||
m_pFollowTarget = pDesc->pFollowTarget;
|
||||
SAFE_ADDREF(m_pFollowTarget);
|
||||
m_pLookTarget = pDesc->pLookTarget;
|
||||
@@ -81,12 +82,12 @@ void CCamera::Transition(_float fTimeDelta)
|
||||
void CCamera::Active_Camera(pair<_float4, _float3>& pairTransitionInfo)
|
||||
{
|
||||
//if (true == m_bTransitionLerp) {
|
||||
m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(),
|
||||
XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second)));
|
||||
m_fTransitionCurrentTime = 0.f;
|
||||
m_bIsCurrentTransition = true;
|
||||
// m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(),
|
||||
// XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second)));
|
||||
// m_fTransitionCurrentTime = 0.f;
|
||||
// m_bIsCurrentTransition = true;
|
||||
//}
|
||||
//m_bActive = true;
|
||||
m_bActive = true;
|
||||
}
|
||||
|
||||
void CCamera::DeActive_Camera(pair<_float4, _float3>& pairTransition)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Camera_Manager.h"
|
||||
#include "Camera.h"
|
||||
#include "GameInstance.h"
|
||||
@@ -66,6 +66,14 @@ HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CCamera_Manager::Force_CamPosition(_fvector vPos)
|
||||
{
|
||||
if (nullptr == m_pCurrentMainCamera)
|
||||
return;
|
||||
|
||||
m_pCurrentMainCamera->Get_Component<CTransform>()->Set_State(STATE::POSITION, XMVectorSetW(vPos, 1.f));
|
||||
}
|
||||
|
||||
const _float* CCamera_Manager::Get_CurrentCameraFar()
|
||||
{
|
||||
return &m_fFar;
|
||||
@@ -92,9 +100,13 @@ CCamera* CCamera_Manager::Find_Camera(_uint iLevel, const _wstring& wstrCameraKe
|
||||
HRESULT CCamera_Manager::Clear_Cameras(_uint iLevel)
|
||||
{
|
||||
if (nullptr != m_pCurrentMainCamera) {
|
||||
pair<_float4, _float3> pairTransitionInfo = { };
|
||||
m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo);
|
||||
SAFE_RELEASE(m_pCurrentMainCamera);
|
||||
for (pair<const _wstring, CCamera*>& pairCamera : m_Cameras[iLevel]) {
|
||||
if (m_pCurrentMainCamera == pairCamera.second) {
|
||||
pair<_float4, _float3> pairTransitionInfo = { };
|
||||
m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo);
|
||||
SAFE_RELEASE(m_pCurrentMainCamera);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto& iter : m_Cameras[iLevel]) {
|
||||
SAFE_RELEASE(iter.second);
|
||||
|
||||
@@ -144,7 +144,8 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
|
||||
}
|
||||
_matrix BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
|
||||
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix);
|
||||
if(Bones.size()>m_iBoneIndex)
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -13,6 +13,54 @@ CCharacter_Controller::CCharacter_Controller(const CCharacter_Controller& rhs)
|
||||
{
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CCharacter_Controller::Render()
|
||||
{
|
||||
_vector vPos = Get_Position();
|
||||
_float3 vVolume = Get_Volume();
|
||||
_matrix WorldMatrix = XMMatrixTranslationFromVector(vPos);
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
// vVolume = half-extents(Hx,Hy,Hz) 라고 가정
|
||||
const _matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
vVolume.y / 0.5f,
|
||||
vVolume.z / 0.5f);
|
||||
m_pMainShape->Draw(ScaleMatrix * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
_float fHalf = vVolume.y;
|
||||
|
||||
_matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
fHalf / (2.f * 0.5f),
|
||||
vVolume.x / 0.5f);
|
||||
m_pMainShape->Draw(ScaleMatrix * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
|
||||
_matrix ScaleSphereMatrix = XMMatrixScaling(vVolume.x / 0.5f, vVolume.x / 0.5f, vVolume.x / 0.5f);
|
||||
|
||||
_matrix WorldUp = XMMatrixTranslation(0.f, +fHalf * 0.5f, 0.f);
|
||||
_matrix WorldDown = XMMatrixTranslation(0.f, -fHalf * 0.5f, 0.f);
|
||||
|
||||
m_pSubShape->Draw(ScaleSphereMatrix * WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(ScaleSphereMatrix * WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
void CCharacter_Controller::Modify_Volume(_float3 fVolume)
|
||||
{
|
||||
@@ -81,13 +129,13 @@ _float3 CCharacter_Controller::Get_Volume()
|
||||
|
||||
void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
{
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
_vector vMomentum = m_pTransform->Get_CurrentMomentum();
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, vMomentum);
|
||||
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
|
||||
|
||||
// eCOLLISION_SIDES = (1 << 0), //!< Character is colliding to the sides.
|
||||
@@ -111,6 +159,12 @@ void CCharacter_Controller::Set_Position(_fvector vNewPos)
|
||||
m_pController->setPosition(pxLVec3NewPos);
|
||||
}
|
||||
|
||||
_vector CCharacter_Controller::Get_Position()
|
||||
{
|
||||
PSX::PxExtendedVec3 pxVPos = m_pController->getPosition();
|
||||
return XMVectorSet((_float)pxVPos.x, (_float)pxVPos.y, (_float)pxVPos.z, 1.f);
|
||||
}
|
||||
|
||||
_float3 CCharacter_Controller::Get_FootPosition()
|
||||
{
|
||||
PSX::PxExtendedVec3 pxLVecfootPos = m_pController->getFootPosition();
|
||||
@@ -143,21 +197,30 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
Desc.halfSideExtent = {};
|
||||
Desc.halfForwardExtent = {};
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(pDesc->fMaterial);
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_BoxController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false));
|
||||
#endif // _DEBUG
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
PSX::PxCapsuleControllerDesc Desc{};
|
||||
Desc.radius = pDesc->tCapsuleInfo.fRadius;
|
||||
Desc.height = pDesc->tCapsuleInfo.fHeight;
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(pDesc->fMaterial);
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false));
|
||||
#endif // _DEBUG
|
||||
} break;
|
||||
default:
|
||||
assert(false); // PhysX에서 불가능
|
||||
assert(false); // PhysX에서 불가능
|
||||
return E_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ void CElementObject::Update(_float fTimeDelta)
|
||||
0.f, 1.f));
|
||||
|
||||
m_fCurrent_Posigion = XMVectorSet(m_fX, m_fY, 0.f, 1.f);
|
||||
m_vNine_Slice = _float4(m_fLeft, m_fRight, m_fTop, m_fBottom);
|
||||
}
|
||||
|
||||
void CElementObject::Late_Update(_float fTimeDelta)
|
||||
@@ -79,6 +80,46 @@ _bool CElementObject::Chack_Visible()
|
||||
return m_bVisible;
|
||||
}
|
||||
|
||||
void CElementObject::Nine_Slice_Left(_float X)
|
||||
{
|
||||
m_fLeft = X;
|
||||
}
|
||||
|
||||
void CElementObject::Nine_Slice_Right(_float Y)
|
||||
{
|
||||
m_fRight = Y;
|
||||
}
|
||||
|
||||
void CElementObject::Nine_Slice_Top(_float Z)
|
||||
{
|
||||
m_fTop = Z;
|
||||
}
|
||||
|
||||
void CElementObject::Nine_Slice_Bottom(_float W)
|
||||
{
|
||||
m_fBottom = W;
|
||||
}
|
||||
|
||||
_float CElementObject::Get_Nine_Slice_Left()
|
||||
{
|
||||
return m_fLeft;
|
||||
}
|
||||
|
||||
_float CElementObject::Get_Nine_Slice_Right()
|
||||
{
|
||||
return m_fRight;
|
||||
}
|
||||
|
||||
_float CElementObject::Get_Nine_Slice_Top()
|
||||
{
|
||||
return m_fTop;
|
||||
}
|
||||
|
||||
_float CElementObject::Get_Nine_Slice_Bottom()
|
||||
{
|
||||
return m_fBottom;
|
||||
}
|
||||
|
||||
HRESULT CElementObject::Ready_Components(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Prototype_Manager.h"
|
||||
#include "GameObject_Manager.h"
|
||||
@@ -315,23 +315,23 @@ void CGameInstance::Present_TimeCost() const
|
||||
|
||||
float minY = 0.f;
|
||||
float maxY = 0.025f;
|
||||
//float threshold = 166.f / 250.f; // 약 0.664f
|
||||
//float threshold = 166.f / 250.f; // 약 0.664f
|
||||
ImVec2 graph_size(0, 80.0f);
|
||||
ImVec2 start_pos = GUI::GetCursorScreenPos();
|
||||
|
||||
GUI::PlotLines("##FrameCount", values, IM_ARRAYSIZE(values), values_offset,
|
||||
overlay, minY, maxY, ImVec2(0, 80.0f));
|
||||
|
||||
// PlotLines의 실제 표시 영역 가져오기
|
||||
// PlotLines의 실제 표시 영역 가져오기
|
||||
ImVec2 plot_min = GUI::GetItemRectMin();
|
||||
ImVec2 plot_max = GUI::GetItemRectMax();
|
||||
|
||||
// 기준선 (60FPS)
|
||||
float threshold = 1.0f / 60.0f; // 0.0166초
|
||||
// 기준선 (60FPS)
|
||||
float threshold = 1.0f / 60.0f; // 0.0166초
|
||||
float normalized = (threshold - minY) / (maxY - minY);
|
||||
float y = plot_max.y - normalized * (plot_max.y - plot_min.y);
|
||||
|
||||
// 빨간 선 그리기
|
||||
// 빨간 선 그리기
|
||||
ImDrawList* draw_list = GUI::GetWindowDrawList();
|
||||
draw_list->AddLine(
|
||||
ImVec2(plot_min.x, y),
|
||||
@@ -533,6 +533,10 @@ const _float* CGameInstance::Get_CurrentCameraFar()
|
||||
{
|
||||
return m_pCamera_Manager->Get_CurrentCameraFar();
|
||||
}
|
||||
void CGameInstance::Force_CamPosition(_fvector vPos)
|
||||
{
|
||||
return m_pCamera_Manager->Force_CamPosition(vPos);
|
||||
}
|
||||
HRESULT CGameInstance::Ready_Shadow_Light(const SHADOW_LIGHT_DESC& Desc)
|
||||
{
|
||||
return m_pShadow->Ready_Shadow_Light(Desc);
|
||||
@@ -567,9 +571,9 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath)
|
||||
}
|
||||
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3& vMatInfo)
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo)
|
||||
{
|
||||
return m_pPhysX_Manager->Get_Material(vMatInfo);
|
||||
return m_pPhysX_Manager->Create_Material(vMatInfo);
|
||||
}
|
||||
|
||||
void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh)
|
||||
@@ -577,10 +581,6 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr
|
||||
return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh);
|
||||
}
|
||||
|
||||
PSX::PxShape* CGameInstance::Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag)
|
||||
{
|
||||
return m_pPhysX_Manager->Create_Shape(eType, vhalfGeometryInfo, pxMaterial, bExclusive, ePxShapeFlag);
|
||||
}
|
||||
const PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GameObject_Manager.h"
|
||||
|
||||
#include "Layer.h"
|
||||
@@ -15,7 +15,7 @@ HRESULT CGameObject_Manager::Initialize(_uint iNumLevels)
|
||||
m_iNumLevels = iNumLevels;
|
||||
|
||||
m_pLayers = new map<const _wstring, CLayer*>[iNumLevels];
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ HRESULT CGameObject_Manager::Add_GameObject_ToLayer(_uint iLayerLevelIndex, cons
|
||||
|
||||
void CGameObject_Manager::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
Describe_Entity();
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
#endif // _DEBUG
|
||||
@@ -157,3 +158,46 @@ void CGameObject_Manager::Free()
|
||||
|
||||
Safe_Delete_Array(m_pLayers);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGameObject_Manager::Describe_Entity()
|
||||
{
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
|
||||
GUI::Begin("Object_Manager");
|
||||
GUI::Text("Levels : "); GUI::SameLine();
|
||||
if (GUI::BeginTabBar("Levels")) {
|
||||
for (_uint i = 0; i < m_iNumLevels; ++i) {
|
||||
|
||||
if (GUI::BeginTabItem(to_string(i).c_str(), nullptr)) { // Insert Here Level Names
|
||||
GUI::BeginChild("Object_Lists");
|
||||
if (GUI::BeginTabBar("Layers")) {
|
||||
string strlayerName;
|
||||
for (pair< const _wstring, CLayer*>& pairLayer : m_pLayers[i]) {
|
||||
size_t pos = pairLayer.first.find(TEXT("Layer_"));
|
||||
strlayerName = "NOT_STARTED_WITH_Layer_";
|
||||
if (pos != wstring::npos) {
|
||||
strlayerName = CMyTools::ToString(pairLayer.first.c_str() + pos + wcslen(TEXT("Layer_"))).c_str();
|
||||
}
|
||||
if (GUI::BeginTabItem(strlayerName.c_str(), nullptr)) {
|
||||
if (GUI::BeginChild("Items", ImVec2(0, 0), 0, window_flags)) {
|
||||
pairLayer.second->Describe_Entity();
|
||||
GUI::EndChild();
|
||||
}
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
}
|
||||
GUI::EndChild();
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Layer.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CLayer::CLayer()
|
||||
{
|
||||
}
|
||||
|
||||
CLayer::~CLayer()
|
||||
CLayer::CLayer():
|
||||
m_pGameInstance(CGameInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CLayer::Initialize()
|
||||
@@ -89,9 +87,9 @@ void CLayer::Free()
|
||||
for (auto& iter : m_ObjectList)
|
||||
{
|
||||
SAFE_RELEASE(iter);
|
||||
}
|
||||
} m_ObjectList.clear();
|
||||
|
||||
m_ObjectList.clear();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
CLayer* CLayer::Create()
|
||||
@@ -106,3 +104,21 @@ CLayer* CLayer::Create()
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CLayer::Describe_Entity()
|
||||
{
|
||||
_int iIndex = 0;
|
||||
|
||||
for (CGameObject*& iter : m_ObjectList)
|
||||
{
|
||||
GUI::PushID(iter);
|
||||
if (GUI::SmallButton((to_string(iIndex) + " : " + typeid(*iter).name()).c_str())) {
|
||||
m_pGameInstance->Force_CamPosition(iter->Get_WorldPostion() - XMVectorSet(0.f, -1.f, 1.f, 0.f) * 10.f);
|
||||
} iIndex++;
|
||||
GUI::PopID();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -405,85 +405,6 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader, const _char* pConstantName, _uint
|
||||
return pShader->Bind_SRV(pConstantName, m_SRVs[iType][iTextureIndex]);
|
||||
}
|
||||
|
||||
|
||||
HRESULT CMaterial::Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
for (int i = 0; i < AI_TEXTURE_TYPE_MAX; ++i) {
|
||||
_uint iNumSrv = { 0 };
|
||||
if (!ReadFile(hFile, &i, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (!ReadFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (iNumSrv == 0) {
|
||||
continue;
|
||||
}
|
||||
m_SRVs[i].reserve(iNumSrv);
|
||||
|
||||
ID3D11ShaderResourceView* pSRV = { nullptr };
|
||||
HRESULT hr = {};
|
||||
|
||||
for (_uint j = 0; j < iNumSrv; ++j) {
|
||||
_uint strLength = { 0 };
|
||||
if (!ReadFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_char szTextureName[MAX_PATH] = {};
|
||||
if (!ReadFile(hFile, szTextureName, strLength, &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_char szTextureDir[MAX_PATH] = {};
|
||||
_char szDrive[MAX_PATH] = {};
|
||||
_char szDir[MAX_PATH] = {};
|
||||
_splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, nullptr, 0, nullptr, 0);
|
||||
strcpy_s(szTextureDir, sizeof(_char) * MAX_PATH, szDrive);
|
||||
strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szDir);
|
||||
strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szTextureName);
|
||||
|
||||
|
||||
{
|
||||
_char szTextureFileName[MAX_PATH] = {};
|
||||
_char szTextureFilePath[MAX_PATH] = {};
|
||||
_char szDrive[MAX_PATH] = {};
|
||||
_char szDir[MAX_PATH] = {};
|
||||
_char szFileName[MAX_PATH] = {};
|
||||
_char szEXT[MAX_PATH] = {};
|
||||
_splitpath_s(szTextureDir, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, szEXT, MAX_PATH);
|
||||
strcpy_s(szTextureFileName, szDrive);
|
||||
strcat_s(szTextureFileName, szDir);
|
||||
strcat_s(szTextureFileName, szFileName);
|
||||
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, ".dds");
|
||||
|
||||
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고
|
||||
if (FAILED(hr)) {
|
||||
memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, szEXT);
|
||||
|
||||
if (false == strcmp(".tga", szEXT)) {
|
||||
assert(false); // trying to Load TGA
|
||||
hr = S_OK;
|
||||
}
|
||||
else {
|
||||
hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (FAILED(hr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_SRVs[i].push_back(pSRV);
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _SaveMaterial)
|
||||
{
|
||||
for (size_t type = 0; type < 27; type++)
|
||||
@@ -524,19 +445,6 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte) {
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pModelFilePath, hFile, dwByte)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMaterial");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const SaveMaterial& _SaveMaterial)
|
||||
{
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
@@ -607,7 +607,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _fmatrix WorldMatrix)
|
||||
PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix)
|
||||
{
|
||||
PSX::PxTriangleMeshDesc tMeshDesc = {};
|
||||
vector<PSX::PxVec3> Vertices = {};
|
||||
@@ -616,7 +616,7 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
|
||||
tMeshDesc.points.count = m_iNumVertices;
|
||||
tMeshDesc.points.stride = sizeof(PSX::PxVec3);
|
||||
Vertices.resize(m_iNumVertices);
|
||||
XMVector3TransformCoordStream(reinterpret_cast<_float3*>(Vertices.data()), sizeof(PSX::PxVec3), (_float3*)m_pVertexPositions, sizeof(_float3), m_iNumVertices, WorldMatrix);
|
||||
memcpy(Vertices.data(), m_pVertexPositions, sizeof(PSX::PxVec3) * m_iNumVertices);
|
||||
tMeshDesc.points.data = Vertices.data();
|
||||
}
|
||||
{
|
||||
|
||||
@@ -351,7 +351,7 @@ HRESULT CModel::Ready_PhysXMeshes()
|
||||
|
||||
m_TriMeshes.reserve(m_iNumMeshes);
|
||||
|
||||
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes, m_pTransform->Get_XMWorldMatrix());
|
||||
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ HRESULT CModel::Save_PhysXTriMeshes(const _char* pModelFilePath)
|
||||
return E_FAIL;
|
||||
}
|
||||
for (_uint i = 0; i < m_iNumMeshes; ++i) {
|
||||
m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]);
|
||||
m_pGameInstance->RegistTriMesh((m_Meshes[i]->Get_Name() + to_string(i)).c_str(), m_TriMeshes[i]);
|
||||
}
|
||||
return m_pGameInstance->SaveTriMeshes(pModelFilePath, m_TriMeshes);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
if (!file.is_open())
|
||||
{
|
||||
//MSG_BOX("Failed to Open Mesh File");
|
||||
/* LOD */
|
||||
///* LOD */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -856,7 +856,9 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
|
||||
strcpy_s(Temp, szDir);
|
||||
strcat_s(Temp, szName);
|
||||
strcat_s(Temp, ".bin");
|
||||
Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0);
|
||||
if (FAILED(Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
SaveAssimpModel(Temp);
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "PhysX_Manager.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameInstance.h"
|
||||
#include "RigidBody.h"
|
||||
#include "Mesh.h"
|
||||
|
||||
static PSX::PxTransform XMWorldToPx(const _matrix& WorldMatrix)
|
||||
static PSX::PxTransform XMWorldToPx_NoScale(const _matrix& WorldMatrix)
|
||||
{
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
@@ -15,7 +15,6 @@ static PSX::PxTransform XMWorldToPx(const _matrix& WorldMatrix)
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -31,22 +30,54 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
|
||||
const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_PxTransformPtr()->Get_XMWorldMatrix();
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx(WorldMatrix);
|
||||
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix);
|
||||
pActorDynamic->userData = &RigidBody;
|
||||
pActorDynamic->attachShape(*RigidBody.Get_ShapePtr());
|
||||
if (RigidBody.Is_Kinematic()) {
|
||||
pActorDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true);
|
||||
|
||||
PSX::PxShape* pShape = nullptr;
|
||||
PSX::PxGeometryHolder geoHolder = {};
|
||||
|
||||
_float3 vVolume = RigidBody.Get_HalfGeometryInfo();
|
||||
|
||||
switch (RigidBody.Get_Type()) {
|
||||
case ACTOR::BOX:
|
||||
geoHolder = PSX::PxBoxGeometry(PSX::PxVec3(vVolume.x, vVolume.y, vVolume.z));
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y);
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x);
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
assert(nullptr != pShape);
|
||||
|
||||
pShape->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
pActorDynamic->attachShape(*pShape);
|
||||
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
|
||||
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
|
||||
|
||||
|
||||
|
||||
if (pxRigidFlags.isSet(PSX::PxRigidBodyFlag::eKINEMATIC)) {
|
||||
|
||||
}
|
||||
else {
|
||||
PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density());
|
||||
}
|
||||
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActorDynamic);
|
||||
m_pScene->addActor(*pActorDynamic);
|
||||
|
||||
@@ -55,78 +86,71 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod
|
||||
|
||||
const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_PxTransformPtr()->Get_XMWorldMatrix();
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx(WorldMatrix);
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
const PSX::PxTriangleMesh* pPxMesh = { nullptr };
|
||||
{
|
||||
auto iter = m_TriangleMeshes.find(RigidBody.Get_PxMeshKey());
|
||||
if (m_TriangleMeshes.end() == iter) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
pPxMesh = iter->second;
|
||||
}
|
||||
const PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
|
||||
{
|
||||
auto iter = m_TriangleMeshGeometry.find(RigidBody.Get_PxMeshKey());
|
||||
if (m_TriangleMeshGeometry.end() == iter) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
pPxMeshGeometry = iter->second;
|
||||
}
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix);
|
||||
PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *RigidBody.Get_PxMaterial());
|
||||
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true);
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true);
|
||||
|
||||
pActor->userData = &RigidBody;
|
||||
|
||||
PSX::PxShape* pShape = { nullptr };
|
||||
PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey());
|
||||
PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
|
||||
|
||||
switch (RigidBody.Get_Type())
|
||||
{
|
||||
case ACTOR::PLANE:
|
||||
break;
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
{ // SetUp Geometry
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
vRotq = XMQuaternionNormalize(vRotq);
|
||||
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
PSX::PxMeshScale meshScale(
|
||||
PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])),
|
||||
PSX::PxQuat(PSX::PxIdentity) // 스케일 축은 로컬 기준
|
||||
);
|
||||
pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale);
|
||||
|
||||
// GeoFlag 중 더블사이드는 이제 지원 안함, 할거면 노말 뒤집어서 하라고 함
|
||||
// pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
// 유효성 체크
|
||||
PX_ASSERT(pPxMeshGeometry.isValid());
|
||||
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
|
||||
}
|
||||
break;
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
|
||||
pShape->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActor);
|
||||
m_pScene->addActor(*pActor);
|
||||
|
||||
return pActor;
|
||||
}
|
||||
|
||||
PSX::PxMaterial* CPhysX_Manager::Get_Material(_float3& vMatInfo)
|
||||
PSX::PxMaterial* CPhysX_Manager::Create_Material(const _float3* vMatInfo)
|
||||
{
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo.x, vMatInfo.y, vMatInfo.z);
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z);
|
||||
return pPxMaterial;
|
||||
}
|
||||
|
||||
PSX::PxShape* CPhysX_Manager::Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag)
|
||||
void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh)
|
||||
{
|
||||
PSX::PxShape* pShape = { nullptr };
|
||||
switch (eType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
pShape = m_pPhysics->createShape(PSX::PxBoxGeometry(vhalfGeometryInfo.x, vhalfGeometryInfo.y, vhalfGeometryInfo.z), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
pShape = m_pPhysics->createShape(PSX::PxCapsuleGeometry(vhalfGeometryInfo.x, vhalfGeometryInfo.y), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
case Engine::ACTOR::SPHERE:
|
||||
pShape = m_pPhysics->createShape(PSX::PxSphereGeometry(vhalfGeometryInfo.x), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return pShape;
|
||||
}
|
||||
|
||||
void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) {
|
||||
m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh);
|
||||
|
||||
PSX::PxTriangleMeshGeometry* pGeometry = new PSX::PxTriangleMeshGeometry(pPxTriMesh);
|
||||
pGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
m_TriangleMeshGeometry.emplace(CMyTools::ToWstring(pName), pGeometry);
|
||||
}
|
||||
|
||||
HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
|
||||
@@ -216,8 +240,8 @@ HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangle
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// 바이너리 로드에는 128B 정렬된 메모리 포인터를 넘겨야 함. InputData 그대로 넘기면 안됨
|
||||
// 심지어 바이너리로 불러온 블럭은 피직스의 모든 메시들을 릴리즈 한 뒤에 해제 해야 함
|
||||
// 바이너리 로드에는 128B 정렬된 메모리 포인터를 넘겨야 함. InputData 그대로 넘기면 안됨
|
||||
// 심지어 바이너리로 불러온 블럭은 피직스의 모든 메시들을 릴리즈 한 뒤에 해제 해야 함
|
||||
//_bool CPhysX_Manager::LoadTriMeshes_Binary(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes)
|
||||
//{
|
||||
// filesystem::path pathPhysX = pPath;
|
||||
@@ -274,9 +298,10 @@ void CPhysX_Manager::Update_Kinematic()
|
||||
if (pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)
|
||||
{
|
||||
CRigidBody* pBody = pairBody.first;
|
||||
const CTransform* pTransform = pBody->Get_PxTransformPtr();
|
||||
const CTransform* pTransform = pBody->Get_TransformPtr();
|
||||
|
||||
|
||||
pActor->setKinematicTarget(XMWorldToPx(pTransform->Get_XMWorldMatrix()));
|
||||
pActor->setKinematicTarget(XMWorldToPx_NoScale(pTransform->Get_XMWorldMatrix()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -294,11 +319,12 @@ void CPhysX_Manager::Update(_float fTimeDelta)
|
||||
_bool bResult = m_pScene->fetchResults(true);
|
||||
}
|
||||
{ // Post
|
||||
Update_Dynamic();
|
||||
Update_Dynamic_ActiveActors();
|
||||
//Update_Dynamic_AllActors();
|
||||
}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update_Dynamic()
|
||||
void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
{
|
||||
PSX::PxU32 iNumActiveActor = {};
|
||||
PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor);
|
||||
@@ -310,7 +336,7 @@ void CPhysX_Manager::Update_Dynamic()
|
||||
if (nullptr == ppActiveActors[i]->userData) {
|
||||
continue;
|
||||
}
|
||||
CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_PxTransformPtr();
|
||||
CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_TransformPtr();
|
||||
|
||||
PSX::PxTransform pPrevPxTransform;
|
||||
PSX::PxTransform pPxTransform = pActorDynamic->getGlobalPose();
|
||||
@@ -319,7 +345,27 @@ void CPhysX_Manager::Update_Dynamic()
|
||||
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
//_uint iNumActor = (_uint)m_RigidBodys.size();
|
||||
//for (_uint i = 0; i < iNumActor; ++i) {
|
||||
//for (auto& pairBody : m_RigidBodys)
|
||||
// pairBody.second->userData
|
||||
//}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update_Dynamic_AllActors()
|
||||
{
|
||||
for (pair<CRigidBody*, PSX::PxActor*>& pairActors : m_RigidBodys) {
|
||||
PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is<PSX::PxRigidDynamic>();
|
||||
if (nullptr != pActorDynamic) {
|
||||
CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr();
|
||||
|
||||
PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose();
|
||||
_float3 vOriginalScale = pTransform->Get_Scale();
|
||||
_matrix WorldMatrix = {};
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,7 +434,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
}
|
||||
|
||||
|
||||
{ // 씬 세팅
|
||||
{ // 씬 세팅
|
||||
m_ToleranceScale.length = 1.f; // 1 meter
|
||||
m_ToleranceScale.speed = GRAVITY; //
|
||||
|
||||
@@ -401,7 +447,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f);
|
||||
|
||||
m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/);
|
||||
m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/);
|
||||
if (nullptr == m_pDispatcher) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
@@ -410,7 +456,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader;
|
||||
|
||||
sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS;
|
||||
sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_CCD| PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS;
|
||||
if (false == sceneDesc.isValid()) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
@@ -420,7 +466,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
m_pCCTManager->setOverlapRecoveryModule(false);
|
||||
}
|
||||
|
||||
// 디버그서버의 클라 세팅
|
||||
// 디버그서버의 클라 세팅
|
||||
PSX::PxPvdSceneClient* pPvdClient = m_pScene->getScenePvdClient();
|
||||
if (nullptr != pPvdClient) {
|
||||
pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true);
|
||||
@@ -430,10 +476,11 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
// m_pScene->overlap();??????
|
||||
|
||||
#ifdef 기무리
|
||||
physx::PxMaterial* pMaterial = m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f);
|
||||
//physx::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 90), *pMaterial);
|
||||
//m_pScene->addActor(*pGroundPlane);
|
||||
#ifdef 기무리
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
m_pScene->addActor(*pGroundPlane);
|
||||
|
||||
//{
|
||||
// float halfExtent = .5f;
|
||||
@@ -451,8 +498,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//pMaterial->release();
|
||||
#endif // 기무리
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
|
||||
@@ -461,7 +507,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
HRESULT CPhysX_Manager::Connect_DebugServer()
|
||||
{
|
||||
// 네트워크 디버거 전송객체 생성
|
||||
// 네트워크 디버거 전송객체 생성
|
||||
m_pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10);
|
||||
if (nullptr == m_pTransport) {
|
||||
assert(false);
|
||||
|
||||
@@ -8,52 +8,67 @@ CRigidBody::CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
{
|
||||
}
|
||||
|
||||
CRigidBody::CRigidBody(const CRigidBody& rhs):
|
||||
CRigidBody::CRigidBody(const CRigidBody& rhs) :
|
||||
CComponent(rhs),
|
||||
m_pMaterial(rhs.m_pMaterial),
|
||||
m_eActorType(rhs.m_eActorType),
|
||||
m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo),
|
||||
m_pShape(rhs.m_pShape),
|
||||
m_wstrMeshKey(rhs.m_wstrMeshKey),
|
||||
m_bExclusive(rhs.m_bExclusive),
|
||||
m_bKinematic(rhs.m_bKinematic)
|
||||
m_vMatInfo(rhs.m_vMatInfo),
|
||||
m_ePxRigidBodyFlags(rhs.m_ePxRigidBodyFlags),
|
||||
m_ePxShapeFlags(rhs.m_ePxShapeFlags),
|
||||
m_eMatType(rhs.m_eMatType),
|
||||
m_fContactOffset(rhs.m_fContactOffset)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Render()
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
_matrix WorldMatrix = m_pTransform->Get_XMWorldMatrix();
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * m_vhalfGeometryInfo.y);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * -m_vhalfGeometryInfo.y);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMaterial = m_pGameInstance->Get_Material(Desc.tRigidDynamicDesc.vMatInfo);
|
||||
m_vhalfGeometryInfo = Desc.tRigidDynamicDesc.vhalfGeometryInfo;
|
||||
m_bExclusive = Desc.tRigidDynamicDesc.bExclusive;
|
||||
m_pShape = m_pGameInstance->Create_Shape(m_eActorType, m_vhalfGeometryInfo, *m_pMaterial, m_bExclusive, Desc.tRigidDynamicDesc.ePxShapeFlag);
|
||||
if (nullptr == m_pShape) {
|
||||
assert(false);
|
||||
m_pMaterial->release();
|
||||
m_pMaterial = nullptr;
|
||||
return E_FAIL;
|
||||
}
|
||||
break;
|
||||
case ACTOR::PLANE:
|
||||
break;
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
{
|
||||
m_pMaterial = m_pGameInstance->Get_Material(Desc.tRigidDynamicDesc.vMatInfo);
|
||||
m_wstrMeshKey = CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName);
|
||||
}
|
||||
break;
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
m_ePxRigidBodyFlags = Desc.ePxRigidBodyFlags;
|
||||
m_ePxShapeFlags = Desc.ePxShapeFlags;
|
||||
m_eMatType = Desc.ePxMaterialTypes;
|
||||
m_vMatInfo = Desc.vMatInfo;
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
m_vhalfGeometryInfo = Desc.vhalfGeometryInfo;
|
||||
m_fDensity = Desc.fDensity;
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -64,9 +79,6 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (true == m_bExclusive) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pTransform = m_pOwner->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pTransform);
|
||||
@@ -76,8 +88,6 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
case Engine::ACTOR::BOX:
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
case Engine::ACTOR::SPHERE:
|
||||
m_fDensity = pDesc->tRigidDynamicDesc.fDensity;
|
||||
m_bKinematic = pDesc->tRigidDynamicDesc.bIsKinematic;
|
||||
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this);
|
||||
break;
|
||||
case Engine::ACTOR::PLANE:
|
||||
@@ -92,12 +102,39 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
Add_DebugShape();
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Add_DebugShape()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y, m_vhalfGeometryInfo.x, 10, false));
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
break;
|
||||
case ACTOR::PLANE:
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
CRigidBody* CRigidBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
CRigidBody* pInstance = new CRigidBody(pDevice, pContext);
|
||||
|
||||
@@ -83,7 +83,12 @@ HRESULT CUIObject::Initialize(void* pArg)
|
||||
|
||||
m_bVisible = true;
|
||||
|
||||
m_vNine_Slice = XMVectorSet(-m_fSizeX * 0.5f, m_fSizeX * 0.5f, -m_fSizeY * 0.5f, m_fSizeY * 0.5f);
|
||||
m_fLeft = 0.f;
|
||||
m_fRight = m_fSizeX;
|
||||
m_fTop = 0.f;
|
||||
m_fBottom = m_fSizeY;
|
||||
|
||||
m_vNine_Slice = _float4(m_fLeft, m_fRight, m_fTop, m_fBottom);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -98,7 +103,7 @@ void CUIObject::Update(_float fTimeDelta)
|
||||
m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f);
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f,-m_fY + m_fWinSizeY * 0.5f,0.f, 1.f));
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f));
|
||||
|
||||
m_fCurrent_Posigion = XMVectorSet(m_fX, m_fY, 0.f, 1.f);
|
||||
|
||||
@@ -275,22 +280,42 @@ _float2 CUIObject::Get_UV()
|
||||
|
||||
void CUIObject::Nine_Slice_Left(_float X)
|
||||
{
|
||||
XMVectorSetX(m_vNine_Slice, X);
|
||||
m_fLeft = -m_fSizeX * 0.5f + X;
|
||||
}
|
||||
|
||||
void CUIObject::Nine_Slice_Right(_float Y)
|
||||
{
|
||||
XMVectorSetY(m_vNine_Slice, Y);
|
||||
m_fRight = m_fSizeX * 0.5f - Y;
|
||||
}
|
||||
|
||||
void CUIObject::Nine_Slice_Top(_float Z)
|
||||
{
|
||||
XMVectorSetZ(m_vNine_Slice, Z);
|
||||
m_fTop = -m_fSizeY * 0.5f + Z;
|
||||
}
|
||||
|
||||
void CUIObject::Nine_Slice_Bottom(_float W)
|
||||
{
|
||||
XMVectorSetW(m_vNine_Slice, W);
|
||||
m_fBottom = m_fSizeY * 0.5f - W;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_Nine_Slice_Left()
|
||||
{
|
||||
return m_fLeft;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_Nine_Slice_Right()
|
||||
{
|
||||
return m_fRight;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_Nine_Slice_Top()
|
||||
{
|
||||
return m_fTop;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_Nine_Slice_Bottom()
|
||||
{
|
||||
return m_fBottom;
|
||||
}
|
||||
|
||||
_float2 CUIObject::Get_Origin_Position()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -9,10 +9,11 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
public:
|
||||
typedef struct tagCameraDesc : public CTransform::TRANSFORM_DESC
|
||||
{
|
||||
_float fFovy{}, fNear{}, fFar{};
|
||||
_uint iPriority = { UINT_MAX };
|
||||
CGameObject* pFollowTarget = { nullptr };
|
||||
CGameObject* pLookTarget = { nullptr };
|
||||
_float fFovy{}, fNear{}, fFar{};
|
||||
_uint iPriority = { UINT_MAX };
|
||||
const _wchar* pCameraKey = { };
|
||||
CGameObject* pFollowTarget = { nullptr };
|
||||
CGameObject* pLookTarget = { nullptr };
|
||||
}CAMERA_DESC;
|
||||
|
||||
protected:
|
||||
@@ -48,6 +49,7 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
|
||||
_bool m_bActive = { false };
|
||||
|
||||
const _wchar* m_pCameraKey = { nullptr };
|
||||
CGameObject* m_pFollowTarget = { nullptr };
|
||||
CGameObject* m_pLookTarget = { nullptr };
|
||||
|
||||
@@ -65,4 +67,4 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -17,8 +17,9 @@ class CCamera_Manager final : public CBase
|
||||
HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority);
|
||||
HRESULT IsBinded_Camera(const _wstring& wstrCameraKey);
|
||||
|
||||
const _float* Get_CurrentCameraFar();
|
||||
|
||||
void Force_CamPosition(_fvector vPos);
|
||||
const _float* Get_CurrentCameraFar();
|
||||
|
||||
private:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
@@ -42,4 +43,4 @@ class CCamera_Manager final : public CBase
|
||||
virtual void Free()override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -14,7 +14,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
{
|
||||
_float fRadius;
|
||||
_float fHeight;
|
||||
PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset 값이 무제한), (eCONSTRAINED, stepOffset 값이 제대로 먹음)
|
||||
PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset 값이 무제한), (eCONSTRAINED, stepOffset 값이 제대로 먹음)
|
||||
};
|
||||
typedef struct tagCharacter_ControllerDesc
|
||||
{
|
||||
@@ -22,18 +22,18 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
ACTOR eBodyType = { ACTOR::END };
|
||||
_float fContactOffset = { 0.f };
|
||||
_float3 fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
|
||||
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
|
||||
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
|
||||
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
|
||||
|
||||
function<void()> funcHitCallback = { nullptr };
|
||||
function<void()> funcBehaviorCallback = { nullptr };
|
||||
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
|
||||
union
|
||||
{
|
||||
_float3 vBoxSize; // 박스는 AABB임
|
||||
_float3 vBoxSize; // 박스는 AABB임
|
||||
CapsuleInfo tCapsuleInfo;
|
||||
};
|
||||
}Character_Controller_DESC;
|
||||
@@ -43,16 +43,22 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
CCharacter_Controller(const CCharacter_Controller& rhs);
|
||||
virtual ~CCharacter_Controller() = default;
|
||||
public:
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render() override;
|
||||
#endif
|
||||
|
||||
void Move(_float fTimeDelta); // 이동
|
||||
void Set_Position(_fvector vNewPos); // 순간이동
|
||||
_float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 더 아래에 위치한다는 뜻 )
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
|
||||
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
void Move(_float fTimeDelta); // 이동
|
||||
void Set_Position(_fvector vNewPos); // 순간이동
|
||||
_vector Get_Position();
|
||||
_float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 더 아래에 위치한다는 뜻 )
|
||||
|
||||
|
||||
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
|
||||
private:
|
||||
ACTOR m_eBodyType = { ACTOR::END };
|
||||
@@ -65,6 +71,11 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
function<void()> m_funcHitCallback = { nullptr };
|
||||
function<void()> m_funcBehaviorCallback = { nullptr };
|
||||
PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};;
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
@@ -78,4 +89,4 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -21,7 +21,14 @@ class ENGINE_DLL CElementObject abstract : public CUIObject
|
||||
public:
|
||||
virtual void Visible(_bool bVisible) override;
|
||||
virtual _bool Chack_Visible() override;
|
||||
|
||||
virtual void Nine_Slice_Left(_float X) override;
|
||||
virtual void Nine_Slice_Right(_float Y) override;
|
||||
virtual void Nine_Slice_Top(_float Z) override;
|
||||
virtual void Nine_Slice_Bottom(_float W) override;
|
||||
virtual _float Get_Nine_Slice_Left() override;
|
||||
virtual _float Get_Nine_Slice_Right() override;
|
||||
virtual _float Get_Nine_Slice_Top() override;
|
||||
virtual _float Get_Nine_Slice_Bottom() override;
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype();
|
||||
|
||||
@@ -16,7 +16,10 @@ enum class TEXTURE_LOAD_TYPE {
|
||||
PATH, // original/
|
||||
END
|
||||
};
|
||||
|
||||
enum class PXMATERIAL {
|
||||
DEFAULT,
|
||||
END,
|
||||
};
|
||||
|
||||
|
||||
enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON };
|
||||
@@ -77,4 +80,98 @@ enum class PHYSX_KIND {
|
||||
BODY_DYNAMIC = 4,
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
//enum PxRigidBodyFlag::Enum // createBody에 들어감
|
||||
//{
|
||||
// // 해당 바디는 키네마틱 모드가 됨.
|
||||
// // 중력, 힘, 모멘텀에 영향을 안받고 무한질량으로 취급함
|
||||
// // 다른 다이나믹 바디는 밀어내지만
|
||||
// // 스태틱, 키네마틱과는 충돌x, CCT도 이걸 씀
|
||||
// // 직접 개발자가 이동시켜줘야 함
|
||||
// // CCD와 호환되지 않음, 자동으로 한쪽이 꺼짐
|
||||
// // 키는 순간 바디는 sleep 상태가 되고 속도도 0이 됨
|
||||
// [eKINEMATIC]
|
||||
//
|
||||
// // 주의 * 다음 프레임에 적용됨 *
|
||||
// // 씬 쿼리를 세팅하고 이미 움직인 것 처럼 씬 쿼리를 하고 싶을 때 씀
|
||||
// [eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES]
|
||||
//
|
||||
// // 고속 이동으로 인한 튕김/뚫림 방지를 이 바디에 등록함
|
||||
// // 이 플래그가 필요한 shape 페어에는 eDetect_ccd_contact도 켜야 됨
|
||||
// // 키네마틱과 호환되지 않음
|
||||
// // 많이 키면 렉걸림
|
||||
// [eENABLE_CCD]
|
||||
//
|
||||
// // CCD에 마찰을 활성화 시킴
|
||||
// // 총알이 표면을 스치면서 마찰로 속도감소 등
|
||||
// [eENABLE_CCD_FRICTION]
|
||||
//
|
||||
// // contact offset을 바디 속도에 따라 키워서
|
||||
// // 관통을 줄이는 방식의 CCD
|
||||
// // 엄밀히 CCD는 아니지만 터널링을 줄일 순 있음
|
||||
// [eENABLE_SPECULATIVE_CCD]
|
||||
//
|
||||
// // 물리 결과를 scene.fetchResult 도중에 얻을 수 있음
|
||||
// // 콜백으로 받게 됨, 물리 결과를 미리 반영하고 싶을 때 사용
|
||||
// [eENABLE_POSE_INTEGRATION_PREVIEW]
|
||||
//
|
||||
// // 충돌 시 적용되는 최대 임펄스 수를 제한?
|
||||
// // 일반 접촉에만 적용되던 걸 CCD에도 적용하게끔 만듬
|
||||
// // 보통 off라고 함
|
||||
// [eENABLE_CCD_MAX_CONTACT_IMPULSE]
|
||||
//
|
||||
// // 힘/가속도가 다음 시뮬레이션에서도 계속해서 쓰임
|
||||
// // addForce(), addTorque() 등으로 준 것들은 원래는 시뮬 끝나면 지워짐
|
||||
// // 레일건 같은 총알이나 우주선 등
|
||||
// [eRETAIN_ACCELERATIONS]
|
||||
//
|
||||
// // 키네마틱페어를 전체적으로 없애는
|
||||
// // PxSceneDesc::kineKineFilteringMode가 켜져 있어도
|
||||
// // 키네마틱 페어를 서로 충돌이벤트 발생시키게 함
|
||||
// // 런타임에 바꾸면 씬에서 제거하고 다시 추가하기 전까지 반영 안됨
|
||||
// [eFORCE_KINE_KINE_NOTIFICATIONS]
|
||||
//
|
||||
// // 위랑 똑같은데 위에껀 키네마틱 페어라면
|
||||
// // 이건 스태틱-키네마틱 페어임
|
||||
// [eFORCE_STATIC_KINE_NOTIFICATIONS]
|
||||
//
|
||||
// // 강하게 회전하는 바디에서 관성에 의한 보정을 더 엄밀히 계산함
|
||||
// // 비용증가, 운동량 안정화
|
||||
// [eENABLE_GYROSCOPIC_FORCES]
|
||||
//
|
||||
// // 예약 플래그임. 안써야함
|
||||
// [eRESERVED]
|
||||
//};
|
||||
//
|
||||
|
||||
|
||||
//enum PxShapeFlag::Enum // createShape에 들어감
|
||||
//{
|
||||
// // 물리 시뮬레이션에서 충돌/접촉 계산에 참여,
|
||||
// // PxSimulationEventCallback::onContact 접촉 이벤트도 이 플래그 들 끼리의 충돌에서 나옴
|
||||
// // eTrigger_Shape와 동시에 킬 수 없음
|
||||
// // (default = on)
|
||||
// [eSIMULATION_SHAPE],
|
||||
//
|
||||
//
|
||||
// // 씬쿼리 대상이 됨, 레이케스트, 오버랩, 스윕 등
|
||||
// // 충돌시뮬레이션과는 별도의 동작
|
||||
// // (default = on)
|
||||
// [eSCENE_QUERY_SHAPE],
|
||||
//
|
||||
// // 다른 shape가 들어오고 나갈 때 onTrigger 콜백을 발생시킴
|
||||
// // 통과가능한 shape이며 이벤트만 발생시킴
|
||||
// // TriangleMesh, HeightField는 트리거사용불가
|
||||
// // (default = off)
|
||||
// [eTRIGGER_SHAPE],
|
||||
//
|
||||
// // 디버그용, 전용디버거 PVD에 이 shape를 그리게 함
|
||||
// // 꺼도 되고, 키면 PxScene에서 설정을 해줘야함
|
||||
// // (default = on)
|
||||
// [eVISUALIZATION],
|
||||
//
|
||||
// // PhysX Particle들이 닿는 순간 그 파티클을 '흡수'해서 제거함
|
||||
// // (default = off)
|
||||
// [ePARTICLE_DRAIN],
|
||||
//};
|
||||
|
||||