[add] 카메라 애니메이션 전환 싱크 추가

This commit is contained in:
kimnuri
2026-01-05 03:57:59 +09:00
parent bf90475aa9
commit 837539b274
4 changed files with 18 additions and 6 deletions
@@ -95,13 +95,14 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
if (bFinish) { if (bFinish) {
m_pBinded_Camera->Sync_Follow(false); m_pBinded_Camera->Sync_Follow(false);
m_pModelCom->Set_AnimationIndex(UINT_MAX); m_pModelCom->Set_AnimationIndex(UINT_MAX);
m_pBinded_Camera->EnableTransition(0.45f);
m_bPlayAnim = false; m_bPlayAnim = false;
} }
_matrix OwnerMatrix = m_pParentTransformCom->Get_XMWorldMatrix(); _matrix OwnerMatrix = m_pParentTransformCom->Get_XMWorldMatrix();
_matrix LookMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("lookat_target")); _matrix LookMatrix = XMLoadFloat4x4(m_pLookAtAnimMatrix);
_matrix CamMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("skt_cam")); _matrix CamMatrix = XMLoadFloat4x4(m_pFollowAnimMatrix);
m_pLookTransform->Set_State(STATE::POSITION, (LookMatrix * OwnerMatrix).r[3]); m_pLookTransform->Set_State(STATE::POSITION, (LookMatrix * OwnerMatrix).r[3]);
m_pFollowTransform->Set_WorldMatrix((CamMatrix * OwnerMatrix)); m_pFollowTransform->Set_WorldMatrix(CamMatrix * OwnerMatrix);
m_pFollowTransform->Set_State(STATE::POSITION, Calc_AnimFollowTargetPos(m_pFollowTransform->Get_State(STATE::POSITION))); m_pFollowTransform->Set_State(STATE::POSITION, Calc_AnimFollowTargetPos(m_pFollowTransform->Get_State(STATE::POSITION)));
m_pBinded_Camera->Sync_Follow(true); m_pBinded_Camera->Sync_Follow(true);
} }
@@ -372,10 +373,10 @@ HRESULT CCamPosition_Shoulder::Ready_Components(void* pArg)
m_pModelCom->Get_BoneMatrixPtr("ctrl_1"); m_pModelCom->Get_BoneMatrixPtr("ctrl_1");
m_pModelCom->Get_BoneMatrixPtr("ctrl_2"); m_pModelCom->Get_BoneMatrixPtr("ctrl_2");
m_pModelCom->Get_BoneMatrixPtr("ctl_shake"); m_pModelCom->Get_BoneMatrixPtr("ctl_shake");
m_pModelCom->Get_BoneMatrixPtr("skt_cam"); m_pFollowAnimMatrix = m_pModelCom->Get_BoneMatrixPtr("skt_cam");
m_pModelCom->Get_BoneMatrixPtr("root"); m_pModelCom->Get_BoneMatrixPtr("root");
m_pModelCom->Get_BoneMatrixPtr("lookat"); m_pModelCom->Get_BoneMatrixPtr("lookat");
m_pModelCom->Get_BoneMatrixPtr("lookat_target"); m_pLookAtAnimMatrix = m_pModelCom->Get_BoneMatrixPtr("lookat_target");
return S_OK; return S_OK;
@@ -82,6 +82,8 @@ class CCamPosition_Shoulder final : public CCamPosition
_bool m_bMovable = { true }; _bool m_bMovable = { true };
const _float4* m_pParentPos = { nullptr }; const _float4* m_pParentPos = { nullptr };
const _float4x4* m_pFollowAnimMatrix = { nullptr };
const _float4x4* m_pLookAtAnimMatrix = { nullptr };
CTransform* m_pLookTransform = { nullptr }; CTransform* m_pLookTransform = { nullptr };
CTransform* m_pFollowTransform = { nullptr }; CTransform* m_pFollowTransform = { nullptr };
CCamPosition_Target* m_pTarget_LookPart = { nullptr }; CCamPosition_Target* m_pTarget_LookPart = { nullptr };
@@ -132,6 +132,13 @@ HRESULT CCamera::Ready_Components(void* pArg)
return S_OK; return S_OK;
} }
void CCamera::EnableTransition(_float fTransitionTime)
{
m_bIsCurrentTransition = true;
m_vTransitionTime.x = 0.f;
m_vTransitionTime.y = fTransitionTime;
}
_bool CCamera::IsImportantThan(CCamera* pOther) const _bool CCamera::IsImportantThan(CCamera* pOther) const
{ {
return m_iPriority > pOther->m_iPriority; return m_iPriority > pOther->m_iPriority;
+2
View File
@@ -40,6 +40,8 @@ class ENGINE_DLL CCamera abstract : public CGameObject
virtual void Late_Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override; virtual HRESULT Render() override;
virtual HRESULT Ready_Components(void* pArg)override; virtual HRESULT Ready_Components(void* pArg)override;
virtual void EnableTransition(_float fTransitionTime);
_bool IsActive() const { return m_bActive; } _bool IsActive() const { return m_bActive; }
_bool IsImportantThan(CCamera* pOther) const; _bool IsImportantThan(CCamera* pOther) const;
const _float* Get_CurrentFar(); const _float* Get_CurrentFar();