[add] 1202 LastRelease
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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); // 모델 불러왔던 경로에 그대로 있음
|
||||
|
||||
@@ -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:
|
||||
//인스턴싱 모델 전용 드로우, 바인딩 함수
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user