[add] 1202 LastRelease

This commit is contained in:
kimnuri
2025-12-02 16:17:46 +09:00
parent b95124238c
commit fedb28902a
21 changed files with 410 additions and 78 deletions
@@ -89,8 +89,6 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
void CCamPosition_Shoulder::Update(_float fTimeDelta)
{
GUI::DragFloat3("Camera Shoulder Position",(_float*)&m_vShoulderPosRatio,0.01f);
GUI::DragFloat("Camera Shoulder Length",&m_fCameraFocalLength, 0.01f);
if (m_pGameInstance->Key_Up(DIK_INSERT)) {
m_pBinded_Camera->Toggle_Priority();
@@ -41,7 +41,6 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
void CCamera_Gaze::Update(_float fTimeDelta)
{
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
if (false == m_bActive) {
return;
}
+40 -1
View File
@@ -57,7 +57,46 @@ void CLevel_Field::Update(_float fTimeDelta)
HRESULT CLevel_Field::Render()
{
SetWindowText(g_hWnd, TEXT("필드레벨"));
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
static _float fAccumulatedTimeSeconds = 0.0f;
static _uint iFrameCountForFps = 0;
static _float fCurrentFps = 0.0f;
static _float fAverageFrameTimeMilliseconds = 0.0f;
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
++iFrameCountForFps;
if (fAccumulatedTimeSeconds >= 1.0f)
{
if (fAccumulatedTimeSeconds > 0.0f)
{
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
if (fCurrentFps > 0.0f)
{
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
}
}
fAccumulatedTimeSeconds = 0.0f;
iFrameCountForFps = 0;
}
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
_tchar szWindowTitle[256] = {};
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
_stprintf_s(
szWindowTitle,
TEXT("필드레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
fCurrentFrameTimeMilliseconds,
fAverageFrameTimeMilliseconds,
fCurrentFps
);
SetWindowText(g_hWnd, szWindowTitle);
return S_OK;
}
@@ -92,7 +92,46 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
HRESULT CLevel_GamePlay::Render()
{
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
static _float fAccumulatedTimeSeconds = 0.0f;
static _uint iFrameCountForFps = 0;
static _float fCurrentFps = 0.0f;
static _float fAverageFrameTimeMilliseconds = 0.0f;
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
++iFrameCountForFps;
if (fAccumulatedTimeSeconds >= 1.0f)
{
if (fAccumulatedTimeSeconds > 0.0f)
{
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
if (fCurrentFps > 0.0f)
{
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
}
}
fAccumulatedTimeSeconds = 0.0f;
iFrameCountForFps = 0;
}
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
_tchar szWindowTitle[256] = {};
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
_stprintf_s(
szWindowTitle,
TEXT("게임플레이레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
fCurrentFrameTimeMilliseconds,
fAverageFrameTimeMilliseconds,
fCurrentFps
);
SetWindowText(g_hWnd, szWindowTitle);
return S_OK;
}
+40 -1
View File
@@ -39,7 +39,46 @@ void CLevel_Logo::Update(_float fTimeDelta)
HRESULT CLevel_Logo::Render()
{
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
static _float fAccumulatedTimeSeconds = 0.0f;
static _uint iFrameCountForFps = 0;
static _float fCurrentFps = 0.0f;
static _float fAverageFrameTimeMilliseconds = 0.0f;
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
++iFrameCountForFps;
if (fAccumulatedTimeSeconds >= 1.0f)
{
if (fAccumulatedTimeSeconds > 0.0f)
{
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
if (fCurrentFps > 0.0f)
{
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
}
}
fAccumulatedTimeSeconds = 0.0f;
iFrameCountForFps = 0;
}
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
_tchar szWindowTitle[256] = {};
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
_stprintf_s(
szWindowTitle,
TEXT("로고 레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
fCurrentFrameTimeMilliseconds,
fAverageFrameTimeMilliseconds,
fCurrentFps
);
SetWindowText(g_hWnd, szWindowTitle);
return S_OK;
}
@@ -38,7 +38,46 @@ void CLevel_Restart::Update(_float fTimeDelta)
HRESULT CLevel_Restart::Render()
{
SetWindowText(g_hWnd, TEXT("리스타트레벨"));
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
static _float fAccumulatedTimeSeconds = 0.0f;
static _uint iFrameCountForFps = 0;
static _float fCurrentFps = 0.0f;
static _float fAverageFrameTimeMilliseconds = 0.0f;
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
++iFrameCountForFps;
if (fAccumulatedTimeSeconds >= 1.0f)
{
if (fAccumulatedTimeSeconds > 0.0f)
{
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
if (fCurrentFps > 0.0f)
{
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
}
}
fAccumulatedTimeSeconds = 0.0f;
iFrameCountForFps = 0;
}
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
_tchar szWindowTitle[256] = {};
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
_stprintf_s(
szWindowTitle,
TEXT("리스타트레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
fCurrentFrameTimeMilliseconds,
fAverageFrameTimeMilliseconds,
fCurrentFps
);
SetWindowText(g_hWnd, szWindowTitle);
return S_OK;
}
@@ -1,6 +1,7 @@
#include "pch.h"
#include "MapContainer.h"
#include "PartObject.h"
#include "MapObject_Collision.h"
//#include "MapObject_LOD.h"
@@ -44,6 +45,10 @@ void CMapContainer::Priority_Update(_float fTimeDelta)
void CMapContainer::Update(_float fTimeDelta)
{
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
__super::Update(fTimeDelta);
}
@@ -57,7 +62,33 @@ HRESULT CMapContainer::Render()
return S_OK;
}
void CMapContainer::ReadyForPhysX()
{
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
pObject->ReadyForPhysX();
}
}
void CMapContainer::ConvertToPhysX()
{
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
pObject->ConvertToPhysX();
}
}
void CMapContainer::Free()
{
__super::Free();
}
#ifdef _DEBUG
void CMapContainer::Describe_Entity()
{
}
#endif // _DEBUG
+84 -2
View File
@@ -8,6 +8,7 @@
#include "MapObject_Render.h"
#include "MapObject_Collision.h"
#include "MapElement_Light.h"
#include "Layer.h"
CMapInfo::CMapInfo()
{
@@ -15,6 +16,41 @@ CMapInfo::CMapInfo()
void CMapInfo::Update(_float fTimeDelta)
{
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
static _bool s_bConverted = { false };
static _bool s_bReadyToCreate = { false };
if (true != s_bConverted || true != s_bReadyToCreate) {
CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_BACKGROUND);
if (nullptr == pLayer) {
return;
}
const list<CGameObject*>* pObjects = pLayer->Get_Objects();
if (false == s_bReadyToCreate) {
s_bReadyToCreate = true;
list<CGameObject*>::const_iterator iter = pObjects->begin();
for (; iter != pObjects->end(); ++iter) {
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
if (nullptr != pContainer) {
pContainer->ReadyForPhysX();
}
}
}
else if (false == s_bConverted) {
s_bConverted = true;
list<CGameObject*>::const_iterator iter = pObjects->begin();
for (; iter != pObjects->end(); ++iter) {
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
if (nullptr != pContainer) {
pContainer->ConvertToPhysX();
}
}
}
}
}
void CMapInfo::Change_Level()
@@ -214,8 +250,9 @@ HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapCon
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc)))
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc))){
return E_FAIL;
}
#pragma endregion
}
@@ -263,7 +300,6 @@ HRESULT CMapInfo::Load_MapCollisionObjects(tinyxml2::XMLElement* Container, CMap
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
#pragma endregion
}
#pragma endregion
@@ -397,3 +433,49 @@ void CMapInfo::Free()
SAFE_RELEASE(m_pContext);
}
#ifdef _DEBUG
void CMapInfo::Describe_Entity()
{
CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_BACKGROUND);
if (nullptr == pLayer) {
return;
}
static _bool s_bConverted = { false };
static _bool s_bReadyToCreate = { false };
const list<CGameObject*>* pObjects = pLayer->Get_Objects();
GUI::Begin("MapInfoDesc");
GUI::SetNextItemWidth(80.f);
GUI::BeginChild("CollisonPartObjects");
GUI::SetNextItemWidth(80.f);
if (false == s_bReadyToCreate) {
if (GUI::Button("Ready_StaticMeshesForPhyX_ALL")) {
s_bReadyToCreate = true;
list<CGameObject*>::const_iterator iter = pObjects->begin();
for (; iter != pObjects->end(); ++iter) {
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
if (nullptr != pContainer) {
pContainer->ReadyForPhysX();
}
}
}
}
else if (false == s_bConverted) {
if (GUI::Button("Convert_StaticMeshesForPhyX_ALL")) {
s_bConverted = true;
list<CGameObject*>::const_iterator iter = pObjects->begin();
for (; iter != pObjects->end(); ++iter) {
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
if (nullptr != pContainer) {
pContainer->ConvertToPhysX();
}
}
}
}
GUI::EndChild();
GUI::End();
}
#endif // _DEBUG
@@ -72,12 +72,59 @@ HRESULT CMapObject_Collision::Initialize(void* pArg)
_wstring CMapObject_Collision::Get_PrototypeTag(_uint iLodIndex)
{
if (m_iMaxLodLevel < iLodIndex)
if (m_iMaxLodLevel < iLodIndex){
return m_ModelPrototypeTags[0];
}
return m_ModelPrototypeTags[iLodIndex];
}
void CMapObject_Collision::ReadyForPhysX()
{
if (true == m_bConverted) {
return;
}
m_bConverted = true;
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix)))) {
assert(false);
}
}
}
void CMapObject_Collision::ConvertToPhysX()
{
if (true == m_bReadyToCreatePhysX) {
return;
}
m_bReadyToCreatePhysX = true;
m_RigidBodies.resize(m_iMaxLodLevel + 1);
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
_uint iNumMeshes = pModel->Get_NumMeshes();
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
{
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
CRigidBody_Static* pRigidBody = { nullptr };
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
Desc.pMeshName = wstrName.c_str();
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) {
assert(false);
}
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
}
}
}
HRESULT CMapObject_Collision::Ready_Components()
{
__super::Ready_Components();
@@ -93,19 +140,6 @@ HRESULT CMapObject_Collision::Ready_Components()
}
m_pModelComs.push_back(pModel);
// _uint iMeshes = pModel->Get_NumMeshes();
// for (_uint iIndex = 0; iIndex < iMeshes; ++iIndex) {
// _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
// CRigidBody_Static* pRigidBody = { nullptr };
// CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
// Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
// Desc.pMeshName = wstrName.c_str();
// if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) {
// return E_FAIL;
// }
// m_RigidBodies[iIndexLOD].push_back(pRigidBody);
// }
}
/* Com_Shader */
+8 -1
View File
@@ -26,6 +26,9 @@ class CMapContainer abstract : public CContainerObject
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
void ReadyForPhysX();
void ConvertToPhysX();
public:
template<typename T>
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
@@ -53,10 +56,14 @@ class CMapContainer abstract : public CContainerObject
protected:
_uint m_iMaxLodLevel = {};
vector<class CPartObject*> m_ColiisonPartObjects;
vector<class CPartObject*> m_ColiisonPartObjects = {};
public:
virtual void Free() override;
#ifdef _DEBUG
virtual void Describe_Entity() override;
#endif // _DEBUG
};
NS_END
+4
View File
@@ -36,6 +36,10 @@ class CMapInfo final : public CBase
public:
static CMapInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
virtual void Free() override;
#ifdef _DEBUG
virtual void Describe_Entity();
#endif // _DEBUG
};
NS_END
@@ -20,13 +20,16 @@ class CMapObject_Collision final : public CMapPartObject // 충돌용 Mesh
public:
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
void ReadyForPhysX();
void ConvertToPhysX();
private:
CShader* m_pShaderCom = { nullptr };
vector<vector<CRigidBody_Static*>> m_RigidBodies;
vector<CModel*> m_pModelComs;
_uint m_iLodIndex = {};
_bool m_bReadyToCreatePhysX = { false };
_bool m_bConverted = { false };
vector<_wstring> m_ModelPrototypeTags;
vector<_uint> m_ModelPathIndices = { };
@@ -722,11 +722,11 @@ void CGameInstance::Release_Actor(PSX::PxActor& Actor)
{
m_pPhysX_Manager->Detach_Actor(Actor);
}
#ifdef EDITOR_PROJECT
HRESULT CGameInstance::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
{
return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes, WorldMatrix);
}
#ifdef EDITOR_PROJECT
HRESULT CGameInstance::SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes)
{
return m_pPhysX_Manager->SaveTriMeshes(pPath, TriMeshes);
+26 -17
View File
@@ -28,7 +28,7 @@ HRESULT CMesh::Bind_BoneMatrices(const vector<class CBone*>& Bones, CShader* pSh
if (0 == m_iNumBones) {
return S_OK;
}
return pShader->Bind_Matrices(pConstantName, m_pBoneMatrices, m_iNumBones);
}
@@ -205,9 +205,12 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh*
D3D11_SUBRESOURCE_DATA InitialIBData{};
InitialIBData.pSysMem = _SaveMesh->Indices.data();
m_pIndices = new _uint[m_iNumIndices];
memcpy_s(m_pIndices, sizeof(_uint) * m_iNumIndices, _SaveMesh->Indices.data(), sizeof(_uint) * m_iNumIndices);
if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB)))
if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB))){
return E_FAIL;
}
#pragma endregion
@@ -386,20 +389,6 @@ HRESULT CMesh::Initialize(void* pArg)
return S_OK;
}
#ifdef EDITOR_PROJECT
CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector<class CBone*>& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix)
{
CMesh* pInstance = new CMesh(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype(eType, Bones, pAIMesh, PreTransformMatrix)))
{
MSG_BOX("Failed to Created : CMesh");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix)
{
PSX::PxTriangleMeshDesc tMeshDesc = {};
@@ -409,7 +398,14 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
tMeshDesc.points.count = m_iNumVertices;
tMeshDesc.points.stride = sizeof(PSX::PxVec3);
Vertices.resize(m_iNumVertices);
memcpy(Vertices.data(), m_pVertexPositions, sizeof(PSX::PxVec3) * m_iNumVertices);
XMVector3TransformCoordStream(
reinterpret_cast<XMFLOAT3*>(Vertices.data()), // dest
sizeof(PSX::PxVec3),
reinterpret_cast<const XMFLOAT3*>(m_pVertexPositions), // src
sizeof(PSX::PxVec3),
m_iNumVertices,
WorldMatrix
);
tMeshDesc.points.data = Vertices.data();
}
{
@@ -438,6 +434,19 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
return pTriangleMesh;
}
#ifdef EDITOR_PROJECT
CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector<class CBone*>& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix)
{
CMesh* pInstance = new CMesh(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype(eType, Bones, pAIMesh, PreTransformMatrix)))
{
MSG_BOX("Failed to Created : CMesh");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(const aiMesh* pAIMesh, _fmatrix PreTransformMatrix)
{
+22 -26
View File
@@ -174,8 +174,9 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform)
{
m_bLoopRestarted = true;
}
else
else{
XMStoreFloat3(&m_vPrevRootPos, m_vector[2]);
}
m_vPrevRootRot = { 0.f,0.f,0.f,0.f };
m_bInitialRootRotSaved = false;
@@ -234,8 +235,9 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform)
{
m_fSecondRatio = 1.f;
}
else
else{
m_fSecondBlendTime = 0.f;
}
}
}
else
@@ -256,8 +258,9 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform)
{
m_fSecondRatio = 1.f;
}
else
else{
m_fSecondBlendTime = 0.f;
}
}
}
@@ -275,8 +278,9 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform)
{
m_bLoopRestarted = true;
}
else
else{
XMStoreFloat3(&m_vPrevRootPos, m_vector[2]);
}
m_vPrevRootRot = { 0.f,0.f,0.f,0.f };
m_bInitialRootRotSaved = false;
@@ -579,6 +583,19 @@ HRESULT CModel::Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIn
return S_OK;
}
HRESULT CModel::Ready_PhysXMeshes(_fmatrix& PreTransformMatrix)
{
m_iNumPhysXMeshes = m_iNumMeshes;
m_TriMeshes.reserve(m_iNumMeshes);
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes, PreTransformMatrix);
for (_uint i = 0; i < m_iNumMeshes; ++i) {
m_pGameInstance->RegistTriMesh((m_Meshes[i]->Get_Name() + to_string(i)).c_str(), m_TriMeshes[i]);
}
return S_OK;
}
#ifdef EDITOR_PROJECT
HRESULT CModel::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix)
@@ -601,25 +618,8 @@ HRESULT CModel::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& Pre
return S_OK;
}
HRESULT CModel::Ready_PhysXMeshes()
{
m_iNumPhysXMeshes = m_iNumMeshes;
m_TriMeshes.reserve(m_iNumMeshes);
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes);
return S_OK;
}
HRESULT CModel::Save_PhysXTriMeshes(const _char* pModelFilePath)
{
if (FAILED(Ready_PhysXMeshes())) {
return E_FAIL;
}
for (_uint i = 0; i < m_iNumMeshes; ++i) {
m_pGameInstance->RegistTriMesh((m_Meshes[i]->Get_Name() + to_string(i)).c_str(), m_TriMeshes[i]);
}
return m_pGameInstance->SaveTriMeshes(pModelFilePath, m_TriMeshes);
}
@@ -1391,11 +1391,7 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
if (FAILED(Ready_Animations(m_Bones))) {
return E_FAIL;
}
//#ifdef 기무리
// if (MODEL::ENVIROMENT == eType) {
// Save_PhysXTriMeshes(pModelFilePath);
// }
//#endif // _DEBUG
return S_OK;
}
@@ -106,7 +106,11 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
// 유효성 체크
PX_ASSERT(pPxMeshGeometry->isValid());
pGeometry = pPxMeshGeometry;
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
_bool bEmplaceSuccess = m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry).second;
if (false == bEmplaceSuccess) {
Safe_Delete(pPxMeshGeometry);
pGeometry = (*m_TriangleMeshGeometry.find(RigidBody.Get_PxMeshKey())).second;
}
}
break;
case ACTOR::HEIGHTFIELD:
@@ -118,7 +122,11 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
// 유효성 체크
PX_ASSERT(pPxHeightGeometry->isValid());
pGeometry = pPxHeightGeometry;
m_HeightFieldGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxHeightGeometry);
_bool bEmplaceSuccess = m_HeightFieldGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxHeightGeometry).second;
if (false == bEmplaceSuccess) {
Safe_Delete(pPxHeightGeometry);
pGeometry = (*m_HeightFieldGeometry.find(RigidBody.Get_PxMeshKey())).second;
}
}
break;
default:
@@ -185,8 +193,6 @@ void CPhysX_Manager::RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& D
}
}
#ifdef EDITOR_PROJECT
HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
{
for (size_t i = 0; i < Meshes.size(); ++i)
@@ -204,6 +210,8 @@ HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<
return S_OK;
}
#ifdef EDITOR_PROJECT
HRESULT CPhysX_Manager::SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes)
{
filesystem::path pathPhysX = pPath;
@@ -613,7 +621,7 @@ void CPhysX_Manager::Free()
ClearScene();
for (auto& pMeshes : m_TriangleMeshes) {
pMeshes.second->release();
pMeshes.second->release();
} m_TriangleMeshes.clear();
for (auto& pGeometry : m_TriangleMeshGeometry) {
@@ -534,12 +534,16 @@ void CRenderer::Render_Blend()
void CRenderer::Render_Bloom()
{
#ifdef _DEBUG
GUI::Begin("PostProcessing_Bloom");
GUI::PushItemWidth(80);
GUI::DragFloat("g_fThreshold", &m_fThreshold, 0.01f, 0.02f, 100.f, "%.3f");
GUI::SliderInt("g_iEmbossingPass", &m_iBloomEmbossingPass, 0, 2, "%d");
GUI::End();
#endif // _DEBUG
//{ // BackBuffer
// ID3D11Texture2D* pBackBuffer = nullptr;
// m_pGameInstance->Get_BackBufferPTR(&pBackBuffer);
+1 -1
View File
@@ -208,8 +208,8 @@ class ENGINE_DLL CGameInstance final : public CBase
void Attach_Actor(PSX::PxActor& Actor);
void Detach_Actor(PSX::PxActor& pActor);
void Release_Actor(PSX::PxActor& Actor);
#ifdef EDITOR_PROJECT
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity());
#ifdef EDITOR_PROJECT
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
#endif // EDITOR_PROJECT
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); // 모델 불러왔던 경로에 그대로 있음
+1 -1
View File
@@ -28,8 +28,8 @@ class ENGINE_DLL CMesh final : public CVIBuffer
HRESULT Ready_VertexBuffer_For_Anim(vector<class CBone*>& Bones, const aiMesh* pAIMesh);
public:
static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector<class CBone*>& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix);
PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix);
#endif // EDITOR_PROJECT
PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix);
public:
//인스턴싱 모델 전용 드로우, 바인딩 함수
+1 -1
View File
@@ -86,10 +86,10 @@ class ENGINE_DLL CModel final : public CComponent
void Initialize_BoneMasks();
public:
HRESULT Ready_PhysXMeshes(_fmatrix& PreTransformMatrix);
#ifdef EDITOR_PROJECT
HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex);
HRESULT Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix);
HRESULT Ready_PhysXMeshes();
HRESULT Save_PhysXTriMeshes(const _char* pModelFilePath);
HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath);
HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath);
@@ -30,10 +30,11 @@ class CPhysX_Manager final : public CBase
PSX::PxMaterial* Create_Material(const _float3* vMatInfo);
_bool SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer);
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix);
#ifdef EDITOR_PROJECT
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix);
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
void Add_Editor_Plane(PhsXUserData& PlaneData);
#endif // EDITOR_PROJECT