[merge commit]
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
#include "pch.h"
|
||||
#include "Broom.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Broom_Ride.h"
|
||||
#pragma endregion
|
||||
|
||||
#pragma region States
|
||||
|
||||
HRESULT CBroom::InputAction()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
|| m_pGameInstance->Key_Down(DIK_Z)
|
||||
|| m_pGameInstance->Key_Down(DIK_G)
|
||||
|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CBroom::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CBroom::InputKeyUpMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_W)
|
||||
|| m_pGameInstance->Key_Up(DIK_A)
|
||||
|| m_pGameInstance->Key_Up(DIK_S)
|
||||
|| m_pGameInstance->Key_Up(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CBroom::InputSpell()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CBroom::InputAim()
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON) ||
|
||||
m_pGameInstance->Mouse_Pressing(DIM_LBUTTON))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CBroom::Behavior_IdleEnter() {
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_IDLE_B];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta)
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_B)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_MOUNT_B];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CBroom::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CBroom::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B];
|
||||
}
|
||||
else if (bLeft)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_LEFT_B];
|
||||
}
|
||||
else if (bRight)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_RIGHT_B];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B];
|
||||
m_pTransformCom->Go_Straight(fTimeDelta);
|
||||
}
|
||||
else if (bLeft)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_LEFT_B];
|
||||
}
|
||||
else if (bRight)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_RIGHT_B];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CBroom::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CBroom::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CBroom::Set_Anim()
|
||||
{
|
||||
m_Animation[STATEANIM::BROOM_MOUNT_B] = { 29,false };
|
||||
m_Animation[STATEANIM::BROOM_HOVER_IDLE_B] = { 24,true };
|
||||
m_Animation[STATEANIM::BROOM_HOVER_STOP_B] = { 6,false };
|
||||
m_Animation[STATEANIM::BROOM_FLY_B] = { 5,true };
|
||||
m_Animation[STATEANIM::BROOM_FLY_DOWN_B] = { 13,true };
|
||||
m_Animation[STATEANIM::BROOM_FLY_LEFT_B] = { 15,true };
|
||||
m_Animation[STATEANIM::BROOM_FLY_RIGHT_B] = { 16,true };
|
||||
m_Animation[STATEANIM::BROOM_FLY_UP_B] = { 17,true };
|
||||
//Mount 29
|
||||
//호버 스탑 6
|
||||
//호버 제자리 24
|
||||
//플라이 업 17 다운 13 왼쪽15 오른쪽 16
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
|
||||
@@ -228,6 +228,7 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\Public\Spell_Overlay.h" />
|
||||
<ClInclude Include="..\Public\Spell_Slot.h" />
|
||||
<ClInclude Include="..\Public\Spell_UI.h" />
|
||||
<ClInclude Include="..\Public\State_Broom_Ride.h" />
|
||||
<ClInclude Include="..\Public\State_Combat.h" />
|
||||
<ClInclude Include="..\Public\State_Dodge.h" />
|
||||
<ClInclude Include="..\Public\State_Idle.h" />
|
||||
@@ -235,6 +236,7 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\public\StreetContainer.h" />
|
||||
<ClInclude Include="..\public\Terrain.h" />
|
||||
<ClInclude Include="..\Public\TrailObject.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
@@ -315,6 +317,7 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\Private\Spell_Overlay.cpp" />
|
||||
<ClCompile Include="..\Private\Spell_Slot.cpp" />
|
||||
<ClCompile Include="..\Private\Spell_UI.cpp" />
|
||||
<ClCompile Include="..\Private\State_Broom_Ride.cpp" />
|
||||
<ClCompile Include="..\Private\State_Combat.cpp" />
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle.cpp" />
|
||||
@@ -322,9 +325,11 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\private\StreetContainer.cpp" />
|
||||
<ClCompile Include="..\private\Terrain.cpp" />
|
||||
<ClCompile Include="..\Private\TrailObject.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="Broom_States.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -250,6 +250,12 @@
|
||||
<ClInclude Include="..\Public\Potion.h">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\StreetContainer.h">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\StreetContainer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Broom_Ride.h">
|
||||
<Filter>04.Mechanic\State\Broom</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -548,6 +554,12 @@
|
||||
<Filter Include="02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_UI">
|
||||
<UniqueIdentifier>{9914341c-f246-4fdb-b28c-de7a6d2d149b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Broom">
|
||||
<UniqueIdentifier>{48b905c1-b91e-44ca-a61b-86633826768b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\00.MapContainer\StreetContainer">
|
||||
<UniqueIdentifier>{e12a4228-0754-4217-b65d-7f962409f85c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -787,6 +799,15 @@
|
||||
<ClCompile Include="..\Private\Potion.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Broom_States.cpp">
|
||||
<Filter>02.GameObjects\Item\Broom</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Broom_Ride.cpp">
|
||||
<Filter>04.Mechanic\State\Broom</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\StreetContainer.cpp">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\StreetContainer</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
CBroom::CBroom(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CBroom::CBroom(const CBroom& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
: CUnit(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,19 @@ HRESULT CBroom::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(5);
|
||||
Add_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -38,12 +50,14 @@ void CBroom::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CBroom::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
}
|
||||
|
||||
void CBroom::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CBroom::Render()
|
||||
@@ -96,8 +110,10 @@ HRESULT CBroom::Ready_Components()
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -151,11 +167,6 @@ CGameObject* CBroom::Clone(void* pArg, CGameObject* pOwner)
|
||||
void CBroom::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "PartObject.h"
|
||||
//#include "Terrain.h"
|
||||
//#include "Layer.h"
|
||||
//#include "VIBuffer_Terrain.h"
|
||||
|
||||
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
@@ -27,16 +24,21 @@ void CBuildingContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
m_fCamDepth = XMVectorGetX(XMVector3Length(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat3(&m_vExtentWorldPosition)));
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render()
|
||||
@@ -44,6 +46,38 @@ HRESULT CBuildingContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render_BoundingBox()
|
||||
{
|
||||
/* Begin_Query, End_Query 사이에 Render */
|
||||
|
||||
m_pOcclusionQueryCom->Begin_Query();
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pOcclusionQueryCom->End_Query();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
@@ -65,6 +99,8 @@ HRESULT CBuildingContainer::Initialize(void* pArg)
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
XMStoreFloat3(&m_vExtentWorldPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vExtentWorldPosition), m_pTransformCom->Get_XMWorldMatrix()));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -74,6 +110,44 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
_float3 vBoxCorners[8] = {};
|
||||
|
||||
vBoxCorners[0] = _float3(pDesc->vContainerMin.x, pDesc->vContainerMax.y, pDesc->vContainerMin.z);
|
||||
vBoxCorners[1] = _float3(pDesc->vContainerMax.x, pDesc->vContainerMax.y, pDesc->vContainerMin.z);
|
||||
vBoxCorners[2] = _float3(pDesc->vContainerMax.x, pDesc->vContainerMin.y, pDesc->vContainerMin.z);
|
||||
vBoxCorners[3] = _float3(pDesc->vContainerMin.x, pDesc->vContainerMin.y, pDesc->vContainerMin.z);
|
||||
vBoxCorners[4] = _float3(pDesc->vContainerMin.x, pDesc->vContainerMax.y, pDesc->vContainerMax.z);
|
||||
vBoxCorners[5] = _float3(pDesc->vContainerMax.x, pDesc->vContainerMax.y, pDesc->vContainerMax.z);
|
||||
vBoxCorners[6] = _float3(pDesc->vContainerMax.x, pDesc->vContainerMin.y, pDesc->vContainerMax.z);
|
||||
vBoxCorners[7] = _float3(pDesc->vContainerMin.x, pDesc->vContainerMin.y, pDesc->vContainerMax.z);
|
||||
|
||||
_float3 vRadius = {};
|
||||
|
||||
vRadius.x = (pDesc->vContainerMax.x - pDesc->vContainerMin.x) * 0.5f;
|
||||
vRadius.y = (pDesc->vContainerMax.y - pDesc->vContainerMin.y) * 0.5f;
|
||||
vRadius.z = (pDesc->vContainerMax.z - pDesc->vContainerMin.z) * 0.5f;
|
||||
|
||||
m_vExtentWorldPosition.x = pDesc->vContainerMin.x + vRadius.x;
|
||||
m_vExtentWorldPosition.y = pDesc->vContainerMin.y + vRadius.y;
|
||||
m_vExtentWorldPosition.z = pDesc->vContainerMin.z + vRadius.z;
|
||||
|
||||
/* Com_VIBuffer */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom), &vBoxCorners)))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_OcclusionQuery */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
reinterpret_cast<CComponent**>(&m_pOcclusionQueryCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -112,6 +186,10 @@ void CBuildingContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pOcclusionQueryCom);
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,9 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
GUI::DragFloat3("Camera Shoulder Position",(_float*)&m_vShoulderPosRatio,0.01f);
|
||||
GUI::DragFloat("Camera Shoulder Length",&m_fCameraFocalLength, 0.01f);
|
||||
if (m_pGameInstance->Key_Up(DIK_O)) {
|
||||
m_pBinded_Camera->Toggle_Priority();
|
||||
}
|
||||
@@ -110,6 +113,14 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
m_bLerp = true;
|
||||
m_vLerpTimer.x = 0.f;
|
||||
}
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON)) {
|
||||
m_pBinded_Camera->ZoomIn(fTimeDelta);
|
||||
m_bZoomIn = true;
|
||||
}
|
||||
else if(m_bZoomIn)
|
||||
{
|
||||
m_pBinded_Camera->Set_Fov(XMConvertToRadians(60.f),fTimeDelta, m_bZoomIn);
|
||||
}
|
||||
}
|
||||
|
||||
void CCamPosition_Shoulder::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -182,13 +182,15 @@ HRESULT CLevel_GamePlay::Ready_Markers()
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag,nullptr,nullptr,&m_pBroom)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_pBroom))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "VIBuffer_Model_Instance.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "StreetContainer.h"
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
#include "InstancedProp.h"
|
||||
@@ -458,6 +459,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"),
|
||||
VTXPOS::Elements, VTXPOS::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_MESH,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl"),
|
||||
VTXMESH::Elements, VTXMESH::iNumElements)))) {
|
||||
@@ -572,7 +579,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"),
|
||||
@@ -1106,6 +1113,16 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Box */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
CVIBuffer_Box::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_OcclusionQuery */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
COcclusionQuery::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Terrain */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
@@ -1114,6 +1131,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBuildingContainer>(g_iStaticLevel, CBuildingContainer::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CStreetContainer */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CStreetContainer>(g_iStaticLevel, CStreetContainer::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CMapObject_Render */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Render>(g_iStaticLevel, CMapObject_Render::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "StreetContainer.h"
|
||||
#include "MAPPartObject.h"
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
@@ -40,123 +41,28 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName)
|
||||
for (auto* Container = root->FirstChildElement("Container"); Container; Container = Container->NextSiblingElement("Container"))
|
||||
{
|
||||
const _char* pName = {};
|
||||
|
||||
_uint iMapContainerType = {};
|
||||
Container->QueryStringAttribute("Name", &pName);
|
||||
#pragma region ADD_CONTAINER_OBJECT
|
||||
Container->QueryUnsignedAttribute("MapContainerType", &iMapContainerType);
|
||||
|
||||
CBuildingContainer* pContainerObject = { nullptr };
|
||||
CMapContainer::MAP_CONTAINER_DESC ContainerDesc = {};
|
||||
CMapContainer* pContainerObject = nullptr;
|
||||
|
||||
auto* ContainerPosition = Container->FirstChildElement("Position");
|
||||
ContainerPosition->QueryFloatAttribute("x", &ContainerDesc.vPosition.x);
|
||||
ContainerPosition->QueryFloatAttribute("y", &ContainerDesc.vPosition.y);
|
||||
ContainerPosition->QueryFloatAttribute("z", &ContainerDesc.vPosition.z);
|
||||
|
||||
auto* ContainerScale = Container->FirstChildElement("Scale");
|
||||
ContainerScale->QueryFloatAttribute("x", &ContainerDesc.vScale.x);
|
||||
ContainerScale->QueryFloatAttribute("y", &ContainerDesc.vScale.y);
|
||||
ContainerScale->QueryFloatAttribute("z", &ContainerDesc.vScale.z);
|
||||
|
||||
auto* ContainerRotation = Container->FirstChildElement("Rotation");
|
||||
ContainerRotation->QueryFloatAttribute("x", &ContainerDesc.vRotation.x);
|
||||
ContainerRotation->QueryFloatAttribute("y", &ContainerDesc.vRotation.y);
|
||||
ContainerRotation->QueryFloatAttribute("z", &ContainerDesc.vRotation.z);
|
||||
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
|
||||
g_iStaticLevel, ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_BACKGROUND, &ContainerDesc, nullptr, &pContainerObject);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ADD_PARTOBJECT
|
||||
for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
|
||||
if (0 == iMapContainerType)
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_RENDER
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
strTag = PrototypeTag->GetText();
|
||||
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
|
||||
}
|
||||
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
Load_BuildingContainer(Container, &pContainerObject);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ADD_COLLISION
|
||||
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
|
||||
else if (1 == iMapContainerType)
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
Collision->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
Collision->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_LOD
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = Collision->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(PrototypeTag->GetText()));
|
||||
}
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = Collision->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = Collision->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = Collision->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
|
||||
#pragma endregion
|
||||
|
||||
Load_StreetContainer(Container, &pContainerObject);
|
||||
}
|
||||
#pragma endregion
|
||||
else
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_MapRenderObjects(Container, pContainerObject)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_MapCollisionObjects(Container, pContainerObject)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
|
||||
@@ -201,6 +107,165 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_BuildingContainer(tinyxml2::XMLElement* Container, CMapContainer** ppContainerObject)
|
||||
{
|
||||
CBuildingContainer::MAP_CONTAINER_DESC ContainerDesc = {};
|
||||
|
||||
auto* ContainerPosition = Container->FirstChildElement("Position");
|
||||
ContainerPosition->QueryFloatAttribute("x", &ContainerDesc.vPosition.x);
|
||||
ContainerPosition->QueryFloatAttribute("y", &ContainerDesc.vPosition.y);
|
||||
ContainerPosition->QueryFloatAttribute("z", &ContainerDesc.vPosition.z);
|
||||
|
||||
auto* ContainerScale = Container->FirstChildElement("Scale");
|
||||
ContainerScale->QueryFloatAttribute("x", &ContainerDesc.vScale.x);
|
||||
ContainerScale->QueryFloatAttribute("y", &ContainerDesc.vScale.y);
|
||||
ContainerScale->QueryFloatAttribute("z", &ContainerDesc.vScale.z);
|
||||
|
||||
auto* ContainerRotation = Container->FirstChildElement("Rotation");
|
||||
ContainerRotation->QueryFloatAttribute("x", &ContainerDesc.vRotation.x);
|
||||
ContainerRotation->QueryFloatAttribute("y", &ContainerDesc.vRotation.y);
|
||||
ContainerRotation->QueryFloatAttribute("z", &ContainerDesc.vRotation.z);
|
||||
|
||||
auto* BoundingBox_Min = Container->FirstChildElement("BoundingBox_Min");
|
||||
BoundingBox_Min->QueryFloatAttribute("x", &ContainerDesc.vContainerMin.x);
|
||||
BoundingBox_Min->QueryFloatAttribute("y", &ContainerDesc.vContainerMin.y);
|
||||
BoundingBox_Min->QueryFloatAttribute("z", &ContainerDesc.vContainerMin.z);
|
||||
|
||||
auto* BoundingBox_Max = Container->FirstChildElement("BoundingBox_Max");
|
||||
BoundingBox_Max->QueryFloatAttribute("x", &ContainerDesc.vContainerMax.x);
|
||||
BoundingBox_Max->QueryFloatAttribute("y", &ContainerDesc.vContainerMax.y);
|
||||
BoundingBox_Max->QueryFloatAttribute("z", &ContainerDesc.vContainerMax.z);
|
||||
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
|
||||
g_iStaticLevel, ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_BACKGROUND, &ContainerDesc, nullptr, reinterpret_cast<CBuildingContainer**>(ppContainerObject));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_StreetContainer(tinyxml2::XMLElement* Container, CMapContainer** ppContainerObject)
|
||||
{
|
||||
CMapContainer::MAP_CONTAINER_DESC ContainerDesc = {};
|
||||
|
||||
auto* ContainerPosition = Container->FirstChildElement("Position");
|
||||
ContainerPosition->QueryFloatAttribute("x", &ContainerDesc.vPosition.x);
|
||||
ContainerPosition->QueryFloatAttribute("y", &ContainerDesc.vPosition.y);
|
||||
ContainerPosition->QueryFloatAttribute("z", &ContainerDesc.vPosition.z);
|
||||
|
||||
auto* ContainerScale = Container->FirstChildElement("Scale");
|
||||
ContainerScale->QueryFloatAttribute("x", &ContainerDesc.vScale.x);
|
||||
ContainerScale->QueryFloatAttribute("y", &ContainerDesc.vScale.y);
|
||||
ContainerScale->QueryFloatAttribute("z", &ContainerDesc.vScale.z);
|
||||
|
||||
auto* ContainerRotation = Container->FirstChildElement("Rotation");
|
||||
ContainerRotation->QueryFloatAttribute("x", &ContainerDesc.vRotation.x);
|
||||
ContainerRotation->QueryFloatAttribute("y", &ContainerDesc.vRotation.y);
|
||||
ContainerRotation->QueryFloatAttribute("z", &ContainerDesc.vRotation.z);
|
||||
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CStreetContainer>(
|
||||
g_iStaticLevel, ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_BACKGROUND, &ContainerDesc, nullptr, reinterpret_cast<CStreetContainer**>(ppContainerObject));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapContainer* pContainerObject)
|
||||
{
|
||||
#pragma region ADD_PARTOBJECT
|
||||
for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_RENDER
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
strTag = PrototypeTag->GetText();
|
||||
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
|
||||
}
|
||||
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc)))
|
||||
return E_FAIL;
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_MapCollisionObjects(tinyxml2::XMLElement* Container, CMapContainer* pContainerObject)
|
||||
{
|
||||
#pragma region ADD_COLLISION
|
||||
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
Collision->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
Collision->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_LOD
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = Collision->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(PrototypeTag->GetText()));
|
||||
}
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = Collision->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = Collision->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = Collision->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Broom_Ride.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Layer.h"
|
||||
@@ -58,6 +59,8 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
Load_KeyFrame();
|
||||
#endif // _DEBUG
|
||||
|
||||
m_pBroomModel = static_cast<CGameObject*>(pArg)->Get_Component<CModel>();
|
||||
m_pBroomTransform = static_cast<CGameObject*>(pArg)->Get_Component<CTransform>();
|
||||
|
||||
Add_FSM();
|
||||
|
||||
@@ -297,8 +300,8 @@ HRESULT CPlayer::Ready_Parts()
|
||||
Desc.fMouseSensor = 0.1f;
|
||||
Desc.fShoulderDistance = 2.f;
|
||||
Desc.fBackFrontRatio = 0.9f;
|
||||
Desc.fCameraFocalLength = 10.f;
|
||||
Desc.vInitialLook = { 1.f, 2.f, -1.f };
|
||||
Desc.fCameraFocalLength = 13.4f;
|
||||
Desc.vInitialLook = { 0.77f, 1.35f, -1.f };
|
||||
|
||||
if (FAILED(Add_PartObject<CCamPosition_Shoulder>("Cam_Shoulder_Part", g_iStaticLevel, &m_pCamPosition_ShoulderPart, &Desc))) {
|
||||
return E_FAIL;
|
||||
@@ -450,6 +453,8 @@ void CPlayer::Describe_Entity()
|
||||
|
||||
GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
GUI::Text("%d", m_iStateMask);
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Broom_Ride.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "EffectPool.h"
|
||||
@@ -66,6 +67,8 @@ HRESULT CPlayer::InputAction()
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
|| m_pGameInstance->Key_Down(DIK_Z)
|
||||
|| m_pGameInstance->Key_Down(DIK_G)
|
||||
|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
@@ -114,7 +117,8 @@ HRESULT CPlayer::InputSpell()
|
||||
|
||||
HRESULT CPlayer::InputAim()
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON))
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON)||
|
||||
m_pGameInstance->Mouse_Pressing(DIM_LBUTTON))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
@@ -127,7 +131,11 @@ void CPlayer::Behavior_IdleEnter() {
|
||||
|
||||
if (SUCCEEDED(InputAim()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_AIM];
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_AIM];
|
||||
}
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,6 +177,12 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta)
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_G)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_B)) {
|
||||
m_pFSM->Change_State(FSMSTATE::BROOM_RIDE);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -292,7 +306,6 @@ void CPlayer::Behavior_MoveEnter()
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,6 +366,12 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_G)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_B)) {
|
||||
m_pFSM->Change_State(FSMSTATE::BROOM_RIDE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
@@ -387,7 +406,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
@@ -395,7 +414,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
|
||||
_vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f));
|
||||
_vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f));
|
||||
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W))
|
||||
xmvInputDir += xmvCamLook;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S))
|
||||
@@ -411,7 +430,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
xmvInputDir = XMVector3Normalize(xmvInputDir);
|
||||
|
||||
_float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) };
|
||||
|
||||
GUI::Text("%.1f, %.1f", vInputDir.x, vInputDir.y);
|
||||
_vector xmvCurLook = XMVector4Normalize(
|
||||
XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) };
|
||||
@@ -422,35 +441,77 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
_float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x;
|
||||
|
||||
_bool bSkipAngleCheck = { false };
|
||||
if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
|
||||
if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) {
|
||||
if (m_pFSM->IsEnable(FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first &&
|
||||
iCurrentAnimIndex != m_Animation[STATEANIM::WALK_FWD].first) {
|
||||
bSkipAngleCheck = true;
|
||||
if (m_pModelCom->IsFinishedAnim()||
|
||||
m_pFSM->IsEnable(FSMSTATE::STOP)) {
|
||||
if (m_pModelCom->IsFinishedAnim() || m_pFSM->IsEnable(FSMSTATE::STOP)|| SUCCEEDED(InputAim())) {
|
||||
m_pFSM->Disable_State(FSMSTATE::STOP);
|
||||
bSkipAngleCheck = false;
|
||||
}
|
||||
}
|
||||
if (!bSkipAngleCheck) {
|
||||
_float absDir = fabsf(vDir);
|
||||
if (absDir <= XMConvertToRadians(60.f)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
if (absDir <= XMConvertToRadians(90.f)) {
|
||||
if (m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
if (m_pFSM->IsEnable(FSMSTATE::WALK))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(160.f)) {
|
||||
if (cross > 0)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT];
|
||||
if (SUCCEEDED(InputAim()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_LEFT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT];
|
||||
}
|
||||
|
||||
/*if (m_pFSM->IsEnable(FSMSTATE::WALK))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_LEFT];
|
||||
}*/
|
||||
m_fAmount = 0.5f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT];
|
||||
if (SUCCEEDED(InputAim()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_RIGHT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT];
|
||||
}
|
||||
|
||||
/*if (m_pFSM->IsEnable(FSMSTATE::WALK))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_RIGHT];
|
||||
}*/
|
||||
m_fAmount = 0.5f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
if (SUCCEEDED(InputAim()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_BWD];
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::WALK))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
m_fAmount = 0.5f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
@@ -462,12 +523,11 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
|
||||
Player_InterpTurn(fTimeDelta);
|
||||
|
||||
return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)||
|
||||
!SUCCEEDED(InputMove())) {
|
||||
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::STOP))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::STOP);
|
||||
@@ -480,7 +540,22 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
if (iCurrentAnimIndex == m_Animation[STATEANIM::JOG_AIM_LEFT].first)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_STOP_L];
|
||||
}
|
||||
else if (iCurrentAnimIndex == m_Animation[STATEANIM::JOG_AIM_RIGHT].first)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_STOP_R];
|
||||
}
|
||||
else if (iCurrentAnimIndex == m_Animation[STATEANIM::JOG_AIM_BWD].first)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_AIM_STOP_BWD];
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
@@ -507,16 +582,16 @@ void CPlayer::Behavior_JumpEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::WALK | FSMSTATE::JOG | FSMSTATE::SPRINT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG];
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -542,7 +617,7 @@ void CPlayer::Behavior_JumpExit()
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::LAND];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
@@ -569,7 +644,7 @@ void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
m_pFSM->Enable_State(FSMSTATE::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::DODGE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
@@ -580,7 +655,7 @@ HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Dodge")) {
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -654,6 +729,10 @@ void CPlayer::Behavior_CombatEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW);
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_G)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::POTION);
|
||||
pairAnimInfo = m_Animation[STATEANIM::POTION];
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
@@ -712,6 +791,11 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_G)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::POTION);
|
||||
pairAnimInfo = m_Animation[STATEANIM::POTION];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat"))
|
||||
@@ -723,8 +807,6 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
case STATEANIM::ACCIO:
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case STATEANIM::DESCENDO:
|
||||
@@ -750,11 +832,9 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
m_eSpell = STATEANIM::END;
|
||||
return E_FAIL;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::ANCIENT_THROW))
|
||||
{
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) {
|
||||
@@ -781,12 +861,96 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW);
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL |
|
||||
FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW | FSMSTATE::POTION);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_HitEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::HIT);
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
std::random_device rd;
|
||||
std::mt19937 mt(rd());
|
||||
std::uniform_int_distribution<int> Index(0, 1);
|
||||
auto RandIndex = Index(mt);
|
||||
if (RandIndex == 0)
|
||||
pairAnimInfo = m_Animation[STATEANIM::HIT_R];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::HIT_L];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_HitExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_HitExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::HIT);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_Broom_RideEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::BROOM_RIDE);
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_MOUNT];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_Broom_RideExitCheck()
|
||||
{
|
||||
_uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex();
|
||||
|
||||
if (iCurrAnimIndex == m_Animation[STATEANIM::BROOM_MOUNT].first)
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
pairAnimInfo = m_Animation[STATEANIM::BROOM_MOUNT_END];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, true);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
/*if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}*/
|
||||
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_HOVER_IDLE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_HOVER_IDLE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_N)) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_Broom_RideExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::BROOM_RIDE);
|
||||
}
|
||||
|
||||
void CPlayer::Player_InterpTurn(_float fTimeDelta)
|
||||
{
|
||||
if (m_pModelCom->Get_AnimIndex() != m_Animation[STATEANIM::JOG_FWD].first)
|
||||
_uint iCurrIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (iCurrIndex != m_Animation[STATEANIM::JOG_FWD].first&&
|
||||
iCurrIndex != m_Animation[STATEANIM::WALK_FWD].first&&
|
||||
iCurrIndex != m_Animation[STATEANIM::SPRINT].first)
|
||||
return;
|
||||
|
||||
_vector xmvCurLook = XMVector4Normalize(
|
||||
@@ -851,7 +1015,15 @@ void CPlayer::Add_FSM()
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
{
|
||||
if (SUCCEEDED(InputAim()))
|
||||
{
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f);
|
||||
}
|
||||
}
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
@@ -862,15 +1034,11 @@ void CPlayer::Add_FSM()
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
|
||||
_vector xmvPlayerDir = { };
|
||||
|
||||
{
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::STOP))
|
||||
{
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f);
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.05f);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -926,6 +1094,42 @@ void CPlayer::Add_FSM()
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Behavior_Broom_Ride
|
||||
{
|
||||
CState_Broom_Ride::STATE_BROOM_RIDE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_Broom_RideEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_Broom_RideExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_Broom_RideExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W))
|
||||
{
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pBroomTransform->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.03f);
|
||||
}
|
||||
_matrix BroomWorld = XMLoadFloat4x4(m_pBroomTransform->Get_WorldMatrixPtr());
|
||||
_matrix BoneLocal = XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket"));
|
||||
|
||||
XMVECTOR Scale, Rot, Trans;
|
||||
XMMatrixDecompose(&Scale, &Rot, &Trans, BoneLocal);
|
||||
|
||||
_matrix BoneNoScale = XMMatrixRotationQuaternion(Rot) * XMMatrixTranslationFromVector(Trans);
|
||||
static _float3 OffsetPos = { 0.f, 0.f, 0.f };
|
||||
GUI::DragFloat3("BroomOffset", (_float*)&OffsetPos, 0.01f);
|
||||
_matrix Offset = XMMatrixTranslation(OffsetPos.x,
|
||||
OffsetPos.y, OffsetPos.z);
|
||||
|
||||
_matrix SocketWorld = BoneNoScale * Offset* BroomWorld;
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(SocketWorld);
|
||||
m_pCharacter_Controller->Set_Position(SocketWorld.r[3]);
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::BROOM_RIDE, CState_Broom_Ride::Create(&Desc));
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
@@ -949,6 +1153,10 @@ void CPlayer::Set_Anim()
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false }; // Turn
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_AIM_LEFT] = { 171,true };
|
||||
m_Animation[STATEANIM::JOG_AIM_RIGHT] = { 175,true };
|
||||
m_Animation[STATEANIM::JOG_AIM_BWD] = { 166,true };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
@@ -957,22 +1165,40 @@ void CPlayer::Set_Anim()
|
||||
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
m_Animation[STATEANIM::DODGE_BLINK] = { 799,true };
|
||||
m_Animation[STATEANIM::DODGE] = { 878,false };
|
||||
m_Animation[STATEANIM::DODGE_BLINK] = { 876,true };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 991,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::SPELL] = { 696,false };
|
||||
m_Animation[STATEANIM::SPELL] = { 772,false };
|
||||
m_Animation[STATEANIM::MAPHELP] = { 122,false };
|
||||
m_Animation[STATEANIM::POTION] = { 114,false };
|
||||
m_Animation[STATEANIM::ACCIO] = { 417,false };
|
||||
m_Animation[STATEANIM::DESCENDO] = { 418,false };
|
||||
m_Animation[STATEANIM::DEPULSO] = { 782,false };
|
||||
m_Animation[STATEANIM::DIFFINDO] = { 786,false };
|
||||
m_Animation[STATEANIM::LUMOS] = { 782,false };
|
||||
m_Animation[STATEANIM::DESCENDO] = { 857,false };
|
||||
m_Animation[STATEANIM::DEPULSO] = { 858,false };
|
||||
m_Animation[STATEANIM::DIFFINDO] = { 862,false };
|
||||
m_Animation[STATEANIM::LUMOS] = { 851,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
|
||||
m_Animation[STATEANIM::ANCIENT_THROW] = { 843,false };
|
||||
m_Animation[STATEANIM::ANCIENT_THROW] = { 919,false };
|
||||
|
||||
|
||||
m_Animation[STATEANIM::HIT_L] = { 1124,false };
|
||||
m_Animation[STATEANIM::HIT_R] = { 1125,false };
|
||||
|
||||
m_Animation[STATEANIM::BROOM_IDLE] = { 679,true };
|
||||
m_Animation[STATEANIM::BROOM_FWD] = { 680,true };
|
||||
|
||||
m_Animation[STATEANIM::BROOM_MOUNT] = { 734,false };
|
||||
m_Animation[STATEANIM::BROOM_MOUNT_END] = { 737,false };
|
||||
m_Animation[STATEANIM::BROOM_HOVER_START] = { 699,false };
|
||||
m_Animation[STATEANIM::BROOM_HOVER_IDLE] = { 703,true };
|
||||
|
||||
|
||||
m_Animation[STATEANIM::JOG_AIM_STOP_L] = { 295,false };
|
||||
m_Animation[STATEANIM::JOG_AIM_STOP_R] = { 456,false };
|
||||
m_Animation[STATEANIM::JOG_AIM_STOP_BWD] = { 444,false };
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#include "pch.h"
|
||||
#include "State_Broom_Ride.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Broom_Ride::CState_Broom_Ride()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Broom_Ride::Enter()
|
||||
{
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
HRESULT CState_Broom_Ride::Update(_float fTimeDelta)
|
||||
{
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Broom_Ride::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
HRESULT CState_Broom_Ride::Initialize(STATE_BROOM_RIDE_DESC* pDesc)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Broom_Ride* CState_Broom_Ride::Create(STATE_BROOM_RIDE_DESC* pDesc)
|
||||
{
|
||||
CState_Broom_Ride* pInstance = new CState_Broom_Ride;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Broom_Ride::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Broom_Ride::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
#include "pch.h"
|
||||
#include "StreetContainer.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
CStreetContainer::CStreetContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CStreetContainer::CStreetContainer(const CStreetContainer& rhs)
|
||||
:CMapContainer(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CStreetContainer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CStreetContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CStreetContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CStreetContainer* CStreetContainer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CStreetContainer* pInstance = new CStreetContainer(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CStreetContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CStreetContainer::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CStreetContainer* pInstance = new CStreetContainer(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CStreetContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CStreetContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CStreetContainer::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "Unit.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CBroom final : public CGameObject
|
||||
class CBroom final : public CUnit
|
||||
{
|
||||
private:
|
||||
CBroom(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -21,14 +21,8 @@ class CBroom final : public CGameObject
|
||||
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 };
|
||||
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
@@ -41,6 +35,31 @@ class CBroom final : public CGameObject
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
#pragma region STATE
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
|
||||
_float m_fAmount = { 1.f };
|
||||
_float m_fInputTime = {};
|
||||
_bool m_bRatio = { false };
|
||||
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
HRESULT InputKeyUpMove();
|
||||
HRESULT InputSpell();
|
||||
HRESULT InputAim();
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck(_float fTimeDelta);
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck(_float fTimeDelta);
|
||||
void Behavior_MoveExit();
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -3,10 +3,23 @@
|
||||
#include "Client_Define.h"
|
||||
#include "MapContainer.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Box;
|
||||
class COcclusionQuery;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CBuildingContainer final : public CMapContainer
|
||||
class CBuildingContainer final : public CMapContainer // OCCLUSION CONTAINER
|
||||
{
|
||||
public:
|
||||
typedef struct tagMapContainerDesc : public CMapContainer::MAP_CONTAINER_DESC
|
||||
{
|
||||
_float3 vContainerMin;
|
||||
_float3 vContainerMax;
|
||||
}MAP_CONTAINER_DESC;
|
||||
|
||||
private:
|
||||
CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CBuildingContainer(const CBuildingContainer& rhs);
|
||||
@@ -17,25 +30,14 @@ class CBuildingContainer final : public CMapContainer
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_BoundingBox() override;
|
||||
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
return Add_PartObject<T>(strPartKey, iPrototypeLevelIndex, ppOut, pArg);
|
||||
}
|
||||
template<typename T>
|
||||
HRESULT Add_Collision(_uint iPrototypeLevelIndex, void* pArg = nullptr)
|
||||
{
|
||||
T* pPartObject = m_pGameInstance->Clone_Prototype<T>(iPrototypeLevelIndex, pArg, this);
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Box* m_pVIBufferCom = { nullptr };
|
||||
COcclusionQuery* m_pOcclusionQueryCom = { nullptr };
|
||||
|
||||
if (nullptr == pPartObject) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_ColiisonPartObjects.push_back(pPartObject);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
_float3 m_vExtentWorldPosition = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -49,6 +49,8 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
_bool m_bLerp = { false };
|
||||
_float2 m_vLerpTimer = { 0.f, 1.f };
|
||||
|
||||
_bool m_bZoomIn = { false };
|
||||
|
||||
|
||||
CCamPosition_Target* m_pTarget_LookPart = { nullptr };
|
||||
CCamPosition_Target* m_pTarget_FollowPart = { nullptr };
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Client {
|
||||
#define FX_INSTANCE_PROP_MODEL TEXT("FX_INSTANCE_PROP_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
#define FX_VTXPOS TEXT("FX_VTXPOS")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_PROTOTYPE
|
||||
|
||||
@@ -18,6 +18,7 @@ class CLevel_GamePlay final : public CLevel
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
class CBroom* m_pBroom = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Initialize(void* pArg);
|
||||
|
||||
@@ -26,6 +26,25 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
return Add_PartObject<T>(strPartKey, iPrototypeLevelIndex, ppOut, pArg);
|
||||
}
|
||||
template<typename T>
|
||||
HRESULT Add_Collision(_uint iPrototypeLevelIndex, void* pArg = nullptr)
|
||||
{
|
||||
T* pPartObject = m_pGameInstance->Clone_Prototype<T>(iPrototypeLevelIndex, pArg, this);
|
||||
|
||||
if (nullptr == pPartObject) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_ColiisonPartObjects.push_back(pPartObject);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
@@ -18,7 +18,10 @@ class CMapInfo final : public CBase
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_Level();
|
||||
HRESULT Load_MapObjects(const _char* pFilePath);
|
||||
|
||||
HRESULT Load_BuildingContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject);
|
||||
HRESULT Load_StreetContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject);
|
||||
HRESULT Load_MapRenderObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject);
|
||||
HRESULT Load_MapCollisionObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject);
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
@@ -42,6 +42,9 @@ class CPlayer final : public CUnit
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
class CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
class CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
|
||||
class CModel* m_pBroomModel = { nullptr };
|
||||
class CTransform* m_pBroomTransform = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
@@ -75,8 +78,6 @@ class CPlayer final : public CUnit
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void TestKeyInput(_float fTimeDelta);
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
@@ -115,6 +116,14 @@ class CPlayer final : public CUnit
|
||||
HRESULT Behavior_CombatExitCheck();
|
||||
void Behavior_CombatExit();
|
||||
|
||||
void Behavior_HitEnter();
|
||||
HRESULT Behavior_HitExitCheck();
|
||||
void Behavior_HitExit();
|
||||
|
||||
void Behavior_Broom_RideEnter();
|
||||
HRESULT Behavior_Broom_RideExitCheck();
|
||||
void Behavior_Broom_RideExit();
|
||||
|
||||
|
||||
void Player_InterpTurn(_float fTimeDelta);
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Broom_Ride final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagBroomRide : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_BROOM_RIDE_DESC;
|
||||
private:
|
||||
CState_Broom_Ride();
|
||||
virtual ~CState_Broom_Ride() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_BROOM_RIDE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Broom_Ride* Create(STATE_BROOM_RIDE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "MapContainer.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CStreetContainer final : public CMapContainer // NON OCCLUSION CONTAINER
|
||||
{
|
||||
private:
|
||||
CStreetContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CStreetContainer(const CStreetContainer& rhs);
|
||||
~CStreetContainer() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources()override;
|
||||
|
||||
public:
|
||||
static CStreetContainer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner = nullptr)override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -4,6 +4,9 @@
|
||||
<Position x="39.271946" y="3.7999978" z="70.609833"/>
|
||||
<Scale x="1" y="1" z="1"/>
|
||||
<Rotation x="-0" y="-60" z="-0"/>
|
||||
<MapContainerType type="0"/>
|
||||
<BoundingBox_Min x="-7.0020647" y="-0.45976496" z="-1.5148951"/>
|
||||
<BoundingBox_Max x="6.3698497" y="12.858675" z="14.645905"/>
|
||||
<PartObject Lod_Level="1" Key_Index="4">
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A</PrototypeTag>
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A_Lod1</PrototypeTag>
|
||||
@@ -366,6 +369,9 @@
|
||||
<Position x="24" y="8" z="16"/>
|
||||
<Scale x="1" y="1" z="1"/>
|
||||
<Rotation x="0" y="0" z="0"/>
|
||||
<MapContainerType type="1"/>
|
||||
<BoundingBox_Min x="-35.479698" y="-22.290039" z="7.2240992"/>
|
||||
<BoundingBox_Max x="91.70047" y="12.14246" z="98.067856"/>
|
||||
<PartObject Lod_Level="0" Key_Index="0">
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_LowerHiStreet_Zonkos</PrototypeTag>
|
||||
<Position x="0" y="0" z="0"/>
|
||||
@@ -520,6 +526,9 @@
|
||||
<Position x="23.494474" y="0" z="2.9722724"/>
|
||||
<Scale x="1" y="1" z="1"/>
|
||||
<Rotation x="0" y="7.0000072" z="0"/>
|
||||
<MapContainerType type="0"/>
|
||||
<BoundingBox_Min x="-10.33712" y="-13.23702" z="-19.093868"/>
|
||||
<BoundingBox_Max x="8.3332806" y="10.47531" z="17.818052"/>
|
||||
<PartObject Lod_Level="2" Key_Index="0">
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_Gatehouse_Bridge</PrototypeTag>
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_Gatehouse_Bridge_Lod1</PrototypeTag>
|
||||
@@ -716,6 +725,9 @@
|
||||
<Position x="108.25024" y="16.399971" z="131.35001"/>
|
||||
<Scale x="1" y="1" z="1"/>
|
||||
<Rotation x="0" y="0" z="0"/>
|
||||
<MapContainerType type="1"/>
|
||||
<BoundingBox_Min x="-16.85453" y="-16.870581" z="-19.638439"/>
|
||||
<BoundingBox_Max x="19.18985" y="14.93294" z="34.01255"/>
|
||||
<PartObject Lod_Level="0" Key_Index="0">
|
||||
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaMain_A</PrototypeTag>
|
||||
<Position x="0" y="0" z="0"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,12 @@ RasterizerState RS_Nocull
|
||||
DepthClipEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_NocullOcclusion
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = None;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull_Wireframe
|
||||
{
|
||||
FillMode = Wireframe;
|
||||
@@ -162,6 +168,12 @@ DepthStencilState DSS_Default_OutLine_SRead
|
||||
BackFaceStencilFunc = NOT_Equal;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Occlusion
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = zero;
|
||||
};
|
||||
|
||||
BlendState BS_None
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
@@ -274,6 +286,28 @@ BlendState BS_WeightBlend
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
BlendState BS_WhiteMask
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
BlendEnable[1] = false;
|
||||
BlendEnable[2] = false;
|
||||
BlendEnable[3] = false;
|
||||
BlendEnable[4] = false;
|
||||
BlendEnable[5] = false;
|
||||
BlendEnable[6] = false;
|
||||
BlendEnable[7] = false;
|
||||
|
||||
RenderTargetWriteMask[0] = 0;
|
||||
RenderTargetWriteMask[1] = 0;
|
||||
RenderTargetWriteMask[2] = 0;
|
||||
RenderTargetWriteMask[3] = 0;
|
||||
RenderTargetWriteMask[4] = 0;
|
||||
RenderTargetWriteMask[5] = 0;
|
||||
RenderTargetWriteMask[6] = 0;
|
||||
RenderTargetWriteMask[7] = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // ENGINE_SHADER_STATES_HLSLI
|
||||
|
||||
@@ -72,80 +72,49 @@ void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID)
|
||||
uint boneIndex = DTID.x;
|
||||
if (boneIndex >= (uint) BoneCount)
|
||||
return;
|
||||
|
||||
|
||||
float time = CurrentTime;
|
||||
if (Duration > 0)
|
||||
time = min(time, Duration);
|
||||
|
||||
|
||||
Channel channel = g_ChannelBuffer[boneIndex];
|
||||
|
||||
LocalPos result;
|
||||
|
||||
if (channel.KeyCount == 0)
|
||||
{
|
||||
result.Scale = float3(1, 1, 1);
|
||||
result.Rotation = float4(0, 0, 0, 1);
|
||||
result.Translation = float3(0, 0, 0);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint firstIndex = channel.StartIndex;
|
||||
uint lastIndex = channel.StartIndex + channel.KeyCount - 1;
|
||||
uint keyCount = channel.KeyCount;
|
||||
uint lastIndex = firstIndex + keyCount - 1;
|
||||
|
||||
KeyFrame keyframe1 = g_KeyFrameBuffer[firstIndex];
|
||||
KeyFrame keyframe2 = g_KeyFrameBuffer[lastIndex];
|
||||
KeyFrame keyLast = g_KeyFrameBuffer[lastIndex];
|
||||
|
||||
if (time <= keyframe1.fTrackPosition)
|
||||
if (time >= keyLast.fTrackPosition)
|
||||
{
|
||||
result.Scale = keyframe1.vScale;
|
||||
result.Rotation = keyframe1.vRotation;
|
||||
result.Translation = keyframe1.vTranslation;
|
||||
result.Scale = keyLast.vScale;
|
||||
result.Rotation = keyLast.vRotation;
|
||||
result.Translation = keyLast.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
if (time >= keyframe2.fTrackPosition)
|
||||
else
|
||||
{
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < channel.KeyCount - 1; ++i)
|
||||
{
|
||||
uint A = channel.StartIndex + i;
|
||||
uint B = channel.StartIndex + i + 1;
|
||||
|
||||
KeyFrame ka = g_KeyFrameBuffer[A];
|
||||
KeyFrame kb = g_KeyFrameBuffer[B];
|
||||
|
||||
if (time >= ka.fTrackPosition && time <= kb.fTrackPosition)
|
||||
for (uint i = 0; i < keyCount - 1; ++i)
|
||||
{
|
||||
float t = (time - ka.fTrackPosition) / (kb.fTrackPosition - ka.fTrackPosition);
|
||||
KeyFrame Sour = g_KeyFrameBuffer[firstIndex + i];
|
||||
KeyFrame Dest = g_KeyFrameBuffer[firstIndex + i + 1];
|
||||
|
||||
result.Scale = lerp(ka.vScale, kb.vScale, t);
|
||||
result.Rotation = quatSlerp(ka.vRotation, kb.vRotation, t);
|
||||
result.Translation = lerp(ka.vTranslation, kb.vTranslation, t);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
if (time >= Sour.fTrackPosition && time <= Dest.fTrackPosition)
|
||||
{
|
||||
float ratio = (time - Sour.fTrackPosition) /
|
||||
(Dest.fTrackPosition - Sour.fTrackPosition);
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
result.Scale = lerp(Sour.vScale, Dest.vScale, ratio);
|
||||
result.Rotation = quatSlerp(Sour.vRotation, Dest.vRotation, ratio);
|
||||
result.Translation = lerp(Sour.vTranslation, Dest.vTranslation, ratio);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
g_LocalPosOutput[channel.BoneIndex] = result;
|
||||
return;
|
||||
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
float g_fFar;
|
||||
float3 g_vContainerMin;
|
||||
float3 g_vContainerMax;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
};
|
||||
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
};
|
||||
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
{
|
||||
VS_OUT Out;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
Out.vPosition = mul(float4(In.vPosition, 1.f), matWVP);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
};
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vColor : SV_TARGET0;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
Out.vColor = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_DEBUG(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
Out.vColor = float4(1.f, 0.5f, 0.5f, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 NorTechnique11
|
||||
{
|
||||
pass BoundingBoxPass
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Occlusion, 0);
|
||||
SetBlendState(BS_WhiteMask, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN();
|
||||
}
|
||||
|
||||
pass BoundingDebugPass
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, 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_DEBUG();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -476,6 +476,7 @@
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Effect</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxPos.hlsl" />
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxNorTex.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Effect</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
|
||||
|
||||
@@ -1166,5 +1166,8 @@
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxWorldModelInstance.hlsl">
|
||||
<Filter>99.Define\SHADER</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxPos.hlsl">
|
||||
<Filter>99.Define\SHADER</Filter>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -43,7 +43,7 @@ void CBroom::Update(_float fTimeDelta)
|
||||
|
||||
void CBroom::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CBroom::Render()
|
||||
@@ -59,9 +59,14 @@ HRESULT CBroom::Render()
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#include "Terrain.h"
|
||||
#include "Layer.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "PartObject.h"
|
||||
#include "MapObject_LOD.h"
|
||||
#include "Bounding_OBB.h"
|
||||
|
||||
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
@@ -28,10 +29,24 @@ void CBuildingContainer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CBuildingContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pVIBufferCom->Update(m_vBoxCorners);
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
|
||||
if (m_bOcclusionPassed)
|
||||
{
|
||||
_vector WorldPosition = XMVector3TransformCoord(
|
||||
XMVectorSetW(XMLoadFloat3(&m_vExtentPosition), 1.f),
|
||||
XMMatrixTranslation(m_vExtentPosition.x, m_vExtentPosition.y, m_vExtentPosition.z) * m_pTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_vector vCamPosition = XMLoadFloat4(m_pGameInstance->Get_CamPosition());
|
||||
|
||||
// m_fCamDepth = XMVectorGetX(XMVector3LengthSq(vCamPosition - XMVectorSetW(XMLoadFloat3(&m_vExtentPosition), 1.f)));
|
||||
m_fCamDepth = XMVectorGetX(XMVector3Length(vCamPosition - XMLoadFloat3(&m_vExtentPosition)));
|
||||
}
|
||||
}
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
@@ -46,10 +61,20 @@ void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
|
||||
if (m_bOcclusionPassed)
|
||||
{
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render()
|
||||
@@ -57,6 +82,85 @@ HRESULT CBuildingContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render_BoundingBox()
|
||||
{
|
||||
m_pOcclusionQueryCom->Begin_Query();
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_Q))
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(1)))
|
||||
return E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pOcclusionQueryCom->End_Query();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CBuildingContainer::Set_BoundingBox()
|
||||
{
|
||||
_float3 vCurrentMin = {};
|
||||
_float3 vCurrentMax = {};
|
||||
|
||||
|
||||
for (auto& piar : m_PartObjects)
|
||||
{
|
||||
dynamic_cast<CMapObject_LOD*>(piar.second)->Get_BoundingBox(&vCurrentMin, &vCurrentMax);
|
||||
|
||||
vContainerMin.x = min(vContainerMin.x, vCurrentMin.x);
|
||||
vContainerMin.y = min(vContainerMin.y, vCurrentMin.y);
|
||||
vContainerMin.z = min(vContainerMin.z, vCurrentMin.z);
|
||||
|
||||
vContainerMax.x = max(vContainerMax.x, vCurrentMax.x);
|
||||
vContainerMax.y = max(vContainerMax.y, vCurrentMax.y);
|
||||
vContainerMax.z = max(vContainerMax.z, vCurrentMax.z);
|
||||
}
|
||||
|
||||
m_vExtentRadius.x = (vContainerMax.x - vContainerMin.x) * 0.5f;
|
||||
m_vExtentRadius.y = (vContainerMax.y - vContainerMin.y) * 0.5f;
|
||||
m_vExtentRadius.z = (vContainerMax.z - vContainerMin.z) * 0.5f;
|
||||
|
||||
m_vExtentPosition.x = vContainerMin.x + m_vExtentRadius.x;
|
||||
m_vExtentPosition.y = vContainerMin.y + m_vExtentRadius.y;
|
||||
m_vExtentPosition.z = vContainerMin.z + m_vExtentRadius.z;
|
||||
|
||||
m_vBoxCorners[0] = _float3(vContainerMin.x, vContainerMax.y, vContainerMin.z);
|
||||
m_vBoxCorners[1] = _float3(vContainerMax.x, vContainerMax.y, vContainerMin.z);
|
||||
m_vBoxCorners[2] = _float3(vContainerMax.x, vContainerMin.y, vContainerMin.z);
|
||||
m_vBoxCorners[3] = _float3(vContainerMin.x, vContainerMin.y, vContainerMin.z);
|
||||
m_vBoxCorners[4] = _float3(vContainerMin.x, vContainerMax.y, vContainerMax.z);
|
||||
m_vBoxCorners[5] = _float3(vContainerMax.x, vContainerMax.y, vContainerMax.z);
|
||||
m_vBoxCorners[6] = _float3(vContainerMax.x, vContainerMin.y, vContainerMax.z);
|
||||
m_vBoxCorners[7] = _float3(vContainerMin.x, vContainerMin.y, vContainerMax.z);
|
||||
|
||||
m_pVIBufferCom->Update(m_vBoxCorners);
|
||||
|
||||
//XMStoreFloat4x4(&m_BoundingBoxWorldMatirx, m_pTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
//memcpy(&m_BoundingBoxWorldMatirx.m[3], &m_vExtentPosition, sizeof(_float3));
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
@@ -75,6 +179,10 @@ HRESULT CBuildingContainer::Initialize(void* pArg)
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
m_strName = pDesc->strName;
|
||||
if (string::npos == m_strName.find("Street"))
|
||||
m_bOcclusionPassed = true;
|
||||
else
|
||||
m_bOcclusionPassed = false;
|
||||
|
||||
m_vPosition = pDesc->vPosition;
|
||||
m_vScale = pDesc->vScale;
|
||||
@@ -93,6 +201,21 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_OcclusionQuery */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
reinterpret_cast<CComponent**>(&m_pOcclusionQueryCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -131,6 +254,10 @@ void CBuildingContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pOcclusionQueryCom);
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
@@ -141,6 +268,11 @@ void CBuildingContainer::Describe_Entity()
|
||||
return;
|
||||
if (nullptr == m_pGameInstance)
|
||||
return;
|
||||
if (GUI::Button("BoundingBox"))
|
||||
{
|
||||
Set_BoundingBox();
|
||||
}
|
||||
|
||||
|
||||
GUI::Text(m_strName.c_str());
|
||||
GUI::Text("----- Transfrom ----");
|
||||
@@ -170,6 +302,9 @@ void CBuildingContainer::Describe_Entity()
|
||||
m_vScale.z = max(0.01f, m_vScale.z);
|
||||
|
||||
|
||||
GUI::InputFloat3("Extent Radius", &m_vExtentRadius.x);
|
||||
GUI::InputFloat3("Extent Position", &m_vExtentPosition.x);
|
||||
|
||||
if (GUI::Button("Delete"))
|
||||
m_bDead = true;
|
||||
|
||||
|
||||
@@ -630,6 +630,22 @@ void CLevel_ObjectViewer::Load_KeyFrame(const _char* Name)
|
||||
|
||||
void CLevel_ObjectViewer::Find_Anim()
|
||||
{
|
||||
GUI::InputInt("FindAnimIndex", &m_iAnimIndex);
|
||||
|
||||
if (!m_Objects.empty())
|
||||
{
|
||||
CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component<CModel>();
|
||||
if (m_iAnimIndex <= pModel->Get_AnimSize())
|
||||
{
|
||||
if (GUI::Button(pModel->Get_AnimList(m_iAnimIndex)))
|
||||
{
|
||||
pModel->Set_AnimationIndex(m_iAnimIndex);
|
||||
pModel->Set_CurrentTrackPosition(0.f);
|
||||
pModel->Play_Animation(0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUI::InputText("FindAnim", m_FindAnimName, sizeof(m_FindAnimName));
|
||||
|
||||
if (!m_Objects.empty())
|
||||
@@ -648,6 +664,7 @@ void CLevel_ObjectViewer::Find_Anim()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Save_KeyFrame()
|
||||
@@ -737,8 +754,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
|
||||
return E_FAIL;*/
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
|
||||
#pragma region MAP_HEADER
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
#include "OcclusionQuery.h"
|
||||
#include "Terrain.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MapObject_Collision.h"
|
||||
@@ -1613,7 +1615,7 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
TEXT("Prototype_Component_Wand_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f))* XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Broom_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
@@ -2290,6 +2292,12 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"),
|
||||
VTXPOS::Elements, VTXPOS::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
|
||||
@@ -2303,6 +2311,7 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "../Bin/Resources/Data/Map/T_LandscapeStreamingProxy_0_LOD1_D.png"))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
CVIBuffer_Model_Instance::INSTANCE_DESC InstanceDesc = {};
|
||||
|
||||
InstanceDesc.iNum = 200;
|
||||
@@ -2325,6 +2334,16 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
"../Bin/Resources/Models/InstanceProp/SM_BearBerry_A.fbx", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Box */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
CVIBuffer_Box::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_OcclusionQuery */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
COcclusionQuery::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_SkyBox */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -67,7 +67,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg)
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
|
||||
XMStoreFloat3(&m_CombinedExtendPosition, XMVector3TransformCoord(XMLoadFloat3(&vOffset), XMLoadFloat4x4(&m_CombinedWorldMatrix)));
|
||||
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
|
||||
@@ -111,6 +111,8 @@ void CMapObject_LOD::Late_Update(_float fTimeDelta)
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
|
||||
|
||||
_float fRaius = m_pModelComs[0]->Get_Radius();
|
||||
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), fRaius)) {
|
||||
|
||||
@@ -184,6 +186,24 @@ _wstring CMapObject_LOD::Get_PrototypeTag(_uint iLodIndex)
|
||||
return m_ModelPrototypeTags[iLodIndex];
|
||||
}
|
||||
|
||||
void CMapObject_LOD::Get_BoundingBox(_float3* pMinPosition, _float3* pMaxPosition)
|
||||
{
|
||||
_float fRadius = m_pModelComs[0]->Get_Radius() / 2.f;
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
|
||||
_float3 vPosition = {};
|
||||
|
||||
XMStoreFloat3(&vPosition, XMVector3TransformCoord(XMLoadFloat3(&vOffset), m_pTransformCom->Get_XMWorldMatrix()));
|
||||
|
||||
pMinPosition->x = vPosition.x - fRadius;
|
||||
pMinPosition->y = vPosition.y - fRadius;
|
||||
pMinPosition->z = vPosition.z - fRadius;
|
||||
|
||||
pMaxPosition->x = vPosition.x + fRadius;
|
||||
pMaxPosition->y = vPosition.y + fRadius;
|
||||
pMaxPosition->z = vPosition.z + fRadius;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_LOD::Add_LodModel(const _tchar* pModelPrototypeTag)
|
||||
{
|
||||
CModel* pModel = { nullptr };
|
||||
|
||||
@@ -259,6 +259,32 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
|
||||
container->InsertEndChild(Rotation);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BOUNDING_BOX
|
||||
tinyxml2::XMLElement* MapContainerType = doc.NewElement("MapContainerType");
|
||||
if(pContainerObject->Is_OcclusionPassed())
|
||||
MapContainerType->SetAttribute("type", 0); // Building
|
||||
else
|
||||
MapContainerType->SetAttribute("type", 1); // Road
|
||||
|
||||
container->InsertEndChild(MapContainerType);
|
||||
|
||||
_float3 vMinPosition = dynamic_cast<CBuildingContainer*>(pGamObject)->Get_BoundingBox_Min();
|
||||
_float3 vMaxPosition = dynamic_cast<CBuildingContainer*>(pGamObject)->Get_BoundingBox_Max();
|
||||
|
||||
tinyxml2::XMLElement* BoundingBox_Min = doc.NewElement("BoundingBox_Min");
|
||||
BoundingBox_Min->SetAttribute("x", vMinPosition.x);
|
||||
BoundingBox_Min->SetAttribute("y", vMinPosition.y);
|
||||
BoundingBox_Min->SetAttribute("z", vMinPosition.z);
|
||||
container->InsertEndChild(BoundingBox_Min);
|
||||
|
||||
tinyxml2::XMLElement* BoundingBox_Max = doc.NewElement("BoundingBox_Max");
|
||||
BoundingBox_Max->SetAttribute("x", vMaxPosition.x);
|
||||
BoundingBox_Max->SetAttribute("y", vMaxPosition.y);
|
||||
BoundingBox_Max->SetAttribute("z", vMaxPosition.z);
|
||||
container->InsertEndChild(BoundingBox_Max);
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#pragma region SAVE_PARTOBJECT
|
||||
|
||||
if (FAILED(pContainerObject->Save_PartObjects(doc, container)))
|
||||
@@ -710,6 +736,8 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
pContainerObject->Set_BoundingBox();
|
||||
|
||||
#pragma region ADD_COLLISION
|
||||
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
|
||||
{
|
||||
@@ -1342,6 +1370,17 @@ void CMapObject_Manager::Update_ContainerObject()
|
||||
|
||||
_uint iIndex = {};
|
||||
|
||||
if (GUI::Button("Set Box"))
|
||||
{
|
||||
if (false == (*pList).empty())
|
||||
{
|
||||
for (auto& pObject : (*pList))
|
||||
{
|
||||
dynamic_cast<CBuildingContainer*>(pObject)->Set_BoundingBox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (false == (*pList).empty())
|
||||
{
|
||||
CGameObject* pSelectObject = { nullptr };
|
||||
|
||||
@@ -34,7 +34,7 @@ HRESULT CTerrain::Initialize(void* pArg)
|
||||
|
||||
m_fUsingSurfaceParams = 15.f / 27.f;
|
||||
m_vRotation = _float3{ 0.f, 0.f, 0.f };
|
||||
//m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f));
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f));
|
||||
|
||||
//m_pVIBufferCom->Set_CullingRadius(0.04f);
|
||||
|
||||
@@ -109,7 +109,7 @@ void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTerrain::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pVIBufferCom->Culling(XMMatrixIdentity());
|
||||
//m_pVIBufferCom->Culling(XMMatrixIdentity());
|
||||
|
||||
if(m_pGameInstance->Key_Down(DIK_LSHIFT) && m_pGameInstance->Key_Down(DIK_W))
|
||||
{
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
#include "Editor_Define.h"
|
||||
#include "MapContainer.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Box;
|
||||
class COcclusionQuery;
|
||||
class CCollider;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CBuildingContainer final : public CMapContainer
|
||||
@@ -17,7 +24,12 @@ class CBuildingContainer final : public CMapContainer
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_BoundingBox() override;
|
||||
|
||||
_float3 Get_BoundingBox_Min() { return vContainerMin; }
|
||||
_float3 Get_BoundingBox_Max() { return vContainerMax; }
|
||||
void Set_BoundingBox();
|
||||
_bool Is_OcclusionPassed() { return m_bOcclusionPassed; }
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
@@ -39,7 +51,20 @@ class CBuildingContainer final : public CMapContainer
|
||||
|
||||
vector<class CPartObject*>* Get_Collision() { return &m_ColiisonPartObjects; }
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Box* m_pVIBufferCom = { nullptr };
|
||||
COcclusionQuery* m_pOcclusionQueryCom = { nullptr };
|
||||
CCollider* m_pCollider = { nullptr };
|
||||
|
||||
_bool m_bOcclusionPassed = { true };
|
||||
_float4x4 m_BoundingBoxWorldMatirx = {};
|
||||
_float3 m_vBoxCorners[8] = {};
|
||||
|
||||
_float3 m_vExtentPosition = {};
|
||||
_float3 m_vExtentRadius = {};
|
||||
_float3 vContainerMin = { 999.f, 999.f, 999.f };
|
||||
_float3 vContainerMax = { -999.f, -999.f, -999.f };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Editor {
|
||||
#define FX_INSTANCE_PROP_MODEL TEXT("FX_INSTANCE_PROP_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
|
||||
#define FX_VTXPOS TEXT("FX_VTXPOS")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_PROTOTYPE
|
||||
|
||||
@@ -57,6 +57,7 @@ class CLevel_ObjectViewer final : public CLevel
|
||||
_char m_DummyPath[MAX_PATH];
|
||||
_char m_FindAnimName[256] = {};
|
||||
string m_SelectedKey;
|
||||
_int m_iAnimIndex = {};
|
||||
|
||||
class CPlayer* m_Test = { nullptr };
|
||||
public:
|
||||
|
||||
@@ -25,6 +25,7 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
|
||||
virtual _string& Get_Name() { return m_strName; }
|
||||
virtual HRESULT Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XMLElement* Container);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ class CMapObject_LOD final : public CMapObject // LOD 있는 애들
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
void Get_BoundingBox(_float3* pMinPosition, _float3* pMaxPosition);
|
||||
HRESULT Add_LodModel(const _tchar* pModelPrototypeTag);
|
||||
void Set_KeyIndex(_uint iIndex) {
|
||||
m_iKeyIndex = iIndex;
|
||||
@@ -41,6 +42,8 @@ class CMapObject_LOD final : public CMapObject // LOD 있는 애들
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
vector<_uint> m_ModelPathIndices = { };
|
||||
_float3 m_CombinedExtendPosition = {};
|
||||
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
|
||||
@@ -15,6 +15,12 @@ RasterizerState RS_Nocull
|
||||
DepthClipEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_NocullOcclusion
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = None;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull_Wireframe
|
||||
{
|
||||
FillMode = Wireframe;
|
||||
@@ -162,6 +168,12 @@ DepthStencilState DSS_Default_OutLine_SRead
|
||||
BackFaceStencilFunc = NOT_Equal;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Occlusion
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = zero;
|
||||
};
|
||||
|
||||
BlendState BS_None
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
@@ -274,6 +286,28 @@ BlendState BS_WeightBlend
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
BlendState BS_WhiteMask
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
BlendEnable[1] = false;
|
||||
BlendEnable[2] = false;
|
||||
BlendEnable[3] = false;
|
||||
BlendEnable[4] = false;
|
||||
BlendEnable[5] = false;
|
||||
BlendEnable[6] = false;
|
||||
BlendEnable[7] = false;
|
||||
|
||||
RenderTargetWriteMask[0] = 0;
|
||||
RenderTargetWriteMask[1] = 0;
|
||||
RenderTargetWriteMask[2] = 0;
|
||||
RenderTargetWriteMask[3] = 0;
|
||||
RenderTargetWriteMask[4] = 0;
|
||||
RenderTargetWriteMask[5] = 0;
|
||||
RenderTargetWriteMask[6] = 0;
|
||||
RenderTargetWriteMask[7] = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // ENGINE_SHADER_STATES_HLSLI
|
||||
|
||||
@@ -72,80 +72,49 @@ void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID)
|
||||
uint boneIndex = DTID.x;
|
||||
if (boneIndex >= (uint) BoneCount)
|
||||
return;
|
||||
|
||||
|
||||
float time = CurrentTime;
|
||||
if (Duration > 0)
|
||||
time = min(time, Duration);
|
||||
|
||||
|
||||
Channel channel = g_ChannelBuffer[boneIndex];
|
||||
|
||||
LocalPos result;
|
||||
|
||||
if (channel.KeyCount == 0)
|
||||
{
|
||||
result.Scale = float3(1, 1, 1);
|
||||
result.Rotation = float4(0, 0, 0, 1);
|
||||
result.Translation = float3(0, 0, 0);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint firstIndex = channel.StartIndex;
|
||||
uint lastIndex = channel.StartIndex + channel.KeyCount - 1;
|
||||
uint keyCount = channel.KeyCount;
|
||||
uint lastIndex = firstIndex + keyCount - 1;
|
||||
|
||||
KeyFrame keyframe1 = g_KeyFrameBuffer[firstIndex];
|
||||
KeyFrame keyframe2 = g_KeyFrameBuffer[lastIndex];
|
||||
KeyFrame keyLast = g_KeyFrameBuffer[lastIndex];
|
||||
|
||||
if (time <= keyframe1.fTrackPosition)
|
||||
if (time >= keyLast.fTrackPosition)
|
||||
{
|
||||
result.Scale = keyframe1.vScale;
|
||||
result.Rotation = keyframe1.vRotation;
|
||||
result.Translation = keyframe1.vTranslation;
|
||||
result.Scale = keyLast.vScale;
|
||||
result.Rotation = keyLast.vRotation;
|
||||
result.Translation = keyLast.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
if (time >= keyframe2.fTrackPosition)
|
||||
else
|
||||
{
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < channel.KeyCount - 1; ++i)
|
||||
{
|
||||
uint A = channel.StartIndex + i;
|
||||
uint B = channel.StartIndex + i + 1;
|
||||
|
||||
KeyFrame ka = g_KeyFrameBuffer[A];
|
||||
KeyFrame kb = g_KeyFrameBuffer[B];
|
||||
|
||||
if (time >= ka.fTrackPosition && time <= kb.fTrackPosition)
|
||||
for (uint i = 0; i < keyCount - 1; ++i)
|
||||
{
|
||||
float t = (time - ka.fTrackPosition) / (kb.fTrackPosition - ka.fTrackPosition);
|
||||
KeyFrame Sour = g_KeyFrameBuffer[firstIndex + i];
|
||||
KeyFrame Dest = g_KeyFrameBuffer[firstIndex + i + 1];
|
||||
|
||||
result.Scale = lerp(ka.vScale, kb.vScale, t);
|
||||
result.Rotation = quatSlerp(ka.vRotation, kb.vRotation, t);
|
||||
result.Translation = lerp(ka.vTranslation, kb.vTranslation, t);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
if (time >= Sour.fTrackPosition && time <= Dest.fTrackPosition)
|
||||
{
|
||||
float ratio = (time - Sour.fTrackPosition) /
|
||||
(Dest.fTrackPosition - Sour.fTrackPosition);
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
result.Scale = lerp(Sour.vScale, Dest.vScale, ratio);
|
||||
result.Rotation = quatSlerp(Sour.vRotation, Dest.vRotation, ratio);
|
||||
result.Translation = lerp(Sour.vTranslation, Dest.vTranslation, ratio);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
g_LocalPosOutput[channel.BoneIndex] = result;
|
||||
return;
|
||||
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
}
|
||||
|
||||
@@ -208,6 +208,7 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\ContainerObject.cpp" />
|
||||
<ClCompile Include="..\Private\DebugDraw.cpp" />
|
||||
<ClCompile Include="..\private\QuadTree.cpp" />
|
||||
<ClCompile Include="..\private\OcclusionQuery.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic_Joint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -311,6 +312,7 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\private\UIObject.cpp" />
|
||||
<ClCompile Include="..\Private\Unit.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer.cpp" />
|
||||
<ClCompile Include="..\private\VIBuffer_Box.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Cell.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Instance_Model.cpp" />
|
||||
@@ -423,6 +425,7 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\Bounding_Sphere.h" />
|
||||
<ClInclude Include="..\public\FSM.h" />
|
||||
<ClInclude Include="..\public\QuadTree.h" />
|
||||
<ClInclude Include="..\public\OcclusionQuery.h" />
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic_Joint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -556,6 +559,7 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\public\UIObject.h" />
|
||||
<ClInclude Include="..\Public\Unit.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer.h" />
|
||||
<ClInclude Include="..\public\VIBuffer_Box.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Cell.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Cube.h" />
|
||||
<ClInclude Include="..\Public\Instance_Model.h" />
|
||||
|
||||
@@ -289,6 +289,12 @@
|
||||
<Filter Include="99.Define\99.THIRDPARTY\PHYSX">
|
||||
<UniqueIdentifier>{5948985e-f67e-4627-aca4-09b8e9edc359}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\02.VIBuffer\Box">
|
||||
<UniqueIdentifier>{f1ac53f8-59f6-4371-a48c-c331f337ebe7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\11.Query">
|
||||
<UniqueIdentifier>{432b36d5-fdf6-456a-bc71-8bf793a42314}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -546,6 +552,12 @@
|
||||
<ClCompile Include="..\Private\VIBuffer_Model_Instance.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance\Model_Instance</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\OcclusionQuery.cpp">
|
||||
<Filter>02.Element\02.Component\11.Query</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\VIBuffer_Box.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Box</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -1172,6 +1184,12 @@
|
||||
<ClInclude Include="..\Public\VIBuffer_Model_Instance.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance\Model_Instance</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\OcclusionQuery.h">
|
||||
<Filter>02.Element\02.Component\11.Query</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\VIBuffer_Box.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Box</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -33,7 +33,7 @@ CAnimation::CAnimation(const CAnimation& rhs)
|
||||
SAFE_ADDREF(pChannel);
|
||||
}
|
||||
}
|
||||
_bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,_vector vector[3], _float m_fAmount)
|
||||
_bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,_vector vector[3])
|
||||
{
|
||||
m_fProgress = m_fTickPerSecond * fTimeDelta * m_fAnimSpeed;
|
||||
m_fCurrentTrackPosition += m_fProgress;
|
||||
@@ -48,12 +48,12 @@ _bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bone
|
||||
Depart_Animation();
|
||||
m_fCurrentTrackPosition = m_fProgress;
|
||||
ResetRootMotion();
|
||||
ProgressAnimation(Bones, pLocalPosArray, vector, m_fAmount);
|
||||
ProgressAnimation(Bones, pLocalPosArray, vector);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
ProgressAnimation(Bones, pLocalPosArray, vector, m_fAmount);
|
||||
ProgressAnimation(Bones, pLocalPosArray, vector);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -309,14 +309,14 @@ HRESULT CAnimation::Initialize(const vector<CBone*>& Bones, const CModel* pModel
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CAnimation::ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray,_vector vector[3], _float m_fAmount)
|
||||
void CAnimation::ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray,_vector vector[3])
|
||||
{
|
||||
_uint iIndex = {};
|
||||
if (m_vBoneTransformationMatrix.size() > 0) {
|
||||
m_vBoneTransformationMatrix.clear();
|
||||
}
|
||||
for (auto& pChannel : m_Channels) {
|
||||
pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], vector, m_fAmount);
|
||||
pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], vector);
|
||||
m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,32 @@ HRESULT CCamera::Ready_Shadow()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CCamera::ZoomIn(_float fTimeDelta)
|
||||
{
|
||||
if (m_fFovy > XMConvertToRadians(40.f))
|
||||
{
|
||||
m_fFovy -= (fTimeDelta * 1.2f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CCamera::Set_Fov(_float fFovy, _float fTimeDelta,_bool& bZoomIn)
|
||||
{
|
||||
if (fFovy > m_fFovy)
|
||||
{
|
||||
m_fFovy += (fTimeDelta * 0.6f);
|
||||
}
|
||||
else if(fFovy < m_fFovy)
|
||||
{
|
||||
m_fFovy -= (fTimeDelta * 0.6f);
|
||||
}
|
||||
|
||||
if (fFovy == m_fFovy)
|
||||
{
|
||||
bZoomIn = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
@@ -116,81 +116,31 @@ void CChannel::Update_TransformationMatirx(
|
||||
const LOCALPOS_DESC* pLocalPosArray,
|
||||
_float fCurrentTrackPosition,
|
||||
_uint* pCurrentKeyFrameIndex,
|
||||
_vector vector[3],_float m_fAmount)
|
||||
_vector vector[3])
|
||||
{
|
||||
const LOCALPOS_DESC& LocalPos = pLocalPosArray[m_iBoneIndex];
|
||||
|
||||
if (0.f == fCurrentTrackPosition)
|
||||
*pCurrentKeyFrameIndex = 0;
|
||||
|
||||
KEYFRAME LastKeyFrame = m_KeyFrames.back();
|
||||
|
||||
_vector vScale{};
|
||||
_vector vRotation{};
|
||||
_vector vTranslation{};
|
||||
|
||||
if (fCurrentTrackPosition >= LastKeyFrame.fTrackPosition)
|
||||
{
|
||||
vScale = XMLoadFloat3(&LastKeyFrame.vScale);
|
||||
vRotation = XMLoadFloat4(&LastKeyFrame.vRotation);
|
||||
vTranslation = XMVectorSetW(XMLoadFloat3(&LastKeyFrame.vTranslation), 1.f);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
while (fCurrentTrackPosition >= m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition){
|
||||
++*pCurrentKeyFrameIndex;
|
||||
}
|
||||
|
||||
_float3 vSourScale{}, vDestScale{};
|
||||
_float4 vSourRotation{}, vDestRotation{};
|
||||
_float3 vSourTranslation{}, vDestTranslation{};
|
||||
|
||||
vSourScale = m_KeyFrames[*pCurrentKeyFrameIndex].vScale;
|
||||
vDestScale = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vScale;
|
||||
|
||||
vSourRotation = m_KeyFrames[*pCurrentKeyFrameIndex].vRotation;
|
||||
vDestRotation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vRotation;
|
||||
|
||||
vSourTranslation = m_KeyFrames[*pCurrentKeyFrameIndex].vTranslation;
|
||||
vDestTranslation = m_KeyFrames[*pCurrentKeyFrameIndex + 1].vTranslation;
|
||||
|
||||
_float fRatio = (fCurrentTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition) /
|
||||
(m_KeyFrames[*pCurrentKeyFrameIndex + 1].fTrackPosition - m_KeyFrames[*pCurrentKeyFrameIndex].fTrackPosition);
|
||||
|
||||
vScale = XMVectorLerp(XMLoadFloat3(&vSourScale), XMLoadFloat3(&vDestScale), fRatio);
|
||||
vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSourRotation), XMLoadFloat4(&vDestRotation), fRatio);
|
||||
vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSourTranslation), XMLoadFloat3(&vDestTranslation), fRatio), 1.f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//const LOCALPOS_DESC& LocalPos = pLocalPosArray[m_iBoneIndex];
|
||||
|
||||
//_vector vScale = XMLoadFloat3(&LocalPos.Scale);
|
||||
//_vector vRotation = XMLoadFloat4(&LocalPos.Rotation);
|
||||
//_vector vTranslation = XMVectorSet(
|
||||
// LocalPos.Translation.x,
|
||||
// LocalPos.Translation.y,
|
||||
// LocalPos.Translation.z,
|
||||
// 1.f);
|
||||
_vector vScale = XMLoadFloat3(&LocalPos.Scale);
|
||||
_vector vRotation = XMLoadFloat4(&LocalPos.Rotation);
|
||||
_vector vTranslation = XMVectorSet(
|
||||
LocalPos.Translation.x,
|
||||
LocalPos.Translation.y,
|
||||
LocalPos.Translation.z,
|
||||
1.f);
|
||||
|
||||
if (Bones[m_iBoneIndex]->Compare_Name("Reference"))
|
||||
{
|
||||
vector[0] = vScale;
|
||||
vector[1] = vRotation;
|
||||
vector[2] = vTranslation;
|
||||
vTranslation = XMVectorZero();
|
||||
}
|
||||
|
||||
m_BoneTransformationMatrix =
|
||||
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
|
||||
m_BoneTransformationMatrix =
|
||||
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
|
||||
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CChannel::ResetRootMotion()
|
||||
{
|
||||
m_vPrevRootPos = { 0.f, 0.f, 0.f };
|
||||
|
||||
@@ -113,6 +113,12 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
if (m_iCurrentAnimIndex < 0 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations)
|
||||
return false;
|
||||
|
||||
if (m_bLoopRestarted)
|
||||
{
|
||||
m_vPrevRootPos = { 0,0,0 };
|
||||
m_bLoopRestarted = false;
|
||||
}
|
||||
|
||||
ComputeAnimation();
|
||||
|
||||
if (m_iPreAnimIndex >= 0 && m_iPreAnimIndex != m_iCurrentAnimIndex)
|
||||
@@ -136,22 +142,11 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector, m_fAmount);
|
||||
|
||||
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector);
|
||||
|
||||
m_iPreAnimIndex = m_iCurrentAnimIndex;
|
||||
}
|
||||
|
||||
if (m_bIsFinishedAnim)
|
||||
{
|
||||
if (m_bIsLoop)
|
||||
{
|
||||
m_vPrevRootPos = { 0.f, 0.f, 0.f };
|
||||
}
|
||||
else
|
||||
XMStoreFloat3(&m_vPrevRootPos, m_vector[2]);
|
||||
}
|
||||
|
||||
if (m_bRatio) {
|
||||
Update_RootBone(m_fAmount * m_fRatio);
|
||||
}
|
||||
@@ -162,10 +157,18 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
|
||||
if (m_bIsFinishedAnim)
|
||||
{
|
||||
if (m_bIsLoop)
|
||||
{
|
||||
m_bLoopRestarted = true;
|
||||
}
|
||||
else
|
||||
XMStoreFloat3(&m_vPrevRootPos, m_vector[2]);
|
||||
|
||||
m_vPrevRootRot = { 0.f,0.f,0.f,0.f };
|
||||
m_bInitialRootRotSaved = false;
|
||||
}
|
||||
|
||||
|
||||
for (auto& pBone : m_Bones)
|
||||
{
|
||||
pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix));
|
||||
@@ -280,7 +283,7 @@ void CModel::Initialize_RootBone()
|
||||
{
|
||||
for (_uint i = 0; i < (_uint)m_Bones.size(); i++)
|
||||
{
|
||||
if (m_Bones[i]->Compare_Name("Reference"))
|
||||
if (m_Bones[i]->Compare_Name("Reference") || m_Bones[i]->Compare_Name("root"))
|
||||
{
|
||||
m_iRootBoneIndex = i;
|
||||
}
|
||||
@@ -1025,6 +1028,17 @@ void CModel::ComputeAnimation()
|
||||
m_pLocalPos = static_cast<LOCALPOS_DESC*>(outSubs[0].pData);
|
||||
}
|
||||
|
||||
void CModel::InItialize_SpineIndex()
|
||||
{
|
||||
for (_uint i = 0; i < (_uint)m_Bones.size(); i++)
|
||||
{
|
||||
if (m_Bones[i]->Compare_Name("Spine"))
|
||||
{
|
||||
m_iSpineIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HRESULT CModel::Create_ParentVB()
|
||||
{
|
||||
@@ -1412,6 +1426,7 @@ HRESULT CModel::Initialize(void* pArg)
|
||||
if (m_eType == MODEL::ANIM)
|
||||
{
|
||||
Initialize_RootBone();
|
||||
InItialize_SpineIndex();
|
||||
Create_Temp();
|
||||
m_Parent.resize(m_Bones.size());
|
||||
for (size_t i = 0; i < (_uint)m_Bones.size(); i++)
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "pch.h"
|
||||
#include "OcclusionQuery.h"
|
||||
|
||||
COcclusionQuery::COcclusionQuery(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
COcclusionQuery::COcclusionQuery(const COcclusionQuery& rhs)
|
||||
:CComponent(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void COcclusionQuery::Begin_Query()
|
||||
{
|
||||
m_pContext->Begin(m_pQuery);
|
||||
}
|
||||
|
||||
_bool COcclusionQuery::isDraw()
|
||||
{
|
||||
UINT64 iNumSample;
|
||||
|
||||
if (m_pContext->GetData(m_pQuery, &iNumSample, sizeof(UINT64), 0) != S_OK)
|
||||
return m_bPreFrameDraw;
|
||||
|
||||
0 < iNumSample ? m_bThisFrameDraw = true : m_bThisFrameDraw = false;
|
||||
|
||||
_bool bDraw = { false };
|
||||
|
||||
if(true == m_bThisFrameDraw)
|
||||
m_NumCullFrame = 0;
|
||||
else
|
||||
{
|
||||
if(m_NumCullFrame < 5)
|
||||
++m_NumCullFrame;
|
||||
}
|
||||
|
||||
m_bPreFrameDraw = m_bThisFrameDraw;
|
||||
|
||||
return m_NumCullFrame < 5;
|
||||
}
|
||||
|
||||
void COcclusionQuery::End_Query()
|
||||
{
|
||||
m_pContext->End(m_pQuery);
|
||||
}
|
||||
|
||||
HRESULT COcclusionQuery::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT COcclusionQuery::Initialize(void* pArg)
|
||||
{
|
||||
D3D11_QUERY_DESC queryDesc = {};
|
||||
|
||||
queryDesc.Query = D3D11_QUERY_OCCLUSION;
|
||||
queryDesc.MiscFlags = 0;
|
||||
|
||||
if (FAILED(m_pDevice->CreateQuery(&queryDesc, &m_pQuery)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : ID3D11Query");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_bPreFrameDraw = m_bThisFrameDraw = true;
|
||||
m_NumCullFrame = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
COcclusionQuery* COcclusionQuery::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
COcclusionQuery* pInstance = new COcclusionQuery(pDevice, pContext);
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : COcclusionQuery");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* COcclusionQuery::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
COcclusionQuery* pInstance = new COcclusionQuery(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : COcclusionQuery");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void COcclusionQuery::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pQuery);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void COcclusionQuery::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -57,13 +57,13 @@ void CRenderer::Render()
|
||||
if (FAILED(m_pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
Render_Priority();
|
||||
Render_Shadow();
|
||||
Render_NonBlend();
|
||||
Render_LightAcc();
|
||||
Render_Blur();
|
||||
Render_Combined();
|
||||
Render_Occlusion();
|
||||
Render_EnvironmentPostProcess();
|
||||
Render_Effect();
|
||||
Render_NonLight();
|
||||
@@ -83,6 +83,26 @@ void CRenderer::Render()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CRenderer::Render_Occlusion()
|
||||
{
|
||||
m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)].sort([](CGameObject* pSour, CGameObject* pDest)->_bool {
|
||||
return pSour->Get_Depth() < pDest->Get_Depth();
|
||||
});
|
||||
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)])
|
||||
{
|
||||
if (nullptr != pRenderObject) {
|
||||
if (FAILED(pRenderObject->Render_BoundingBox())) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pRenderObject);
|
||||
}
|
||||
|
||||
m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)].clear();
|
||||
}
|
||||
|
||||
void CRenderer::Render_Priority()
|
||||
{
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::PRIORITY)])
|
||||
@@ -889,8 +909,6 @@ HRESULT CRenderer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_Color")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr);
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
#include "pch.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
|
||||
CVIBuffer_Box::CVIBuffer_Box(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CVIBuffer(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CVIBuffer_Box::CVIBuffer_Box(const CVIBuffer_Box& rhs)
|
||||
: CVIBuffer(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Update(_float3* pVertexDatas)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE SubResource{};
|
||||
m_pContext->Map(m_pVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource);
|
||||
|
||||
VTXPOS* pVertices = static_cast<VTXPOS*>(SubResource.pData);
|
||||
|
||||
for (_uint i = 0; i < m_iNumVertices; ++i)
|
||||
{
|
||||
memcpy(&pVertices[i].vPosition, &pVertexDatas[i], sizeof(_float3));
|
||||
}
|
||||
|
||||
m_pContext->Unmap(m_pVB, 0);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Initialize_Prototype()
|
||||
{
|
||||
m_iNumVertexBuffers = 1;
|
||||
m_iNumVertices = 8;
|
||||
m_iVertexStride = sizeof(VTXPOS);
|
||||
|
||||
m_iIndexStride = 2;
|
||||
m_iNumIndices = 36;
|
||||
|
||||
m_eIndexFormat = DXGI_FORMAT_R16_UINT;
|
||||
m_ePrimitive = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
|
||||
|
||||
#pragma region IB_BUFFER
|
||||
D3D11_BUFFER_DESC IBDesc{};
|
||||
IBDesc.ByteWidth = m_iIndexStride * m_iNumIndices;
|
||||
IBDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
IBDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
IBDesc.StructureByteStride = m_iIndexStride;
|
||||
IBDesc.CPUAccessFlags = 0;
|
||||
IBDesc.MiscFlags = 0;
|
||||
|
||||
|
||||
_ushort* pIndices = new _ushort[m_iNumIndices];
|
||||
ZeroMemory(pIndices, sizeof(_ushort) * m_iNumIndices);
|
||||
|
||||
/* + x */
|
||||
pIndices[0] = 1; pIndices[1] = 5; pIndices[2] = 6;
|
||||
pIndices[3] = 1; pIndices[4] = 6; pIndices[5] = 2;
|
||||
|
||||
/* - x */
|
||||
pIndices[6] = 4; pIndices[7] = 0; pIndices[8] = 3;
|
||||
pIndices[9] = 4; pIndices[10] = 3; pIndices[11] = 7;
|
||||
|
||||
/* + y */
|
||||
pIndices[12] = 4; pIndices[13] = 5; pIndices[14] = 1;
|
||||
pIndices[15] = 4; pIndices[16] = 1; pIndices[17] = 0;
|
||||
|
||||
/* - y */
|
||||
pIndices[18] = 3; pIndices[19] = 2; pIndices[20] = 6;
|
||||
pIndices[21] = 3; pIndices[22] = 6; pIndices[23] = 7;
|
||||
|
||||
/* + z */
|
||||
pIndices[24] = 5; pIndices[25] = 4; pIndices[26] = 7;
|
||||
pIndices[27] = 5; pIndices[28] = 7; pIndices[29] = 6;
|
||||
|
||||
/* - z */
|
||||
pIndices[30] = 0; pIndices[31] = 1; pIndices[32] = 2;
|
||||
pIndices[33] = 0; pIndices[34] = 2; pIndices[35] = 3;
|
||||
|
||||
|
||||
D3D11_SUBRESOURCE_DATA IBRes{};
|
||||
IBRes.pSysMem = pIndices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &IBRes, &m_pIB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pIndices);
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Initialize(void* pArg)
|
||||
{
|
||||
if (nullptr == pArg)
|
||||
{
|
||||
#ifdef EDITOR_PROJECT
|
||||
if(FAILED(Ready_VIBuffer_Editor()))
|
||||
return E_FAIL;
|
||||
#else
|
||||
return E_FAIL;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if(FAILED(Ready_VIBuffer(pArg)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Ready_VIBuffer(void* pArg)
|
||||
{
|
||||
_float3* pCorners = static_cast<_float3*>(pArg);
|
||||
|
||||
#pragma region VTX_BUFFER
|
||||
D3D11_BUFFER_DESC VBDesc{};
|
||||
VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices;
|
||||
VBDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
VBDesc.CPUAccessFlags = 0;
|
||||
VBDesc.MiscFlags = 0;
|
||||
VBDesc.StructureByteStride = m_iVertexStride;
|
||||
|
||||
VTXPOS* pVertices = new VTXPOS[m_iNumVertices];
|
||||
memset(pVertices, 0, sizeof(VTXPOS) * m_iNumVertices);
|
||||
|
||||
pVertices[0].vPosition = pCorners[0];
|
||||
pVertices[1].vPosition = pCorners[1];
|
||||
pVertices[2].vPosition = pCorners[2];
|
||||
pVertices[3].vPosition = pCorners[3];
|
||||
pVertices[4].vPosition = pCorners[4];
|
||||
pVertices[5].vPosition = pCorners[5];
|
||||
pVertices[6].vPosition = pCorners[6];
|
||||
pVertices[7].vPosition = pCorners[7];
|
||||
|
||||
D3D11_SUBRESOURCE_DATA VBRes{};
|
||||
VBRes.pSysMem = pVertices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &VBRes, &m_pVB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pVertices);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT CVIBuffer_Box::Ready_VIBuffer_Editor()
|
||||
{
|
||||
#pragma region VTX_BUFFER
|
||||
D3D11_BUFFER_DESC VBDesc{};
|
||||
VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices;
|
||||
VBDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
VBDesc.MiscFlags = 0;
|
||||
VBDesc.StructureByteStride = m_iVertexStride;
|
||||
|
||||
VTXPOS* pVertices = new VTXPOS[m_iNumVertices];
|
||||
memset(pVertices, 0, sizeof(VTXPOS) * m_iNumVertices);
|
||||
|
||||
pVertices[0].vPosition = _float3(-0.5f, 0.5f, -0.5f);
|
||||
pVertices[1].vPosition = _float3(0.5f, 0.5f, -0.5f);
|
||||
pVertices[2].vPosition = _float3(0.5f, -0.5f, -0.5f);
|
||||
pVertices[3].vPosition = _float3(-0.5f, -0.5f, -0.5f);
|
||||
pVertices[4].vPosition = _float3(-0.5f, 0.5f, 0.5f);
|
||||
pVertices[5].vPosition = _float3(0.5f, 0.5f, 0.5f);
|
||||
pVertices[6].vPosition = _float3(0.5f, -0.5f, 0.5f);
|
||||
pVertices[7].vPosition = _float3(-0.5f, -0.5f, 0.5f);
|
||||
|
||||
D3D11_SUBRESOURCE_DATA VBRes{};
|
||||
VBRes.pSysMem = pVertices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &VBRes, &m_pVB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pVertices);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
CVIBuffer_Box* CVIBuffer_Box::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CVIBuffer_Box* pInstance = new CVIBuffer_Box(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CVIBuffer_Rect");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CVIBuffer_Box* CVIBuffer_Box::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CVIBuffer_Box* pInstance = new CVIBuffer_Box(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CVIBuffer_Box");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CVIBuffer_Box::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CVIBuffer_Box::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -11,8 +11,8 @@ class ENGINE_DLL CAnimation : public CBase
|
||||
CAnimation(const CAnimation& rhs);
|
||||
virtual ~CAnimation() = default;
|
||||
public:
|
||||
_bool Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _vector vector[3], _float m_fAmount = 1.f);
|
||||
void ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _vector vector[3], _float m_fAmount);
|
||||
_bool Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _vector vector[3]);
|
||||
void ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _vector vector[3]);
|
||||
void ResetRootMotion();
|
||||
void Depart_Animation();
|
||||
void Set_AnimPause(_bool bValue) { m_bPause = bValue; }
|
||||
|
||||
@@ -44,6 +44,8 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
_bool IsImportantThan(CCamera* pOther) const;
|
||||
const _float* Get_CurrentFar();
|
||||
HRESULT Ready_Shadow();
|
||||
void ZoomIn(_float fTimeDelta);
|
||||
void Set_Fov(_float fFovy,_float fTimeDelta, _bool& bZoomIn);
|
||||
|
||||
protected:
|
||||
_float m_fFovy = {};
|
||||
|
||||
@@ -23,7 +23,7 @@ class ENGINE_DLL CChannel : public CBase
|
||||
CHANNEL_DESC Fill_GPU_ChannelDesc();
|
||||
|
||||
public:
|
||||
void Update_TransformationMatirx(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, _vector vector[3],_float m_fAmount = 1.f);
|
||||
void Update_TransformationMatirx(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, _vector vector[3]);
|
||||
_int Get_BoneIndex() { return { m_iBoneIndex }; }
|
||||
void Set_BoneIndex(_int iBoneIndex) { m_iBoneIndex = iBoneIndex; }
|
||||
void ResetRootMotion();
|
||||
|
||||
@@ -5,7 +5,7 @@ NS_BEGIN(Engine)
|
||||
enum class STATE { RIGHT, UP, LOOK, POSITION, END };
|
||||
enum class LIGHT { DIRECTIONAL, POINT, SPOT, END };
|
||||
enum class COLLIDER { AABB, OBB, SPHERE, END };
|
||||
enum class RENDER { PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END };
|
||||
enum class RENDER { OCCLUSION, PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END };
|
||||
enum class RAY { LOCAL, WORLD, END };
|
||||
enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END };
|
||||
|
||||
|
||||
@@ -240,6 +240,18 @@ typedef struct tagVertexPositionTexcoord {
|
||||
|
||||
}VTXPOSTEX;
|
||||
|
||||
typedef struct tagVertexPositionNormal {
|
||||
_float3 vPosition = {};
|
||||
_float3 vNormal = {};
|
||||
|
||||
static constexpr _uint iNumElements = { 2 };
|
||||
static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = {
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }
|
||||
};
|
||||
|
||||
}VTXPOSNOR;
|
||||
|
||||
typedef struct tagVertexPositionNormalTexcoord {
|
||||
_float3 vPosition = {};
|
||||
_float3 vNormal = {};
|
||||
|
||||
@@ -20,7 +20,10 @@ enum ESTATE : _u64Flag
|
||||
SKILL2 = 1ULL << 13,
|
||||
ANCIENT_THROW = 1ULL << 14,
|
||||
MAPHELP = 1ULL << 15,
|
||||
STOP = 1ULL << 16,
|
||||
POTION = 1ULL << 16,
|
||||
STOP = 1ULL << 17,
|
||||
HIT = 1ULL << 18,
|
||||
BROOM_RIDE = 1ULL << 19,
|
||||
END
|
||||
};
|
||||
NS_END
|
||||
|
||||
@@ -255,6 +255,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
class CPhysX_Manager* m_pPhysX_Manager = { nullptr };
|
||||
class CPicking* m_pPicking = { nullptr };
|
||||
class CThreadHolder* m_pThreadHolder = { nullptr };
|
||||
class COcclusionQuery* m_pOcclusionQuery = { nullptr };
|
||||
|
||||
#ifdef _DEBUG
|
||||
private:
|
||||
|
||||
@@ -24,6 +24,7 @@ class ENGINE_DLL CGameObject abstract
|
||||
virtual HRESULT Render_Blur() { return S_OK; }
|
||||
virtual HRESULT Render_Bloom() { return S_OK; }
|
||||
virtual HRESULT Render_OutLine() { return S_OK; }
|
||||
virtual HRESULT Render_BoundingBox() { return S_OK; }
|
||||
|
||||
virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
#pragma endregion
|
||||
#pragma region Animation
|
||||
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr ); // 애니메이션에 델타타임을 넣어줌
|
||||
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false);
|
||||
_bool IsFinishedAnim() const { return m_bIsFinishedAnim; }
|
||||
_bool IsLoopAnim() const { return m_bIsLoop; }
|
||||
@@ -71,6 +71,7 @@ void Combined_BoneMatrix();
|
||||
#pragma endregion
|
||||
|
||||
void ComputeAnimation();
|
||||
void InItialize_SpineIndex();
|
||||
|
||||
public:
|
||||
#ifdef EDITOR_PROJECT
|
||||
@@ -133,7 +134,8 @@ void Combined_BoneMatrix();
|
||||
_matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션
|
||||
class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼
|
||||
|
||||
_float m_fRatio = {};
|
||||
_float m_fRatio = {};
|
||||
_int m_iSpineIndex = { -1 };
|
||||
|
||||
// 바이너리
|
||||
SaveModel* m_pSaveModel = { nullptr };
|
||||
@@ -151,6 +153,8 @@ void Combined_BoneMatrix();
|
||||
_float4 m_vInitialRootRot = {};
|
||||
|
||||
_vector m_vector[3];
|
||||
_bool m_bLoopRestarted = false;
|
||||
|
||||
|
||||
#pragma region Compute
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL COcclusionQuery final : public CComponent
|
||||
{
|
||||
private:
|
||||
COcclusionQuery(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
COcclusionQuery(const COcclusionQuery& rhs);
|
||||
virtual ~COcclusionQuery() = default;
|
||||
|
||||
public:
|
||||
void Begin_Query();
|
||||
_bool isDraw();
|
||||
void End_Query();
|
||||
|
||||
private:
|
||||
ID3D11Query* m_pQuery = { nullptr };
|
||||
|
||||
_bool m_bPreFrameDraw = {};
|
||||
_bool m_bThisFrameDraw = {};
|
||||
_uint m_NumCullFrame = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
public:
|
||||
static COcclusionQuery* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -16,7 +16,9 @@
|
||||
#include "FSM.h"
|
||||
#include "State.h"
|
||||
#include "VIBuffer_UI_Instance.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
#include "Trail.h"
|
||||
#include "OcclusionQuery.h"
|
||||
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
@@ -40,6 +40,7 @@ class CRenderer final : public CBase
|
||||
_float4x4 m_ProjMatrix = {};
|
||||
|
||||
ID3D11DepthStencilView* m_pShadowDSV = { nullptr };
|
||||
ID3D11DepthStencilView* m_pOcclusionDSV = { nullptr };
|
||||
|
||||
SHADOW_LIGHT_DESC m_PreShadowDesc = {};
|
||||
_float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {};
|
||||
@@ -56,6 +57,7 @@ class CRenderer final : public CBase
|
||||
|
||||
|
||||
private:
|
||||
void Render_Occlusion();
|
||||
void Render_Priority();
|
||||
void Render_Shadow();
|
||||
void Render_NonBlend();
|
||||
@@ -79,6 +81,7 @@ class CRenderer final : public CBase
|
||||
|
||||
private:
|
||||
HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY);
|
||||
HRESULT Ready_OcclusionDepthStencilView(_uint iSizeX, _uint iSizeY);
|
||||
|
||||
private:
|
||||
HRESULT Initialize();
|
||||
|
||||
@@ -7,14 +7,15 @@ enum ESTATE
|
||||
IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD,
|
||||
MOVE,
|
||||
WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_STOP,
|
||||
JOG,JOG_FWD,JOG_RIGHT,JOG_LEFT, JOG_BWD,JOG_STOP,
|
||||
JOG, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,
|
||||
SPRINT,
|
||||
JUMP,JUMP_JOG,JUMP_SPRINT,
|
||||
LAND,
|
||||
DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT,
|
||||
COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2,
|
||||
MAPHELP,
|
||||
MAPHELP,POTION,
|
||||
ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW,
|
||||
BROOM_IDLE,BROOM_FWD, BROOM_HOVER_IDLE, BROOM_HOVER_START,BROOM_MOUNT, BROOM_MOUNT_END,
|
||||
HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R,
|
||||
KNOCKDOWN, KNOCKDOWN_FWD, KNOCKDOWN_FWD_SPLT, KNOCKDOWN_FWD_SPLT_HOLD, KNOCKDOWN_BWD, KNOCKDOWN_BWD_SPLT, KNOCKDOWN_BWD_SPLT_HOLD,
|
||||
GETUP, GETUP_BWD, GETUP_FWD, GETUP_L, GETUP_L_FD, GETUP_L_FU, GETUP_R, GETUP_R_FD, GETUP_R_FU, GETUP_SLOUCH,
|
||||
@@ -22,7 +23,9 @@ enum ESTATE
|
||||
KNOCKBACK, KNOCKBACK2,
|
||||
TUMBLE, TUMBLE2,
|
||||
PETRIFICUSED_START,
|
||||
|
||||
////////////////////////// 빗자루
|
||||
BROOM_MOUNT_B, BROOM_HOVER_IDLE_B, BROOM_HOVER_STOP_B,BROOM_FLY_DOWN_B, BROOM_FLY_LEFT_B, BROOM_FLY_RIGHT_B, BROOM_FLY_UP_B,BROOM_FLY_B,
|
||||
/// ////////////////////////////
|
||||
END
|
||||
};
|
||||
NS_END
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
#include "VIBuffer.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL CVIBuffer_Box final :
|
||||
public CVIBuffer
|
||||
{
|
||||
private:
|
||||
CVIBuffer_Box(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CVIBuffer_Box(const CVIBuffer_Box& rhs);
|
||||
virtual ~CVIBuffer_Box() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Update(_float3* pVertices);
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
HRESULT Ready_VIBuffer(void* pArg);
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT Ready_VIBuffer_Editor();
|
||||
#endif
|
||||
|
||||
public:
|
||||
static CVIBuffer_Box* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CVIBuffer_Box* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
Reference in New Issue
Block a user