[add] PhysX 메시 추가
[modify] model 안쓰는 함수 제거
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -34,7 +34,32 @@ HRESULT CDummy_PhysXMesh::Initialize(void* pArg)
|
||||
|
||||
void CDummy_PhysXMesh::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F2)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes("../Bin/Resources/Models/River/River.bin");
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXMesh::Update(_float fTimeDelta)
|
||||
@@ -43,36 +68,36 @@ void CDummy_PhysXMesh::Update(_float fTimeDelta)
|
||||
|
||||
void CDummy_PhysXMesh::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
//_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMesh::Render()
|
||||
{
|
||||
//if (FAILED(Bind_ShaderResources())) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
//_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//for (_uint i = 0; i < iNumMeshes; i++)
|
||||
//{
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// if (FAILED(m_pModelCom->Render(i))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
@@ -83,44 +108,39 @@ HRESULT CDummy_PhysXMesh::Ready_Components(void* pArg)
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
BOXSTARTPOS_DESC* pBox = static_cast<BOXSTARTPOS_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pBox->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pBox->vRotRPY.x, pBox->vRotRPY.y, pBox->vRotRPY.z);
|
||||
|
||||
|
||||
CModel* pModel = (CModel*)m_pGameInstance->Find_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"));
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i< iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(20.f, 20.f, 20.f, 1.f));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMesh::Bind_ShaderResources()
|
||||
{
|
||||
//if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -154,8 +174,8 @@ void CDummy_PhysXMesh::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
//SAFE_RELEASE(m_pModelCom);
|
||||
//SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXMesh::Describe_Entity()
|
||||
|
||||
@@ -45,10 +45,42 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
Describe_Entity();
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//m_pShaderCom->Bind_SRV("g_NormalTexture", nullptr);
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
//if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -92,12 +124,38 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
}
|
||||
}
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Steve_Model"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
//m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
|
||||
return S_OK;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -132,6 +190,8 @@ void CDummy_PhysXPlayable::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXPlayable::Describe_Entity()
|
||||
|
||||
@@ -68,7 +68,7 @@ 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 = 500.f;
|
||||
CameraDesc.fFar = 5000.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 2.f;
|
||||
|
||||
@@ -212,11 +212,6 @@ HRESULT CLoader::Loading_For_Logo()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Box/Box.fbx", MODEL::NONANIM, XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_strMessage = TEXT("Prototype Loading..");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummyRect>(g_iStaticLevel, CDummyRect::Create(m_pDevice, m_pContext)))) {
|
||||
@@ -506,8 +501,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){
|
||||
//CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){
|
||||
//CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -533,6 +528,10 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Steve/Steve.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
m_strMessage = TEXT("Shader Loading..");
|
||||
|
||||
m_strMessage = TEXT("Prototype Loading..");
|
||||
|
||||
@@ -29,8 +29,9 @@ class CDummy_PhysXMesh final : public CGameObject
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -32,8 +32,8 @@ class CDummy_PhysXPlayable final : public CGameObject
|
||||
|
||||
private:
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
//CModel* m_pModelCom = { nullptr };
|
||||
//CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -616,7 +616,7 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
|
||||
tMeshDesc.points.count = m_iNumVertices;
|
||||
tMeshDesc.points.stride = sizeof(PSX::PxVec3);
|
||||
Vertices.resize(m_iNumVertices);
|
||||
XMVector3TransformCoordStream(reinterpret_cast<XMFLOAT3*>(Vertices.data()), sizeof(PSX::PxVec3), (_float3*)m_pVertexPositions, sizeof(_float3), m_iNumVertices, WorldMatrix);
|
||||
XMVector3TransformCoordStream(reinterpret_cast<_float3*>(Vertices.data()), sizeof(PSX::PxVec3), (_float3*)m_pVertexPositions, sizeof(_float3), m_iNumVertices, WorldMatrix);
|
||||
tMeshDesc.points.data = Vertices.data();
|
||||
}
|
||||
{
|
||||
@@ -636,6 +636,8 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
|
||||
|
||||
PSX::PxDefaultMemoryInputData readBuff(streamWriteBuffer.getData(), streamWriteBuffer.getSize());
|
||||
PSX::PxTriangleMesh* pTriangleMesh = pPhysX->createTriangleMesh(readBuff);
|
||||
PX_ASSERT(pTriangleMesh);
|
||||
PX_ASSERT(pTriangleMesh->getReferenceCount() == 1);
|
||||
if (nullptr == pTriangleMesh) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
|
||||
@@ -777,19 +777,6 @@ _int CModel::SaveNodeRecursive(const aiNode* pAINode, std::vector<SaveNode>& out
|
||||
|
||||
return currentIndex;
|
||||
}
|
||||
CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
CModel* pInstance = new CModel(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(pModelFilePath, eType, PreTransformMatrix, iRootBoneIndex)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CModel");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
_uint iFlag = {};
|
||||
@@ -818,9 +805,17 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
|
||||
#pragma region Material
|
||||
if (MODEL::ENVIROMENT == eType)
|
||||
{
|
||||
#ifdef 扁公府
|
||||
if (FAILED(Ready_Materials(m_pAIScene, pModelFilePath))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // 扁公府
|
||||
#ifndef 扁公府
|
||||
if (FAILED(Ready_Materials_FromFile(m_pAIScene, pModelFilePath))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // !扁公府
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -842,17 +837,8 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CModel::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
return Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, iRootBoneIndex);
|
||||
}
|
||||
#endif // EDITOR_PROJECT
|
||||
|
||||
HRESULT CModel::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix)
|
||||
{
|
||||
m_eType = eType;
|
||||
@@ -865,12 +851,6 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
|
||||
if (strcmp(".bin", szEXT) == 0)
|
||||
{
|
||||
LoadData(pModelFilePath);
|
||||
if (MODEL::ENVIROMENT == m_eType) {
|
||||
m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes);
|
||||
for (_uint i = 0; i < m_iNumMeshes; ++i) {
|
||||
m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcmp(".fbx", szEXT) == 0)
|
||||
{
|
||||
@@ -903,6 +883,12 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
|
||||
}
|
||||
|
||||
|
||||
if (MODEL::ENVIROMENT == m_eType) {
|
||||
m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes);
|
||||
for (_uint i = 0; i < m_iNumMeshes; ++i) {
|
||||
m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1107,19 +1093,6 @@ HRESULT CModel::Ready_Animations()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CModel* pInstance = new CModel(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CModel");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath,_fmatrix PreTransformMatrix)
|
||||
{
|
||||
CModel* pInstance = new CModel(pDevice, pContext);
|
||||
|
||||
@@ -134,6 +134,8 @@ HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<
|
||||
for (size_t i = 0; i < Meshes.size(); ++i)
|
||||
{
|
||||
PSX::PxTriangleMesh* pTriangleMesh = Meshes[i]->ConvertToPxMesh(m_pCookingParam, m_pPhysics, WorldMatrix);
|
||||
PX_ASSERT(pTriangleMesh);
|
||||
PX_ASSERT(pTriangleMesh->getReferenceCount() == 1);
|
||||
if (nullptr == pTriangleMesh) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -394,6 +396,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScale, true, m_pPvd);
|
||||
|
||||
m_pCookingParam = new PSX::PxCookingParams(m_pPhysics->getTolerancesScale());
|
||||
m_pCookingParam->meshPreprocessParams |= PSX::PxMeshPreprocessingFlag::eWELD_VERTICES;
|
||||
PSX::PxSceneDesc sceneDesc = { m_pPhysics->getTolerancesScale() };
|
||||
|
||||
sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f);
|
||||
@@ -429,7 +432,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
#ifdef ±â¹«¸®
|
||||
physx::PxMaterial* pMaterial = m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f);
|
||||
//physx::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *pMaterial);
|
||||
//physx::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 90), *pMaterial);
|
||||
//m_pScene->addActor(*pGroundPlane);
|
||||
|
||||
//{
|
||||
|
||||
@@ -57,8 +57,6 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex);
|
||||
static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex);
|
||||
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();
|
||||
@@ -116,7 +114,6 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
//
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
// ¹ÙÀ̳ʸ®
|
||||
virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix);
|
||||
bool LoadData(const _char* filename);
|
||||
@@ -132,7 +129,6 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
//
|
||||
|
||||
public:
|
||||
static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
// ¹ÙÀ̳ʸ®
|
||||
static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix = XMMatrixIdentity());
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user