[add] 문 완성
This commit is contained in:
@@ -1959,21 +1959,13 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.1f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 0.5f, 1.f, 0.125f };
|
||||
Desc.fDensity = 1.f;
|
||||
Desc.vhalfGeometryInfo = { 0.5f, 1.f, 0.01f };
|
||||
Desc.fDensity = 100.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(0.f, 1.f, 0.f));
|
||||
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
|
||||
Desc.vLocalTranslation = { 0.5f, 1.375f, 0.f };
|
||||
|
||||
Desc.pxMassCenter = pxPivotTransform;
|
||||
Desc.eLockFlag = {
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X |
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y |
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z |
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y |
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X |
|
||||
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z
|
||||
};
|
||||
Desc.vAutoDamping = { 10.f, 10.f };
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
|
||||
@@ -68,15 +68,17 @@ void CMapElement_Door::ActingIdle()
|
||||
}
|
||||
if (true == m_bDrive) { // 드라이브 중이면
|
||||
if (fCurrentDegree > 0.f) {
|
||||
|
||||
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true);
|
||||
m_pJoint->setDriveVelocity(-fabsf(fCurrentDegree) * 0.2f);
|
||||
}
|
||||
else {
|
||||
m_pJoint->setDriveVelocity(40.f);
|
||||
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true);
|
||||
m_pJoint->setDriveVelocity(fabsf(fCurrentDegree) * 0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // 각도가 안벌어져 있음
|
||||
if (true == m_bDrive && fCurrentDegree < 0.3f) { // 드라이브 중지 트리거
|
||||
if (true == m_bDrive && fabsf(fCurrentDegree) < 0.3f) { // 드라이브 중지 트리거
|
||||
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, false);
|
||||
}
|
||||
}
|
||||
@@ -130,6 +132,7 @@ HRESULT CMapElement_Door::Render()
|
||||
void CMapElement_Door::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
if (0.f != m_vKinematicTimer.x) {
|
||||
m_vKinematicTimer.x = FLT_EPSILON3;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,19 +180,20 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg)
|
||||
m_pRigidBody->Move_Kinematic(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_QuarternionVector(), true);
|
||||
}
|
||||
PSX::PxTransform doorWorldPose = m_pActor->getGlobalPose();
|
||||
PSX::PxVec3 hingePivotWorld = PSX::PxVec3(39.64f, 5.12f, 71.f);
|
||||
PSX::PxVec3 hingePivotWorld = PSX::PxVec3(39.7f, 5.12f, 71.12f);
|
||||
PSX::PxVec3 hingeAxisWorld = doorWorldPose.q.rotate(PSX::PxVec3(0.f, 1.f, 0.f)).getNormalized();
|
||||
PSX::PxTransform jointWorldPose;
|
||||
jointWorldPose.p = hingePivotWorld;
|
||||
jointWorldPose.q = CMyTools::Calc_RevJointPosFromWorldHingeAxis(hingeAxisWorld);
|
||||
PSX::PxTransform localFrameDoor = doorWorldPose.transformInv(jointWorldPose);
|
||||
|
||||
m_pActor->setSolverIterationCounts(8, 1);
|
||||
m_pJoint = (PSX::PxRevoluteJoint*)m_pGameInstance->Create_PxJoint(PHYSX_JOINT::REVOLUTE, nullptr, jointWorldPose, m_pActor, localFrameDoor);
|
||||
|
||||
m_pJoint->setLimit(PSX::PxJointAngularLimitPair(-XMConvertToRadians(100.f), XMConvertToRadians(100.f)));
|
||||
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, true);
|
||||
|
||||
m_pJoint->setDriveForceLimit(120.f);
|
||||
m_pJoint->setDriveForceLimit(10.f);
|
||||
|
||||
m_pJoint->setConstraintFlag(PSX::PxConstraintFlag::eVISUALIZATION, true);
|
||||
m_pActor->setLinearVelocity(PSX::PxVec3(0.f, 0.f, 0.f));
|
||||
|
||||
@@ -15,7 +15,7 @@ void CPlayerRobe::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef 기무리
|
||||
Update_RobeJoints();
|
||||
//Update_RobeJoints();
|
||||
#endif // 기무리
|
||||
|
||||
Describe_Entity();
|
||||
|
||||
@@ -34,7 +34,7 @@ class CMapElement_Door final : public CMapElement
|
||||
PSX::PxRevoluteJoint* m_pJoint = { nullptr };
|
||||
|
||||
_float3 m_vRadianYAngle = {};
|
||||
_float3 m_vKinematicTimer = { 0.f, 2.f, 2.3f };
|
||||
_float3 m_vKinematicTimer = { 0.f, 3.f, 3.3f };
|
||||
_bool m_bDrive = { false };
|
||||
#ifdef _DEBUG
|
||||
_bool m_bUseSelectColor = { true };
|
||||
|
||||
Reference in New Issue
Block a user