[add] 문짝 피벗 회전 추가
This commit is contained in:
@@ -199,8 +199,8 @@
|
||||
<ClInclude Include="..\Public\MainLight.h" />
|
||||
<ClInclude Include="..\public\MapObject_Collision.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoor.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\Terrain.h" />
|
||||
<ClInclude Include="..\Public\Level_PhysXLab.h" />
|
||||
@@ -277,8 +277,8 @@
|
||||
<ClCompile Include="..\Private\MainLight.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Collision.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoor.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\Terrain.cpp" />
|
||||
<ClCompile Include="..\Private\Level_PhysXLab.cpp" />
|
||||
|
||||
@@ -41,6 +41,9 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con
|
||||
case 23:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case 24:
|
||||
eResults = PSX::PxControllerBehaviorFlags(0);;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -43,17 +43,32 @@ void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hi
|
||||
{
|
||||
case 23: // 무거운데 올라갈 수 있는 벽
|
||||
if (m_pGameInstance->Key_Pressing(DIK_E)) {
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, 1.f, 0.f, 0.f));
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
|
||||
}
|
||||
else if (m_pGameInstance->Key_Pressing(DIK_R)) {
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
|
||||
}
|
||||
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
|
||||
break;
|
||||
case 24: // 문짝
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addTorque(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
_float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f));
|
||||
if (fDot > 0) {
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
}
|
||||
else {
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
} break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
@@ -101,7 +116,7 @@ void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& h
|
||||
|
||||
void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
|
||||
@@ -39,6 +39,12 @@ void CDummy_PhysXDoor::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CDummy_PhysXDoor::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef 기무리
|
||||
//if (m_pActor->is wakeup)
|
||||
// _vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
|
||||
//_float fRadian = XMConvertToRadians(XMVectorGetZ(vRPY));
|
||||
//if (tanf(fRadian)
|
||||
#endif // 기무리
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Late_Update(_float fTimeDelta)
|
||||
@@ -81,14 +87,17 @@ HRESULT CDummy_PhysXDoor::Ready_Components(void* pArg)
|
||||
}
|
||||
PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast<PHYSXDUMMY_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);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z);
|
||||
|
||||
m_vRadianYAngle.y = pPhysXDummyDesc->vRotRPY.y;
|
||||
m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-70.f);
|
||||
m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(70.f);
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pPhysXDummyDesc->iSubKind;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +112,6 @@ HRESULT CDummy_PhysXDoor::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
CTransform::TRANSFORM_DESC TransformDesc{};
|
||||
TransformDesc.fRadius = 100.f;
|
||||
TransformDesc.fRotationPerSec = XMConvertToRadians(60.f);
|
||||
TransformDesc.fSpeedPerSec = 30.f;
|
||||
TransformDesc.fSpeedPerSec = 15.f;
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "Dummy_PhysXMesh.h"
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXPlatform.h"
|
||||
#include "Dummy_PhysXDoor.h"
|
||||
#include "MapObject_Manager.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MainLight.h"
|
||||
@@ -116,7 +117,7 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
}
|
||||
{
|
||||
CDummy_PhysXPlatform::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { -1.f, 2.f, 10.f };
|
||||
Desc.vPos = { -3.f, 2.f, 10.f };
|
||||
Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
Desc.iSubKind = 20;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlatform>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
@@ -125,13 +126,22 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
}
|
||||
{
|
||||
CDummy_PhysXPlatform::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 2.f, 10.f };
|
||||
Desc.vPos = { 0.f, 2.f, 8.f };
|
||||
Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
Desc.iSubKind = 21;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlatform>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXDoor::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 10.f, 2.f, 10.f };
|
||||
Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
Desc.iSubKind = 24;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXDoor>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXPlayable::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 100.f, 0.f };
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "Dummy_PhysXMesh.h"
|
||||
#include "Dummy_PhysXPlatform.h"
|
||||
#include "Dummy_PhysXDoor.h"
|
||||
#include "Dummy_PhysXWall.h"
|
||||
|
||||
#pragma endregion
|
||||
@@ -588,8 +589,36 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{ // Door
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
Desc.eType = ACTOR::BOX;
|
||||
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.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.5f, 1.5f, 0.0625f };
|
||||
Desc.fDensity = 100.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 1.5f, 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)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -687,6 +716,9 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXBox>(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoor>(g_iStaticLevel, CDummy_PhysXDoor::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;
|
||||
}
|
||||
@@ -699,11 +731,9 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXPlatform>(g_iStaticLevel, CDummy_PhysXPlatform::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Collision>(g_iStaticLevel, CMapObject_Collision::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_LOD>(g_iStaticLevel, CMapObject_LOD::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@ class CDummy_PhysXDoor final : public CGameObject
|
||||
private:
|
||||
CRigidBody* m_pRigidBody = { nullptr };
|
||||
const PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
_float3 m_vRadianYAngle = {};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user