Merge branch 'Develope' of https://github.com/SpicyGangjeong/Team3D into Develope
This commit is contained in:
@@ -186,6 +186,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
@@ -212,9 +213,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))){
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -228,6 +227,7 @@ HRESULT CLevel_GamePlay::Reday_Layer_EffectPool()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectPool>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함!
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_fAmount = 1.f;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
@@ -417,6 +417,45 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
|
||||
_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) {
|
||||
@@ -799,7 +838,7 @@ void CPlayer::Add_FSM()
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
|
||||
|
||||
@@ -95,7 +95,7 @@ class CPlayer final : public CUnit
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck();
|
||||
HRESULT Behavior_MoveExitCheck(_float fTimeDelta);
|
||||
void Behavior_MoveExit();
|
||||
|
||||
void Behavior_JumpEnter();
|
||||
|
||||
@@ -734,8 +734,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
|
||||
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
|
||||
// return E_FAIL;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
|
||||
return E_FAIL;
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
@@ -23,7 +23,7 @@ CAnimation::CAnimation(const CAnimation& rhs)
|
||||
, m_fTickPerSecond{ rhs.m_fTickPerSecond }
|
||||
, m_pSaveAnim{ rhs.m_pSaveAnim }
|
||||
, m_fAnimSpeed{rhs.m_fAnimSpeed }
|
||||
,m_iBoneCount{rhs.m_iBoneCount}
|
||||
, m_iBoneCount{rhs.m_iBoneCount}
|
||||
{
|
||||
memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2);
|
||||
|
||||
|
||||
@@ -118,6 +118,10 @@ void CChannel::Update_TransformationMatirx(
|
||||
_uint* pCurrentKeyFrameIndex,
|
||||
CTransform* pTransform,_float m_fAmount)
|
||||
{
|
||||
|
||||
if (0.f == fCurrentTrackPosition)
|
||||
*pCurrentKeyFrameIndex = 0;
|
||||
|
||||
KEYFRAME LastKeyFrame = m_KeyFrames.back();
|
||||
|
||||
_vector vScale{};
|
||||
@@ -171,7 +175,6 @@ void CChannel::Update_TransformationMatirx(
|
||||
|
||||
if (Bones[m_iBoneIndex]->Compare_Name("Reference") && pTransform != nullptr)
|
||||
{
|
||||
|
||||
_float3 vCurRootPos;
|
||||
XMStoreFloat3(&vCurRootPos, vTranslation);
|
||||
|
||||
@@ -192,8 +195,6 @@ void CChannel::Update_TransformationMatirx(
|
||||
vDeltaWorld *= 0.01f;
|
||||
vDeltaWorld *= m_fAmount;
|
||||
|
||||
|
||||
|
||||
vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f);
|
||||
//pTransform->Set_State(STATE::POSITION,vDeltaWorld);
|
||||
pTransform->AccumulateMomentum(vDeltaWorld);
|
||||
@@ -235,6 +236,8 @@ void CChannel::Update_TransformationMatirx(
|
||||
vRotation = XMLoadFloat4(&m_vInitialRootRot);
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_BoneTransformationMatrix =
|
||||
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
|
||||
|
||||
@@ -250,8 +253,6 @@ void CChannel::ResetRootMotion()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
KEYFRAME* CChannel::Get_Frame(_uint iIndex)
|
||||
{
|
||||
return &m_KeyFrames[iIndex];
|
||||
@@ -262,31 +263,6 @@ void CChannel::Set_Frame(_uint iIndex, KEYFRAME& kf)
|
||||
m_KeyFrames[iIndex] = kf;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CChannel::Initialize(HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
_uint iLength = { 0 };
|
||||
if (!ReadFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (!ReadFile(hFile, m_szName, iLength, &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (!ReadFile(hFile, &m_iBoneIndex, sizeof(_int), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (!ReadFile(hFile, &m_iNumKeyFrames, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_KeyFrames.resize(m_iNumKeyFrames);
|
||||
for (_uint i = 0; i < m_iNumKeyFrames; ++i) {
|
||||
if (!ReadFile(hFile, &m_KeyFrames[i], sizeof(KEYFRAME), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel)
|
||||
{
|
||||
strcpy_s(m_szName, pSaveChannel->ChannelName.c_str());
|
||||
|
||||
@@ -255,7 +255,6 @@ HRESULT CModel::Anim_Event(_float fRatio,_uint AnimIndex,function<void()> Event)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CModel::Render(_uint iMeshIndex)
|
||||
{
|
||||
m_Meshes[iMeshIndex]->Bind_Resources();
|
||||
|
||||
@@ -36,7 +36,6 @@ class ENGINE_DLL CChannel : public CBase
|
||||
}
|
||||
_char* Get_Name() { return m_szName; }
|
||||
private:
|
||||
HRESULT Initialize(HANDLE hFile, DWORD& dwByte);
|
||||
// 바이너리
|
||||
HRESULT Initialize(const class CModel* pModel, SaveChannel* pSaveChannel);
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user