@@ -1128,8 +1128,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Npc()
|
||||
_bool isLoad_RandomNPC = { true };
|
||||
#ifdef _DEBUG
|
||||
#ifdef gimch
|
||||
isLoad_NPC = false;
|
||||
isLoad_RandomNPC = false;
|
||||
isLoad_NPC = true;
|
||||
isLoad_RandomNPC = true;
|
||||
#endif // gimch
|
||||
#ifdef 진우
|
||||
isLoad_RandomNPC = true;
|
||||
|
||||
@@ -3601,7 +3601,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
/* For.Prototype_Component_FloatingBalloon */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, TEXT("Prototype_Component_FloatingBalloon"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.bin"))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "../Bin/Resources/Models/MapMesh/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.bin"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_Hogwart_Lake */
|
||||
|
||||
@@ -36,7 +36,7 @@ HRESULT CMapElement_Chest_Lid::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_fOpenDuration = 0.1f;
|
||||
m_fOpenDuration = 0.3f;
|
||||
m_fRotationAngle = pDesc->fRotaitionAngle;
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vLid_Offset), 1.f));
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod1</PrototypeTag>
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod2</PrototypeTag>
|
||||
<Position x="0" y="0.5" z="0"/>
|
||||
<RotationAngle RotationAngle="10"/>
|
||||
<RotationAngle RotationAngle="70"/>
|
||||
</Lid>
|
||||
</Object>
|
||||
<Object Type="2" ID="2" Lod_Level="3">
|
||||
@@ -35,7 +35,7 @@
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod1</PrototypeTag>
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod2</PrototypeTag>
|
||||
<Position x="0" y="0.5" z="0"/>
|
||||
<RotationAngle RotationAngle="10"/>
|
||||
<RotationAngle RotationAngle="70"/>
|
||||
</Lid>
|
||||
</Object>
|
||||
<Object Type="2" ID="2" Lod_Level="3">
|
||||
@@ -54,7 +54,7 @@
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod1</PrototypeTag>
|
||||
<PrototypeTag>Prototype_GameObject_SM_Chest_RewardContainer_C_Lid_Lod2</PrototypeTag>
|
||||
<Position x="0" y="0.5" z="0"/>
|
||||
<RotationAngle RotationAngle="10"/>
|
||||
<RotationAngle RotationAngle="70"/>
|
||||
</Lid>
|
||||
</Object>
|
||||
</Chests>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<NPC>
|
||||
<Object ID="13">
|
||||
<Position x="7.1631966" y="-13.129012" z="-29.87093"/>
|
||||
<Scale x="0.99811238" y="1" z="0.99811238"/>
|
||||
<Rotation x="0" y="214" z="0"/>
|
||||
</Object>
|
||||
<Object ID="0">
|
||||
<Position x="32.72155" y="3.801733" z="74.733856"/>
|
||||
<Scale x="0.99974245" y="1" z="0.99974245"/>
|
||||
<Rotation x="0" y="129" z="0"/>
|
||||
</Object>
|
||||
<Object ID="1">
|
||||
<Position x="47.214542" y="4.2283616" z="82.240288"/>
|
||||
<Scale x="0.99857348" y="1" z="0.99857348"/>
|
||||
<Rotation x="0" y="150" z="0"/>
|
||||
</Object>
|
||||
<Object ID="2">
|
||||
<Position x="48.645473" y="4.2111044" z="80.637032"/>
|
||||
<Scale x="0.99998683" y="1" z="0.99998683"/>
|
||||
<Rotation x="0" y="287" z="0"/>
|
||||
</Object>
|
||||
<Object ID="3">
|
||||
<Position x="91.189796" y="15.22409" z="129.24487"/>
|
||||
<Scale x="0.99990129" y="1" z="0.99990129"/>
|
||||
<Rotation x="0" y="90" z="0"/>
|
||||
</Object>
|
||||
<Object ID="5">
|
||||
<Position x="40.331745" y="6.6973305" z="99.171661"/>
|
||||
<Scale x="0.99978107" y="1" z="0.99978107"/>
|
||||
<Rotation x="0" y="160" z="0"/>
|
||||
</Object>
|
||||
<Object ID="6">
|
||||
<Position x="90.164291" y="15.802738" z="142.52655"/>
|
||||
<Scale x="1.0003461" y="1" z="1.0003461"/>
|
||||
<Rotation x="0" y="135" z="0"/>
|
||||
</Object>
|
||||
<Object ID="7">
|
||||
<Position x="114.85642" y="15.469075" z="116.20981"/>
|
||||
<Scale x="0.99999529" y="1" z="0.99999529"/>
|
||||
<Rotation x="0" y="315" z="0"/>
|
||||
</Object>
|
||||
<Object ID="8">
|
||||
<Position x="125.50824" y="15.934627" z="141.39334"/>
|
||||
<Scale x="0.99993688" y="1" z="0.99993688"/>
|
||||
<Rotation x="0" y="195" z="0"/>
|
||||
</Object>
|
||||
<Object ID="9">
|
||||
<Position x="35.15633" y="1.5198594" z="50.624886"/>
|
||||
<Scale x="0.99999732" y="1" z="0.99999732"/>
|
||||
<Rotation x="0" y="120" z="0"/>
|
||||
</Object>
|
||||
<Object ID="10">
|
||||
<Position x="129.77383" y="15.728663" z="121.83965"/>
|
||||
<Scale x="0.99999732" y="1" z="0.99999732"/>
|
||||
<Rotation x="0" y="-105" z="0"/>
|
||||
</Object>
|
||||
<Object ID="11">
|
||||
<Position x="-393.24478" y="-33.342117" z="-362.13519"/>
|
||||
<Scale x="0.9999885" y="1" z="0.9999885"/>
|
||||
<Rotation x="0" y="285" z="0"/>
|
||||
</Object>
|
||||
<Object ID="12">
|
||||
<Position x="79.841499" y="3.8484674" z="83.004013"/>
|
||||
<Scale x="0.99980307" y="1" z="0.99980307"/>
|
||||
<Rotation x="0" y="210" z="0"/>
|
||||
</Object>
|
||||
</NPC>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -193,6 +193,7 @@ call Update_Shaders.bat
|
||||
<ClInclude Include="..\public\Dialogue_Panel.h" />
|
||||
<ClInclude Include="..\public\DummyDecal.h" />
|
||||
<ClInclude Include="..\public\Dialogue.h" />
|
||||
<ClInclude Include="..\public\DummyNPC.h" />
|
||||
<ClInclude Include="..\public\Enemy_Detection.h" />
|
||||
<ClInclude Include="..\Public\Goblin_BattleAxe.h" />
|
||||
<ClInclude Include="..\Public\Goblin_Dagger.h" />
|
||||
@@ -480,6 +481,7 @@ call Update_Shaders.bat
|
||||
<ClCompile Include="..\private\Dialogue_Choice.cpp" />
|
||||
<ClCompile Include="..\private\Dialogue_Panel.cpp" />
|
||||
<ClCompile Include="..\private\DummyDecal.cpp" />
|
||||
<ClCompile Include="..\private\DummyNPC.cpp" />
|
||||
<ClCompile Include="..\Private\Enemy_Detection.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_BattleAxe.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_Dagger.cpp" />
|
||||
|
||||
@@ -796,6 +796,9 @@
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Broom_Panel\Broom_TargetGate2D">
|
||||
<UniqueIdentifier>{bde6e952-c6ee-4136-8559-99392c01645e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyNPC">
|
||||
<UniqueIdentifier>{aa6ef154-b82d-42eb-82a7-f8b7f6631a1e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -1611,6 +1614,9 @@
|
||||
<ClInclude Include="..\public\Broom_TargetGate2D.h">
|
||||
<Filter>50.UI\GamePlay_Canvas\Broom_Panel\Broom_TargetGate2D</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\DummyNPC.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyNPC</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -2434,6 +2440,9 @@
|
||||
<ClCompile Include="..\private\Broom_TargetGate2D.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Broom_Panel\Broom_TargetGate2D</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\DummyNPC.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyNPC</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -162,7 +162,6 @@ void CAlphaMap::Load_ToFile(const _char* pFilePath)
|
||||
in.read(reinterpret_cast<_char*>(&m_pPixels[i]), sizeof(_float4));
|
||||
}
|
||||
|
||||
|
||||
in.close();
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE SubResource{};
|
||||
@@ -175,8 +174,8 @@ void CAlphaMap::Load_ToFile(const _char* pFilePath)
|
||||
|
||||
m_pContext->Unmap(m_pTexture2D, 0);
|
||||
|
||||
/*if (FAILED(SaveDDSTextureToFile(m_pContext, m_pTexture2D, L"../Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds")))
|
||||
return;*/
|
||||
if (FAILED(SaveDDSTextureToFile(m_pContext, m_pTexture2D, L"../Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds")))
|
||||
return;
|
||||
}
|
||||
|
||||
void CAlphaMap::Save_DDS(const _char* pFilePath)
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
#include "pch.h"
|
||||
#include "DummyNPC.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummyNPC::CDummyNPC(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummyNPC::CDummyNPC(const CDummyNPC& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
m_fUsingSurfaceParams = PBR_MRO;
|
||||
|
||||
_float fMaxScale = 1.f;
|
||||
m_iID = 0;
|
||||
|
||||
if (nullptr != pArg)
|
||||
{
|
||||
DUMMY_NPC_DESC* pDesc = static_cast<DUMMY_NPC_DESC*>(pArg);
|
||||
m_iID = pDesc->iID;
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Set_Rotation(pDesc->vRotation);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummyNPC::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummyNPC::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CDummyNPC::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMesh = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; i++)
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_SRV("g_DiffuseTexture", m_pDiffuseTextureCom->Get_SRV(0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_SRV("g_NormalTexture", m_pNormalTextureCom->Get_SRV(0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_SRV("g_SurfaceParamsTexture", m_pSurfaceTextureCom->Get_SRV(0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("DUMMY_NPC_Diffuse"),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuseTextureCom))))
|
||||
return E_FAIL;
|
||||
/* Com_Texture */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("DUMMY_NPC_Normal"),
|
||||
reinterpret_cast<CComponent**>(&m_pNormalTextureCom))))
|
||||
return E_FAIL;
|
||||
/* Com_Texture */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Base_MRO"),
|
||||
reinterpret_cast<CComponent**>(&m_pSurfaceTextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Model_DummyNpc"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::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_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummyNPC* CDummyNPC::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummyNPC* pInstance = new CDummyNPC(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummyNPC");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummyNPC::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummyNPC* pInstance = new CDummyNPC(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummyNPC");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummyNPC::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pDiffuseTextureCom);
|
||||
SAFE_RELEASE(m_pNormalTextureCom);
|
||||
SAFE_RELEASE(m_pSurfaceTextureCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
}
|
||||
|
||||
void CDummyNPC::Describe_Entity()
|
||||
{
|
||||
GUI::InputInt("ID", (_int*)(&m_iID));
|
||||
m_pTransformCom->Describe_Entity();
|
||||
|
||||
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
|
||||
{
|
||||
_float3 vPosition = {};
|
||||
if (m_pGameInstance->isPicking(&vPosition))
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CDummyNPC::Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root)
|
||||
{
|
||||
tinyxml2::XMLElement* object = doc.NewElement("Object");
|
||||
object->SetAttribute("ID", m_iID);
|
||||
root->InsertEndChild(object);
|
||||
|
||||
|
||||
#pragma region TRANSFORM
|
||||
_float3 vPosition = {};
|
||||
XMStoreFloat3(&vPosition, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
_float3 vScale = m_pTransformCom->Get_Scale();
|
||||
|
||||
_float3 vRotation = m_pTransformCom->Get_Rotation();
|
||||
|
||||
tinyxml2::XMLElement* Position = doc.NewElement("Position");
|
||||
Position->SetAttribute("x", vPosition.x);
|
||||
Position->SetAttribute("y", vPosition.y);
|
||||
Position->SetAttribute("z", vPosition.z);
|
||||
object->InsertEndChild(Position);
|
||||
|
||||
tinyxml2::XMLElement* Scale = doc.NewElement("Scale");
|
||||
Scale->SetAttribute("x", vScale.x);
|
||||
Scale->SetAttribute("y", vScale.y);
|
||||
Scale->SetAttribute("z", vScale.z);
|
||||
object->InsertEndChild(Scale);
|
||||
|
||||
tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation");
|
||||
Rotation->SetAttribute("x", vRotation.x);
|
||||
Rotation->SetAttribute("y", vRotation.y);
|
||||
Rotation->SetAttribute("z", vRotation.z);
|
||||
object->InsertEndChild(Rotation);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -634,7 +634,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag)
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
Desc.bEditMode = true;
|
||||
Desc.bEditMode = false;
|
||||
Desc.isShake = false;
|
||||
Desc.iShaderPassIndex = 4;
|
||||
Desc.vRadius = _float2(0.f, 0.f);
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
#include "LightSpawner.h"
|
||||
#include "RaceRing.h"
|
||||
#include "MapElement_Balloon.h"
|
||||
#include "DummyNPC.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -3038,6 +3039,24 @@ HRESULT CLoader::Loading_For_MapViewer()
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/Decal/DecalBox.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma region DUMMY_NPC
|
||||
/* DUMMY_NPC_Diffuse */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("DUMMY_NPC_Diffuse"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("C:/MeshTable/Game/Environment/Sanctum_Dungeon/Textures/Props/T_AgedTombProtector_Grunt_A_D.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* DUMMY_NPC_Normal */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("DUMMY_NPC_Normal"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("C:/MeshTable/Game/Environment/Sanctum_Dungeon/Textures/Props/T_AgedTombProtector_Grunt_A_N.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* For.Prototype_Component_Model_DummyNpc */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Model_DummyNpc"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "C:/MeshTable/Game/Environment/DummyNpc.fbx", XMMatrixRotationY(XMConvertToRadians(180.f))))))
|
||||
return E_FAIL;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MAP_LANDS
|
||||
/* For.Prototype_Component_Hogsmead_Land */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Hogsmead_Land"),
|
||||
@@ -3117,7 +3136,7 @@ HRESULT CLoader::Loading_For_MapViewer()
|
||||
|
||||
/* For.Prototype_Component_FloatingBalloon */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_FloatingBalloon"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.fbx"))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.bin"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_Hogwart_Lake */
|
||||
@@ -3424,7 +3443,7 @@ _bool bLoadHogsmeade = true;
|
||||
}
|
||||
|
||||
#pragma region HOGWART
|
||||
_bool bHogwartLoad = { true };
|
||||
_bool bHogwartLoad = { false };
|
||||
|
||||
/* Hogwart LOD */
|
||||
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD",
|
||||
@@ -3760,7 +3779,7 @@ vector<future<void>> jobFutures;
|
||||
_uint iLoadCount = 44;
|
||||
vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
|
||||
_bool isLoad_Map = { false };
|
||||
_bool isLoad_Map = { true };
|
||||
if(isLoad_Map)
|
||||
{
|
||||
{ /* Terrain */
|
||||
@@ -4393,6 +4412,9 @@ if(isLoad_Map)
|
||||
/* For.Prototype_GameObject_RaceRing */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CRaceRing>(g_iStaticLevel, CRaceRing::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
/* For.Prototype_GameObject_DummyNPC */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummyNPC>(g_iStaticLevel, CDummyNPC::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_MapObject_Manager */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath))))
|
||||
|
||||
@@ -47,8 +47,8 @@ HRESULT CMapElement_Balloon::Initialize(void* pArg)
|
||||
m_isFloating = false;
|
||||
m_iDiffuseIndex = 0;
|
||||
m_vPosition = _float3(0.f, 0.f, 0.f);
|
||||
m_vScale = _float3(0.f, 0.f, 0.f);
|
||||
m_vRotation = _float3(1.f, 1.f, 1.f);
|
||||
m_vScale = _float3(1.f, 1.f, 1.f);
|
||||
m_vRotation = _float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
memcpy(&m_vOriginPosition, &m_vPosition, sizeof(_float3));
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "InstancedProp_Light.h"
|
||||
#include "EditEffect.h"
|
||||
#include "MapElement_Balloon.h"
|
||||
#include "DummyNPC.h"
|
||||
|
||||
CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext)
|
||||
: CGameObject(pDevice, pContext), m_pInfoInstance{CInfoInstance::GetInstance()}
|
||||
@@ -87,8 +88,8 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
|
||||
// return E_FAIL;
|
||||
|
||||
#pragma region HOGSMEADE
|
||||
/* if (FAILED(Load_MapData("Hogsmeade_MapContainer_Data", LAYER_HOGSMEADE)))
|
||||
return E_FAIL;*/
|
||||
if (FAILED(Load_MapData("Hogsmeade_MapContainer_Data", LAYER_HOGSMEADE)))
|
||||
return E_FAIL;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region DUNGEON
|
||||
@@ -99,10 +100,10 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
|
||||
#pragma endregion
|
||||
|
||||
#pragma region HOGWART
|
||||
if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART)))
|
||||
return E_FAIL;
|
||||
if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART)))
|
||||
return E_FAIL;
|
||||
//if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART)))
|
||||
// return E_FAIL;
|
||||
//if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART)))
|
||||
// return E_FAIL;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Light
|
||||
@@ -129,8 +130,8 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
|
||||
if (FAILED(Load_RaceRing("RaceRing_Data")))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_Balloons("Ballon_Data")))
|
||||
return E_FAIL;
|
||||
/*if (FAILED(Load_Balloons("Ballon_Data")))
|
||||
return E_FAIL;*/
|
||||
#pragma endregion
|
||||
|
||||
#pragma region EFFECT_PART
|
||||
@@ -159,10 +160,8 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
|
||||
//if (FAILED(Load_EffectParts("Rotate_Rock_Large2_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Large2")))
|
||||
// return E_FAIL;
|
||||
|
||||
|
||||
//if (FAILED(Load_EffectParts("Bon_Fire_Data", "../Bin/Resources/Data/Effect/MapEffect/Bon_Fire")))
|
||||
// return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
@@ -278,9 +277,9 @@ void CMapObject_Manager::Update(_float fTimeDelta)
|
||||
//Update_LightSpawer();
|
||||
//Update_Decal();
|
||||
//Update_RaceRing();
|
||||
//Update_Balloon();
|
||||
//Update_EffectParts();
|
||||
//Update_Balloon();
|
||||
Update_DummyNpc();
|
||||
|
||||
Update_Unified();
|
||||
|
||||
@@ -2102,7 +2101,6 @@ HRESULT CMapObject_Manager::Load_RaceRing(const _char* pFileName)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -2114,14 +2112,14 @@ HRESULT CMapObject_Manager::Save_Balloons(const _char* pFileName)
|
||||
return S_OK;
|
||||
|
||||
tinyxml2::XMLDocument doc;
|
||||
string strPath = "../Bin/Resources/Data/Map/Balloon/" + string(pFileName) + ".xml";
|
||||
string strPath = "../Bin/Resources/Data/Map/NPC/" + string(pFileName) + ".xml";
|
||||
|
||||
tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str());
|
||||
|
||||
doc.Clear();
|
||||
doc.InsertFirstChild(doc.NewDeclaration());
|
||||
|
||||
tinyxml2::XMLElement* root = doc.NewElement("Balloon");
|
||||
tinyxml2::XMLElement* root = doc.NewElement("NPC");
|
||||
doc.InsertEndChild(root);
|
||||
|
||||
if (nullptr != pLayer)
|
||||
@@ -2330,6 +2328,51 @@ HRESULT CMapObject_Manager::Load_EffectParts(const _char* pFileName, const _char
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Save_DummyNpc(const _char* pFileName)
|
||||
{
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Npc"));
|
||||
|
||||
if (nullptr == pLayer)
|
||||
return S_OK;
|
||||
|
||||
tinyxml2::XMLDocument doc;
|
||||
string strPath = "../Bin/Resources/Data/Map/NPC/" + string(pFileName) + ".xml";
|
||||
|
||||
tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str());
|
||||
|
||||
doc.Clear();
|
||||
doc.InsertFirstChild(doc.NewDeclaration());
|
||||
|
||||
tinyxml2::XMLElement* root = doc.NewElement("NPC");
|
||||
doc.InsertEndChild(root);
|
||||
|
||||
if (nullptr != pLayer)
|
||||
{
|
||||
const list<CGameObject*>* pList = pLayer->Get_Objects();
|
||||
|
||||
for (auto pGamObject : *pList)
|
||||
{
|
||||
CDummyNPC* pNpc = dynamic_cast<CDummyNPC*>(pGamObject);
|
||||
|
||||
if (nullptr == pNpc)
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(pNpc->Save_XML(doc, root)))
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
MSG_BOX("Failed to Save File");
|
||||
}
|
||||
else
|
||||
{
|
||||
MSG_BOX("Succeed to Save CDummyNPC");
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Update_PrototypeList()
|
||||
{
|
||||
GUI::Begin("Model Prototype List");
|
||||
@@ -2750,11 +2793,11 @@ void CMapObject_Manager::Update_Balloon()
|
||||
GUI::Begin("Ballon Editor");
|
||||
if (GUI::Button("Save Ballon"))
|
||||
{
|
||||
Save_Balloons("Ballon_Data");
|
||||
Save_Balloons("DummyNPC_Data");
|
||||
}
|
||||
if (GUI::Button("Load Ballon"))
|
||||
{
|
||||
Load_Balloons("Ballon_Data");
|
||||
Load_Balloons("DummyNPC_Data");
|
||||
}
|
||||
if (GUI::Button("Add Ballon"))
|
||||
{
|
||||
@@ -2781,6 +2824,42 @@ void CMapObject_Manager::Update_Balloon()
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Update_DummyNpc()
|
||||
{
|
||||
GUI::Begin("DummyNpc Editor");
|
||||
if (GUI::Button("Save DummyNpc"))
|
||||
{
|
||||
Save_DummyNpc("DummyNPC_Data");
|
||||
}
|
||||
if (GUI::Button("Load DummyNpc"))
|
||||
{
|
||||
//Load_Balloons("DummyNPC_Data");
|
||||
}
|
||||
if (GUI::Button("Add DummyNpc"))
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummyNPC>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Npc"))))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
GUI::InputInt("Index : ", (_int*)&m_iSelectedIndex);
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Npc"));
|
||||
|
||||
if (nullptr != pLayer)
|
||||
{
|
||||
_uint iIndex = {};
|
||||
for (auto& pObject : *pLayer->Get_Objects())
|
||||
{
|
||||
if (m_iSelectedIndex == iIndex)
|
||||
pObject->Describe_Entity();
|
||||
|
||||
++iIndex;
|
||||
}
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag)
|
||||
{
|
||||
vector<_uint> LodModelIndices;
|
||||
|
||||
@@ -306,35 +306,35 @@ void CTerrain::Describe_Entity()
|
||||
GUI::Begin("Terrain");
|
||||
|
||||
#pragma region ALPHA_MAP
|
||||
//GUI::InputInt("Color", &m_iColorIndex);
|
||||
//m_iColorIndex = max(0, min(4, m_iColorIndex));
|
||||
|
||||
GUI::InputInt("Color", &m_iColorIndex);
|
||||
m_iColorIndex = max(0, min(4, m_iColorIndex));
|
||||
//GUI::Checkbox("Flat", &m_isFlat);
|
||||
GUI::InputInt("Rnage", (_int*)(&m_iMaskRange));
|
||||
//GUI::DragFloat("Value", &m_fMaskValue, 0.01f, -1.0f, 1.f);
|
||||
//if (GUI::Button("Save", ImVec2(100.f, 30.f)))
|
||||
//{
|
||||
// m_pAlphaMap->Save_ToFile("Hogwart_AlphaMap.bin");
|
||||
//}
|
||||
//if (GUI::Button("Load", ImVec2(100.f, 30.f)))
|
||||
//{
|
||||
// m_pAlphaMap->Load_ToFile("Hogwart_AlphaMap.bin");
|
||||
//}
|
||||
GUI::DragFloat("Value", &m_fMaskValue, 0.01f, -1.0f, 1.f);
|
||||
if (GUI::Button("Save", ImVec2(100.f, 30.f)))
|
||||
{
|
||||
m_pAlphaMap->Save_ToFile("Hogsmeade_AlphaMap.bin");
|
||||
}
|
||||
if (GUI::Button("Load", ImVec2(100.f, 30.f)))
|
||||
{
|
||||
m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin");
|
||||
}
|
||||
|
||||
m_iMaskRange = max(0, m_iMaskRange);
|
||||
GUI::InputFloat("Up Value", &m_fUpValue, 0.001f, 0.1f);
|
||||
|
||||
GUI::InputFloat3("Picking Pos", (_float*)(&m_vPickingPosition));
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON))
|
||||
{
|
||||
if (m_pGameInstance->isPicking(&m_vPickingPosition))
|
||||
{
|
||||
{/*
|
||||
if (m_pGameInstance->Key_Pressing(DIK_PERIOD))
|
||||
m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue, m_vPickingPosition, m_iMaskRange);
|
||||
m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue , m_vPickingPosition, m_iMaskRange, m_isFlat);
|
||||
if (m_pGameInstance->Key_Pressing(DIK_COMMA))
|
||||
m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue * -1.f, m_vPickingPosition, m_iMaskRange);
|
||||
m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue, m_vPickingPosition, m_iMaskRange, m_isFlat);*/
|
||||
|
||||
//XMStoreFloat3(&m_vPickingPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vPickingPosition), m_pTransformCom->Get_WorldMatrixInv()));
|
||||
//if(m_pGameInstance->Key_Pressing(DIK_M))
|
||||
// m_pAlphaMap->Update(m_vPickingPosition, m_iColorIndex, m_fMaskValue, m_iMaskRange);
|
||||
XMStoreFloat3(&m_vPickingPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vPickingPosition), m_pTransformCom->Get_WorldMatrixInv()));
|
||||
if(m_pGameInstance->Key_Pressing(DIK_M))
|
||||
m_pAlphaMap->Update(m_vPickingPosition, m_iColorIndex, m_fMaskValue, m_iMaskRange);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummyNPC final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagDummyNpcDesc
|
||||
{
|
||||
_uint iID = {};
|
||||
_float3 vPosition = {};
|
||||
_float3 vRotation = {};
|
||||
_float3 vScale = { 1.f, 1.f, 1.f };
|
||||
}DUMMY_NPC_DESC;
|
||||
private:
|
||||
CDummyNPC(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummyNPC(const CDummyNPC& rhs);
|
||||
virtual ~CDummyNPC() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
CTexture* m_pNormalTextureCom = { nullptr };
|
||||
CTexture* m_pSurfaceTextureCom = { nullptr };
|
||||
CTexture* m_pDiffuseTextureCom = { nullptr };
|
||||
|
||||
_uint m_iID = {};
|
||||
_float m_fUsingSurfaceParams = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CDummyNPC* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
HRESULT Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root);
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -95,6 +95,8 @@ class CMapObject_Manager final : public CGameObject
|
||||
|
||||
HRESULT Save_EffectParts(const _char* pFileName);
|
||||
HRESULT Load_EffectParts(const _char* pFileName, const _char* pEffectrFilePath);
|
||||
|
||||
HRESULT Save_DummyNpc(const _char* pFileName);
|
||||
#pragma endregion
|
||||
|
||||
void Update_PrototypeList();
|
||||
@@ -107,6 +109,7 @@ class CMapObject_Manager final : public CGameObject
|
||||
void Update_RaceRing();
|
||||
void Update_EffectParts();
|
||||
void Update_Balloon();
|
||||
void Update_DummyNpc();
|
||||
|
||||
void Create_PartObject(_wstring& strPrototypeTag);
|
||||
void Create_Elemnt(_wstring& strPrototypeTag);
|
||||
|
||||
@@ -50,6 +50,7 @@ class CTerrain final : public CGameObject
|
||||
|
||||
_bool m_bUsePsx = { false };
|
||||
_bool m_isEdit = {};
|
||||
_bool m_isFlat = {};
|
||||
|
||||
_float m_fUsingSurfaceParams = {};
|
||||
_float m_fHeightRatio = {1.f};
|
||||
|
||||
@@ -455,7 +455,7 @@ void CVIBuffer_Terrain::Culling(_fmatrix WorldMatrix)
|
||||
m_iNumIndices = iNumIndices;
|
||||
}
|
||||
|
||||
void CVIBuffer_Terrain::FitY(_fmatrix WorldMatrix, _float fY, _float3 vPickingPos, _uint iRange)
|
||||
void CVIBuffer_Terrain::FitY(_fmatrix WorldMatrix, _float fY, _float3 vPickingPos, _uint iRange, _bool isFlat)
|
||||
{
|
||||
m_pGameInstance->Transform_Frustum_ToLocalSpace(XMMatrixInverse(nullptr, WorldMatrix));
|
||||
|
||||
@@ -492,8 +492,11 @@ void CVIBuffer_Terrain::FitY(_fmatrix WorldMatrix, _float fY, _float3 vPickingPo
|
||||
D3D11_MAPPED_SUBRESOURCE SubResource{};
|
||||
m_pContext->Map(m_pVB, 0, D3D11_MAP_READ_WRITE, 0, &SubResource);
|
||||
VTXNORTEX* pVertices = static_cast<VTXNORTEX*>(SubResource.pData);
|
||||
Add_Y(pVertices, iIndex, fY);
|
||||
Add_NeighborY(pVertices, static_cast<_uint>(vLocalPosition.x), static_cast<_uint>(vLocalPosition.z), fY, iRange);
|
||||
//Add_Y(pVertices, iIndex, fY);
|
||||
if (isFlat)
|
||||
Flat_NeighborY(pVertices, static_cast<_uint>(vLocalPosition.x), static_cast<_uint>(vLocalPosition.z), fY, iRange);
|
||||
else
|
||||
Add_NeighborY(pVertices, static_cast<_uint>(vLocalPosition.x), static_cast<_uint>(vLocalPosition.z), fY, iRange);
|
||||
|
||||
m_pContext->Unmap(m_pVB, 0);
|
||||
}
|
||||
@@ -525,6 +528,32 @@ void CVIBuffer_Terrain::Add_NeighborY(VTXNORTEX* pVertices, _uint iX, _uint iZ,
|
||||
|
||||
}
|
||||
|
||||
void CVIBuffer_Terrain::Flat_NeighborY(VTXNORTEX* pVertices, _uint iX, _uint iZ, _float fY, _uint iRange)
|
||||
{
|
||||
_int Range = iRange; // 이웃 범위 설정
|
||||
|
||||
for (_int dz = -Range; dz <= Range; ++dz)
|
||||
{
|
||||
for (_int dx = -Range; dx <= Range; ++dx)
|
||||
{
|
||||
_int nx = iX + dx;
|
||||
_int nz = iZ + dz;
|
||||
|
||||
// 범위 체크 (0 ~ m_iNumVerticesX/Z-1)
|
||||
if (nx < 0 || nz < 0 ||
|
||||
nx >= (_int)m_iNumVerticesX ||
|
||||
nz >= (_int)m_iNumVerticesZ)
|
||||
continue;
|
||||
|
||||
_uint iNeighborIndex =
|
||||
static_cast<_uint>(nx) +
|
||||
static_cast<_uint>(nz) * m_iNumVerticesX;
|
||||
|
||||
Flat(pVertices, iNeighborIndex, fY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CVIBuffer_Terrain::Add_Y(VTXNORTEX* pVertices, _uint iIndex, _float fY)
|
||||
{
|
||||
_uint iIndices[4] = {
|
||||
@@ -555,6 +584,36 @@ void CVIBuffer_Terrain::Add_Y(VTXNORTEX* pVertices, _uint iIndex, _float fY)
|
||||
}
|
||||
}
|
||||
|
||||
void CVIBuffer_Terrain::Flat(VTXNORTEX* pVertices, _uint iIndex, _float fY)
|
||||
{
|
||||
_uint iIndices[4] = {
|
||||
iIndex + m_iNumVerticesX,
|
||||
iIndex + m_iNumVerticesX + 1,
|
||||
iIndex + 1,
|
||||
iIndex
|
||||
};
|
||||
|
||||
for (_uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (0 > iIndices[i] || m_iNumVertices <= iIndices[i])
|
||||
return;
|
||||
}
|
||||
_float fHieght = { };
|
||||
_float fAvgHieght = { };
|
||||
for (_uint i = 0; i < 4; i++)
|
||||
{
|
||||
fHieght += pVertices[iIndices[i]].vPosition.y;
|
||||
}
|
||||
|
||||
fAvgHieght = fHieght / 4.f;
|
||||
|
||||
for (_uint i = 0; i < 4; i++)
|
||||
{
|
||||
pVertices[iIndices[i]].vPosition.y = fY;
|
||||
memcpy(&m_pVertexPositions[iIndices[i]], &pVertices[iIndices[i]].vPosition, sizeof(_float3));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HRESULT CVIBuffer_Terrain::Load_HeightMap(const _char* pFilePath)
|
||||
{
|
||||
|
||||
@@ -28,9 +28,11 @@ class ENGINE_DLL CVIBuffer_Terrain final : public CVIBuffer
|
||||
|
||||
_bool Picking(_fmatrix WorldMatrix, _float3* pOut);
|
||||
void Culling(_fmatrix WorldMatrix);
|
||||
void FitY(_fmatrix WorldMatrix, _float fY, _float3 vPickingPos, _uint iRange);
|
||||
void FitY(_fmatrix WorldMatrix, _float fY, _float3 vPickingPos, _uint iRange, _bool isFlat);
|
||||
void Add_NeighborY(VTXNORTEX* pVertices, _uint iX, _uint iZ, _float fY, _uint iRange);
|
||||
void Flat_NeighborY(VTXNORTEX* pVertices, _uint iX, _uint iZ, _float fY, _uint iRange);
|
||||
void Add_Y(VTXNORTEX* pVertices, _uint iIndex, _float fY);
|
||||
void Flat(VTXNORTEX* pVertices, _uint iIndex, _float fY);
|
||||
HRESULT Load_HeightMap(const _char* pFilePath);
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
|
||||
Reference in New Issue
Block a user