[fix] TriggerBoxToGameObject
This commit is contained in:
@@ -1931,9 +1931,6 @@
|
||||
<Filter Include="02.GameObjects\NPC\Ally\Elf">
|
||||
<UniqueIdentifier>{9263815e-9651-4ba2-813f-c2a7f207522d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.InfoInstance\NewFilter1">
|
||||
<UniqueIdentifier>{44a8eee1-6b7f-4c9a-bf92-21f6b90e84c3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
|
||||
@@ -510,16 +510,17 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path)
|
||||
SocketContents.funcEvent = [&](CTimeSocket& Socket) { m_pGameInstance->ResetLevel_Environment(); };
|
||||
break;
|
||||
case TIMESOCKET_FUNC::SET_VOLUMETRIC:
|
||||
SocketContents.funcEvent = [&](CTimeSocket& Socket) {
|
||||
{
|
||||
tinyxml2::XMLElement* pTransformNode = pParam0Node->FirstChildElement("Transform");
|
||||
ReadPxTransform(pTransformNode, SocketContents.pxTransform);
|
||||
SocketContents.funcEvent = [&](CTimeSocket& Socket) {
|
||||
if (Socket.m_Contents.vFlags.b[0]) {
|
||||
m_pGameInstance->Setting_Volumetirc(
|
||||
Socket.m_Contents.pxTransform.q.x, Socket.m_Contents.pxTransform.q.y, Socket.m_Contents.pxTransform.q.z,
|
||||
Socket.m_Contents.pxTransform.p.x, Socket.m_Contents.pxTransform.p.y);
|
||||
Socket.m_Contents.pxTransform.q.x, Socket.m_Contents.pxTransform.q.y, Socket.m_Contents.pxTransform.q.z, Socket.m_Contents.pxTransform.q.w,
|
||||
Socket.m_Contents.pxTransform.p.x);
|
||||
}
|
||||
else {
|
||||
}
|
||||
};
|
||||
break;
|
||||
};
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -546,7 +547,7 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path)
|
||||
pTriggerNode->QueryFloatAttribute("X", &Desc.vPosition_Radius.x);
|
||||
pTriggerNode->QueryFloatAttribute("Y", &Desc.vPosition_Radius.y);
|
||||
pTriggerNode->QueryFloatAttribute("Z", &Desc.vPosition_Radius.z);
|
||||
pTimeLine->m_pTriggerBox = CTriggerBox::Create(&Desc);
|
||||
pTimeLine->m_pTriggerBox = CTriggerBox::Create(m_pDevice, m_pContext, &Desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -639,6 +639,7 @@ HRESULT CPlayer::Ready_Components()
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pCharacter_Controller->SetGravity(false);
|
||||
m_pCharacter_Controller->Set_GravityAmount(1.2f);
|
||||
}
|
||||
|
||||
{ // DO
|
||||
|
||||
@@ -383,7 +383,7 @@ void CPlayer::Behavior_CutSceneEnter()
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::CUTSCENE_OPENINGINTRO2];
|
||||
pairAnimInfo = m_Animation[STATEANIM::CUTSCENE_OPENINGINTRO1];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_bOpeningCutScene = true;
|
||||
}
|
||||
@@ -394,7 +394,7 @@ HRESULT CPlayer::Behavior_CutSceneExitCheck(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCarriage->Get_SocketWorldMatrix(CThestralCarriage::CARRIAGE_SOCKET::FRONT_RIGHT).r[3]);
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
m_pTransformCom->RotationQ(XMQuaternionRotationAxis(XMVectorSet(0.f, 1.f, 0.f, 0.f), XMConvertToRadians(90.f)));
|
||||
m_pTransformCom->RotationQ(XMQuaternionRotationAxis(XMVectorSet(0.f, -1.f, 0.f, 0.f), XMConvertToRadians(90.f)));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -1,22 +1,50 @@
|
||||
#include "pch.h"
|
||||
#include "TriggerBox.h"
|
||||
|
||||
CTriggerBox::CTriggerBox():
|
||||
m_pGameInstance(CGameInstance::GetInstance())
|
||||
CTriggerBox::CTriggerBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CTriggerBox::CTriggerBox(const CTriggerBox& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CTriggerBox::TryScanArea(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
|
||||
#endif // _DEBUG
|
||||
m_vScanTimer.x += fTimeDelta;
|
||||
if (m_vScanTimer.x > m_vScanTimer.y) {
|
||||
m_vScanTimer.x = m_vScanTimer.y;
|
||||
m_vScanTimer.x = 0.f;
|
||||
return Scan();
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CTriggerBox::Render()
|
||||
{
|
||||
m_Batch->Begin();
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0f0f, CMyTools::Saturate(m_vScanTimer.x / m_vScanTimer.y + 0.1f));
|
||||
m_pSubShape->Draw(XMMatrixTranslation(m_vPosition.x, m_vPosition.y, m_vPosition.z), ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
|
||||
m_Batch->End();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CTriggerBox::Create_DebugShape(ID3D11DeviceContext* pContext)
|
||||
{
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_fRadius, 12, false, false));
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CTriggerBox::Initialize(TRIGGERBOX_DESC* pDesc)
|
||||
{
|
||||
m_fRadius = pDesc->vPosition_Radius.w;
|
||||
@@ -69,18 +97,31 @@ HRESULT CTriggerBox::Scan()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTriggerBox* CTriggerBox::Create(TRIGGERBOX_DESC* Desc)
|
||||
CTriggerBox* CTriggerBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, TRIGGERBOX_DESC* Desc)
|
||||
{
|
||||
CTriggerBox* pInstance = new CTriggerBox();
|
||||
|
||||
if (FAILED(pInstance->Initialize(Desc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
CTriggerBox* pInstance = new CTriggerBox(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize(Desc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CTriggerBox::Free()
|
||||
{
|
||||
__super::Free();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CTriggerBox::Bind_ShaderResources()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
CGameObject* CTriggerBox::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CTriggerBox::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -9,32 +9,45 @@ NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CTriggerBox final : public CBase
|
||||
class CTriggerBox final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagTriggerDesc {
|
||||
_float4 vPosition_Radius = { 0.f, 0.f, 0.f, 1.f };
|
||||
}TRIGGERBOX_DESC;
|
||||
private:
|
||||
CTriggerBox();
|
||||
CTriggerBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTriggerBox(const CTriggerBox& rhs);
|
||||
virtual ~CTriggerBox() = default;
|
||||
|
||||
public:
|
||||
HRESULT TryScanArea(_float fTimeDelta);
|
||||
|
||||
|
||||
virtual HRESULT Render()override;
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
void Describe_Entity() override;
|
||||
private:
|
||||
HRESULT Initialize(TRIGGERBOX_DESC*);
|
||||
HRESULT Scan();
|
||||
#ifdef _DEBUG
|
||||
void Create_DebugShape(ID3D11DeviceContext* pContext);
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
_float4 m_vPosition = { };
|
||||
_float m_fRadius = {};
|
||||
_float2 m_vScanTimer = { 0.f, 0.5f };
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch;
|
||||
#endif // _DEBUG
|
||||
|
||||
public:
|
||||
static CTriggerBox* Create(TRIGGERBOX_DESC* Desc);
|
||||
static CTriggerBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, TRIGGERBOX_DESC* Desc);
|
||||
virtual void Free() override;
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -79,11 +79,11 @@
|
||||
<OtherTarget Layer = "" TypeID = ""/>
|
||||
<Transform>
|
||||
<RotQ X="0.939" Y="0.0347" Z="-0.6125" W="0.773"/>
|
||||
<Trans X="0.00694" Y="9.7" Z=""/>
|
||||
<Trans X="0.00694" Y="" Z=""/>
|
||||
</Transform>
|
||||
</Param_0>
|
||||
<vFlags>
|
||||
<Flag id ="0">false</Flag>
|
||||
<Flag id ="0">true</Flag>
|
||||
<Flag id ="1">false</Flag>
|
||||
<Flag id ="2">false</Flag>
|
||||
<Flag id ="3">false</Flag>
|
||||
|
||||
@@ -71,11 +71,12 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
vector<future<pair<_wstring, CModel*>*>> futures = {};
|
||||
|
||||
#pragma region MONSTER
|
||||
|
||||
#ifndef 기무리
|
||||
/* For.Prototype_Component_Hogsmead_NorthLakeShallow */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Hogsmead_NorthLakeShallow"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Wands\\CharacterWands\\SK_Wands_Amit.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ HRESULT CTimeSocket::Initialize(void* pArg)
|
||||
SOCKETCONTENTS* pDesc = static_cast<SOCKETCONTENTS*>(pArg);
|
||||
|
||||
m_Contents.fRatio = pDesc->fRatio;
|
||||
m_Contents.pxTransform = pDesc->pxTransform;
|
||||
m_Contents.bTriggerred = pDesc->bTriggerred;
|
||||
m_Contents.pEventTarget = pDesc->pEventTarget;
|
||||
m_Contents.strEventName = pDesc->strEventName;
|
||||
@@ -43,7 +44,6 @@ HRESULT CTimeSocket::Initialize(void* pArg)
|
||||
m_Contents.pxTransform = pDesc->pxTransform;
|
||||
break;
|
||||
case TIMESOCKET_PARAM::NOT_USE:
|
||||
m_Contents.pOtherTarget = nullptr;
|
||||
break;
|
||||
default:
|
||||
m_Contents.pOtherTarget = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user