[add] 슬라이드콜백추가#2

This commit is contained in:
kimnuri
2025-11-15 16:56:32 +09:00
parent e22dfbeae8
commit 84ad0bbad7
4 changed files with 25 additions and 8 deletions
@@ -21,7 +21,8 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con
| PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
break;
case PHYSX_KIND::BODY_DYNAMIC:
return PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT
| PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
break;
case PHYSX_KIND::CCTActor:
// Action
@@ -39,6 +39,18 @@ void CDummy_PhysXPlatform::Priority_Update(_float fTimeDelta)
void CDummy_PhysXPlatform::Update(_float fTimeDelta)
{
if (m_pGameInstance->Key_Pressing(DIK_I)) {
m_pRigidBody->Add_Force(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta, PSX::PxForceMode::eACCELERATION);
}
if (m_pGameInstance->Key_Pressing(DIK_J)) {
m_pRigidBody->Add_Force(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta, PSX::PxForceMode::eACCELERATION);
}
if (m_pGameInstance->Key_Pressing(DIK_K)) {
m_pRigidBody->Add_Force(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta, PSX::PxForceMode::eACCELERATION);
}
if (m_pGameInstance->Key_Pressing(DIK_L)) {
m_pRigidBody->Add_Force(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta, PSX::PxForceMode::eACCELERATION);
}
}
void CDummy_PhysXPlatform::Late_Update(_float fTimeDelta)
@@ -76,7 +88,10 @@ HRESULT CDummy_PhysXPlatform::Render()
HRESULT CDummy_PhysXPlatform::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
CTransform::TRANSFORM_DESC Desc = { };
Desc.fSpeedPerSec = 1000.f;
Desc.fRotationPerSec = XMConvertToDegrees(90.f);
if (FAILED(__super::Ready_Components(&Desc))) {
return E_FAIL;
}
BOXSTARTPOS_DESC* pBox = static_cast<BOXSTARTPOS_DESC*>(pArg);
@@ -31,7 +31,7 @@ class CDummy_PhysXPlatform final : public CGameObject
virtual HRESULT Render() override;
private:
CRigidBody* m_pRigidBody = { nullptr };
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
const PSX::PxRigidDynamic* m_pActor = { nullptr };
CModel* m_pModelCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
@@ -60,7 +60,7 @@ void CRigidBody_Dynamic::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum
{
PSX::PxVec3 vPxTorque = {};
XMStoreFloat3((_float3*)&vPxTorque, vDirection);
m_pRigidBody->addForce(vPxTorque, eType);
m_pRigidBody->addTorque(vPxTorque, eType);
}
void CRigidBody_Dynamic::Set_Kinematic(_bool bKinematic)
@@ -118,14 +118,15 @@ HRESULT CRigidBody_Dynamic::Add_DebugShape()
switch (m_eActorType)
{
case ACTOR::BOX:
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
_float3 vDXGeometricSize = { m_vhalfGeometryInfo.x * 2.f, m_vhalfGeometryInfo.y * 2.f, m_vhalfGeometryInfo.z * 2.f };
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vDXGeometricSize, false, false));
break;
case ACTOR::CAPSULE:
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y, m_vhalfGeometryInfo.x, 10, false));
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x * 2.f, 10, false, false));
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y * 2.f, m_vhalfGeometryInfo.x * 2.f, 10, false));
break;
case ACTOR::SPHERE:
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x * 2.f, 10, false, false));
break;
default:
break;