[Modify] UI애니메이션 수정
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
#include "ElementObject.h"
|
||||
|
||||
CElementObject::CElementObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUIObject{ pDevice, pContext }
|
||||
: CUIObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CElementObject::CElementObject(const CElementObject& rhs)
|
||||
: CUIObject(rhs)
|
||||
: CUIObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CElementObject::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CElementObject::Initialize(void* pArg)
|
||||
@@ -51,7 +51,7 @@ void CElementObject::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CElementObject::Render()
|
||||
{
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_vector CElementObject::Get_WorldPostion()
|
||||
@@ -66,7 +66,7 @@ void CElementObject::Visible(_bool bVisible)
|
||||
|
||||
_bool CElementObject::Chack_Visible()
|
||||
{
|
||||
if (m_pOwner->Get_Visible() == false )
|
||||
if (m_pOwner->Get_Visible() == false)
|
||||
{
|
||||
m_bVisible = m_pOwner->Get_Visible();
|
||||
}
|
||||
@@ -123,14 +123,56 @@ _float CElementObject::Get_Nine_Slice_Bottom()
|
||||
|
||||
void CElementObject::Start_Lerp(_float fTimeDelta, _bool Alpha)
|
||||
{
|
||||
m_fX = MovDir(m_fCurrent_Position.m128_f32[0], m_vLerp_Position.m128_f32[0], fTimeDelta);
|
||||
m_fY = MovDir(m_fCurrent_Position.m128_f32[1], m_vLerp_Position.m128_f32[1], fTimeDelta);
|
||||
_vector Pos = m_fCurrent_Position;
|
||||
|
||||
_vector Target = m_vLerp_Position;
|
||||
|
||||
_vector Dir = XMVectorSubtract(Target, Pos);
|
||||
_vector LenVec = XMVector3Length(Dir);
|
||||
_float Distance = XMVectorGetX(LenVec);
|
||||
|
||||
_float move = m_fMoveSpeed * fTimeDelta;
|
||||
|
||||
if (Distance <= move)
|
||||
{
|
||||
m_fX = m_vLerp_Position.m128_f32[0];
|
||||
m_fY = m_vLerp_Position.m128_f32[1];
|
||||
m_bLerpOn = false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
XMVECTOR DirNorm = XMVector3Normalize(Dir);
|
||||
m_fX = (Pos + DirNorm * move).m128_f32[0];
|
||||
m_fY = (Pos + DirNorm * move).m128_f32[1];
|
||||
}
|
||||
}
|
||||
|
||||
void CElementObject::Reset_Pos(_float fTimeDelta, _bool Alpha)
|
||||
{
|
||||
m_fX = MovDir(m_fCurrent_Position.m128_f32[0], m_fOrigin_Position.x, fTimeDelta);
|
||||
m_fY = MovDir(m_fCurrent_Position.m128_f32[1], m_fOrigin_Position.y, fTimeDelta);
|
||||
_vector Pos = m_fCurrent_Position;
|
||||
|
||||
_vector Target = XMVectorSet(m_fOrigin_Position.x, m_fOrigin_Position.y, 0.f, 0.f);
|
||||
|
||||
_vector Dir = XMVectorSubtract(Target, Pos);
|
||||
_vector LenVec = XMVector3Length(Dir);
|
||||
_float Distance = XMVectorGetX(LenVec);
|
||||
|
||||
_float move = m_fMoveSpeed * fTimeDelta;
|
||||
|
||||
if (Distance <= move)
|
||||
{
|
||||
m_fX = m_fOrigin_Position.x;
|
||||
m_fY = m_fOrigin_Position.y;
|
||||
m_bLerpOn = false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
XMVECTOR DirNorm = XMVector3Normalize(Dir);
|
||||
m_fX = (Pos + DirNorm * move).m128_f32[0];
|
||||
m_fY = (Pos + DirNorm * move).m128_f32[1];
|
||||
}
|
||||
}
|
||||
|
||||
_vector CElementObject::Get_Lerp_Pos()
|
||||
@@ -145,5 +187,5 @@ HRESULT CElementObject::Ready_Components(void* pArg)
|
||||
|
||||
void CElementObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user