[add] DO Actor
This commit is contained in:
@@ -114,7 +114,7 @@ void CGoblin::Late_Update(_float fTimeDelta)
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose());
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform());
|
||||
}
|
||||
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
@@ -183,7 +183,7 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
_float fLength = {}; // 작용된 힘
|
||||
|
||||
m_pCharacter_Controller->ConvertToDO(*m_pRigidBody);
|
||||
m_pRigidBody->Add_Force(vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE);
|
||||
m_pRigidBody->Add_Force(vHitDir * fLength * 10000.f, PSX::PxForceMode::eFORCE);
|
||||
|
||||
_uint iSkillType = dynamic_cast<CEffect_Container*>(pOther)->Get_SkillType();
|
||||
switch (iSkillType)
|
||||
|
||||
@@ -1171,11 +1171,11 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f };
|
||||
Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f };
|
||||
Desc.fDensity = 1.f;
|
||||
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
|
||||
Desc.eLockFlag = {};
|
||||
Desc.vAutoDamping = { 100.f, 100.f };
|
||||
Desc.vAutoDamping = { 1.f, 1.f };
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
|
||||
@@ -83,6 +83,35 @@ HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_float3 CRigidBody_Dynamic::Get_FootPosition()
|
||||
{
|
||||
PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose();
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
pxTransform.p.y -= m_vhalfGeometryInfo.y;
|
||||
break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
pxTransform.p.y -= m_vhalfGeometryInfo.y * 0.5f + m_vhalfGeometryInfo.x;
|
||||
break;
|
||||
case Engine::ACTOR::SPHERE:
|
||||
pxTransform.p.y -= m_vhalfGeometryInfo.x;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_float3 vOut = { pxTransform.p.x , pxTransform.p.y , pxTransform.p.z };
|
||||
return vOut;
|
||||
}
|
||||
|
||||
PSX::PxTransform CRigidBody_Dynamic::Get_FootPositionPxTransform()
|
||||
{
|
||||
PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose();
|
||||
_float3 vFootPos = Get_FootPosition();
|
||||
pxTransform.p = { vFootPos.x, vFootPos.y, vFootPos.z };
|
||||
return pxTransform;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -44,6 +44,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
_float3 Get_FootPosition();
|
||||
PSX::PxTransform Get_FootPositionPxTransform();
|
||||
private:
|
||||
PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
PSX::PxRigidDynamicLockFlags m_eLockFlag = { };
|
||||
|
||||
Reference in New Issue
Block a user