[Merge Commit] 콜백함수 추가
This commit is contained in:
@@ -165,6 +165,8 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Body.h" />
|
||||
<ClInclude Include="..\public\Active_Icon.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitRepot.h" />
|
||||
<ClInclude Include="..\Public\DummyObject.h" />
|
||||
<ClInclude Include="..\public\DummySkyBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Plane.h" />
|
||||
@@ -232,6 +234,8 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Body.cpp" />
|
||||
<ClCompile Include="..\private\Active_Icon.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitRepot.cpp" />
|
||||
<ClCompile Include="..\Private\DummyObject.cpp" />
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Plane.cpp" />
|
||||
|
||||
@@ -202,6 +202,21 @@
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Dummy_Plane">
|
||||
<UniqueIdentifier>{6872c5bc-5eac-46a1-b6d8-3ec0f4fb2cd5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback">
|
||||
<UniqueIdentifier>{b6d1496a-c8ef-4b7a-9ed4-f00b0a244313}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable">
|
||||
<UniqueIdentifier>{a225d78f-7eec-4407-bdfd-9e14452f3338}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable">
|
||||
<UniqueIdentifier>{a32d5869-5562-4099-925a-f8c022e9aac7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior">
|
||||
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback">
|
||||
<UniqueIdentifier>{b6d1496a-c8ef-4b7a-9ed4-f00b0a244313}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -405,6 +420,12 @@
|
||||
<ClInclude Include="..\Public\Dummy_Plane.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitRepot.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -604,6 +625,12 @@
|
||||
<ClCompile Include="..\Private\Dummy_Plane.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitRepot.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CCallBack_Playable_Behavior::CCallBack_Playable_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
{
|
||||
if (nullptr == actor.userData) {
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(actor.userData);
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT
|
||||
| PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
return PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// 나머지는 아무 특별 동작 없음
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxController& controller)
|
||||
{
|
||||
// CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle)
|
||||
{
|
||||
// Obstacle이 움직이는 발판이다?
|
||||
// 여기서 ride/slide 세팅
|
||||
//return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Playable_HitRepot.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CCallBack_Playable_HitRepot::CCallBack_Playable_HitRepot()
|
||||
{
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
if (nullptr == pActorData) { // missing user data
|
||||
return;
|
||||
}
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
} break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pOtherController->getActor()->userData);
|
||||
assert(nullptr != pActorData); // missing user data
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
const void* pOtherController = hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ HRESULT CDummy_PhysXBox::Ready_Components(void* pArg)
|
||||
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
@@ -95,8 +95,9 @@ HRESULT CDummy_PhysXBox::Ready_Components(void* pArg)
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
@@ -119,6 +118,8 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = &m_pCallBack_HitReport;
|
||||
Desc.pCallback_Behavior = &m_pCallBack_Behavior;
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -530,7 +530,7 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
m_strMessage = TEXT("PhysX Bodies Loading..");
|
||||
|
||||
{
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
Desc.eType = ACTOR::BOX;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
@@ -541,7 +541,7 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f };
|
||||
Desc.fDensity = 10.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -605,7 +605,7 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{ // basic static RIGIDBODY
|
||||
@@ -616,7 +616,7 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody_Static::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -723,7 +723,7 @@ HRESULT CLoader::MapFolderLoad(const _char* pDirectoryPath, const _char* pFileEx
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{
|
||||
@@ -734,7 +734,7 @@ HRESULT CLoader::MapFolderLoad(const _char* pDirectoryPath, const _char* pFileEx
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody_Static::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,21 +285,21 @@ void CMapObject_LOD::Describe_Entity()
|
||||
GUI::SameLine();
|
||||
if (GUI::Button("Bake!!!")) {
|
||||
CMapObject_Manager* pManager = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_MAPOBJECTMANAGER)->Get_Object<CMapObject_Manager>();
|
||||
for (_uint i = 0; i < (_uint)m_ModelPathIndices.size(); ++i) {
|
||||
filesystem::path filePath = pManager->Get_PrototypePath(m_ModelPathIndices[i]);
|
||||
for (_uint iModelIndex = 0; iModelIndex < (_uint)m_ModelPathIndices.size(); ++iModelIndex) {
|
||||
filesystem::path filePath = pManager->Get_PrototypePath(m_ModelPathIndices[iModelIndex]);
|
||||
|
||||
CModel* pModel = m_pModelComs[i];
|
||||
CModel* pModel = m_pModelComs[iModelIndex];
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes(filePath.string().c_str());
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc{};
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
for (_uint iMeshIndex = 0; iMeshIndex < iNumMesh; ++iMeshIndex)
|
||||
{ // RIGID_BODY
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
Desc.szMeshName = strDestName.c_str();
|
||||
_wstring dest = CMyTools::ToWstring(m_pModelComs[iModelIndex]->Get_MeshName(iMeshIndex) + to_string(iMeshIndex)).c_str();
|
||||
Desc.pMeshName = dest.c_str();
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), nullptr, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, Desc.pMeshName, nullptr, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
public:
|
||||
CCallBack_Playable_Behavior();
|
||||
~CCallBack_Playable_Behavior() = default;
|
||||
|
||||
public:
|
||||
// PxControllerBehaviorCallback을(를) 통해 상속됨
|
||||
// 충돌알림이 아닌, 행동정책 정해주기. CCT vs CCT는 지원안함
|
||||
// slopeLimit로 미끄러져 갈 수 있는지 없는지 이분법적인 계산 대신, 원하는 물체에 대해서만 미끄러운 표면으로 정의해줌
|
||||
// 주인이 되는 CCT가 이 물체에 대해 이 물체를 어떻게 해야 할까? -> (타고 올라갈까? Ride?) (미끄러져갈까? Slide?) ( 직접 내가 구현할까? user defined ride? )
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) override;
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override;
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override;
|
||||
};
|
||||
NS_END
|
||||
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
public:
|
||||
CCallBack_Playable_HitRepot();
|
||||
~CCallBack_Playable_HitRepot() = default;
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
// 충돌알림!!
|
||||
// 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까?
|
||||
virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우
|
||||
|
||||
virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
};
|
||||
NS_END
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CallBack_Playable_HitRepot.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
@@ -34,7 +36,9 @@ class CDummy_PhysXPlayable final : public CGameObject
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
CCallBack_Playable_Behavior m_pCallBack_Behavior = {};
|
||||
CCallBack_Playable_HitRepot m_pCallBack_HitReport = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
@@ -49,4 +53,4 @@ class CDummy_PhysXPlayable final : public CGameObject
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -203,7 +203,6 @@ call Update_Lib.bat
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Collider.cpp" />
|
||||
<ClCompile Include="..\Private\Collider_Manager.cpp" />
|
||||
<ClCompile Include="..\Private\Collision_Callback.cpp" />
|
||||
<ClCompile Include="..\Private\Component.cpp" />
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp" />
|
||||
<ClCompile Include="..\Private\ContainerObject.cpp" />
|
||||
@@ -287,6 +286,8 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\RenderTarget.cpp" />
|
||||
<ClCompile Include="..\Private\RenderTarget_Manager.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody_Static.cpp" />
|
||||
<ClCompile Include="..\Private\Shader.cpp" />
|
||||
<ClCompile Include="..\Private\Shadow.cpp" />
|
||||
<ClCompile Include="..\Private\SoundSrc.cpp" />
|
||||
@@ -305,6 +306,14 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\Instance_Model.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Rect.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Terrain.cpp" />
|
||||
<ClCompile Include="..\Public\NCallBack_Playable_Behavior.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Public\NCallBack_Playable_HitRepot.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Animation.h" />
|
||||
@@ -398,6 +407,14 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\Bounding_AABB.h" />
|
||||
<ClInclude Include="..\Public\Bounding_OBB.h" />
|
||||
<ClInclude Include="..\Public\Bounding_Sphere.h" />
|
||||
<ClInclude Include="..\Public\NCallBack_Playable_Behavior.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\NCallBack_Playable_HitRepot.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</ExcludedFromBuild>
|
||||
@@ -419,7 +436,6 @@ call Update_Lib.bat
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Collider.h" />
|
||||
<ClInclude Include="..\Public\Collider_Manager.h" />
|
||||
<ClInclude Include="..\Public\Collision_Callback.h" />
|
||||
<ClInclude Include="..\Public\Component.h" />
|
||||
<ClInclude Include="..\Public\ComputeShader.h" />
|
||||
<ClInclude Include="..\Public\ContainerObject.h" />
|
||||
@@ -503,6 +519,8 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\RenderTarget.h" />
|
||||
<ClInclude Include="..\Public\RenderTarget_Manager.h" />
|
||||
<ClInclude Include="..\Public\RigidBody.h" />
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic.h" />
|
||||
<ClInclude Include="..\Public\RigidBody_Static.h" />
|
||||
<ClInclude Include="..\Public\Shader.h" />
|
||||
<ClInclude Include="..\Public\Shadow.h" />
|
||||
<ClInclude Include="..\Public\SoundSrc.h" />
|
||||
|
||||
@@ -244,15 +244,9 @@
|
||||
<Filter Include="01.Utility\06.Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\08.Character_Controller\Collision_Callback">
|
||||
<UniqueIdentifier>{05865481-fa20-4432-a5a7-945d4f8c7f3c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\10.Dynamic">
|
||||
<UniqueIdentifier>{bed0de44-4e62-4b5f-9767-65cfc8a933a3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\11.Kinematic">
|
||||
<UniqueIdentifier>{33ac85a2-be8e-4ad9-a179-1239d818dc9c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\00.Static">
|
||||
<UniqueIdentifier>{fda41884-634b-4dd4-8bd2-f6f7ad68ab1f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -262,6 +256,9 @@
|
||||
<Filter Include="03.Management\03.Light_Manager">
|
||||
<UniqueIdentifier>{8727e975-e9e2-4b59-9a52-27ad3ad79f2f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\08.Character_Controller\CallBack">
|
||||
<UniqueIdentifier>{05865481-fa20-4432-a5a7-945d4f8c7f3c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -438,9 +435,6 @@
|
||||
<ClCompile Include="..\Private\PhysX_Manager.cpp">
|
||||
<Filter>03.Management\21.PhysX_Manager</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RigidBody.cpp">
|
||||
<Filter>02.Element\02.Component\07.RigidBody</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\UIComponent.cpp">
|
||||
<Filter>02.Element\02.Component\50.UI</Filter>
|
||||
</ClCompile>
|
||||
@@ -477,8 +471,20 @@
|
||||
<ClCompile Include="..\Private\Light_Manager.cpp">
|
||||
<Filter>03.Management\03.Light_Manager</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Collision_Callback.cpp">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
|
||||
<ClCompile Include="..\Private\RigidBody_Static.cpp">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\00.Static</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic.cpp">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\10.Dynamic</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RigidBody.cpp">
|
||||
<Filter>02.Element\02.Component\07.RigidBody</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Public\NCallBack_Playable_HitRepot.cpp">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Public\NCallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -1061,8 +1067,17 @@
|
||||
<ClInclude Include="..\Public\Light_Manager.h">
|
||||
<Filter>03.Management\03.Light_Manager</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Collision_Callback.h">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
|
||||
<ClInclude Include="..\Public\RigidBody_Static.h">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\00.Static</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic.h">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\10.Dynamic</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\NCallBack_Playable_HitRepot.h">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\NCallBack_Playable_Behavior.h">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Collision_Callback.h"
|
||||
|
||||
CCharacter_Controller::CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CComponent{ pDevice, pContext }
|
||||
@@ -202,11 +201,12 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
Desc.halfSideExtent = pDesc->vBoxSize.x;
|
||||
Desc.halfForwardExtent = pDesc->vBoxSize.z;
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.reportCallback = static_cast<PSX::PxUserControllerHitReport*>(pDesc->pCallback);
|
||||
Desc.behaviorCallback = static_cast<PSX::PxControllerBehaviorCallback*>(pDesc->pCallback);
|
||||
Desc.reportCallback = pDesc->pCallback_HitReport;
|
||||
Desc.behaviorCallback = pDesc->pCallback_Behavior;
|
||||
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_BoxController(Desc);
|
||||
m_pController->setUserData(&m_tagData);
|
||||
m_pController->getActor()->userData = &m_tagData;
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
@@ -215,11 +215,12 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
Desc.height = pDesc->fHeight;
|
||||
Desc.climbingMode = pDesc->eClimbingMode; // 기본 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.reportCallback = static_cast<PSX::PxUserControllerHitReport*>(pDesc->pCallback);
|
||||
Desc.behaviorCallback = static_cast<PSX::PxControllerBehaviorCallback*>(pDesc->pCallback);
|
||||
Desc.reportCallback = pDesc->pCallback_HitReport;
|
||||
Desc.behaviorCallback = pDesc->pCallback_Behavior;
|
||||
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
m_pController->setUserData(&m_tagData);
|
||||
m_pController->getActor()->userData = &m_tagData;
|
||||
} break;
|
||||
default:
|
||||
assert(false); // PhysX에서 불가능
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Collision_Callback.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CCollision_Callback::CCollision_Callback()
|
||||
{
|
||||
}
|
||||
|
||||
void CCollision_Callback::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
assert(nullptr != pActor); // missing user data
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCollision_Callback::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
PSX::PxController* pOtherController= hit.other; // 다른 컨트롤러
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pOtherController->getActor()->userData);
|
||||
assert(nullptr != pOtherController); // missing user data
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCollision_Callback::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
const void* pOtherController= hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
{
|
||||
//if (actor.userData.subKind == kMovingPlatformTag)
|
||||
// return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT
|
||||
// | PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
|
||||
// 나머지는 아무 특별 동작 없음
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxController& controller)
|
||||
{
|
||||
// CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxObstacle& obstacle)
|
||||
{
|
||||
// Obstacle이 움직이는 발판이다?
|
||||
// 여기서 ride/slide 세팅
|
||||
//return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
|
||||
return PSX::PxControllerBehaviorFlags();
|
||||
}
|
||||
@@ -581,11 +581,11 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr
|
||||
return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh);
|
||||
}
|
||||
|
||||
PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody_Dynamic& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
|
||||
}
|
||||
PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody_Static& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_StaticActor(RigidBody);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
@@ -68,7 +68,7 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
return pActorDynamic;
|
||||
}
|
||||
|
||||
PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
@@ -260,9 +260,9 @@ HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangle
|
||||
// return true;
|
||||
//}
|
||||
|
||||
PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _wstring& wstrMeshKey)
|
||||
PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _tchar* pMeshName)
|
||||
{
|
||||
map<_wstring, PSX::PxTriangleMesh*>::iterator iter = m_TriangleMeshes.find(wstrMeshKey);
|
||||
map<_wstring, PSX::PxTriangleMesh*>::iterator iter = m_TriangleMeshes.find(pMeshName);
|
||||
if (iter != m_TriangleMeshes.end()) {
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
@@ -11,80 +11,12 @@ CRigidBody::CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
CRigidBody::CRigidBody(const CRigidBody& rhs) :
|
||||
CComponent(rhs),
|
||||
m_eActorType(rhs.m_eActorType),
|
||||
m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo),
|
||||
m_wstrMeshKey(rhs.m_wstrMeshKey),
|
||||
m_vMatInfo(rhs.m_vMatInfo),
|
||||
m_ePxRigidBodyFlags(rhs.m_ePxRigidBodyFlags),
|
||||
m_ePxShapeFlags(rhs.m_ePxShapeFlags),
|
||||
m_eMatType(rhs.m_eMatType),
|
||||
m_fContactOffset(rhs.m_fContactOffset)
|
||||
{
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Render()
|
||||
{
|
||||
_matrix WorldMatrix = m_pTransform->Get_XMWorldMatrix();
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * m_vhalfGeometryInfo.y);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * -m_vhalfGeometryInfo.y);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::SPHERE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
void CRigidBody::Set_Kinematic(_bool bKinematic)
|
||||
{
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic);
|
||||
}
|
||||
|
||||
void CRigidBody::Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxForce = {};
|
||||
XMStoreFloat3((_float3*)&vPxForce, vForce);
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->addForce(vPxForce, eType);
|
||||
}
|
||||
|
||||
void CRigidBody::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxTorque = {};
|
||||
XMStoreFloat3((_float3*)&vPxTorque, vDirection);
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->addForce(vPxTorque, eType);
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
m_ePxRigidBodyFlags = Desc.ePxRigidBodyFlags;
|
||||
m_ePxShapeFlags = Desc.ePxShapeFlags;
|
||||
m_eMatType = Desc.ePxMaterialTypes;
|
||||
m_vMatInfo = Desc.vMatInfo;
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
m_vhalfGeometryInfo = Desc.vhalfGeometryInfo;
|
||||
m_fDensity = Desc.fDensity;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize(void* pArg)
|
||||
{
|
||||
@@ -97,136 +29,11 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
m_pTransform = m_pOwner->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pTransform);
|
||||
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
case Engine::ACTOR::SPHERE:
|
||||
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this);
|
||||
break;
|
||||
case Engine::ACTOR::PLANE:
|
||||
break;
|
||||
case Engine::ACTOR::TRIANGLEMESH:
|
||||
m_pRigidBody = m_pGameInstance->Add_StaticActor(*this);
|
||||
break;
|
||||
case Engine::ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
case Engine::ACTOR::END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Initialize_UserData();
|
||||
m_pRigidBody->userData = &m_tagData;
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_UserData()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::SPHERE:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::PLANE:
|
||||
break;
|
||||
case Engine::ACTOR::TRIANGLEMESH:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_STATIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
case Engine::ACTOR::END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Add_DebugShape()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y, m_vhalfGeometryInfo.x, 10, false));
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
break;
|
||||
case ACTOR::PLANE:
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
CRigidBody* CRigidBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
CRigidBody* pInstance = new CRigidBody(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(Desc))) {
|
||||
MSG_BOX("CRigidBody Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* CRigidBody::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CRigidBody* pInstance = new CRigidBody(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg))) {
|
||||
MSG_BOX("CRigidBody Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CRigidBody::Free()
|
||||
{
|
||||
if (nullptr != m_pRigidBody) {
|
||||
m_pRigidBody = nullptr;
|
||||
}
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pTransform);
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
#include "pch.h"
|
||||
#include "RigidBody_Dynamic.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CRigidBody_Dynamic::CRigidBody_Dynamic(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
CRigidBody(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CRigidBody_Dynamic::CRigidBody_Dynamic(const CRigidBody_Dynamic& rhs) :
|
||||
CRigidBody(rhs),
|
||||
m_vMatInfo(rhs.m_vMatInfo),
|
||||
m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody_Dynamic::Render()
|
||||
{
|
||||
_matrix WorldMatrix = m_pTransform->Get_XMWorldMatrix();
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * m_vhalfGeometryInfo.y);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * -m_vhalfGeometryInfo.y);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::SPHERE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
void CRigidBody_Dynamic::Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxForce = {};
|
||||
XMStoreFloat3((_float3*)&vPxForce, vForce);
|
||||
m_pRigidBody->addForce(vPxForce, eType);
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxTorque = {};
|
||||
XMStoreFloat3((_float3*)&vPxTorque, vDirection);
|
||||
m_pRigidBody->addForce(vPxTorque, eType);
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Set_Kinematic(_bool bKinematic)
|
||||
{
|
||||
m_pRigidBody->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic);
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
m_ePxRigidBodyFlags = Desc.ePxRigidBodyFlags;
|
||||
m_ePxShapeFlags = Desc.ePxShapeFlags;
|
||||
m_eMatType = Desc.ePxMaterialTypes;
|
||||
m_vMatInfo = Desc.vMatInfo;
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
m_vhalfGeometryInfo = Desc.vhalfGeometryInfo;
|
||||
m_fDensity = Desc.fDensity;
|
||||
m_vMassCenter = Desc.vMassCenter;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Dynamic::Initialize(void* pArg)
|
||||
{
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this);
|
||||
m_pRigidBody->userData = &m_tagData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody_Dynamic::Add_DebugShape()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y, m_vhalfGeometryInfo.x, 10, false));
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
CRigidBody_Dynamic* CRigidBody_Dynamic::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc)
|
||||
{
|
||||
CRigidBody_Dynamic* pInstance = new CRigidBody_Dynamic(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(Desc))) {
|
||||
MSG_BOX("CRigidBody_Dynamic Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* CRigidBody_Dynamic::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CRigidBody_Dynamic* pInstance = new CRigidBody_Dynamic(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg))) {
|
||||
MSG_BOX("CRigidBody_Dynamic Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Free()
|
||||
{
|
||||
__super::Free();
|
||||
if (nullptr != m_pRigidBody) {
|
||||
m_pRigidBody = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "pch.h"
|
||||
#include "RigidBody_Static.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CRigidBody_Static::CRigidBody_Static(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :
|
||||
CRigidBody(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CRigidBody_Static::CRigidBody_Static(const CRigidBody_Static& rhs) :
|
||||
CRigidBody(rhs),
|
||||
m_pMeshName(rhs.m_pMeshName)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Static::Initialize_Prototype(RIGIDBODY_STATIC_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
m_ePxRigidBodyFlags = Desc.ePxRigidBodyFlags;
|
||||
m_ePxShapeFlags = Desc.ePxShapeFlags;
|
||||
m_eMatType = Desc.ePxMaterialTypes;
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Static::Initialize(void* pArg)
|
||||
{
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_STATIC;
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
m_pRigidBody = m_pGameInstance->Add_StaticActor(*this);
|
||||
m_pRigidBody->userData = &m_tagData;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CRigidBody_Static* CRigidBody_Static::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_STATIC_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
CRigidBody_Static* pInstance = new CRigidBody_Static(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(Desc))) {
|
||||
MSG_BOX("CRigidBody_Static Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* CRigidBody_Static::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CRigidBody_Static* pInstance = new CRigidBody_Static(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg))) {
|
||||
MSG_BOX("CRigidBody_Static Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CRigidBody_Static::Free()
|
||||
{
|
||||
__super::Free();
|
||||
if (nullptr != m_pRigidBody) {
|
||||
m_pRigidBody = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CRigidBody_Static::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -24,7 +24,8 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
|
||||
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
|
||||
|
||||
void* pCallback = { }; // move가 호출될 때 호출 됨 // dll을 받는 각 프로젝트에서 CCollision_Callback 을 구현해야함
|
||||
PSX::PxUserControllerHitReport* pCallback_HitReport = { }; // move가 호출될 때 호출 됨 // dll을 받는 각 프로젝트에서 구현해야함
|
||||
PSX::PxControllerBehaviorCallback* pCallback_Behavior = { }; // move가 호출될 때 호출 됨 // dll을 받는 각 프로젝트에서 구현해야함
|
||||
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
|
||||
@@ -182,8 +182,8 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* Create_Material(_float3* vMatInfo);
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody);
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody);
|
||||
|
||||
|
||||
PSX::PxController* Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc);
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
|
||||
|
||||
CCallBack_Playable_Behavior::CCallBack_Playable_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
{
|
||||
if (nullptr == actor.userData) {
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(actor.userData);
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT
|
||||
| PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
return PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// 나머지는 아무 특별 동작 없음
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxController& controller)
|
||||
{
|
||||
// CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle)
|
||||
{
|
||||
// Obstacle이 움직이는 발판이다?
|
||||
// 여기서 ride/slide 세팅
|
||||
//return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
+7
-15
@@ -1,8 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
NS_BEGIN(PSX)
|
||||
class PxControllerBehaviorCallback;
|
||||
class PxUserControllerHitReport;
|
||||
NS_END
|
||||
|
||||
class CCollision_Callback final : public PSX::PxUserControllerHitReport, PSX::PxControllerBehaviorCallback
|
||||
class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
@@ -12,21 +16,10 @@ class CCollision_Callback final : public PSX::PxUserControllerHitReport, PSX::Px
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
public:
|
||||
NO_COPY(CCollision_Callback)
|
||||
CCollision_Callback();
|
||||
~CCollision_Callback()=default;
|
||||
CCallBack_Playable_Behavior();
|
||||
~CCallBack_Playable_Behavior() = default;
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
// 충돌알림!!
|
||||
// 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까?
|
||||
virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우
|
||||
|
||||
virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
|
||||
|
||||
// PxControllerBehaviorCallback을(를) 통해 상속됨
|
||||
// 충돌알림이 아닌, 행동정책 정해주기. CCT vs CCT는 지원안함
|
||||
// slopeLimit로 미끄러져 갈 수 있는지 없는지 이분법적인 계산 대신, 원하는 물체에 대해서만 미끄러운 표면으로 정의해줌
|
||||
@@ -37,4 +30,3 @@ class CCollision_Callback final : public PSX::PxUserControllerHitReport, PSX::Px
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Playable_HitRepot.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CCallBack_Playable_HitRepot::CCallBack_Playable_HitRepot()
|
||||
{
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
if (nullptr == pActorData) { // missing user data
|
||||
return;
|
||||
}
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addForce(vDir * fLength, PSX::PxForceMode::eIMPULSE);
|
||||
} break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pOtherController->getActor()->userData);
|
||||
assert(nullptr != pActorData); // missing user data
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
const void* pOtherController = hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
NS_BEGIN(PSX)
|
||||
class PxControllerBehaviorCallback;
|
||||
class PxUserControllerHitReport;
|
||||
NS_END
|
||||
|
||||
class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
public:
|
||||
CCallBack_Playable_HitRepot();
|
||||
~CCallBack_Playable_HitRepot() = default;
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
// 충돌알림!!
|
||||
// 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까?
|
||||
virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우
|
||||
|
||||
virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
};
|
||||
@@ -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
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CRigidBody;
|
||||
class CRigidBody_Dynamic;
|
||||
class CRigidBody_Static;
|
||||
class CTransform;
|
||||
class CMesh;
|
||||
|
||||
@@ -20,8 +22,8 @@ class CPhysX_Manager final : public CBase
|
||||
// HRESULT Update_RegionOfInterest(); ( 충돌 컬링, 필터링도 검색해야함 )
|
||||
// Aggregate ( 충돌 그룹, 이 그룹끼리는 서로 충돌검사를 하지 않음, 지형, 레그돌 등 )
|
||||
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody);
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody);
|
||||
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxMaterial* Create_Material(const _float3* vMatInfo);
|
||||
@@ -30,7 +32,7 @@ class CPhysX_Manager final : public CBase
|
||||
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
//HRESULT LoadTriMeshes_Binary(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
PSX::PxTriangleMesh* Find_TriangleMesh(const _wstring& wstrMeshKey);
|
||||
PSX::PxTriangleMesh* Find_TriangleMesh(const _tchar* pMeshName);
|
||||
|
||||
void Update(_float fTimeDelta);
|
||||
void ClearScene();
|
||||
@@ -76,6 +78,11 @@ class CPhysX_Manager final : public CBase
|
||||
list<pair<CRigidBody*, PSX::PxActor*>> m_RigidBodys = { };
|
||||
map<_wstring, PSX::PxTriangleMesh*> m_TriangleMeshes = {};
|
||||
map<_wstring, PSX::PxTriangleMeshGeometry*> m_TriangleMeshGeometry = {};
|
||||
#ifdef 기무리
|
||||
PhsXUserData PlaneData = {};
|
||||
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
vector<PSX::PxMaterial*> m_pMaterials = { };
|
||||
_uint m_iNumLevel = {};
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
#include "VIBuffer_Cell.h"
|
||||
#include "Shader.h"
|
||||
#include "Navigation.h"
|
||||
#include "RigidBody.h"
|
||||
#include "RigidBody_Dynamic.h"
|
||||
#include "RigidBody_Static.h"
|
||||
#include "Texture.h"
|
||||
#include "Cell.h"
|
||||
#include "Model.h"
|
||||
|
||||
@@ -10,9 +10,9 @@ NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
class CMesh;
|
||||
|
||||
class ENGINE_DLL CRigidBody final : public CComponent
|
||||
class ENGINE_DLL CRigidBody abstract : public CComponent
|
||||
{
|
||||
public: // MORE INFO ON ENGINE_ENUM
|
||||
protected: // MORE INFO ON ENGINE_ENUM
|
||||
typedef struct tagRigidBody_PrototypeDesc // 다 채우세요 NONE 빼고, 목적에 안맞는거 빼고
|
||||
{
|
||||
ACTOR eType;
|
||||
@@ -22,91 +22,41 @@ class ENGINE_DLL CRigidBody final : public CComponent
|
||||
_float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피직스 객체의 속성 등
|
||||
_float fContactOffset = { 0.05f }; // 접촉 유격 오프셋
|
||||
|
||||
#pragma region DYNAMIC
|
||||
_float3 vhalfGeometryInfo; // 박스는 vSize, 캡슐은 radius, height로 씀
|
||||
_float fDensity = { 1000.f }; // 밀도, 실제 무게는 부피에 따라 달라짐
|
||||
|
||||
#pragma endregion
|
||||
#pragma region STATIC
|
||||
#pragma endregion
|
||||
}RIGIDBODY_PROTOTYPEDESC;
|
||||
|
||||
typedef struct tagRigidBody_Desc
|
||||
{
|
||||
#pragma region DYNAMIC
|
||||
#pragma endregion
|
||||
#pragma region STATIC
|
||||
const _char* szMeshName = { };
|
||||
#pragma endregion
|
||||
|
||||
}RIGIDBODY_DESC;
|
||||
|
||||
private:
|
||||
protected:
|
||||
CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CRigidBody(const CRigidBody& rhs);
|
||||
virtual ~CRigidBody() = default;
|
||||
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
ACTOR Get_Type() const { return m_eActorType; }
|
||||
PSX::PxActor* Get_Actor() const { return m_pRigidBody; }
|
||||
virtual PSX::PxActor* Get_Actor()PURE;
|
||||
CTransform* Get_TransformPtr() const { return m_pTransform; }
|
||||
const _tchar* Get_PxMeshKey() const { return m_wstrMeshKey.c_str(); }
|
||||
PXMATERIAL Get_MaterialType() const { return m_eMatType; }
|
||||
_float Get_ContactOffset() const { return m_fContactOffset; }
|
||||
_float Get_Density() const { return m_fDensity; }
|
||||
PSX::PxShapeFlags Get_ShapeFlags() const { return m_ePxShapeFlags; }
|
||||
PSX::PxRigidBodyFlags Get_RigidBodyFlags() const { return m_ePxRigidBodyFlags; }
|
||||
_float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; }
|
||||
|
||||
|
||||
// 키네마틱은 transform으로 이동 ( simulate 전에 이동함 )
|
||||
// 키네마틱이 아닌 dynamic은 토크와 포스로 이동 ( simulate 후에 이동함 )
|
||||
void Set_Kinematic(_bool bKinematic);
|
||||
|
||||
|
||||
void Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 속도 + 방향
|
||||
void Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 방향
|
||||
|
||||
private:
|
||||
protected:
|
||||
ACTOR m_eActorType = ACTOR::END;
|
||||
PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = {};
|
||||
PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = { };
|
||||
PSX::PxShapeFlags m_ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
PXMATERIAL m_eMatType = { PXMATERIAL::END };
|
||||
_float m_fContactOffset = { 0.05f };
|
||||
PSX::PxActor* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
|
||||
CTransform* m_pTransform = { nullptr };
|
||||
PhsXUserData m_tagData = {};
|
||||
|
||||
#pragma region DYNAMIC
|
||||
PSX::PxShapeFlags m_ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
_float3 m_vMatInfo = {};
|
||||
_float3 m_vhalfGeometryInfo = {};
|
||||
_float3 m_vCenterOfMess = {}; // 회전축
|
||||
_float m_fDensity = { 1000.f };
|
||||
#pragma endregion
|
||||
#pragma region STATIC
|
||||
_wstring m_wstrMeshKey = { }; // 짝꿍 스태틱 메시의 triangleMesh 키
|
||||
#pragma endregion
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
HRESULT Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc);
|
||||
HRESULT Initialize(void* pArg);
|
||||
HRESULT Initialize_UserData();
|
||||
#ifdef _DEBUG
|
||||
HRESULT Add_DebugShape();
|
||||
#endif
|
||||
protected:
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
|
||||
public:
|
||||
static CRigidBody* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPEDESC& Desc);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
#include "RigidBody.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
class CMesh;
|
||||
|
||||
class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
{
|
||||
public:
|
||||
typedef struct tagRigidBody_Prototype_DYNAMIC_Desc : public CRigidBody::RIGIDBODY_PROTOTYPEDESC
|
||||
{
|
||||
_float3 vhalfGeometryInfo; // 박스는 vSize, 캡슐은 radius, height로 씀
|
||||
_float fDensity = { 1000.f }; // 밀도, 실제 무게는 부피에 따라 달라짐
|
||||
_float3 vMassCenter = {};
|
||||
}RIGIDBODY_PROTOTYPE_DYNAMIC_DESC;
|
||||
|
||||
typedef struct tagRigidBody_DYNAMIC_Desc : public CRigidBody::RIGIDBODY_DESC
|
||||
{
|
||||
|
||||
}RIGIDBODY_DYNAMIC_DESC;
|
||||
|
||||
private:
|
||||
CRigidBody_Dynamic(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CRigidBody_Dynamic(const CRigidBody_Dynamic& rhs);
|
||||
virtual ~CRigidBody_Dynamic() = default;
|
||||
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
virtual PSX::PxRigidDynamic* Get_Actor() override { return m_pRigidBody; };
|
||||
_float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; }
|
||||
_float Get_Density() const { return m_fDensity; }
|
||||
|
||||
virtual void Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 속도 + 방향
|
||||
virtual void Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 방향 ( 회전축은 MassCenter )
|
||||
void Set_Kinematic(_bool bKinematic);
|
||||
|
||||
private:
|
||||
PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
_float3 m_vMatInfo = {};
|
||||
_float3 m_vhalfGeometryInfo = {};
|
||||
_float3 m_vMassCenter = {}; // 회전축
|
||||
_float m_fDensity = { 1000.f };
|
||||
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
HRESULT Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc);
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT Add_DebugShape();
|
||||
#endif
|
||||
|
||||
public:
|
||||
static CRigidBody_Dynamic* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
#include "RigidBody.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
class CMesh;
|
||||
|
||||
|
||||
class ENGINE_DLL CRigidBody_Static : public CRigidBody
|
||||
{
|
||||
public:
|
||||
typedef struct tagRigidBody_Prototype_STATIC_Desc : public CRigidBody::RIGIDBODY_PROTOTYPEDESC
|
||||
{
|
||||
|
||||
}RIGIDBODY_STATIC_PROTOTYPEDESC;
|
||||
|
||||
typedef struct tagRigidBody_STATIC_Desc : public CRigidBody::RIGIDBODY_PROTOTYPEDESC
|
||||
{
|
||||
const _tchar* pMeshName = { nullptr };
|
||||
}RIGIDBODY_STATIC_DESC;
|
||||
|
||||
private:
|
||||
CRigidBody_Static(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CRigidBody_Static(const CRigidBody_Static& rhs);
|
||||
virtual ~CRigidBody_Static() = default;
|
||||
|
||||
public:
|
||||
PSX::PxRigidStatic* Get_Actor() override { return m_pRigidBody; }
|
||||
const _tchar* Get_PxMeshKey() const { return m_pMeshName; }
|
||||
|
||||
private:
|
||||
PSX::PxRigidStatic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
const _tchar* m_pMeshName = { nullptr }; // 짝꿍 스태틱 메시의 triangleMesh 키
|
||||
|
||||
private:
|
||||
HRESULT Initialize_Prototype(RIGIDBODY_STATIC_PROTOTYPEDESC& Desc);
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
public:
|
||||
static CRigidBody_Static* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_STATIC_PROTOTYPEDESC& Desc);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
Reference in New Issue
Block a user