[add] 플레이어 다리 리지드본 추가
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
<PreprocessorDefinitions>$(USERNAME);_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;../../EngineSDK/Inc/PhysX/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -123,7 +123,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;DirectXTKd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;DirectXTKd.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>cd /d "$(SolutionDir)"
|
||||
@@ -140,7 +140,7 @@ call Update_Resources.bat
|
||||
<PreprocessorDefinitions>$(USERNAME);NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;../../EngineSDK/Inc/PhysX/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -150,7 +150,7 @@ call Update_Resources.bat
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>cd /d "$(SolutionDir)"
|
||||
|
||||
@@ -646,6 +646,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
{
|
||||
#ifdef 기무리
|
||||
#else
|
||||
for (_uint i = 0; i <1; ++i)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
@@ -664,7 +666,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#endif
|
||||
#if 진우
|
||||
#else
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CRanrok>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
|
||||
@@ -1764,13 +1764,13 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
}
|
||||
{
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
Desc.eType = ACTOR::BOX;
|
||||
Desc.eType = ACTOR::CAPSULE;
|
||||
Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ };
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.01f };
|
||||
Desc.vhalfGeometryInfo = { 0.0025f, 0.15f, 0.0025f };
|
||||
Desc.vhalfGeometryInfo = { 0.0025f, 0.15f, 0.f };
|
||||
Desc.fDensity = 1.f;
|
||||
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
|
||||
Desc.eLockFlag = {};
|
||||
@@ -1800,6 +1800,11 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), CDynamic_Joint::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{ // LIGHT PHYSX DYNAMIC
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
|
||||
@@ -111,7 +111,9 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
m_BasicEffect->SetProjection(m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ));
|
||||
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
m_pBoneShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 10, false, false));
|
||||
m_pBoneShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false));
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, 0.3f, 0.075f, 22, false));
|
||||
D3D11_DEPTH_STENCIL_DESC depthStencilDesc = {};
|
||||
depthStencilDesc.DepthEnable = FALSE;
|
||||
depthStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
|
||||
@@ -218,6 +220,9 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
|
||||
#endif // _DEBUG
|
||||
|
||||
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
|
||||
|
||||
@@ -263,49 +268,50 @@ HRESULT CPlayer::Render()
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
RENDER eType = m_pGameInstance->Get_CurrentRenderPass();
|
||||
if (RENDER::NONBLEND == eType) {
|
||||
_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))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrices(
|
||||
"g_OffsetMatrix",
|
||||
m_pModelCom->Get_OffsetMatrix(i).data(),
|
||||
(_int)m_pModelCom->Get_OffsetMatrix(i).size()
|
||||
)))
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, false))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrices(
|
||||
"g_OffsetMatrix",
|
||||
m_pModelCom->Get_OffsetMatrix(i).data(),
|
||||
(_int)m_pModelCom->Get_OffsetMatrix(i).size()
|
||||
)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, false))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
|
||||
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
|
||||
if (FAILED(Bind_ShaderParameters(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
|
||||
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
|
||||
if (FAILED(Bind_ShaderParameters(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
|
||||
// m_pRobeJointRoute[i]->Render();
|
||||
//}
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
m_pLeftLeg->Render();
|
||||
m_pRightLeg->Render();
|
||||
Render_CameraCoordinateSystem();
|
||||
Render_BonePhysX();
|
||||
if (RENDER::NONLIGHT == eType) {
|
||||
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
|
||||
// m_pRobeJointRoute[i]->Render();
|
||||
//}
|
||||
//m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
Render_CameraCoordinateSystem();
|
||||
Render_BonePhysX();
|
||||
}
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
@@ -437,24 +443,135 @@ void CPlayer::Render_CameraCoordinateSystem()
|
||||
);
|
||||
m_Batch->End();
|
||||
}
|
||||
HRESULT CPlayer::Update_LegsPosition()
|
||||
{
|
||||
_matrix WorldMatrix = m_pTransformCom->Get_XMWorldMatrix();
|
||||
_matrix FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftFoot")) * WorldMatrix;
|
||||
_matrix LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftLeg")) * WorldMatrix;
|
||||
m_pLeftLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
|
||||
|
||||
#ifdef _DEBUG
|
||||
{
|
||||
_vector vCenterWorldPos = (FootMatrix.r[3] + LegMatrix.r[3]) * 0.5f;
|
||||
_vector vRotQ = XMQuaternionIdentity();
|
||||
_vector vDir = XMVectorSetW(LegMatrix.r[3] - FootMatrix.r[3], 0.f);
|
||||
_float vLength = XMVectorGetX(XMVector3Length(vDir));
|
||||
if (vLength > FLT_EPSILON5) {
|
||||
vDir = XMVector3Normalize(vDir);
|
||||
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
|
||||
}
|
||||
XMStoreFloat4x4(&m_LeftLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightFoot")) * WorldMatrix;
|
||||
LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightLeg")) * WorldMatrix;
|
||||
m_pRightLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
|
||||
|
||||
#ifdef _DEBUG
|
||||
{
|
||||
_vector vCenterWorldPos = (FootMatrix.r[3] + LegMatrix.r[3]) * 0.5f;
|
||||
_vector vRotQ = XMQuaternionIdentity();
|
||||
_vector vDir = XMVectorSetW(LegMatrix.r[3] - FootMatrix.r[3], 0.f);
|
||||
_float vLength = XMVectorGetX(XMVector3Length(vDir));
|
||||
if (vLength > FLT_EPSILON5) {
|
||||
vDir = XMVector3Normalize(vDir);
|
||||
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
|
||||
}
|
||||
XMStoreFloat4x4(&m_RightLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
|
||||
}
|
||||
#endif // _DEBUG
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Render_Legs()
|
||||
{
|
||||
_float fHeight = 0.25f;
|
||||
|
||||
_matrix WorldMatrix = XMLoadFloat4x4(&m_LeftLegMatrix);
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0000, 1.f);
|
||||
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
|
||||
WorldMatrix = XMLoadFloat4x4(&m_RightLegMatrix);
|
||||
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
|
||||
WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//HRESULT CPlayer::Helper_JointGenerater(CDynamic_Joint::DYNAMICJOINT_DESC& Desc, _uint iRoute0, _bool bUseHead0, _uint iRoute1, _bool bUseHead1, _uint iJoint)
|
||||
//{
|
||||
// Desc.pActor0 = m_pRobeJointRoute[iRoute0]->Get_Actor();
|
||||
// if (true == bUseHead0) {
|
||||
// Desc.pLocalFrame0 = m_pRobeJointRoute[iRoute0]->Get_HeadPositionPxTransform();
|
||||
// }
|
||||
// else {
|
||||
// Desc.pLocalFrame0 = m_pRobeJointRoute[iRoute0]->Get_FootPositionPxTransform();
|
||||
// }
|
||||
//
|
||||
// Desc.pActor1 = m_pRobeJointRoute[iRoute1]->Get_Actor();
|
||||
// if (true == bUseHead1) {
|
||||
// Desc.pLocalFrame1 = m_pRobeJointRoute[iRoute1]->Get_HeadPositionPxTransform();
|
||||
// }
|
||||
// else {
|
||||
// Desc.pLocalFrame1 = m_pRobeJointRoute[iRoute1]->Get_FootPositionPxTransform();
|
||||
// }
|
||||
// if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), (CComponent**)&m_pDynamicJoints[iJoint], &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// return S_OK;
|
||||
//}
|
||||
|
||||
HRESULT CPlayer::Render_BonePhysX()
|
||||
{
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xffffff, 1.f);
|
||||
_fmatrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_cmatrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x00ff00, 1.f);
|
||||
_fmatrix OwnerMatrix = m_pTransformCom->Get_XMWorldMatrix();
|
||||
_cmatrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
ID3D11DepthStencilState* pPrevDSS = nullptr;
|
||||
UINT iPrevStencilRef = 0;
|
||||
m_pContext->OMGetDepthStencilState(&pPrevDSS, &iPrevStencilRef);
|
||||
|
||||
for (_uint iBoneIndex = 0; iBoneIndex < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++iBoneIndex)
|
||||
{
|
||||
_matrix WorldMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr(PLAYER_JOINT_BONE_NAMES[iBoneIndex]));
|
||||
_matrix WorldMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr(PLAYER_JOINT_BONE_NAMES[iBoneIndex])) * OwnerMatrix;
|
||||
|
||||
m_pBoneShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
|
||||
[this]() {
|
||||
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
|
||||
});
|
||||
}
|
||||
Render_Legs();
|
||||
|
||||
m_pContext->OMSetDepthStencilState(pPrevDSS, iPrevStencilRef);
|
||||
if (pPrevDSS != nullptr){
|
||||
pPrevDSS->Release();
|
||||
@@ -558,6 +675,105 @@ HRESULT CPlayer::Ready_Components()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//{
|
||||
// CDynamic_Joint::DYNAMICJOINT_DESC Desc{}; // 조인트 실제 본이랑연결해야함
|
||||
// Desc.eType = PHYSX_JOINT::D6;
|
||||
// _uint iRoute0 = 0;
|
||||
// _bool bHead0 = 0;
|
||||
// _uint iRoute1 = 0;
|
||||
// _bool bHead1 = 0;
|
||||
// _uint iJoint = 0;
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTUP);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_R_T);
|
||||
// bHead0 = false;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_MIDDLE_R);
|
||||
// bHead1 = false;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTUP);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_T_L);
|
||||
// bHead0 = false;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_MIDDLE_L);
|
||||
// bHead1 = false;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHT);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_R_T);
|
||||
// bHead0 = false;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TR);
|
||||
// bHead1 = false;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFT);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_T_L);
|
||||
// bHead0 = false;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TL);
|
||||
// bHead1 = false;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::TAIL);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TR);
|
||||
// bHead0 = false;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TL);
|
||||
// bHead1 = false;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTDOWNRIGHT);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_RR);
|
||||
// bHead0 = true;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_RR_TR);
|
||||
// bHead1 = true;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTDOWNLEFT);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_LL);
|
||||
// bHead0 = true;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_TL_L);
|
||||
// bHead1 = true;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTDOWN);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_R);
|
||||
// bHead0 = true;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_R_RR);
|
||||
// bHead1 = true;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTDOWN);
|
||||
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_L);
|
||||
// bHead0 = true;
|
||||
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_L_LL);
|
||||
// bHead1 = true;
|
||||
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -771,9 +987,12 @@ void CPlayer::Free()
|
||||
#endif // _DEBUG
|
||||
SAFE_RELEASE(m_pRightLeg);
|
||||
SAFE_RELEASE(m_pLeftLeg);
|
||||
//for (_uint i = 0; i < ENUM_CLASS(PXOBJECT::JOINT_ROUTE); ++i) {
|
||||
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
|
||||
// SAFE_RELEASE(m_pRobeJointRoute[i]);
|
||||
//}
|
||||
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) {
|
||||
// SAFE_RELEASE(m_pDynamicJoints[i]);
|
||||
//}
|
||||
|
||||
SAFE_RELEASE(m_pGrapInteractive);
|
||||
if (nullptr != m_pInfoInstance) {
|
||||
|
||||
@@ -2661,20 +2661,6 @@ void CPlayer::Play_SpellHitAnim()
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Update_LegsPosition()
|
||||
{
|
||||
_matrix WorldMatrix = m_pTransformCom->Get_XMWorldMatrix();
|
||||
_matrix FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftFoot")) * WorldMatrix;
|
||||
_matrix LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftLeg")) * WorldMatrix;
|
||||
m_pLeftLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
|
||||
|
||||
FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightFoot")) * WorldMatrix;
|
||||
LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightLeg")) * WorldMatrix;
|
||||
m_pRightLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
|
||||
@@ -76,7 +76,8 @@ class CPlayer final : public CUnit
|
||||
CStat* m_pStat = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRightLeg = { nullptr };
|
||||
CRigidBody_Dynamic* m_pLeftLeg = { nullptr };
|
||||
// CRigidBody_Dynamic* m_pRobeJointRoute[ENUM_CLASS(PXOBJECT::JOINT_ROUTE)] = {nullptr};
|
||||
//CRigidBody_Dynamic* m_pRobeJointRoute[ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END)] = { nullptr };
|
||||
//CDynamic_Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
@@ -90,14 +91,20 @@ class CPlayer final : public CUnit
|
||||
void Play_SpellHitAnim();
|
||||
|
||||
HRESULT Update_LegsPosition();
|
||||
HRESULT Render_Legs();
|
||||
//HRESULT Helper_JointGenerater(CDynamic_Joint::DYNAMICJOINT_DESC& Desc, _uint iRoute0, _bool bUseHead0, _uint iRoute1, _bool bUseHead1, _uint iJoint);
|
||||
|
||||
void Update_CameraCoordinateSystem(_float fTimeDelta);
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<BasicEffect> m_BasicEffect;
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch;
|
||||
unique_ptr<GeometricPrimitive> m_pBoneShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
ID3D11DepthStencilState* m_pDepthStencilStateNone = { nullptr };
|
||||
|
||||
_float4x4 m_LeftLegMatrix = {};
|
||||
_float4x4 m_RightLegMatrix = {};
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ enum class PLAYER_MESH_ORDER {
|
||||
|
||||
enum class PLAYER_JOINT_ORDER {
|
||||
RIGHTUP
|
||||
, TAILUP
|
||||
, TAILUP //
|
||||
, LEFTUP
|
||||
|
||||
, RIGHT
|
||||
@@ -34,9 +34,9 @@ enum class PLAYER_JOINT_ORDER {
|
||||
|
||||
, RIGHTDOWN
|
||||
, RIGHTDOWNRIGHT
|
||||
, TAILRIGHTDOWN
|
||||
, TAILRIGHTDOWN //
|
||||
|
||||
, TAILLEFTDOWN
|
||||
, TAILLEFTDOWN //
|
||||
, LEFTDOWNLEFT
|
||||
, LEFTDOWN
|
||||
, END
|
||||
@@ -64,13 +64,24 @@ enum class PLAYER_JOINT_ROUTE_ORDER {
|
||||
UP_R_T
|
||||
, UP_T_L
|
||||
|
||||
, UP_MIDDLE_R
|
||||
// , UP_MIDDLE_T //
|
||||
, UP_MIDDLE_L
|
||||
|
||||
, MIDDLE_R_T
|
||||
, MIDDLE_T_L
|
||||
|
||||
, MIDDLE_DOWN_R
|
||||
, MIDDLE_DOWN_RR
|
||||
, MIDDLE_DOWN_TR
|
||||
, MIDDLE_DOWN_TL
|
||||
, MIDDLE_DOWN_LL
|
||||
, MIDDLE_DOWN_L
|
||||
|
||||
, DOWN_R_RR
|
||||
, DOWN_RR_TR
|
||||
|
||||
, DOWN_TR_TL
|
||||
// , DOWN_TR_TL //
|
||||
|
||||
, DOWN_TL_L
|
||||
, DOWN_L_LL
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<PreprocessorDefinitions>EDITOR_PROJECT;$(USERNAME);_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../../EngineSDK/Inc/PhysX/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -123,7 +123,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mtd.lib;DirectXTKd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;assimp-vc145-mtd.lib;DirectXTKd.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@@ -150,7 +150,7 @@ call Update_Shaders.bat
|
||||
<PreprocessorDefinitions>EDITOR_PROJECT;$(USERNAME);NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../../EngineSDK/Inc/PhysX/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -160,7 +160,7 @@ call Update_Shaders.bat
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;assimp-vc145-mt.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@@ -263,13 +263,13 @@ call Update_Shaders.bat
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorSet.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXEffectHitBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXFixedDoor.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXHitBox.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -508,13 +508,13 @@ call Update_Shaders.bat
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorSet.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXEffectHitBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXFixedDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXHitBox.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXDoorSet.h"
|
||||
#include "Dummy_PhysXFixedDoor.h"
|
||||
#include "Dummy_PhysXDoorFrame.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
@@ -32,22 +31,41 @@ HRESULT CDummy_PhysXDoorSet::Initialize(void* pArg)
|
||||
if (FAILED(Ready_PartObject(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PSX::PxRigidDynamic* doorRigidDynamicActor = m_pDoorPart->Get_Actor();
|
||||
PSX::PxTransform doorGlobalPose = doorRigidDynamicActor->getGlobalPose();
|
||||
|
||||
PSX::PxTransform pxFrameTransform = {};
|
||||
PSX::PxTransform pxDoorTransform = {};
|
||||
PSX::PxRigidDynamic* pFrameBody = m_pFramePart->Get_Actor();
|
||||
PSX::PxRigidDynamic* pDoorBody = m_pDoorPart->Get_Actor();
|
||||
PSX::PxVec3 hingeLocalPositionInDoor = PSX::PxVec3(-1.5f, 0.0f, 0.0f);
|
||||
|
||||
_vector vPos = m_pTransformCom->Get_State(STATE::POSITION) + XMVectorSet(0.f, 1.f, 0.f, 0.f);
|
||||
PSX::PxVec3 vHingeLocalPos = {};
|
||||
XMStoreFloat3((_float3*)&vHingeLocalPos, vPos);
|
||||
pxFrameTransform.p = pFrameBody->getGlobalPose().transformInv(vHingeLocalPos);
|
||||
pxDoorTransform.p = pDoorBody->getGlobalPose().transformInv(vHingeLocalPos);
|
||||
|
||||
pxDoorTransform.q = pxFrameTransform.q = PSX::PxQuat(XM_PIDIV2, PSX::PxVec3(0.f, 0.f, 1.f));
|
||||
// 2) 힌지 월드 위치 = 도어 글로벌 포즈로 로컬 점 변환
|
||||
PSX::PxVec3 hingeWorldPosition = doorGlobalPose.transform(hingeLocalPositionInDoor);
|
||||
|
||||
// 3) 힌지 회전축(월드 Y)
|
||||
PSX::PxVec3 hingeWorldAxis = PSX::PxVec3(0.f, 1.f, 0.f);
|
||||
|
||||
// 4) Revolute는 프레임 X축이 회전축이므로 X->힌지축 회전
|
||||
PSX::PxQuat jointWorldOrientation = PSX::PxShortestRotation(PSX::PxVec3(1.f, 0.f, 0.f), hingeWorldAxis);
|
||||
|
||||
// 5) 월드 프레임 구성
|
||||
PSX::PxTransform jointWorldFrame = PSX::PxTransform(hingeWorldPosition, jointWorldOrientation);
|
||||
|
||||
// 6) 도어 로컬 프레임(도어 기준)
|
||||
PSX::PxTransform jointLocalFrameInDoor = doorGlobalPose.transformInv(jointWorldFrame);
|
||||
|
||||
// 7) 조인트 생성
|
||||
m_pPSXJoint = (PSX::PxRevoluteJoint*)m_pGameInstance->Create_PxJoint(
|
||||
PHYSX_JOINT::REVOLUTE,
|
||||
doorRigidDynamicActor,
|
||||
jointLocalFrameInDoor,
|
||||
nullptr,
|
||||
jointWorldFrame
|
||||
);
|
||||
m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true);
|
||||
m_pPSXJoint->setDriveVelocity(2.f);
|
||||
m_pPSXJoint->setDriveForceLimit(5000.f);
|
||||
//m_pPSXJoint->setLimit(PSX::PxJointAngularLimitPair(XMConvertToRadians(-70.f), XMConvertToRadians(70.f)));
|
||||
//m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, true);
|
||||
//m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, false);
|
||||
|
||||
m_pPSXJoint = m_pGameInstance->Create_PxRevoluteJoint(pFrameBody, pxFrameTransform, pDoorBody ,pxDoorTransform);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -89,15 +107,6 @@ HRESULT CDummy_PhysXDoorSet::Ready_Components(void* pArg)
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Ready_PartObject(void* pArg)
|
||||
{
|
||||
{
|
||||
CDummy_PhysXDoorFrame::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
Desc.vPos = { -10.f, 3.f, -10.f };
|
||||
Desc.iSubKind = 23;
|
||||
if (FAILED(Add_PartObject<CDummy_PhysXDoorFrame>("DoorFrame", g_iStaticLevel, &m_pFramePart, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXFixedDoor::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
@@ -146,7 +155,6 @@ void CDummy_PhysXDoorSet::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pDoorPart);
|
||||
SAFE_RELEASE(m_pFramePart);
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Describe_Entity()
|
||||
|
||||
@@ -45,21 +45,12 @@ void CDummy_PhysXFixedDoor::Update(_float fTimeDelta)
|
||||
|
||||
void CDummy_PhysXFixedDoor::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Render()
|
||||
{
|
||||
_vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
|
||||
|
||||
//GUI::Begin("FixedDoor");
|
||||
//m_pTransformCom->Describe_Entity();
|
||||
//GUI::Text("Current Roll : %f", XMConvertToDegrees(XMVectorGetX(vRPY)));
|
||||
//GUI::Text("Current Pitch : %f", XMConvertToDegrees(XMVectorGetY(vRPY)));
|
||||
//GUI::Text("Current Yaw : %f", XMConvertToDegrees(XMVectorGetZ(vRPY)));
|
||||
//GUI::End();
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
@@ -89,7 +80,7 @@ HRESULT CDummy_PhysXFixedDoor::Ready_Components(void* pArg)
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pPhysXDummyDesc->iSubKind;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_FIXED_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,11 +97,6 @@ HRESULT CLevel_EffectViewer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//ZeroMemory(&m_PlaneData, sizeof(m_PlaneData));
|
||||
//m_PlaneData.eKind = PHYSX_KIND::BODY_STATIC;
|
||||
//m_PlaneData.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
|
||||
//m_pGameInstance->Add_Editor_Plane(m_PlaneData);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
return;
|
||||
#endif // gimch
|
||||
#ifdef 기무리
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT))))
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::PHYSX))))
|
||||
return;
|
||||
#endif // 기무리
|
||||
#ifdef 진우
|
||||
|
||||
@@ -109,14 +109,14 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
//{
|
||||
// CDummy_PhysXDoorSet::PHYSXDUMMY_DESC Desc{};
|
||||
// Desc.vPos = { -15.f, 3.f, -15.f };
|
||||
// Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXDoorSet>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
{
|
||||
CDummy_PhysXDoorSet::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { -15.f, 3.f, -15.f };
|
||||
Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXDoorSet>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXPlatform::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { -3.f, 2.f, 10.f };
|
||||
@@ -181,6 +181,7 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXEffectHitBox.h"
|
||||
//#include "Dummy_PhysXDoorFrame.h"
|
||||
//#include "Dummy_PhysXFixedDoor.h"
|
||||
//#include "Dummy_PhysXDoorSet.h"
|
||||
#include "Dummy_PhysXFixedDoor.h"
|
||||
#include "Dummy_PhysXDoorSet.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -2021,19 +2021,19 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ };
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.1f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.5f, 1.5f, 0.25f };
|
||||
Desc.fDensity = 10.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 1.5f, 0.f));
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 0.75f, 0.125f));
|
||||
|
||||
Desc.pxMassCenter = pxPivotTransform;
|
||||
Desc.eLockFlag = { };
|
||||
Desc.vAutoDamping = { 10.f, 10.f };
|
||||
Desc.vAutoDamping = { 0.f, 0.2f };
|
||||
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
|
||||
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_FIXED_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -2130,15 +2130,15 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXFreeDoor>(g_iStaticLevel, CDummy_PhysXFreeDoor::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoorSet>(g_iStaticLevel, CDummy_PhysXDoorSet::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoorSet>(g_iStaticLevel, CDummy_PhysXDoorSet::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoorFrame>(g_iStaticLevel, CDummy_PhysXDoorFrame::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXFixedDoor>(g_iStaticLevel, CDummy_PhysXFixedDoor::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXFixedDoor>(g_iStaticLevel, CDummy_PhysXFixedDoor::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXPlayable>(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -2542,6 +2542,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/GoblinSpector/GoblinSpector_Anim.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_TombProtector_Model")
|
||||
@@ -2627,10 +2631,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
TEXT("Prototype_Component_GerboldOlivander_Model")
|
||||
));
|
||||
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin",XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Playable_Model")
|
||||
));
|
||||
//futures.emplace_back(Deferred_ModelLoad(
|
||||
// MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin",XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
// TEXT("Prototype_Component_Playable_Model")
|
||||
//));
|
||||
|
||||
/*futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.fbx", XMMatrixIdentity(),
|
||||
|
||||
@@ -33,7 +33,6 @@ class CDummy_PhysXDoorSet final : public CContainerObject
|
||||
|
||||
private:
|
||||
class CDummy_PhysXFixedDoor* m_pDoorPart = { nullptr };
|
||||
class CDummy_PhysXDoorFrame* m_pFramePart = { nullptr };
|
||||
PSX::PxRevoluteJoint* m_pPSXJoint = { nullptr };
|
||||
_float3 m_vRadianYAngle = {};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<PreprocessorDefinitions>ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;EDITOR_PROJECT;$(USERNAME);_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../Public/;../Public/PhysX/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -151,7 +151,7 @@ call Update_Lib.bat
|
||||
<PreprocessorDefinitions>ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;$(USERNAME);NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>../Public/;../Public/PhysX/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "Dynamic_Joint.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CDynamic_Joint::CDynamic_Joint(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CComponent(pDevice, pContext)
|
||||
@@ -13,22 +14,36 @@ CDynamic_Joint::CDynamic_Joint(const CDynamic_Joint& rhs)
|
||||
|
||||
HRESULT CDynamic_Joint::Initialize_Prototype()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDynamic_Joint::Initialize(void* pArg)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
DYNAMICJOINT_DESC* pDesc = static_cast<DYNAMICJOINT_DESC*>(pArg);
|
||||
m_pJoint = m_pGameInstance->Create_PxJoint(pDesc->eType, pDesc->pActor0, pDesc->pLocalFrame0, pDesc->pActor1, pDesc->pLocalFrame1);
|
||||
return S_OK;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CDynamic_Joint::Add_DebugShape()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
if (nullptr != m_pMainShape){
|
||||
m_pMainShape.reset();
|
||||
}
|
||||
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 10, false, false));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CDynamic_Joint::Render()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
//PSX::PxTransform pxTranform = m_pRigidBody->getGlobalPose();
|
||||
//_matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z) * XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f));
|
||||
//_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
//_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
//_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
//m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -36,16 +51,31 @@ HRESULT CDynamic_Joint::Render()
|
||||
|
||||
CDynamic_Joint* CDynamic_Joint::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
return nullptr;
|
||||
CDynamic_Joint* pInstance = new CDynamic_Joint(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype())) {
|
||||
MSG_BOX("CDynamic_Joint Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* CDynamic_Joint::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
return nullptr;
|
||||
CDynamic_Joint* pInstance = new CDynamic_Joint(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg))) {
|
||||
MSG_BOX("CDynamic_Joint Prototype Created Failed");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDynamic_Joint::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
||||
@@ -159,6 +159,12 @@ PSX::PxJoint* CPhysX_Manager::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActo
|
||||
pOut = pJoint;
|
||||
}
|
||||
break;
|
||||
case PHYSX_JOINT::REVOLUTE:
|
||||
{
|
||||
PSX::PxRevoluteJoint* pJoint = PSX::PxRevoluteJointCreate(*m_pPhysics, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1);
|
||||
pOut = pJoint;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -671,7 +677,7 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel)
|
||||
PlaneData.pOwner = nullptr;
|
||||
PlaneData.pBody = nullptr;
|
||||
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 85), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
pGroundPlane->userData = &PlaneData;
|
||||
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
|
||||
m_pScene->addActor(*pGroundPlane);
|
||||
|
||||
@@ -22,7 +22,8 @@ CRigidBody_Dynamic::CRigidBody_Dynamic(const CRigidBody_Dynamic& rhs) :
|
||||
HRESULT CRigidBody_Dynamic::Render()
|
||||
{
|
||||
PSX::PxTransform pxTranform = m_pRigidBody->getGlobalPose();
|
||||
_matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z) * XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f));
|
||||
_matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z)
|
||||
* XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f));
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
@@ -35,6 +36,7 @@ HRESULT CRigidBody_Dynamic::Render()
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f));
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * m_vhalfGeometryInfo.y);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -m_vhalfGeometryInfo.y);
|
||||
@@ -206,7 +208,7 @@ void CRigidBody_Dynamic::Set_CenterTransform(_matrix CenterMatrix, _vector Start
|
||||
_float vLength = XMVectorGetX(XMVector3Length(vDir));
|
||||
if (vLength > FLT_EPSILON5) {
|
||||
vDir = XMVector3Normalize(vDir);
|
||||
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
|
||||
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(1.f, 0.f, 0.f, 0.f), vDir);
|
||||
}
|
||||
Set_Transform(vCenterWorldPos, vRotQ);
|
||||
}
|
||||
@@ -258,6 +260,19 @@ _float3 CRigidBody_Dynamic::Get_HeadPosition()
|
||||
return vOut;
|
||||
}
|
||||
|
||||
PSX::PxTransform CRigidBody_Dynamic::Get_GlobalPosition()
|
||||
{
|
||||
return m_pRigidBody->getGlobalPose();
|
||||
}
|
||||
|
||||
PSX::PxTransform CRigidBody_Dynamic::Get_HeadPositionPxTransform()
|
||||
{
|
||||
PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose();
|
||||
_float3 vFootPos = Get_HeadPosition();
|
||||
pxTransform.p = { vFootPos.x, vFootPos.y, vFootPos.z };
|
||||
return pxTransform;
|
||||
}
|
||||
|
||||
PSX::PxTransform CRigidBody_Dynamic::Get_FootPositionPxTransform()
|
||||
{
|
||||
PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose();
|
||||
|
||||
@@ -5,14 +5,15 @@ NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
class CMesh;
|
||||
|
||||
class ENGINE_DLL CDynamic_Joint abstract : public CComponent
|
||||
class ENGINE_DLL CDynamic_Joint final : public CComponent
|
||||
{
|
||||
public:
|
||||
typedef struct tagDynamicJointDesc {
|
||||
PHYSX_JOINT eType;
|
||||
PSX::PxActor* pActor0;
|
||||
PSX::PxTransform* pLocalFrame0;
|
||||
PSX::PxActor* pActor1;
|
||||
PSX::PxTransform* pLocalFrame1;
|
||||
PSX::PxRigidActor* pActor0;
|
||||
PSX::PxTransform pLocalFrame0;
|
||||
PSX::PxRigidActor* pActor1;
|
||||
PSX::PxTransform pLocalFrame1;
|
||||
}DYNAMICJOINT_DESC;
|
||||
private:
|
||||
CDynamic_Joint(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -23,8 +24,8 @@ class ENGINE_DLL CDynamic_Joint abstract : public CComponent
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
PSX::PxJoint* m_pJoint = { nullptr };
|
||||
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
|
||||
@@ -121,6 +121,7 @@ enum class PHYSX_KIND {
|
||||
enum class PHYSX_JOINT {
|
||||
D6,
|
||||
DISTANCE,
|
||||
REVOLUTE,
|
||||
END
|
||||
};
|
||||
|
||||
|
||||
@@ -59,6 +59,33 @@ static PSX::PxTransform XMWorldToPx_NoScale(const _fmatrix& WorldMatrix)
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
return out;
|
||||
}
|
||||
// 주의, XMWorldToPx_NoScale 만들었을 때는 lh rh 변환을 생각안하고 했었음
|
||||
// 지금 쓰는 이 함수는 lh -> rh 자동 변환임
|
||||
static _matrix PxToXMWorld_NoScale(const PSX::PxTransform& pxTransform)
|
||||
{
|
||||
_vector vPos = XMVectorSet(
|
||||
pxTransform.p.x,
|
||||
pxTransform.p.y,
|
||||
pxTransform.p.z,
|
||||
1.f
|
||||
);
|
||||
|
||||
_vector vRotQ = XMVectorSet(
|
||||
-pxTransform.q.x,
|
||||
-pxTransform.q.y,
|
||||
pxTransform.q.z,
|
||||
pxTransform.q.w
|
||||
);
|
||||
|
||||
vRotQ = XMQuaternionNormalize(vRotQ);
|
||||
|
||||
_matrix rotationMatrix = XMMatrixRotationQuaternion(vRotQ);
|
||||
_matrix translationMatrix = XMMatrixTranslationFromVector(vPos);
|
||||
|
||||
_matrix worldMatrix = rotationMatrix * translationMatrix;
|
||||
return worldMatrix;
|
||||
}
|
||||
|
||||
|
||||
static void GUIHelpMarker(const char* desc)
|
||||
{
|
||||
|
||||
@@ -11,35 +11,35 @@ class CMyTools {
|
||||
#pragma region Color
|
||||
// [(255, 255, 255, xx), alpha] -> [(0~1, 0~1, 0~1, alpha)]
|
||||
// 0xRRGGBBxx, alpha -> _float4( 0~1, 0~1, 0~1, alpha )
|
||||
static _float4 ColorRGB_A_HEXtoFLOAT4(_uint hexCode, _float alpha) {
|
||||
inline static _float4 ColorRGB_A_HEXtoFLOAT4(_uint hexCode, _float alpha) {
|
||||
float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, false); a = alpha;
|
||||
return _float4(r, g, b, a);
|
||||
}
|
||||
|
||||
// [(255, 255, 255, 255)] -> [(0~1, 0~1, 0~1, 0~1)]
|
||||
// 0xRRGGBBAA -> _float4( 0~1, 0~1, 0~1, 0~1 )
|
||||
static _float4 ColorRGBA_HEXtoFLOAT4(_uint hexCode) {
|
||||
inline static _float4 ColorRGBA_HEXtoFLOAT4(_uint hexCode) {
|
||||
float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, true);
|
||||
return _float4(r, g, b, a);
|
||||
}
|
||||
|
||||
// [(255, 255, 255, xx), alpha] -> [(0~1, 0~1, 0~1, alpha)]
|
||||
// 0xRRGGBBxx, alpha -> _vector( 0~1, 0~1, 0~1, alpha )
|
||||
static _vector ColorRGB_A_HEXtoVECTOR(_uint hexCode, _float alpha) {
|
||||
inline static _vector ColorRGB_A_HEXtoVECTOR(_uint hexCode, _float alpha) {
|
||||
float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, false); a = alpha;
|
||||
return XMVectorSet(r, g, b, a);
|
||||
}
|
||||
|
||||
// [(255, 255, 255, 255)] -> [(0~1, 0~1, 0~1, 0~1)]
|
||||
// 0xRRGGBBAA -> _vector( 0~1, 0~1, 0~1, 0~1 )
|
||||
static _vector ColorRGBA_HEXtoVECTOR(_uint hexCode) {
|
||||
inline static _vector ColorRGBA_HEXtoVECTOR(_uint hexCode) {
|
||||
float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, true);
|
||||
return XMVectorSet(r, g, b, a);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region String
|
||||
// wstring --> string 변환
|
||||
static _string ToString(const _wstring& var)
|
||||
inline static _string ToString(const _wstring& var)
|
||||
{
|
||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, var.c_str(),
|
||||
(int)var.size(), nullptr, 0, nullptr, nullptr);
|
||||
@@ -52,7 +52,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// string --> wstring 변환
|
||||
static _wstring ToWstring(const _string& var)
|
||||
inline static _wstring ToWstring(const _string& var)
|
||||
{
|
||||
int size_needed = MultiByteToWideChar(CP_UTF8, 0, var.c_str(),
|
||||
(int)var.size(), nullptr, 0);
|
||||
@@ -65,7 +65,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// source에 keyword가 있는지 검사
|
||||
static _bool ContainsString(const char* source, const char* keyword) {
|
||||
inline static _bool ContainsString(const char* source, const char* keyword) {
|
||||
if (!source || !keyword || *keyword == '\0') {
|
||||
return false;
|
||||
}
|
||||
@@ -75,13 +75,13 @@ class CMyTools {
|
||||
#pragma endregion
|
||||
#pragma region Mathematics
|
||||
// ratio로 현재 value 가져오기
|
||||
static _float Lerp_f1D(_float fA, _float fB, _float fRatio)
|
||||
inline static _float Lerp_f1D(_float fA, _float fB, _float fRatio)
|
||||
{
|
||||
return fA + (fB - fA) * fRatio;
|
||||
}
|
||||
|
||||
// value로 현재 ratio 가져오기
|
||||
static _float InverseLerp_f1D(_float fA, _float fB, _float fValue)
|
||||
inline static _float InverseLerp_f1D(_float fA, _float fB, _float fValue)
|
||||
{
|
||||
if (fA == fB) {
|
||||
return 0.0f;
|
||||
@@ -101,7 +101,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// dx9에 있던 IntersectTri
|
||||
static _bool IntersectTri(
|
||||
inline static _bool IntersectTri(
|
||||
const _fvector& vPos, const _fvector& vDir,
|
||||
const _fvector& vertexA, const _gvector& vertexB, const _hvector& vertexC,
|
||||
_float& t, _float& u, _float& v)
|
||||
@@ -130,17 +130,24 @@ class CMyTools {
|
||||
|
||||
return t >= 0.f;
|
||||
}
|
||||
|
||||
// 매트릭스 럴프
|
||||
static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0
|
||||
inline static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0
|
||||
_In_ _float4x4* pMatTarget, // Target -> 1
|
||||
_Out_ _float4x4& matOut, _float fRatio) {
|
||||
_matrix matOrigin = XMLoadFloat4x4(pMatOrigin);
|
||||
_matrix matTarget = XMLoadFloat4x4(pMatTarget);
|
||||
MatrixLerp(&matOrigin, &matTarget, matOut, fRatio);
|
||||
}
|
||||
|
||||
inline static void MatrixLerp( _In_ _matrix* pMatOrigin, // Origin -> 0
|
||||
_In_ _matrix* pMatTarget, // Target -> 1
|
||||
_Out_ _float4x4& matOut, _float fRatio) {
|
||||
fRatio = Saturate(fRatio);
|
||||
|
||||
_vector vTargetScale{}, vTargetRotq{}, vTargetTrans{};
|
||||
_vector vOriginScale{}, vOriginRotq{}, vOriginTrans{};
|
||||
XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, XMLoadFloat4x4(pMatTarget));
|
||||
XMMatrixDecompose(&vOriginScale, &vOriginRotq, &vOriginTrans, XMLoadFloat4x4(pMatOrigin));
|
||||
XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, *pMatTarget);
|
||||
XMMatrixDecompose(&vOriginScale, &vOriginRotq, &vOriginTrans, *pMatOrigin);
|
||||
|
||||
vTargetScale = XMVectorLerp(vOriginScale, vTargetScale, fRatio);
|
||||
vTargetRotq = XMQuaternionSlerp(vOriginRotq, vTargetRotq, fRatio);
|
||||
@@ -150,7 +157,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// 비슷하면 1 직교하면 0 완전 반대방향일수록 -1
|
||||
static _float DirectionCompare(_vector a, _vector b)
|
||||
inline static _float DirectionCompare(_vector a, _vector b)
|
||||
{
|
||||
_vector vNormalA = XMVector3Normalize(a);
|
||||
_vector vNormalB = XMVector3Normalize(b);
|
||||
@@ -158,7 +165,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// hlsl에 있는 Saturate
|
||||
static _float Saturate(_float fValue) {
|
||||
inline static _float Saturate(_float fValue) {
|
||||
if (fValue > 1.f) {
|
||||
fValue = 1.f;
|
||||
}
|
||||
@@ -169,7 +176,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
// 입력 라디안이 들어오면 -PI ~ +PI로 정규화된 라디안으로 변경
|
||||
static _float NormalizeRadian(_float fRadian)
|
||||
inline static _float NormalizeRadian(_float fRadian)
|
||||
{
|
||||
fRadian = fmodf(fRadian, XM_2PI);
|
||||
if (fRadian <= -XM_PI) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -57,6 +57,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
void Set_Transform(PSX::PxTransform pxTransform);
|
||||
_float3 Get_FootPosition();
|
||||
_float3 Get_HeadPosition();
|
||||
PSX::PxTransform Get_GlobalPosition();
|
||||
PSX::PxTransform Get_HeadPositionPxTransform();
|
||||
PSX::PxTransform Get_FootPositionPxTransform();
|
||||
private:
|
||||
PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
|
||||
@@ -79,7 +79,7 @@ using namespace FMOD;
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 26495)
|
||||
#pragma warning(disable: 33010)
|
||||
|
||||
#include "PhysX/foundation/PxMath.h"
|
||||
#include "PhysX/PxPhysicsAPI.h"
|
||||
#include "PhysX/extensions/PxExtensionsAPI.h"
|
||||
#pragma warning(pop)
|
||||
|
||||
@@ -36,8 +36,12 @@ xcopy /y .\Engine\Bin\Assimp\assimp-vc145-mt.dll .\Editor\Bin\Release\
|
||||
:: fMod는 아쉽게도 pdb가 없기 때문에 안옮김
|
||||
xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mtd.pdb .\Client\Bin\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mt.pdb .\Client\Bin\Release\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX_debug\*.pdb .\Client\Bin\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX_release\*.pdb .\Client\Bin\Release\
|
||||
xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mtd.pdb .\Editor\Bin\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mt.pdb .\Editor\Bin\Release\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX_debug\*.pdb .\Editor\Bin\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX_release\*.pdb .\Editor\Bin\Release\
|
||||
xcopy /y .\Editor\ThirdPartyLib\ZLib\Debug\zlibd.pdb .\Editor\Bin\Debug\
|
||||
xcopy /y .\Editor\ThirdPartyLib\ZLib\Release\zlib.pdb .\Editor\Bin\Release\
|
||||
|
||||
@@ -55,3 +59,5 @@ xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Release\
|
||||
|
||||
xcopy /y .\Engine\ThirdPartyLib\DirectXTK\DirectXTKd.lib .\EngineSDK\Lib\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX\PhysX_debug\*.lib .\EngineSDK\Lib\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\PhysX\PhysX_release\*.lib .\EngineSDK\Lib\Release\
|
||||
|
||||
Reference in New Issue
Block a user