Merge branch 'Develope' into Bloom
This commit is contained in:
@@ -189,12 +189,11 @@ void CChannel::Update_TransformationMatirx(
|
||||
_float dz = XMVectorGetZ(vDeltaAdjusted);
|
||||
|
||||
_vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy);
|
||||
if (fabsf(dx) < FLT_EPSILON3 && fabsf(dy) < FLT_EPSILON3 && fabsf(dz) < FLT_EPSILON3) {
|
||||
int a = 0;
|
||||
}
|
||||
vDeltaWorld *= 0.01f;
|
||||
vDeltaWorld *= m_fAmount;
|
||||
|
||||
|
||||
|
||||
vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f);
|
||||
//pTransform->Set_State(STATE::POSITION,vDeltaWorld);
|
||||
pTransform->AccumulateMomentum(vDeltaWorld);
|
||||
@@ -202,7 +201,7 @@ void CChannel::Update_TransformationMatirx(
|
||||
m_vPrevRootPos = vCurRootPos;
|
||||
vTranslation = XMVectorZero();
|
||||
|
||||
_float4 curRotF4;
|
||||
_float4 curRotF4;
|
||||
XMStoreFloat4(&curRotF4, vRotation);
|
||||
_vector qCur = XMLoadFloat4(&curRotF4);
|
||||
|
||||
@@ -227,11 +226,9 @@ void CChannel::Update_TransformationMatirx(
|
||||
|
||||
_float4 axis;
|
||||
XMStoreFloat4(&axis, axisWorld);
|
||||
|
||||
swap(axis.z, axis.y);
|
||||
|
||||
|
||||
if (angle > 0 )
|
||||
pTransform->TurnAngle(XMLoadFloat4(&axis), angle);
|
||||
pTransform->TurnAngle(XMLoadFloat4(&axis), angle);
|
||||
}
|
||||
|
||||
XMStoreFloat4(&m_vPrevRootRot, qCur);
|
||||
|
||||
@@ -206,10 +206,7 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char
|
||||
}
|
||||
else
|
||||
Value = strText.substr(iBeginIndex, iEndIndex - iBeginIndex);
|
||||
|
||||
strcpy_s(szTextureFilePath, pTextureFolderPath);
|
||||
strcat_s(szTextureFilePath, Value.c_str());
|
||||
|
||||
|
||||
// name
|
||||
iBeginIndex = (_uint)strText.find_last_of('_');
|
||||
iEndIndex = (_uint)strText.rfind('\'');
|
||||
@@ -220,7 +217,7 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char
|
||||
getline(file, strText);
|
||||
|
||||
// Add Texture
|
||||
if (FAILED(Add_Texture(szTextureFilePath, Type))){
|
||||
if (FAILED(Add_Texture(("C:/MeshTable" + Value).c_str(), Type))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,9 +124,15 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex];
|
||||
CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex];
|
||||
|
||||
//_bool bPreFinished = pPreAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
|
||||
_bool bCurFinished;
|
||||
|
||||
if (m_bRatio) {
|
||||
bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount * fRatio);
|
||||
}
|
||||
else {
|
||||
bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
|
||||
}
|
||||
|
||||
_bool bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
|
||||
|
||||
pCurAnim->InterpAnim(pPreAnim, m_Bones, fRatio);
|
||||
|
||||
@@ -136,6 +142,7 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
{
|
||||
m_iPreAnimIndex = m_iCurrentAnimIndex;
|
||||
m_fBlendTime = 0.f;
|
||||
m_bRatio = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -153,7 +160,7 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
|
||||
return m_bIsFinishedAnim;
|
||||
}
|
||||
|
||||
void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount)
|
||||
void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount,_bool bRatio)
|
||||
{
|
||||
if (m_iCurrentAnimIndex == iIndex){
|
||||
return;
|
||||
@@ -163,6 +170,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount)
|
||||
m_iCurrentAnimIndex = iIndex;
|
||||
m_bIsLoop = isLoop;
|
||||
m_fAmount = fAmount;
|
||||
m_bRatio = bRatio;
|
||||
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
|
||||
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
|
||||
}
|
||||
@@ -235,6 +243,18 @@ void CModel::Set_AnimSpeed(_float fSpeed)
|
||||
m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed);
|
||||
}
|
||||
|
||||
HRESULT CModel::Anim_Event(_float fRatio,_uint AnimIndex,function<void()> Event)
|
||||
{
|
||||
if (AnimIndex == m_iCurrentAnimIndex)
|
||||
{
|
||||
if (m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackProgressRatio() >= fRatio)
|
||||
{
|
||||
Event();
|
||||
}
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CModel::Render(_uint iMeshIndex)
|
||||
{
|
||||
|
||||
@@ -230,8 +230,9 @@ void CTransform::TurnAngle(_vector vAxis, _float fAngle)
|
||||
_vector vRight = Get_State(STATE::RIGHT);
|
||||
_vector vUp = Get_State(STATE::UP);
|
||||
_vector vLook = Get_State(STATE::LOOK);
|
||||
if (vAxis.m128_f32[0] == 0&&
|
||||
vAxis.m128_f32[1] == 0&&
|
||||
|
||||
if (vAxis.m128_f32[0] == 0 &&
|
||||
vAxis.m128_f32[1] == 0 &&
|
||||
vAxis.m128_f32[2] == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ class ENGINE_DLL CAnimation : public CBase
|
||||
virtual ~CAnimation() = default;
|
||||
public:
|
||||
_bool Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr, _float m_fAmount = 1.f);
|
||||
void Reset();
|
||||
void ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount);
|
||||
void ProgressAnimation(const vector<CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount);
|
||||
void ResetRootMotion();
|
||||
void Depart_Animation();
|
||||
void Set_AnimPause(_bool bValue) { m_bPause = bValue; }
|
||||
|
||||
@@ -18,8 +18,9 @@ enum ESTATE : _u64Flag
|
||||
SPELL = 1ULL << 11,
|
||||
SKILL = 1ULL << 12,
|
||||
SKILL2 = 1ULL << 13,
|
||||
MAPHELP = 1ULL << 14,
|
||||
STOP = 1ULL << 15,
|
||||
ANCIENT_THROW = 1ULL << 14,
|
||||
MAPHELP = 1ULL << 15,
|
||||
STOP = 1ULL << 16,
|
||||
END
|
||||
};
|
||||
NS_END
|
||||
|
||||
@@ -32,8 +32,8 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
#pragma endregion
|
||||
#pragma region Animation
|
||||
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f);
|
||||
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr ); // 애니메이션에 델타타임을 넣어줌
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false);
|
||||
_bool IsFinishedAnim() const { return m_bIsFinishedAnim; }
|
||||
_bool IsLoopAnim() const { return m_bIsLoop; }
|
||||
void Set_CurrentTrackPosition(_float TrackPosition);
|
||||
@@ -47,6 +47,8 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
_int Get_AnimIndex() const { return m_iCurrentAnimIndex; }
|
||||
_float Get_AnimSpeed();
|
||||
void Set_AnimSpeed(_float fSpeed);
|
||||
|
||||
HRESULT Anim_Event(_float fRatio, _uint AnimIndex, function<void()> Event);
|
||||
#pragma endregion
|
||||
#pragma region Mesh
|
||||
const _char* Get_MeshName(_uint iIndex);
|
||||
@@ -111,7 +113,7 @@ void Combined_BoneMatrix();
|
||||
_bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지
|
||||
_bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지
|
||||
_bool m_bPlayAnim = { true };
|
||||
_float m_fAmount = { 1.f };
|
||||
_float m_fAmount = { 1.f };
|
||||
|
||||
_int m_iPreAnimIndex = { 0 };
|
||||
_float m_fBlendTime = { 0.f };
|
||||
@@ -135,6 +137,7 @@ void Combined_BoneMatrix();
|
||||
//
|
||||
|
||||
vector<_float4x4> m_BoneMatrix;
|
||||
_bool m_bRatio = { false };
|
||||
|
||||
|
||||
#pragma region Compute
|
||||
@@ -146,6 +149,7 @@ void Combined_BoneMatrix();
|
||||
void Create_LocalPosVB();
|
||||
void Create_Con();
|
||||
void UpdateAnimationCS();
|
||||
|
||||
_uint m_iNumBuffer = {};
|
||||
|
||||
vector<PARENT_DESC> m_Parent = {};
|
||||
|
||||
@@ -13,7 +13,8 @@ enum ESTATE
|
||||
LAND,
|
||||
DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT,
|
||||
COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2,
|
||||
ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT,
|
||||
MAPHELP,
|
||||
ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW,
|
||||
HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R,
|
||||
KNOCKDOWN, KNOCKDOWN_FWD, KNOCKDOWN_FWD_SPLT, KNOCKDOWN_FWD_SPLT_HOLD, KNOCKDOWN_BWD, KNOCKDOWN_BWD_SPLT, KNOCKDOWN_BWD_SPLT_HOLD,
|
||||
GETUP, GETUP_BWD, GETUP_FWD, GETUP_L, GETUP_L_FD, GETUP_L_FU, GETUP_R, GETUP_R_FD, GETUP_R_FU, GETUP_SLOUCH,
|
||||
@@ -22,7 +23,6 @@ enum ESTATE
|
||||
TUMBLE, TUMBLE2,
|
||||
PETRIFICUSED_START,
|
||||
|
||||
MAPHELP,
|
||||
END
|
||||
};
|
||||
NS_END
|
||||
|
||||
Reference in New Issue
Block a user