[add] 오브젝트 매니저 바로가기 뷰어 추가
[add] 피직스 스태틱 오브젝트 정리
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Shader.h"
|
||||
|
||||
@@ -95,6 +95,9 @@ HRESULT CDebugCamera::Initialize(void* pArg)
|
||||
m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f));
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_EffectViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -46,7 +46,7 @@ void CLevel_EffectViewer::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_EffectViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -62,6 +62,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_ObjectViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -54,7 +54,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다"));
|
||||
//GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -464,6 +464,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CameraDesc.vEye = _float3(0.f, 30.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_PhysXLab.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -24,7 +24,7 @@ void CLevel_PhysXLab::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_PhysXLab::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -70,10 +70,11 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 5000.f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 2.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
|
||||
@@ -580,25 +580,29 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
}
|
||||
|
||||
ModelPrototypeTags.push_back(strFileName);
|
||||
ModelPrototypePath.push_back(file.path());
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
{ /* cache rigidbody */ // More Info In 리지드바디, CCT, 엔진이넘
|
||||
ModelPrototypePath.push_back(file.path());
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
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)))) {
|
||||
return E_FAIL;
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{ // basic static RIGIDBODY
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
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)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))){
|
||||
return E_FAIL;
|
||||
|
||||
@@ -226,9 +226,6 @@
|
||||
<Filter Include="01.Utility\06.ComputeShader">
|
||||
<UniqueIdentifier>{96600587-16b1-4627-914d-7fc413c501ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Utility\06. Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="99.Define\99.THIRDPARTY\PHYSX">
|
||||
<UniqueIdentifier>{5948985e-f67e-4627-aca4-09b8e9edc359}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -250,6 +247,9 @@
|
||||
<Filter Include="02.Element\01.GameObject\50.UI\ElementObject">
|
||||
<UniqueIdentifier>{1eafb189-2d0c-4ad7-8690-10a517668206}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Utility\06.Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -445,7 +445,7 @@
|
||||
<Filter>02.Element\02.Component\06.Model\Instance_Model</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Picking.cpp">
|
||||
<Filter>01.Utility\06. Picking</Filter>
|
||||
<Filter>01.Utility\06.Picking</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp">
|
||||
<Filter>01.Utility\06.ComputeShader</Filter>
|
||||
@@ -1023,7 +1023,7 @@
|
||||
<Filter>01.Utility\06.ComputeShader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Picking.h">
|
||||
<Filter>01.Utility\06. Picking</Filter>
|
||||
<Filter>01.Utility\06.Picking</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\VIBuffer_Terrain.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Terrain</Filter>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Camera.h"
|
||||
|
||||
CCamera::CCamera(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -32,6 +32,7 @@ HRESULT CCamera::Initialize(void* pArg)
|
||||
m_fFar = pDesc->fFar;
|
||||
m_bActive = false;
|
||||
m_iPriority = pDesc->iPriority;
|
||||
m_pCameraKey = pDesc->pCameraKey;
|
||||
m_pFollowTarget = pDesc->pFollowTarget;
|
||||
SAFE_ADDREF(m_pFollowTarget);
|
||||
m_pLookTarget = pDesc->pLookTarget;
|
||||
@@ -81,12 +82,12 @@ void CCamera::Transition(_float fTimeDelta)
|
||||
void CCamera::Active_Camera(pair<_float4, _float3>& pairTransitionInfo)
|
||||
{
|
||||
//if (true == m_bTransitionLerp) {
|
||||
m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(),
|
||||
XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second)));
|
||||
m_fTransitionCurrentTime = 0.f;
|
||||
m_bIsCurrentTransition = true;
|
||||
// m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(),
|
||||
// XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second)));
|
||||
// m_fTransitionCurrentTime = 0.f;
|
||||
// m_bIsCurrentTransition = true;
|
||||
//}
|
||||
//m_bActive = true;
|
||||
m_bActive = true;
|
||||
}
|
||||
|
||||
void CCamera::DeActive_Camera(pair<_float4, _float3>& pairTransition)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Camera_Manager.h"
|
||||
#include "Camera.h"
|
||||
#include "GameInstance.h"
|
||||
@@ -66,6 +66,14 @@ HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CCamera_Manager::Force_CamPosition(_fvector vPos)
|
||||
{
|
||||
if (nullptr == m_pCurrentMainCamera)
|
||||
return;
|
||||
|
||||
m_pCurrentMainCamera->Get_Component<CTransform>()->Set_State(STATE::POSITION, XMVectorSetW(vPos, 1.f));
|
||||
}
|
||||
|
||||
const _float* CCamera_Manager::Get_CurrentCameraFar()
|
||||
{
|
||||
return &m_fFar;
|
||||
@@ -92,9 +100,13 @@ CCamera* CCamera_Manager::Find_Camera(_uint iLevel, const _wstring& wstrCameraKe
|
||||
HRESULT CCamera_Manager::Clear_Cameras(_uint iLevel)
|
||||
{
|
||||
if (nullptr != m_pCurrentMainCamera) {
|
||||
pair<_float4, _float3> pairTransitionInfo = { };
|
||||
m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo);
|
||||
SAFE_RELEASE(m_pCurrentMainCamera);
|
||||
for (pair<const _wstring, CCamera*>& pairCamera : m_Cameras[iLevel]) {
|
||||
if (m_pCurrentMainCamera == pairCamera.second) {
|
||||
pair<_float4, _float3> pairTransitionInfo = { };
|
||||
m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo);
|
||||
SAFE_RELEASE(m_pCurrentMainCamera);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto& iter : m_Cameras[iLevel]) {
|
||||
SAFE_RELEASE(iter.second);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -29,7 +29,7 @@ HRESULT CCharacter_Controller::Render()
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
// vVolume = half-extents(Hx,Hy,Hz) 라고 가정
|
||||
// vVolume = half-extents(Hx,Hy,Hz) 라고 가정
|
||||
const _matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
vVolume.y / 0.5f,
|
||||
@@ -129,13 +129,13 @@ _float3 CCharacter_Controller::Get_Volume()
|
||||
|
||||
void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
{
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
_vector vMomentum = m_pTransform->Get_CurrentMomentum();
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, vMomentum);
|
||||
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
|
||||
|
||||
// eCOLLISION_SIDES = (1 << 0), //!< Character is colliding to the sides.
|
||||
@@ -209,7 +209,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
PSX::PxCapsuleControllerDesc Desc{};
|
||||
Desc.radius = pDesc->tCapsuleInfo.fRadius;
|
||||
Desc.height = pDesc->tCapsuleInfo.fHeight;
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
@@ -220,7 +220,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
#endif // _DEBUG
|
||||
} break;
|
||||
default:
|
||||
assert(false); // PhysX에서 불가능
|
||||
assert(false); // PhysX에서 불가능
|
||||
return E_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Prototype_Manager.h"
|
||||
#include "GameObject_Manager.h"
|
||||
@@ -314,23 +314,23 @@ void CGameInstance::Present_TimeCost() const
|
||||
|
||||
float minY = 0.f;
|
||||
float maxY = 0.025f;
|
||||
//float threshold = 166.f / 250.f; // 약 0.664f
|
||||
//float threshold = 166.f / 250.f; // 약 0.664f
|
||||
ImVec2 graph_size(0, 80.0f);
|
||||
ImVec2 start_pos = GUI::GetCursorScreenPos();
|
||||
|
||||
GUI::PlotLines("##FrameCount", values, IM_ARRAYSIZE(values), values_offset,
|
||||
overlay, minY, maxY, ImVec2(0, 80.0f));
|
||||
|
||||
// PlotLines의 실제 표시 영역 가져오기
|
||||
// PlotLines의 실제 표시 영역 가져오기
|
||||
ImVec2 plot_min = GUI::GetItemRectMin();
|
||||
ImVec2 plot_max = GUI::GetItemRectMax();
|
||||
|
||||
// 기준선 (60FPS)
|
||||
float threshold = 1.0f / 60.0f; // 0.0166초
|
||||
// 기준선 (60FPS)
|
||||
float threshold = 1.0f / 60.0f; // 0.0166초
|
||||
float normalized = (threshold - minY) / (maxY - minY);
|
||||
float y = plot_max.y - normalized * (plot_max.y - plot_min.y);
|
||||
|
||||
// 빨간 선 그리기
|
||||
// 빨간 선 그리기
|
||||
ImDrawList* draw_list = GUI::GetWindowDrawList();
|
||||
draw_list->AddLine(
|
||||
ImVec2(plot_min.x, y),
|
||||
@@ -525,6 +525,10 @@ const _float* CGameInstance::Get_CurrentCameraFar()
|
||||
{
|
||||
return m_pCamera_Manager->Get_CurrentCameraFar();
|
||||
}
|
||||
void CGameInstance::Force_CamPosition(_fvector vPos)
|
||||
{
|
||||
return m_pCamera_Manager->Force_CamPosition(vPos);
|
||||
}
|
||||
HRESULT CGameInstance::Ready_Shadow_Light(const SHADOW_LIGHT_DESC& Desc)
|
||||
{
|
||||
return m_pShadow->Ready_Shadow_Light(Desc);
|
||||
@@ -561,7 +565,7 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath)
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo)
|
||||
{
|
||||
return m_pPhysX_Manager->Get_Material(vMatInfo);
|
||||
return m_pPhysX_Manager->Create_Material(vMatInfo);
|
||||
}
|
||||
|
||||
void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GameObject_Manager.h"
|
||||
|
||||
#include "Layer.h"
|
||||
@@ -15,7 +15,7 @@ HRESULT CGameObject_Manager::Initialize(_uint iNumLevels)
|
||||
m_iNumLevels = iNumLevels;
|
||||
|
||||
m_pLayers = new map<const _wstring, CLayer*>[iNumLevels];
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ HRESULT CGameObject_Manager::Add_GameObject_ToLayer(_uint iLayerLevelIndex, cons
|
||||
|
||||
void CGameObject_Manager::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
Describe_Entity();
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
#endif // _DEBUG
|
||||
@@ -157,3 +158,46 @@ void CGameObject_Manager::Free()
|
||||
|
||||
Safe_Delete_Array(m_pLayers);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGameObject_Manager::Describe_Entity()
|
||||
{
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
|
||||
GUI::Begin("Object_Manager");
|
||||
GUI::Text("Levels : "); GUI::SameLine();
|
||||
if (GUI::BeginTabBar("Levels")) {
|
||||
for (_uint i = 0; i < m_iNumLevels; ++i) {
|
||||
|
||||
if (GUI::BeginTabItem(to_string(i).c_str(), nullptr)) { // Insert Here Level Names
|
||||
GUI::BeginChild("Object_Lists");
|
||||
if (GUI::BeginTabBar("Layers")) {
|
||||
string strlayerName;
|
||||
for (pair< const _wstring, CLayer*>& pairLayer : m_pLayers[i]) {
|
||||
size_t pos = pairLayer.first.find(TEXT("Layer_"));
|
||||
strlayerName = "NOT_STARTED_WITH_Layer_";
|
||||
if (pos != wstring::npos) {
|
||||
strlayerName = CMyTools::ToString(pairLayer.first.c_str() + pos + wcslen(TEXT("Layer_"))).c_str();
|
||||
}
|
||||
if (GUI::BeginTabItem(strlayerName.c_str(), nullptr)) {
|
||||
if (GUI::BeginChild("Items", ImVec2(0, 0), 0, window_flags)) {
|
||||
pairLayer.second->Describe_Entity();
|
||||
GUI::EndChild();
|
||||
}
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
}
|
||||
GUI::EndChild();
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Layer.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CLayer::CLayer()
|
||||
{
|
||||
}
|
||||
|
||||
CLayer::~CLayer()
|
||||
CLayer::CLayer():
|
||||
m_pGameInstance(CGameInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CLayer::Initialize()
|
||||
@@ -89,9 +87,9 @@ void CLayer::Free()
|
||||
for (auto& iter : m_ObjectList)
|
||||
{
|
||||
SAFE_RELEASE(iter);
|
||||
}
|
||||
} m_ObjectList.clear();
|
||||
|
||||
m_ObjectList.clear();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
CLayer* CLayer::Create()
|
||||
@@ -106,3 +104,21 @@ CLayer* CLayer::Create()
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CLayer::Describe_Entity()
|
||||
{
|
||||
_int iIndex = 0;
|
||||
|
||||
for (CGameObject*& iter : m_ObjectList)
|
||||
{
|
||||
GUI::PushID(iter);
|
||||
if (GUI::SmallButton((to_string(iIndex) + " : " + typeid(*iter).name()).c_str())) {
|
||||
m_pGameInstance->Force_CamPosition(iter->Get_WorldPostion() - XMVectorSet(0.f, -1.f, 1.f, 0.f) * 10.f);
|
||||
} iIndex++;
|
||||
GUI::PopID();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "PhysX_Manager.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameInstance.h"
|
||||
@@ -31,14 +31,13 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix);
|
||||
pActorDynamic->userData = &RigidBody;
|
||||
|
||||
PSX::PxShape* pClone = nullptr;
|
||||
PSX::PxShape* pShape = nullptr;
|
||||
PSX::PxGeometryHolder geoHolder = {};
|
||||
|
||||
_float3 vVolume = RigidBody.Get_HalfGeometryInfo();
|
||||
@@ -46,29 +45,27 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod
|
||||
switch (RigidBody.Get_Type()) {
|
||||
case ACTOR::BOX:
|
||||
geoHolder = PSX::PxBoxGeometry(PSX::PxVec3(vVolume.x, vVolume.y, vVolume.z));
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y);
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x);
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
break;
|
||||
default:
|
||||
assert(false); break;
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
assert(nullptr != pShape);
|
||||
|
||||
pClone->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pClone->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pClone->setRestOffset(0.f);
|
||||
pShape->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
|
||||
pActorDynamic->attachShape(*pClone);
|
||||
pActorDynamic->attachShape(*pShape);
|
||||
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
|
||||
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
|
||||
|
||||
@@ -90,60 +87,70 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod
|
||||
const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
PSX::PxTriangleMesh* pPxMesh = { nullptr };
|
||||
{
|
||||
auto iter = m_TriangleMeshes.find(RigidBody.Get_PxMeshKey());
|
||||
if (m_TriangleMeshes.end() == iter) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
pPxMesh = iter->second;
|
||||
}
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
|
||||
vRotq = XMQuaternionNormalize(vRotq);
|
||||
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
PSX::PxMeshScale meshScale(
|
||||
PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])),
|
||||
PSX::PxQuat(PSX::PxIdentity) // 스케일 축은 로컬 기준(보통 Identity가 가장 안전)
|
||||
);
|
||||
PSX::PxTriangleMeshGeometry* pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale);
|
||||
{
|
||||
pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
PX_ASSERT(pPxMeshGeometry.isValid()); // 유효성 체크
|
||||
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
|
||||
}
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix);
|
||||
PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true);
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true);
|
||||
|
||||
pActor->userData = &RigidBody;
|
||||
|
||||
PSX::PxShape* pShape = { nullptr };
|
||||
PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey());
|
||||
PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
|
||||
|
||||
switch (RigidBody.Get_Type())
|
||||
{
|
||||
case ACTOR::PLANE:
|
||||
break;
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
{ // SetUp Geometry
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
vRotq = XMQuaternionNormalize(vRotq);
|
||||
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
PSX::PxMeshScale meshScale(
|
||||
PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])),
|
||||
PSX::PxQuat(PSX::PxIdentity) // 스케일 축은 로컬 기준
|
||||
);
|
||||
pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale);
|
||||
|
||||
// GeoFlag 중 더블사이드는 이제 지원 안함, 할거면 노말 뒤집어서 하라고 함
|
||||
// pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
// 유효성 체크
|
||||
PX_ASSERT(pPxMeshGeometry.isValid());
|
||||
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
|
||||
}
|
||||
break;
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
|
||||
pShape->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActor);
|
||||
m_pScene->addActor(*pActor);
|
||||
|
||||
return pActor;
|
||||
}
|
||||
|
||||
PSX::PxMaterial* CPhysX_Manager::Get_Material(const _float3* vMatInfo)
|
||||
PSX::PxMaterial* CPhysX_Manager::Create_Material(const _float3* vMatInfo)
|
||||
{
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z);
|
||||
return pPxMaterial;
|
||||
}
|
||||
|
||||
void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) {
|
||||
void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh)
|
||||
{
|
||||
m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh);
|
||||
|
||||
}
|
||||
|
||||
HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
|
||||
@@ -233,8 +240,8 @@ HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangle
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// 바이너리 로드에는 128B 정렬된 메모리 포인터를 넘겨야 함. InputData 그대로 넘기면 안됨
|
||||
// 심지어 바이너리로 불러온 블럭은 피직스의 모든 메시들을 릴리즈 한 뒤에 해제 해야 함
|
||||
// 바이너리 로드에는 128B 정렬된 메모리 포인터를 넘겨야 함. InputData 그대로 넘기면 안됨
|
||||
// 심지어 바이너리로 불러온 블럭은 피직스의 모든 메시들을 릴리즈 한 뒤에 해제 해야 함
|
||||
//_bool CPhysX_Manager::LoadTriMeshes_Binary(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes)
|
||||
//{
|
||||
// filesystem::path pathPhysX = pPath;
|
||||
@@ -312,8 +319,8 @@ void CPhysX_Manager::Update(_float fTimeDelta)
|
||||
_bool bResult = m_pScene->fetchResults(true);
|
||||
}
|
||||
{ // Post
|
||||
// Update_Dynamic_ActiveActors();
|
||||
Update_Dynamic_AllActors();
|
||||
Update_Dynamic_ActiveActors();
|
||||
//Update_Dynamic_AllActors();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +434,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
}
|
||||
|
||||
|
||||
{ // 씬 세팅
|
||||
{ // 씬 세팅
|
||||
m_ToleranceScale.length = 1.f; // 1 meter
|
||||
m_ToleranceScale.speed = GRAVITY; //
|
||||
|
||||
@@ -440,7 +447,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f);
|
||||
|
||||
m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/);
|
||||
m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/);
|
||||
if (nullptr == m_pDispatcher) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
@@ -459,7 +466,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
m_pCCTManager->setOverlapRecoveryModule(false);
|
||||
}
|
||||
|
||||
// 디버그서버의 클라 세팅
|
||||
// 디버그서버의 클라 세팅
|
||||
PSX::PxPvdSceneClient* pPvdClient = m_pScene->getScenePvdClient();
|
||||
if (nullptr != pPvdClient) {
|
||||
pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true);
|
||||
@@ -469,7 +476,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
// m_pScene->overlap();??????
|
||||
|
||||
#ifdef 기무리
|
||||
#ifdef 기무리
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
@@ -491,7 +498,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
#endif // 기무리
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
|
||||
@@ -500,7 +507,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
HRESULT CPhysX_Manager::Connect_DebugServer()
|
||||
{
|
||||
// 네트워크 디버거 전송객체 생성
|
||||
// 네트워크 디버거 전송객체 생성
|
||||
m_pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10);
|
||||
if (nullptr == m_pTransport) {
|
||||
assert(false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -9,10 +9,11 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
public:
|
||||
typedef struct tagCameraDesc : public CTransform::TRANSFORM_DESC
|
||||
{
|
||||
_float fFovy{}, fNear{}, fFar{};
|
||||
_uint iPriority = { UINT_MAX };
|
||||
CGameObject* pFollowTarget = { nullptr };
|
||||
CGameObject* pLookTarget = { nullptr };
|
||||
_float fFovy{}, fNear{}, fFar{};
|
||||
_uint iPriority = { UINT_MAX };
|
||||
const _wchar* pCameraKey = { };
|
||||
CGameObject* pFollowTarget = { nullptr };
|
||||
CGameObject* pLookTarget = { nullptr };
|
||||
}CAMERA_DESC;
|
||||
|
||||
protected:
|
||||
@@ -48,6 +49,7 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
|
||||
_bool m_bActive = { false };
|
||||
|
||||
const _wchar* m_pCameraKey = { nullptr };
|
||||
CGameObject* m_pFollowTarget = { nullptr };
|
||||
CGameObject* m_pLookTarget = { nullptr };
|
||||
|
||||
@@ -65,4 +67,4 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -17,8 +17,9 @@ class CCamera_Manager final : public CBase
|
||||
HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority);
|
||||
HRESULT IsBinded_Camera(const _wstring& wstrCameraKey);
|
||||
|
||||
const _float* Get_CurrentCameraFar();
|
||||
|
||||
void Force_CamPosition(_fvector vPos);
|
||||
const _float* Get_CurrentCameraFar();
|
||||
|
||||
private:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
@@ -42,4 +43,4 @@ class CCamera_Manager final : public CBase
|
||||
virtual void Free()override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -14,7 +14,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
{
|
||||
_float fRadius;
|
||||
_float fHeight;
|
||||
PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset 값이 무제한), (eCONSTRAINED, stepOffset 값이 제대로 먹음)
|
||||
PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset 값이 무제한), (eCONSTRAINED, stepOffset 값이 제대로 먹음)
|
||||
};
|
||||
typedef struct tagCharacter_ControllerDesc
|
||||
{
|
||||
@@ -22,18 +22,18 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
ACTOR eBodyType = { ACTOR::END };
|
||||
_float fContactOffset = { 0.f };
|
||||
_float3 fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
|
||||
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
|
||||
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
|
||||
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
|
||||
|
||||
function<void()> funcHitCallback = { nullptr };
|
||||
function<void()> funcBehaviorCallback = { nullptr };
|
||||
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
|
||||
union
|
||||
{
|
||||
_float3 vBoxSize; // 박스는 AABB임
|
||||
_float3 vBoxSize; // 박스는 AABB임
|
||||
CapsuleInfo tCapsuleInfo;
|
||||
};
|
||||
}Character_Controller_DESC;
|
||||
@@ -47,18 +47,18 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
virtual HRESULT Render() override;
|
||||
#endif
|
||||
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
|
||||
void Move(_float fTimeDelta); // 이동
|
||||
void Set_Position(_fvector vNewPos); // 순간이동
|
||||
_vector Get_Position();
|
||||
_float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 더 아래에 위치한다는 뜻 )
|
||||
void Move(_float fTimeDelta); // 이동
|
||||
void Set_Position(_fvector vNewPos); // 순간이동
|
||||
_vector Get_Position();
|
||||
_float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 더 아래에 위치한다는 뜻 )
|
||||
|
||||
|
||||
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
|
||||
private:
|
||||
ACTOR m_eBodyType = { ACTOR::END };
|
||||
@@ -89,4 +89,4 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -174,4 +174,4 @@ NS_END
|
||||
// // PhysX Particle들이 닿는 순간 그 파티클을 '흡수'해서 제거함
|
||||
// // (default = off)
|
||||
// [ePARTICLE_DRAIN],
|
||||
//};
|
||||
//};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Prototype_Manager.h"
|
||||
#include "GameObject_Manager.h"
|
||||
|
||||
@@ -163,6 +163,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
HRESULT Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority);
|
||||
HRESULT IsBinded_Camera(const _wstring& strCameraKey);
|
||||
const _float* Get_CurrentCameraFar();
|
||||
void Force_CamPosition(_fvector vPos);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region SHADOW
|
||||
@@ -191,7 +192,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
|
||||
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity());
|
||||
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); // 모델 불러왔던 경로에 그대로 있음
|
||||
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); // 모델 불러왔던 경로에 그대로 있음
|
||||
#pragma endregion
|
||||
|
||||
|
||||
@@ -254,4 +255,4 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
|
||||
@@ -34,6 +34,12 @@ class ENGINE_DLL CGameObject_Manager final : public CBase
|
||||
static CGameObject_Manager* Create(_uint iNumLevels);
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -7,7 +7,7 @@ class ENGINE_DLL CLayer final : public CBase
|
||||
{
|
||||
private:
|
||||
CLayer();
|
||||
virtual ~CLayer();
|
||||
virtual ~CLayer() = default;
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta);
|
||||
virtual void Update(_float fTimeDelta);
|
||||
@@ -40,8 +40,13 @@ class ENGINE_DLL CLayer final : public CBase
|
||||
HRESULT Initialize();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
static CLayer* Create();
|
||||
virtual void Free() override;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
|
||||
@@ -17,14 +17,14 @@ class CPhysX_Manager final : public CBase
|
||||
|
||||
public:
|
||||
/* dev-treadmill.tistory.com/155 */
|
||||
// HRESULT Update_RegionOfInterest(); ( 충돌 컬링, 필터링도 검색해야함 )
|
||||
// Aggregate ( 충돌 그룹, 이 그룹끼리는 서로 충돌검사를 하지 않음, 지형, 레그돌 등 )
|
||||
// HRESULT Update_RegionOfInterest(); ( 충돌 컬링, 필터링도 검색해야함 )
|
||||
// Aggregate ( 충돌 그룹, 이 그룹끼리는 서로 충돌검사를 하지 않음, 지형, 레그돌 등 )
|
||||
|
||||
const PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody);
|
||||
const PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody);
|
||||
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxMaterial* Get_Material(const _float3* vMatInfo);
|
||||
PSX::PxMaterial* Create_Material(const _float3* vMatInfo);
|
||||
|
||||
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix);
|
||||
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
@@ -57,16 +57,16 @@ class CPhysX_Manager final : public CBase
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // 피직스 동적할당자
|
||||
PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // 피직스 오류처리자
|
||||
PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // 피직스 CPU디스패쳐 ( 현재 피직스는 CPU only )
|
||||
PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // 피직스 공차의 집합 ( 기본 단위 집합 )
|
||||
PSX::PxFoundation* m_pFoundation = { nullptr }; // 피직스 초기화 종료 담당자
|
||||
PSX::PxPhysics* m_pPhysics = { nullptr }; // 피직스 객체의 생성, 초기화, 조작 담당 (싱글톤)
|
||||
PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // 피직스 동적할당자
|
||||
PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // 피직스 오류처리자
|
||||
PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // 피직스 CPU디스패쳐 ( 현재 피직스는 CPU only )
|
||||
PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // 피직스 공차의 집합 ( 기본 단위 집합 )
|
||||
PSX::PxFoundation* m_pFoundation = { nullptr }; // 피직스 초기화 종료 담당자
|
||||
PSX::PxPhysics* m_pPhysics = { nullptr }; // 피직스 객체의 생성, 초기화, 조작 담당 (싱글톤)
|
||||
|
||||
PSX::PxScene* m_pScene = { nullptr }; // 피직스 시뮬레이션의 공간
|
||||
PSX::PxControllerManager* m_pCCTManager = { nullptr }; // 피직스 캐릭터 컨트롤러를 전부 추적하고 매니징함
|
||||
PSX::PxPvd* m_pPvd = { nullptr }; // 피직스 시뮬레이션 디버깅을 위한 도구
|
||||
PSX::PxScene* m_pScene = { nullptr }; // 피직스 시뮬레이션의 공간
|
||||
PSX::PxControllerManager* m_pCCTManager = { nullptr }; // 피직스 캐릭터 컨트롤러를 전부 추적하고 매니징함
|
||||
PSX::PxPvd* m_pPvd = { nullptr }; // 피직스 시뮬레이션 디버깅을 위한 도구
|
||||
PSX::PxCookingParams* m_pCookingParam = { nullptr };
|
||||
PSX::PxPvdTransport* m_pTransport = { nullptr };
|
||||
|
||||
@@ -90,4 +90,4 @@ class CPhysX_Manager final : public CBase
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(PSX)
|
||||
@@ -13,17 +13,17 @@ class CMesh;
|
||||
class ENGINE_DLL CRigidBody final : public CComponent
|
||||
{
|
||||
public: // MORE INFO ON ENGINE_ENUM
|
||||
typedef struct tagRigidBody_PrototypeDesc // 다 채우세요 NONE 빼고, 목적에 안맞는거 빼고
|
||||
typedef struct tagRigidBody_PrototypeDesc // 다 채우세요 NONE 빼고, 목적에 안맞는거 빼고
|
||||
{
|
||||
ACTOR eType;
|
||||
PSX::PxRigidBodyFlags ePxRigidBodyFlags = { /* NONE */};
|
||||
PSX::PxShapeFlags ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
PXMATERIAL ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
_float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피직스 객체의 속성 등
|
||||
_float fContactOffset = { 0.05f }; // 접촉 유격 오프셋
|
||||
_float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피직스 객체의 속성 등
|
||||
_float fContactOffset = { 0.05f }; // 접촉 유격 오프셋
|
||||
#pragma region DYNAMIC
|
||||
_float3 vhalfGeometryInfo; // 박스는 vSize, 캡슐은 radius, height로 씀
|
||||
_float fDensity = { 1000.f }; // 밀도, 실제 무게는 부피에 따라 달라짐
|
||||
_float3 vhalfGeometryInfo; // 박스는 vSize, 캡슐은 radius, height로 씀
|
||||
_float fDensity = { 1000.f }; // 밀도, 실제 무게는 부피에 따라 달라짐
|
||||
#pragma endregion
|
||||
#pragma region STATIC
|
||||
#pragma endregion
|
||||
@@ -63,7 +63,7 @@ class ENGINE_DLL CRigidBody final : public CComponent
|
||||
PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = {};
|
||||
PXMATERIAL m_eMatType = { PXMATERIAL::END };
|
||||
_float m_fContactOffset = { 0.05f };
|
||||
const PSX::PxActor* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
const PSX::PxActor* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
|
||||
CTransform* m_pTransform = { nullptr };
|
||||
|
||||
@@ -74,7 +74,7 @@ class ENGINE_DLL CRigidBody final : public CComponent
|
||||
_float m_fDensity = { 1000.f };
|
||||
#pragma endregion
|
||||
#pragma region STATIC
|
||||
_wstring m_wstrMeshKey = { }; // 짝꿍 스태틱 메시의 triangleMesh 키
|
||||
_wstring m_wstrMeshKey = { }; // 짝꿍 스태틱 메시의 triangleMesh 키
|
||||
#pragma endregion
|
||||
|
||||
private:
|
||||
@@ -97,4 +97,4 @@ class ENGINE_DLL CRigidBody final : public CComponent
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
Reference in New Issue
Block a user