[fix] TriggerBox
This commit is contained in:
@@ -120,8 +120,23 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_RacerAI(LAYER_RACERAI))) {
|
||||
return E_FAIL;
|
||||
_bool bLoadNPC = { true };
|
||||
#ifdef _DEBUG
|
||||
#ifdef 기무리
|
||||
bLoadNPC = false;
|
||||
#endif
|
||||
#endif // _DEBUG
|
||||
if (true == bLoadNPC) {
|
||||
if (FAILED(Ready_Layer_RacerAI(LAYER_RACERAI))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_Duelist())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Npc())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,14 +144,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Duelist())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Npc())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pInfoInstance->Late_Initialize()))
|
||||
return E_FAIL;
|
||||
@@ -332,9 +339,9 @@ HRESULT CLevel_GamePlay::Ready_Background()
|
||||
isReady_Hogwart = false;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isReady_Background = true;
|
||||
isReady_Hogsmeade = true;
|
||||
isReady_Hogwart = true;
|
||||
isReady_Background = false;
|
||||
isReady_Hogsmeade = false;
|
||||
isReady_Hogwart = false;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
isReady_Background = false;
|
||||
@@ -1006,7 +1013,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
isLoad_Monster = true;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isLoad_Monster = true;
|
||||
isLoad_Monster = false;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
|
||||
@@ -1118,8 +1125,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Npc()
|
||||
isLoad_NPC = true;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isLoad_NPC = true;
|
||||
isLoad_RandomNPC = true;
|
||||
isLoad_NPC = false;
|
||||
isLoad_RandomNPC = false;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
isLoad_RandomNPC = true;
|
||||
|
||||
@@ -480,9 +480,9 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isLoad_Background = true;
|
||||
isLoad_Hogwart = true;
|
||||
isLoad_UI_SEQUANTIAL = true;
|
||||
isLoad_NPC = true;
|
||||
isLoad_Hogwart = false;
|
||||
isLoad_UI_SEQUANTIAL = false;
|
||||
isLoad_NPC = false;
|
||||
isLoad_Monster = true;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
@@ -2436,7 +2436,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
Desc1.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc1.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc1.fContactOffset = { 0.05f };
|
||||
Desc1.vhalfGeometryInfo = { 2.f, 2.f, 2.f };
|
||||
Desc1.vhalfGeometryInfo = { 2.34f, 2.34f, 2.34f };
|
||||
Desc1.fDensity = 1.f;
|
||||
Desc1.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
|
||||
Desc1.eLockFlag = {};
|
||||
|
||||
@@ -255,7 +255,7 @@ HRESULT CPlayer::Render()
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef 기무리
|
||||
Render_CameraCoordinateSystem();
|
||||
//Render_CameraCoordinateSystem();
|
||||
#endif // 기무리
|
||||
//m_pCharacter_Controller->Render();
|
||||
#endif // _DEBUG
|
||||
@@ -640,6 +640,9 @@ HRESULT CPlayer::Ready_Components()
|
||||
}
|
||||
m_pCharacter_Controller->SetGravity(false);
|
||||
m_pCharacter_Controller->Set_GravityAmount(1.2f);
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Set_Name("CCT_PLAYER");
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
{ // DO
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "TriggerBox.h"
|
||||
#include "Layer.h"
|
||||
#include "Player.h"
|
||||
|
||||
CTriggerBox::CTriggerBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
@@ -50,60 +52,82 @@ HRESULT CTriggerBox::Initialize(TRIGGERBOX_DESC* pDesc)
|
||||
Desc.fRadius = pDesc->vPosition_Radius.w;
|
||||
Desc.fRotationPerSec = 0;
|
||||
Desc.fSpeedPerSec = 0;
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
if (FAILED(__super::Ready_Components(&Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat4(&pDesc->vPosition_Radius), 1.f));
|
||||
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_pTransformCom->Get_Radius(), 12, false, false));
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_pTransformCom->Get_Radius() * 2.f, 12, false, false));
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
|
||||
m_vScanTimer.y += m_pGameInstance->Real_Random_Float(0.f, 0.2f);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTriggerBox::Scan()
|
||||
{
|
||||
_float fRadius = m_pTransformCom->Get_Radius();
|
||||
PSX::PxSweepBuffer pxBuffer = {};
|
||||
|
||||
PSX::PxSweepHit hitBuffer[32];
|
||||
PSX::PxSweepBuffer pxBuffer(hitBuffer, 32);
|
||||
_bool bHit = m_pGameInstance->SphereCast(fRadius, m_pTransformCom->Get_State(STATE::POSITION), XMVectorSet(0.f, 1.f, 0.f, 0.f), 0.1f,
|
||||
PSX::PxHitFlag::ePOSITION, PSX::PxQueryFlag::eDYNAMIC, pxBuffer);
|
||||
PSX::PxHitFlag::eDEFAULT, PSX::PxQueryFlag::eDYNAMIC, pxBuffer);
|
||||
|
||||
const PSX::PxSweepHit & hit = pxBuffer.block;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
_uint iHitCount = pxBuffer.getNbAnyHits();
|
||||
HRESULT hr = E_FAIL;
|
||||
if (bHit) {
|
||||
if (nullptr != pActor && nullptr != pActor->userData)
|
||||
{
|
||||
PHYSX_USERDATA* pUserData = static_cast<PHYSX_USERDATA*>(pActor->userData);
|
||||
switch (pUserData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
switch (PXOBJECT(pUserData->iSubKind))
|
||||
{
|
||||
case PXOBJECT::PLAYER:
|
||||
{
|
||||
return S_OK;
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
{
|
||||
switch (PXOBJECT(pUserData->iSubKind))
|
||||
{
|
||||
case PXOBJECT::PLAYER: {
|
||||
return S_OK;
|
||||
} break;
|
||||
default:
|
||||
hr = CheckPlayerHit(pActor);
|
||||
if (FAILED(hr)) {
|
||||
for (_uint i = 0; i < iHitCount; ++i) {
|
||||
PSX::PxSweepHit* pHit = &pxBuffer.touches[i];
|
||||
hr = CheckPlayerHit(pHit->actor);
|
||||
if (SUCCEEDED(hr)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT CTriggerBox::CheckPlayerHit(PSX::PxActor* pActor)
|
||||
{
|
||||
if (nullptr != pActor && nullptr != pActor->userData)
|
||||
{
|
||||
PHYSX_USERDATA* pUserData = static_cast<PHYSX_USERDATA*>(pActor->userData);
|
||||
switch (pUserData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
switch (PXOBJECT(pUserData->iSubKind))
|
||||
{
|
||||
case PXOBJECT::PLAYER:
|
||||
{
|
||||
return S_OK;
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
{
|
||||
switch (PXOBJECT(pUserData->iSubKind))
|
||||
{
|
||||
case PXOBJECT::PLAYER: {
|
||||
return S_OK;
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return E_FAIL;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTriggerBox* CTriggerBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, TRIGGERBOX_DESC* Desc)
|
||||
|
||||
@@ -86,7 +86,10 @@ void CUI_Manager::Canvas_Change(UI_STATE eType)
|
||||
static_cast<CCanvasObject*>(m_pDialogue_Canvas)->Visible(false);
|
||||
static_cast<CGameObject*>(m_pInteraction_Key)->Set_Visible(true);
|
||||
static_cast<CGameObject*>(m_pNPCInteraction)->Set_Visible(true);
|
||||
#ifndef 기무리
|
||||
static_cast<CGameObject*>(m_pBroom_TargetGate)->Set_Visible(false);
|
||||
#endif // 기무리
|
||||
|
||||
break;
|
||||
|
||||
case UI_STATE::SPELL:
|
||||
|
||||
@@ -30,10 +30,11 @@ class CTriggerBox final : public CGameObject
|
||||
private:
|
||||
HRESULT Initialize(TRIGGERBOX_DESC*);
|
||||
HRESULT Scan();
|
||||
HRESULT CheckPlayerHit(PSX::PxActor* pActor);
|
||||
|
||||
|
||||
private:
|
||||
_float2 m_vScanTimer = { 0.f, 0.5f };
|
||||
_float2 m_vScanTimer = { 0.f, 0.8f };
|
||||
#ifdef _DEBUG
|
||||
_bool m_bRender = false;
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
|
||||
@@ -258,43 +258,6 @@
|
||||
<string tag =""/>
|
||||
</Param_12>
|
||||
</Socket>
|
||||
<Socket fStartPosition = "0">
|
||||
<Info strEventName = "PlayAnim" eTypeParam = "NOT_USE" pTarget = "ACTOR_CARRIAGE" eTypeFunc="SET_FSMSTATE"/>
|
||||
<Param_0>
|
||||
<OtherTarget Layer = "" TypeID = ""/>
|
||||
<Transform>
|
||||
<RotQ X="" Y="" Z="" W=""/>
|
||||
<Trans X="" Y="" Z=""/>
|
||||
</Transform>
|
||||
</Param_0>
|
||||
<vFlags>
|
||||
<Flag id ="0">false</Flag>
|
||||
<Flag id ="1">false</Flag>
|
||||
<Flag id ="2">true</Flag>
|
||||
<Flag id ="3">false</Flag>
|
||||
<Flag id ="4">false</Flag>
|
||||
<Flag id ="5">false</Flag>
|
||||
<Flag id ="6">false</Flag>
|
||||
<Flag id ="7">false</Flag>
|
||||
<Flag id ="8">false</Flag>
|
||||
<Flag id ="9">false</Flag>
|
||||
<Flag id ="10">false</Flag>
|
||||
<Flag id ="11">false</Flag>
|
||||
<Flag id ="12">false</Flag>
|
||||
<Flag id ="13">false</Flag>
|
||||
<Flag id ="14">false</Flag>
|
||||
<Flag id ="15">false</Flag>
|
||||
</vFlags>
|
||||
<Param_10>
|
||||
<uint X="" Y="" Z="" W=""/>
|
||||
</Param_10>
|
||||
<Param_11>
|
||||
<float X="1" Y="" Z="" W=""/>
|
||||
</Param_11>
|
||||
<Param_12>
|
||||
<string tag =""/>
|
||||
</Param_12>
|
||||
</Socket>
|
||||
<Socket fStartPosition = "0">
|
||||
<Info strEventName = "SET_FSMSTATE" eTypeParam = "NOT_USE" pTarget = "ACTOR_PLAYER" eTypeFunc="SET_FSMSTATE"/>
|
||||
<Param_0>
|
||||
|
||||
@@ -61,6 +61,10 @@ HRESULT CCharacter_Controller::Render()
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
void CCharacter_Controller::Set_Name(const _char* pName)
|
||||
{
|
||||
m_pController->getActor()->setName(pName);
|
||||
}
|
||||
#endif // _DEBUG
|
||||
PSX::PxRigidDynamic* CCharacter_Controller::Get_Actor()
|
||||
{
|
||||
|
||||
@@ -52,9 +52,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef 기무리
|
||||
m_pThreadHolder = CThreadHolder::Create(8);
|
||||
#elif Bin
|
||||
#ifdef Bin
|
||||
m_pThreadHolder = CThreadHolder::Create(8);
|
||||
#else
|
||||
m_pThreadHolder = CThreadHolder::Create(6);
|
||||
@@ -65,9 +63,6 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
|
||||
m_pThreadHolder = CThreadHolder::Create(12);
|
||||
#endif // !_DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
if (nullptr == m_pThreadHolder) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render() override;
|
||||
virtual void Set_Name(const _char* pName);
|
||||
#endif
|
||||
PSX::PxRigidDynamic* Get_Actor();
|
||||
PSX::PxController* Get_Controller();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
|
||||
Reference in New Issue
Block a user