diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp
index 149f8d4c1..803e283b6 100644
--- a/Jusin154_Team3D/Client/Default/Client.cpp
+++ b/Jusin154_Team3D/Client/Default/Client.cpp
@@ -25,7 +25,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
{
#ifdef _DEBUG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
- //_CrtSetBreakAlloc(1181);
+ //_CrtSetBreakAlloc(45489776);
//_CrtSetBreakAlloc(1182);
//_CrtSetBreakAlloc(1183);
//_CrtSetBreakAlloc(1184);
diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj
index e1de4a5ba..a9d8abb8e 100644
--- a/Jusin154_Team3D/Client/Default/Client.vcxproj
+++ b/Jusin154_Team3D/Client/Default/Client.vcxproj
@@ -127,7 +127,7 @@
cd /d "$(SolutionDir)"
-call Update_Shaders.bat
+call Update_Resources.bat
@@ -154,7 +154,7 @@ call Update_Shaders.bat
cd /d "$(SolutionDir)"
-call Update_Shaders.bat
+call Update_Resources.bat
diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp
index 530901d28..3387868f1 100644
--- a/Jusin154_Team3D/Client/Private/EffectPool.cpp
+++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp
@@ -111,7 +111,7 @@ HRESULT CEffectPool::Bind_ShaderResources()
HRESULT CEffectPool::Ready_Effect()
{
- if(FAILED(Create_Effect(SKILL_TYPE::JAP, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
+ if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
CNomalJap* pEffect = nullptr;
diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp
index 4ea2c9add..9521d742f 100644
--- a/Jusin154_Team3D/Client/Private/Goblin.cpp
+++ b/Jusin154_Team3D/Client/Private/Goblin.cpp
@@ -78,7 +78,7 @@ void CGoblin::Update(_float fTimeDelta)
void CGoblin::Late_Update(_float fTimeDelta)
{
__super::Late_Update(fTimeDelta);
- m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
+ m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
m_pTransformCom->LookAt(XMLoadFloat4(&m_vTargetPos));
diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp
index 1c7a7e057..dfb6bd412 100644
--- a/Jusin154_Team3D/Client/Private/Loader.cpp
+++ b/Jusin154_Team3D/Client/Private/Loader.cpp
@@ -1072,9 +1072,27 @@ HRESULT CLoader::Loading_For_GamePlay()
#pragma region MAP PROTOTYPE
/* For.Prototype_Component_VIBuffer_Terrain */
- if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
- CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "Hogsmeade_HeightMap.bin", 512, 512))))
- return E_FAIL;
+ {
+ CVIBuffer_Terrain* pTerrain = CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "Hogsmeade_HeightMap.bin", 512, 512);
+ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"), pTerrain))) {
+ return E_FAIL;
+ }
+ pTerrain->ConvertToHeightField(TEXT("Hogsmeade_HeightMap"));
+
+ CRigidBody_Static::RIGIDBODY_STATIC_PROTOTYPEDESC Desc{}; // 터레인 리지드 지형 추가
+ {
+ Desc.eType = ACTOR::HEIGHTFIELD;
+ Desc.ePxRigidBodyFlags = {};
+ Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
+ Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
+ Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
+ Desc.fContactOffset = 0.f;
+ }
+ CRigidBody_Static* pRigid = CRigidBody_Static::Create(m_pDevice, m_pContext, Desc);
+ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_RigidBody_Static_Terrain_Hogsmeade"), pRigid))) {
+ return E_FAIL;
+ }
+ }
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"),
diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp
index ef07ceeec..3c3a4bd3d 100644
--- a/Jusin154_Team3D/Client/Private/Monster.cpp
+++ b/Jusin154_Team3D/Client/Private/Monster.cpp
@@ -63,7 +63,7 @@ HRESULT CMonster::Render_OutLine()
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
- GUI::Begin("OutLine");
+
GUI::SetNextItemWidth(80.f);
static _float3 vOutLineColor = _float3(1.f, 0.960784376f, 0.933333397f);
static _float fOutLineThickness = { 1.f }; // 카메라로부터 거리가 멀어지면 늘어나게끔 바꾸는걸 추천함
@@ -73,7 +73,6 @@ HRESULT CMonster::Render_OutLine()
GUI::SliderFloat("Thickness", &fOutLineThickness, 0.1f, 2.f, "%.1f");
GUI::SliderFloat("Scale", &fOutLineScale, 0.1f, 2.f, "%.1f");
GUI::SliderFloat("Power", &fOutLinePower, 0.1f, 2.f, "%.1f");
- GUI::End();
if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &vOutLineColor, sizeof(_float3)))) {
return E_FAIL;
}
diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp
index 73ae777d4..7d9d54370 100644
--- a/Jusin154_Team3D/Client/Private/NomalJap.cpp
+++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp
@@ -232,8 +232,10 @@ void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc)
Get_PartObject()->Set_Visible(false);
Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f));
- m_pPhysHitBox->Set_Dead();
- SAFE_RELEASE(m_pPhysHitBox);
+ if (nullptr != m_pPhysHitBox) {
+ m_pPhysHitBox->Set_Dead();
+ SAFE_RELEASE(m_pPhysHitBox);
+ }
}
void CNomalJap::Free()
diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp
index 5b5f337ac..760b01efc 100644
--- a/Jusin154_Team3D/Client/Private/Player.cpp
+++ b/Jusin154_Team3D/Client/Private/Player.cpp
@@ -110,7 +110,6 @@ void CPlayer::Update(_float fTimeDelta)
m_pFSM->Update_State(fTimeDelta);
-
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
@@ -127,7 +126,7 @@ void CPlayer::Update(_float fTimeDelta)
void CPlayer::Late_Update(_float fTimeDelta)
{
- m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
+ m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
@@ -254,7 +253,7 @@ HRESULT CPlayer::Ready_Components()
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER);
Desc.pTransform = m_pTransformCom;
Desc.eBodyType = ACTOR::CAPSULE;
- Desc.fContactOffset = 0.1f;
+ Desc.fContactOffset = 0.17f;
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
Desc.bAutoStepping = { false };
Desc.fStepOffset = { 0.05f };
@@ -351,7 +350,7 @@ _matrix CPlayer::Get_WandPos()
if (pWand == nullptr)
return _matrix();
- _matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root"));
+ _matrix BoneMatrix = XMLoadFloat4x4(pWand->Get_BoneMatrixPtr("root"));
BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix();
diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp
index 014e91c29..2113dc2ea 100644
--- a/Jusin154_Team3D/Client/Private/Player_States.cpp
+++ b/Jusin154_Team3D/Client/Private/Player_States.cpp
@@ -112,10 +112,29 @@ HRESULT CPlayer::InputSpell()
return E_FAIL;
}
+
+HRESULT CPlayer::InputAim()
+{
+ if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON))
+ {
+ return S_OK;
+ }
+ return E_FAIL;
+}
+
void CPlayer::Behavior_IdleEnter() {
m_pFSM->Enable_State(FSMSTATE::IDLE);
- pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
+ pair<_uint, _bool> pairAnimInfo;
+ if (SUCCEEDED(InputAim()))
+ {
+ pairAnimInfo = m_Animation[STATEANIM::IDLE_AIM];
+ }
+ else
+ {
+ pairAnimInfo = m_Animation[STATEANIM::IDLE];
+ }
+
m_bSprintToggle = false;
m_bWalkToggle = false;
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
@@ -225,11 +244,16 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta)
return E_FAIL;
}
- if (m_pModelCom->IsFinishedAnim())
+ if (!SUCCEEDED(InputAim()))
{
- pairAnimInfo = m_Animation[STATEANIM::IDLE];
- m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
+ if (m_pModelCom->IsFinishedAnim())
+ {
+ pairAnimInfo = m_Animation[STATEANIM::IDLE];
+ m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
+ }
}
+
+
return S_OK;
}
@@ -260,9 +284,6 @@ void CPlayer::Behavior_MoveEnter()
if (true == bFoward) {
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
}
- else if (true == bBackward) {
- pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
- }
}
else
{
@@ -272,6 +293,7 @@ void CPlayer::Behavior_MoveEnter()
if (SUCCEEDED(InputMove()))
{
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
+ m_bRatio = true;
}
}
}
@@ -288,9 +310,6 @@ void CPlayer::Behavior_MoveEnter()
if (true == bFoward) {
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
}
- else if (true == bBackward) {
- pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
- }
}
else {
m_pFSM->Enable_State(FSMSTATE::JOG);
@@ -300,7 +319,7 @@ void CPlayer::Behavior_MoveEnter()
}
}
- m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount);
+ m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio);
}
HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
@@ -403,45 +422,6 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
_float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x;
- _vector vCameraLook = XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f);
-
- vCameraLook = XMVector3Normalize(vCameraLook);
-
- _float2 fCamLook = { XMVectorGetX(vCameraLook), XMVectorGetZ(vCameraLook) };
-
- _float angle = CMyTools::Get_Direction2D(vCurLook, fCamLook);
-
- _float degree = XMConvertToDegrees(angle);
- if (m_pModelCom->Get_AnimIndex() == m_Animation[STATEANIM::JOG_FWD].first)
- {
- _float targetAngle = degree;
-
- if (m_pGameInstance->Key_Pressing(DIK_W))
- targetAngle = 0.f;
- if (m_pGameInstance->Key_Pressing(DIK_D))
- targetAngle = 90.f;
- if (m_pGameInstance->Key_Pressing(DIK_A))
- targetAngle = -90.f;
- if (m_pGameInstance->Key_Pressing(DIK_S))
- targetAngle = 180.f;
-
- _float angleDiff = degree - targetAngle;
-
- if (angleDiff > 180.f) angleDiff -= 360.f;
- if (angleDiff < -180.f) angleDiff += 360.f;
-
- _float threshold = 2.f;
-
- if (angleDiff > threshold)
- {
- m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
- }
- else if (angleDiff < -threshold)
- {
- m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
- }
- }
-
_bool bSkipAngleCheck = { false };
if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) {
@@ -454,34 +434,36 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
}
if (!bSkipAngleCheck) {
_float absDir = fabsf(vDir);
- if (absDir <= XMConvertToRadians(80.f)) {
+ if (absDir <= XMConvertToRadians(60.f)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
- m_fAmount = 1.f;
- m_bRatio = true;
}
else if (absDir < XMConvertToRadians(160.f)) {
if (cross > 0)
{
pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT];
- m_fAmount = 0.8f;
+ m_fAmount = 0.5f;
m_bRatio = true;
}
else {
pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT];
- m_fAmount = 0.8f;
+ m_fAmount = 0.5f;
m_bRatio = true;
}
}
else {
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
- m_fAmount = 0.8f;
+ m_fAmount = 0.5f;
m_bRatio = true;
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount, m_bRatio);
+ m_fAmount = 1.f;
}
}
- return S_OK;
+
+ Player_InterpTurn(fTimeDelta);
+
+ return E_FAIL;
}
if (m_pFSM->IsEnable(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)||
@@ -504,7 +486,6 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
}
}
else if (IsCurrentKeyFrame("TurnStop"))
-
{
m_pFSM->Change_State(FSMSTATE::IDLE);
m_pFSM->Disable_State(FSMSTATE::STOP);
@@ -632,10 +613,11 @@ void CPlayer::Behavior_CombatEnter()
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
- m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::LIGHT_ATTACK].first, [this]() {
+ m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this);
+ /*m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::LIGHT_ATTACK].first, [this]() {
m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this);
return E_FAIL;
- });
+ });*/
}
else if (SUCCEEDED(InputSpell())) {
m_pFSM->Enable_State(FSMSTATE::SPELL);
@@ -756,11 +738,8 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
break;
}
-
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
-
-
m_pModelCom->Anim_Event(0.f, m_Animation[STATEANIM::ACCIO].first, [this]() {
m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this);
@@ -808,6 +787,64 @@ void CPlayer::Behavior_CombatExit()
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW);
}
+void CPlayer::Player_InterpTurn(_float fTimeDelta)
+{
+ if (m_pModelCom->Get_AnimIndex() != m_Animation[STATEANIM::JOG_FWD].first)
+ return;
+
+ _vector xmvCurLook = XMVector4Normalize(
+ XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
+ _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) };
+
+ _vector vCameraLook = XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f);
+
+ _vector vCameraRight = XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f);
+
+ _float2 fCamLook = { XMVectorGetX(vCameraLook), XMVectorGetZ(vCameraLook) };
+
+ vCameraRight = XMVector3Normalize(vCameraRight);
+
+ _float angle = CMyTools::Get_Direction2D(vCurLook, fCamLook);
+
+ _float degree = XMConvertToDegrees(angle);
+
+ _vector xmvInput = XMVectorZero();
+
+ if (m_pGameInstance->Key_Pressing(DIK_W))
+ xmvInput += vCameraLook;
+
+ if (m_pGameInstance->Key_Pressing(DIK_S))
+ xmvInput -= vCameraLook;
+
+ if (m_pGameInstance->Key_Pressing(DIK_D))
+ xmvInput -= vCameraRight;
+
+ if (m_pGameInstance->Key_Pressing(DIK_A))
+ xmvInput += vCameraRight;
+
+ xmvInput = XMVector3Normalize(xmvInput);
+
+ _float2 fInput2D = { XMVectorGetX(xmvInput), XMVectorGetZ(xmvInput) };
+
+ _float targetAngle = XMConvertToDegrees(CMyTools::Get_Direction2D(fCamLook, fInput2D));
+
+ _float angleDiff = degree - targetAngle;
+
+ if (angleDiff > 180.f) angleDiff -= 360.f;
+ if (angleDiff < -180.f) angleDiff += 360.f;
+
+ _float Offset = 2.f;
+
+ if (angleDiff > Offset)
+ {
+ m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
+ }
+ else if (angleDiff < -Offset)
+ {
+ m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
+ }
+}
+
void CPlayer::Add_FSM()
{
#pragma region Behavior_Movement_NotFocus
@@ -838,27 +875,7 @@ void CPlayer::Add_FSM()
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f);
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.05f);
}
-
-
- if (m_pGameInstance->Key_Pressing(DIK_A)) {
- xmvPlayerDir -= xmvRight;
- }
- if (m_pGameInstance->Key_Pressing(DIK_D)) {
- xmvPlayerDir += xmvRight;
- }
}
-
- xmvPlayerDir = XMVectorSetW(XMVector3Normalize(xmvPlayerDir), 0.f);
- _float2 vPlayerDir = { XMVectorGetX(xmvPlayerDir), XMVectorGetZ(xmvPlayerDir) };
- _float2 vCameraLookDir = { m_vCameraLookDir.x, m_vCameraLookDir.z };
-
- _float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir);
- _float absDir = fabsf(vDir);
- /*if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) {
- m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
- if (m_pGameInstance->Key_Pressing(DIK_D)&& vDir > XMConvertToRadians(-140.f) ) {
- m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };*/
-
};
Desc.funcLateUpdate = nullptr;
@@ -917,19 +934,23 @@ void CPlayer::Add_FSM()
void CPlayer::Set_Anim()
{
m_Animation[STATEANIM::IDLE] = { 266,true };
+ m_Animation[STATEANIM::IDLE_AIM] = { 5,true };
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
- m_Animation[STATEANIM::WALK_BWD] = { 166,true };
+ m_Animation[STATEANIM::WALK_LEFT] = { 337,false };
+ m_Animation[STATEANIM::WALK_RIGHT] = { 504,false };
+ m_Animation[STATEANIM::WALK_BWD] = { 352,false };
+
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
- m_Animation[STATEANIM::JOG_LEFT] = { 164,false };
- m_Animation[STATEANIM::JOG_RIGHT] = { 185,false };
- m_Animation[STATEANIM::JOG_BWD] = { 154,false };//176
- m_Animation[STATEANIM::JOG_STOP] = { 289,false };
+ m_Animation[STATEANIM::JOG_LEFT] = { 164,false }; // Turn
+ m_Animation[STATEANIM::JOG_RIGHT] = { 185,false };// Turn
+ m_Animation[STATEANIM::JOG_BWD] = { 154,false }; // Turn
+ m_Animation[STATEANIM::JOG_STOP] = { 289,false };
m_Animation[STATEANIM::JUMP] = { 205,false };
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp
index d6c9f79a4..89d7a3cae 100644
--- a/Jusin154_Team3D/Client/Private/Terrain.cpp
+++ b/Jusin154_Team3D/Client/Private/Terrain.cpp
@@ -35,6 +35,15 @@ HRESULT CTerrain::Initialize(void* pArg)
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
+ CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc{};
+ Desc.pMeshName = TEXT("Hogsmeade_HeightMap");
+ Desc.iSubKind = 998;
+ /* Com_RigidBody */
+ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_RigidBody_Static_Terrain_Hogsmeade"),
+ reinterpret_cast(&m_pRigidBody), &Desc))) {
+ return E_FAIL;
+ }
+
return S_OK;
}
@@ -106,8 +115,10 @@ HRESULT CTerrain::Ready_Components(void* pArg)
/* Com_VIBuffer */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
- reinterpret_cast(&m_pVIBufferCom))))
+ reinterpret_cast(&m_pVIBufferCom)))){
return E_FAIL;
+ }
+
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_NORTEX,
@@ -205,6 +216,7 @@ void CTerrain::Free()
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pVIBufferCom);
+ SAFE_RELEASE(m_pRigidBody);
SAFE_RELEASE(m_pDiffuseTextureCom);
SAFE_RELEASE(m_pNormalTextureCom);
SAFE_RELEASE(m_pMROTextureCom);
diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h
index a3203c364..7162829e6 100644
--- a/Jusin154_Team3D/Client/Public/Player.h
+++ b/Jusin154_Team3D/Client/Public/Player.h
@@ -89,6 +89,7 @@ class CPlayer final : public CUnit
HRESULT InputMove();
HRESULT InputKeyUpMove();
HRESULT InputSpell();
+ HRESULT InputAim();
void Behavior_IdleEnter();
HRESULT Behavior_IdleExitCheck(_float fTimeDelta);
@@ -114,6 +115,9 @@ class CPlayer final : public CUnit
HRESULT Behavior_CombatExitCheck();
void Behavior_CombatExit();
+
+ void Player_InterpTurn(_float fTimeDelta);
+
#pragma endregion
private:
diff --git a/Jusin154_Team3D/Client/Public/Terrain.h b/Jusin154_Team3D/Client/Public/Terrain.h
index e29ed7a38..ac2349963 100644
--- a/Jusin154_Team3D/Client/Public/Terrain.h
+++ b/Jusin154_Team3D/Client/Public/Terrain.h
@@ -38,6 +38,7 @@ class CTerrain final : public CGameObject
private:
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Terrain* m_pVIBufferCom = { nullptr };
+ CRigidBody_Static* m_pRigidBody = { nullptr };
CTexture* m_pDiffuseTextureCom = { nullptr };
CTexture* m_pNormalTextureCom = { nullptr };
CTexture* m_pMROTextureCom = { nullptr };
diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
index c113073e3..725fd1d18 100644
--- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
+++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
@@ -723,8 +723,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag)
HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
{
- if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test)))
- return E_FAIL;
+ /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test)))
+ return E_FAIL;*/
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
@@ -734,8 +734,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
- if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
- return E_FAIL;
+ /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
+ return E_FAIL;*/
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;*/
diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp
index d71a8a5eb..9fab8a619 100644
--- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp
+++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp
@@ -361,6 +361,7 @@ void CMapObject_LOD::Describe_Entity()
{ // RIGID_BODY
_wstring dest = CMyTools::ToWstring(m_pModelComs[iModelIndex]->Get_MeshName(iMeshIndex) + to_string(iMeshIndex)).c_str();
Desc.pMeshName = dest.c_str();
+ Desc.iSubKind = 998;
if (FAILED(Add_Asset_Component(g_iStaticLevel, Desc.pMeshName, nullptr, &Desc))) {
assert(false);
diff --git a/Jusin154_Team3D/Editor/Private/Player_States.cpp b/Jusin154_Team3D/Editor/Private/Player_States.cpp
index 2ce1e1a10..8f20cd727 100644
--- a/Jusin154_Team3D/Editor/Private/Player_States.cpp
+++ b/Jusin154_Team3D/Editor/Private/Player_States.cpp
@@ -98,6 +98,15 @@ HRESULT CPlayer::InputSpell()
return E_FAIL;
}
+HRESULT CPlayer::InputAimMove()
+{
+ if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON))
+ {
+ return S_OK;
+ }
+ return E_FAIL;
+}
+
void CPlayer::Behavior_IdleEnter() {
m_pFSM->Enable_State(FSMSTATE::IDLE);
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h
index 3c8826632..5c4c27ed7 100644
--- a/Jusin154_Team3D/Editor/Public/Player.h
+++ b/Jusin154_Team3D/Editor/Public/Player.h
@@ -61,6 +61,7 @@ class CPlayer final : public CUnit
HRESULT InputAction();
HRESULT InputMove();
HRESULT InputSpell();
+ HRESULT InputAimMove();
_float m_fAmount = { 1.f };
diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp
index 11d05e60b..1fff47315 100644
--- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp
+++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp
@@ -159,7 +159,7 @@ void CCharacter_Controller::Move(_float fTimeDelta)
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
if (true == m_bGravity) {
- m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
+ m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f));
}
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum());
@@ -182,10 +182,10 @@ _vector CCharacter_Controller::Get_Position()
return XMVectorSet((_float)pxVPos.x, (_float)pxVPos.y, (_float)pxVPos.z, 1.f);
}
-_float3 CCharacter_Controller::Get_FootPosition()
+_vector CCharacter_Controller::Get_FootPosition()
{
PSX::PxExtendedVec3 pxLVecfootPos = m_pController->getFootPosition();
- return { (_float)pxLVecfootPos.x, (_float)pxLVecfootPos.y, (_float)pxLVecfootPos.z };
+ return XMVectorSet((_float)pxLVecfootPos.x, (_float)pxLVecfootPos.y, (_float)pxLVecfootPos.z, 1.f );
}
HRESULT CCharacter_Controller::Initialize_Prototype()
@@ -372,7 +372,8 @@ void CCharacter_Controller::Describe_Entity()
GUIHelpMarker("A capsule is affected by its lower sphere and tends to generate an up vector on steps.\nIn eEASY, the up vector is combined with the step offset, allowing easier climbing; in eCONSTRAINED, the up vector is removed during step detection and only the step offset is used.");
}
}
-
+ GUI::Text("%.1f", XMConvertToDegrees(acosf(m_fSlopeLimit))); GUI::SameLine(); GUI::SliderFloat("m_fSlopeLimit", &m_fSlopeLimit, 0.0f, 1.f);
+ GUI::SliderFloat("m_fGravity_Multiplier", &m_fGravity, 0.0f, 3.f);
if (GUI::SliderFloat3("Volume", (_float*)&vVolume, 0.1f, 10.f, "%.2f")) {
Modify_Volume(vVolume);
}GUIHelpMarker("Box uses vSize; Capsule uses x->fRadius, y->fHeight.\nThe capsule's fHeight is likely the distance from the lower sphere center to the upper sphere center.");
diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp
index 89c5f94de..1689b64d1 100644
--- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp
+++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp
@@ -652,6 +652,11 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr
return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh);
}
+void CGameInstance::RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc)
+{
+ return m_pPhysX_Manager->RegistHeight(pName, Desc);
+}
+
PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody_Dynamic& RigidBody)
{
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp
index d236501f2..089aa6fa5 100644
--- a/Jusin154_Team3D/Engine/Private/Model.cpp
+++ b/Jusin154_Team3D/Engine/Private/Model.cpp
@@ -237,7 +237,7 @@ void CModel::Update_RootBone(_float Amount)
if (!m_bInitialRootRotSaved)
{
m_vInitialRootRot = curRotF4;
- //m_vPrevRootRot = curRotF4;
+ m_vPrevRootRot = curRotF4;
m_bInitialRootRotSaved = true;
}
else
diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp
index fdefcd048..811af0234 100644
--- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp
+++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp
@@ -77,15 +77,17 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
// PxRigidStatic 씬의 정적 바디 인터페이스
PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix);
PSX::PxShape* pShape = { nullptr };
- PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey());
- PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
-
+ PSX::PxGeometry* pGeometry = { nullptr };
+
switch (RigidBody.Get_Type())
{
case ACTOR::PLANE:
break;
case ACTOR::TRIANGLEMESH:
{ // SetUp Geometry
+ PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey());
+ PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
+
_vector vPos, vRotq, vScale;
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
vRotq = XMQuaternionNormalize(vRotq);
@@ -103,17 +105,40 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
// pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
// 유효성 체크
PX_ASSERT(pPxMeshGeometry->isValid());
+ pGeometry = pPxMeshGeometry;
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
}
break;
case ACTOR::HEIGHTFIELD:
- break;
+ { // SetUp HeightField
+ PSX::PxHeightField* pHeightField = Find_HeightField(RigidBody.Get_PxMeshKey());
+ PSX::PxHeightFieldGeometry* pPxHeightGeometry = { nullptr };
+
+ _vector vPos, vRotq, vScale;
+ XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
+ vRotq = XMQuaternionNormalize(vRotq);
+
+ PSX::PxTransform out;
+ XMStoreFloat3((_float3*)&out.p, vPos);
+ XMStoreFloat4((_float4*)&out.q, vRotq);
+ PSX::PxMeshScale meshScale(
+ PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])),
+ PSX::PxQuat(PSX::PxIdentity) // 스케일 축은 로컬 기준
+ );
+ pPxHeightGeometry = new PSX::PxHeightFieldGeometry(pHeightField);
+
+ // 유효성 체크
+ PX_ASSERT(pPxHeightGeometry->isValid());
+ pGeometry = pPxHeightGeometry;
+ m_HeightFieldGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxHeightGeometry);
+ }
+ break;
default:
assert(false);
break;
}
- pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
+ pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
pShape->setFlags(RigidBody.Get_ShapeFlags());
pShape->setContactOffset(RigidBody.Get_ContactOffset());
@@ -144,6 +169,17 @@ void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxT
{
m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh);
}
+void CPhysX_Manager::RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc)
+{
+ PSX::PxHeightField* pHeightField = PxCreateHeightField(Desc);
+ if (nullptr == pHeightField) {
+ assert(false);
+ }
+ else {
+ m_HeightFields.emplace(pName, pHeightField);
+ }
+
+}
#ifdef EDITOR_PROJECT
HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix)
@@ -243,6 +279,15 @@ PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _tchar* pMeshName)
return nullptr;
}
+PSX::PxHeightField* CPhysX_Manager::Find_HeightField(const _tchar* pFieldName)
+{
+ map<_wstring, PSX::PxHeightField*>::iterator iter = m_HeightFields.find(pFieldName);
+ if (iter != m_HeightFields.end()) {
+ return iter->second;
+ }
+ return nullptr;
+}
+
void CPhysX_Manager::Update_Kinematic()
{
for (auto& pBody : m_pActiveBodys) {
@@ -489,16 +534,20 @@ HRESULT CPhysX_Manager::Initialize()
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
// m_pScene->overlap();??????
+#ifdef EDITOR_PROJECT
- PlaneData.eKind = PHYSX_KIND::BODY_STATIC;
- PlaneData.iSubKind = UINT_MAX;
- PlaneData.pOwner = nullptr;
- PlaneData.pBody = nullptr;
+ if (true == m_bDebugCreatePlane) {
+ PlaneData.eKind = PHYSX_KIND::BODY_STATIC;
+ PlaneData.iSubKind = UINT_MAX;
+ PlaneData.pOwner = nullptr;
+ PlaneData.pBody = nullptr;
- 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);;
+ 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);
+ }
+#endif
return S_OK;
}
@@ -537,7 +586,7 @@ CPhysX_Manager* CPhysX_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContex
void CPhysX_Manager::Free()
{
ClearScene();
-
+
for (auto& pMeshes : m_TriangleMeshes) {
pMeshes.second->release();
} m_TriangleMeshes.clear();
@@ -546,6 +595,14 @@ void CPhysX_Manager::Free()
Safe_Delete(pGeometry.second);
} m_TriangleMeshGeometry.clear();
+ for (auto& pGeometry : m_HeightFieldGeometry) {
+ Safe_Delete(pGeometry.second);
+ } m_HeightFieldGeometry.clear();
+
+ for (auto& pField : m_HeightFields) {
+ pField.second->release();
+ } m_HeightFields.clear();
+
if (nullptr != m_pCookingParam) {
Safe_Delete(m_pCookingParam);
}
diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp
index 32d82d0f3..9f450afb4 100644
--- a/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp
+++ b/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp
@@ -30,6 +30,8 @@ HRESULT CRigidBody_Static::Initialize(void* pArg)
if (FAILED(__super::Initialize(pArg))) {
return E_FAIL;
}
+ RIGIDBODY_STATIC_DESC* pDesc = static_cast(pArg);
+ m_pMeshName = pDesc->pMeshName;
m_tagData.pOwner = m_pOwner;
XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
m_tagData.pBody = this;
diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp
index 44b085125..67b8a6fe3 100644
--- a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp
+++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp
@@ -389,6 +389,44 @@ HRESULT CVIBuffer_Terrain::Initialize(void* pArg)
return S_OK;
}
+void CVIBuffer_Terrain::ConvertToHeightField(const _tchar* pStaticKey)
+{
+ vector pxSamples = {};
+ pxSamples.resize(m_iNumVerticesZ * m_iNumVerticesX);
+
+ for (_uint iRow = 0; iRow < m_iNumVerticesZ; ++iRow) {
+ for (_uint iCol = 0; iCol < m_iNumVerticesX; ++iCol) {
+ _uint iIndex = iRow * m_iNumVerticesX + iCol;
+ _uint iPhysXIndex = iCol * m_iNumVerticesZ + iRow;
+
+ _float fRealHeight = m_HeigthValues[iIndex];
+ PSX::PxI16 iClampHeight = (PSX::PxI16)(PSX::PxClamp(fRealHeight, -32767.f, 32767.f));
+
+ PSX::PxHeightFieldSample& pxSample = pxSamples[iPhysXIndex];
+
+ pxSample.height = iClampHeight;
+ pxSample.materialIndex0 = pxSample.materialIndex1 = 0;
+ pxSample.clearTessFlag();
+ }
+ }
+
+ PSX::PxHeightFieldDesc Desc{};
+ Desc.format = PSX::PxHeightFieldFormat::eS16_TM;
+ Desc.nbRows = m_iNumVerticesZ;
+ Desc.nbColumns = m_iNumVerticesX;
+
+ Desc.samples.data = pxSamples.data();
+ Desc.samples.stride = sizeof(PSX::PxHeightFieldSample);
+ Desc.convexEdgeThreshold = 0;
+ if (false == Desc.isValid()) {
+ assert(false);
+ }
+ else {
+ m_pGameInstance->RegistHeight(pStaticKey, Desc);
+ }
+
+}
+
_bool CVIBuffer_Terrain::Picking(_fmatrix WorldMatrix, _float3* pOut)
{
_matrix WorldInv = XMMatrixInverse(nullptr, WorldMatrix);
diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h
index 6fd145437..d35258dfc 100644
--- a/Jusin154_Team3D/Engine/Public/Animation.h
+++ b/Jusin154_Team3D/Engine/Public/Animation.h
@@ -21,7 +21,7 @@ class ENGINE_DLL CAnimation : public CBase
_int Get_AnimProgressPostion(const _char* pAnimChannelName);
void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition);
vector<_int>* Capture_Bones();
- void InterpAnim(CAnimation* pPreAnim, vector& Bones, float fRatio);
+ void InterpAnim(CAnimation* pPreAnim, vector& Bones, _float fRatio);
diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h
index 18aed237d..44f4fe536 100644
--- a/Jusin154_Team3D/Engine/Public/Character_Controller.h
+++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h
@@ -54,7 +54,7 @@ class ENGINE_DLL CCharacter_Controller final :
void Move(_float fTimeDelta); // 이동 // 충돌보정만 있음,
void Set_Position(_fvector vNewPos); // 순간이동
_vector Get_Position();
- _float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 바닥 위치가 더 아래에 위치한다는 뜻 )
+ _vector Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 바닥 위치가 더 아래에 위치한다는 뜻 )
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
void Modify_Volume(_float3 fVolume);
@@ -69,9 +69,10 @@ class ENGINE_DLL CCharacter_Controller final :
private:
ACTOR m_eBodyType = { ACTOR::END };
PSX::PxController* m_pController = { nullptr };
- CTransform* m_pTransform = { nullptr };
+ CTransform* m_pTransform = { nullptr };
_bool m_bAutoStepping = { false };
- _float m_fSlopeLimit = { 0.f }; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 )
+ _float m_fGravity = { 0.129f };
+ _float m_fSlopeLimit = { 0.69f/*0~1*/}; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 )
PhsXUserData m_tagData = {};
PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};
diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h
index 9939c98a1..9aabd37bb 100644
--- a/Jusin154_Team3D/Engine/Public/GameInstance.h
+++ b/Jusin154_Team3D/Engine/Public/GameInstance.h
@@ -193,6 +193,7 @@ class ENGINE_DLL CGameInstance final : public CBase
#pragma region PhysX_Manager
PSX::PxMaterial* Create_Material(_float3* vMatInfo);
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
+ void RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc);
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody);
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody);
PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame);
diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h
index 635d7ce83..fce18734a 100644
--- a/Jusin154_Team3D/Engine/Public/Model.h
+++ b/Jusin154_Team3D/Engine/Public/Model.h
@@ -119,7 +119,7 @@ void Combined_BoneMatrix();
_int m_iPreAnimIndex = { -1 };
_float m_fBlendTime = { 0.f };
- _float m_fBlendDuration = { 0.2f };
+ _float m_fBlendDuration = { 0.3f };
_float m_fRadius = { 0.f }; // 컬링용 Radius
_float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h
index 4bfef7c9c..cb03c91e2 100644
--- a/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h
+++ b/Jusin154_Team3D/Engine/Public/PhysX/cooking/PxCooking.h
@@ -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
diff --git a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxIO.h b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxIO.h
index 177d4776e..2a239d302 100644
--- a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxIO.h
+++ b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxIO.h
@@ -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
diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h
index 52f1c0a07..9f6e97662 100644
--- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h
+++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h
@@ -27,6 +27,7 @@ class CPhysX_Manager final : public CBase
PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame);
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
+ void RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc);
PSX::PxMaterial* Create_Material(const _float3* vMatInfo);
#ifdef EDITOR_PROJECT
@@ -36,6 +37,7 @@ class CPhysX_Manager final : public CBase
HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes);
//HRESULT LoadTriMeshes_Binary(const _char* pPath, vector& TriMeshes);
PSX::PxTriangleMesh* Find_TriangleMesh(const _tchar* pMeshName);
+ PSX::PxHeightField* Find_HeightField(const _tchar* pFieldName);
void Update(_float fTimeDelta);
void ClearScene();
@@ -80,11 +82,20 @@ class CPhysX_Manager final : public CBase
unordered_set m_pActiveBodys = { };
unordered_set m_pRestBodies = { }; // 피직스의 액터로 구별되기 때문에 피직스액터 포인터를 키로 사용함
+
map<_wstring, PSX::PxTriangleMesh*> m_TriangleMeshes = {};
map<_wstring, PSX::PxTriangleMeshGeometry*> m_TriangleMeshGeometry = {};
+ map<_wstring, PSX::PxHeightField*> m_HeightFields = {};
+ map<_wstring, PSX::PxHeightFieldGeometry*> m_HeightFieldGeometry = {};
+
+#ifdef EDITOR_PROJECT
+ _bool m_bDebugCreatePlane = { true };
PhsXUserData PlaneData = {};
+#else
+ _bool m_bDebugCreatePlane = { false };
+#endif // EDITOR_PROJECT
vector m_pMaterials = { };
_uint m_iNumLevel = {};
diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Static.h b/Jusin154_Team3D/Engine/Public/RigidBody_Static.h
index d0122d2fd..1d7794439 100644
--- a/Jusin154_Team3D/Engine/Public/RigidBody_Static.h
+++ b/Jusin154_Team3D/Engine/Public/RigidBody_Static.h
@@ -14,7 +14,7 @@ class ENGINE_DLL CRigidBody_Static : public CRigidBody
}RIGIDBODY_STATIC_PROTOTYPEDESC;
- typedef struct tagRigidBody_STATIC_Desc : public CRigidBody::RIGIDBODY_PROTOTYPEDESC
+ typedef struct tagRigidBody_STATIC_Desc : public CRigidBody::RIGIDBODY_DESC
{
const _tchar* pMeshName = { nullptr };
}RIGIDBODY_STATIC_DESC;
diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h
index 06d980fb6..f7c3d76f6 100644
--- a/Jusin154_Team3D/Engine/Public/State.h
+++ b/Jusin154_Team3D/Engine/Public/State.h
@@ -4,9 +4,9 @@
NS_BEGIN(STATEANIM)
enum ESTATE
{
- IDLE, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD,
+ IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD,
MOVE,
- WALK, WALK_FWD, WALK_BWD,WALK_STOP,
+ WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_STOP,
JOG,JOG_FWD,JOG_RIGHT,JOG_LEFT, JOG_BWD,JOG_STOP,
SPRINT,
JUMP,JUMP_JOG,JUMP_SPRINT,
diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h b/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h
index 7aa8f3dc7..6c02deb16 100644
--- a/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h
+++ b/Jusin154_Team3D/Engine/Public/VIBuffer_Terrain.h
@@ -24,6 +24,7 @@ class ENGINE_DLL CVIBuffer_Terrain final : public CVIBuffer
#endif // EDITOR_PROJECT
virtual HRESULT Initialize_Prototype(const _char* pFilePath, _uint iSizeX, _uint iSizeZ);
virtual HRESULT Initialize(void* pArg);
+ void ConvertToHeightField(const _tchar* pStaticKey);
_bool Picking(_fmatrix WorldMatrix, _float3* pOut);
void Culling(_fmatrix WorldMatrix);