수정중

This commit is contained in:
hyunbin14
2025-12-28 10:05:40 +09:00
parent 2fea8569eb
commit 6b83edfcd9
10 changed files with 69 additions and 19 deletions
+4 -2
View File
@@ -160,9 +160,11 @@ void CRanrok::Late_Update(_float fTimeDelta)
if (!m_pFSM->IsEnable(FSMSTATE::TUCKED))
{
if (true == m_bLookAt) {
/* if (true == m_bLookAt) {
m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f);
}
}*/
m_pModelCom->Set_TargetPos((XMLoadFloat4(&m_vTargetPos)));
}
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
@@ -111,7 +111,6 @@ HRESULT CRanrok_FireBall::Pre_Setting(CGameObject* pObject, void* pArg)
m_pFireBall->Set_Visible(true);
m_pFireBall_PT->Set_Visible(true);
m_pFireBall_Surface->Set_Visible(true);
m_pFireBall_Tail->Set_Visible(true);
/* 초기 객체 위치 초기화*/
@@ -132,7 +131,6 @@ HRESULT CRanrok_FireBall::Pre_Setting(CGameObject* pObject, void* pArg)
m_pFireBall->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_PT->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_Surface->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_Tail->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
/* 플레이어 위치 받기 */
@@ -292,12 +292,12 @@ void CRanrok::Behavior_FireBreathEnter()
Add_Event(pairAnimInfo.first,
[&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_A];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)]; },
m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)];},
0.95f);
Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first,
[&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); },
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);},
0.95f);
}
else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND))
@@ -405,10 +405,10 @@ void CRanrok::Behavior_FireBallEnter()
break;
}
Add_Event(pairAnimInfo.first,
/*Add_Event(pairAnimInfo.first,
[this]() {
m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_FIREBALL, this);
}, 0.1f);
}, 0.1f);*/
}
else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND))
@@ -42,7 +42,12 @@ cbuffer AnimCB : register(b0)
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
int HeadBoneIndex;
float HeadAimWeight;
float paddding1;
float3 TargetDir_Local;
float padding;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
@@ -315,8 +320,6 @@ row_major float4x4 SampleBlendedLocal(uint bone)
prevT = CurrentTime;
}
SampleLocalTRS_Prev(bone, prevT, sA, rA, tA);
SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB);
@@ -24,7 +24,12 @@ cbuffer AnimCB : register(b0)
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
int HeadBoneIndex;
float HeadAimWeight;
float paddding1;
float3 TargetDir_Local;
float padding;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
@@ -42,7 +42,12 @@ cbuffer AnimCB : register(b0)
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
int HeadBoneIndex;
float HeadAimWeight;
float paddding1;
float3 TargetDir_Local;
float padding;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
@@ -315,8 +320,6 @@ row_major float4x4 SampleBlendedLocal(uint bone)
prevT = CurrentTime;
}
SampleLocalTRS_Prev(bone, prevT, sA, rA, tA);
SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB);
@@ -329,6 +332,8 @@ row_major float4x4 SampleBlendedLocal(uint bone)
T = 0;
R = RootInitRot;
}
return MakeAffine(S, R, T);
}
@@ -24,7 +24,12 @@ cbuffer AnimCB : register(b0)
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
int HeadBoneIndex;
float HeadAimWeight;
float paddding1;
float3 TargetDir_Local;
float padding;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
+23
View File
@@ -1341,6 +1341,10 @@ void CModel::InItialize_BoneIndex()
{
m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)] = i;
}
if (m_Bones[i]->Compare_Name("head"))
{
m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)] = i;
}
}
}
@@ -1685,6 +1689,8 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex)
void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex)
{
D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {};
auto* anim = m_Animations[AnimIndex];
@@ -1702,6 +1708,23 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex)
pDesc->PrevTime = m_Animations[m_iPreAnimIndex]->Get_CurrentTrackPosition();
pDesc->BlendRatio = m_fRatio;
pDesc->RootBoneIndex = m_iRootBoneIndex;
pDesc->HeadBoneIndex = m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)];
pDesc->HeadAimWeight = 1.f;
pDesc->paddding1 = 0.f;
if (m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)] != -1)
{
_vector dirWS = XMVector3Normalize(m_vTargetPos - m_pTransform->Get_State(STATE::POSITION));
_matrix worldInv = m_pTransform->Get_WorldMatrixInv();
_vector dirLocal =XMVector3Normalize(XMVector3TransformNormal(dirWS, worldInv));
XMStoreFloat3(&pDesc->TargetDir_Local, dirLocal);
}
else {
pDesc->TargetDir_Local = _float3(0.f, 0.f, 0.f);
}
pDesc->padding = 0.f;
pDesc->PreTransformMatrix = m_PreTransformMatrix;
pDesc->RootInitRot = m_vInitialRootRot;
m_pContext->Unmap(m_pConstantBuffer, 0);
+1 -1
View File
@@ -8,7 +8,7 @@ enum class COLLIDER { AABB, OBB, SPHERE, END };
enum class RENDER {PRIORITY, SHADOW_NEAR, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, DISTORTION, BULR_MESH ,UI, OCCLUSION, SHADOW_MIDDLE, PRESHADOW, UI_OVERLAY ,END };
enum class RAY { LOCAL, WORLD, END };
enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END };
enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END};
enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,HEAD,END};
enum class STAT { NAME, CURRENTHP, MAXHP, TARGETHP, MELEE, MAGIC, DEFENSE, SPEED, AGILITY, LEVEL, EXPERIENCE, MAX_EXPERIENCE, GOLD, END };
//enum class CONDITION { POISON, HPREGENERATION, PANIC, GRAP, END };
enum class SHADOW : _ubyte {
+11 -2
View File
@@ -20,7 +20,12 @@ class ENGINE_DLL CModel final : public CComponent
_float BlendRatio;
_int RootBoneIndex;
_float3 padding;
_int HeadBoneIndex;
_float HeadAimWeight;
_float paddding1;
_float3 TargetDir_Local;
_float padding;
_float4x4 PreTransformMatrix;
_float4 RootInitRot;
@@ -43,6 +48,8 @@ class ENGINE_DLL CModel final : public CComponent
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
MODEL Get_Type() { return m_eType; }
void Set_Temp(_bool Temp) { m_bTemp = Temp; }
void Set_TargetPos(_vector vTargetPos) { m_vTargetPos = vTargetPos; }
void Set_HeadPos(_vector vHeadPos) { m_vHeadPos = vHeadPos; }
#pragma endregion
#pragma region Animation
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌
@@ -164,7 +171,7 @@ class ENGINE_DLL CModel final : public CComponent
_float m_fRatio = {};
_int m_iCurrSecondAnimIndex = { -1 };
_int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 };
_int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1,-1 };
vector<vector<_uint>> m_BoneMask;
vector<_bool> m_CPUBoneMask;
@@ -195,6 +202,8 @@ class ENGINE_DLL CModel final : public CComponent
_bool m_bRootBone = {};
_float4x4 m_RootMatrix = {};
_bool m_bTemp = {false};
_vector m_vTargetPos = XMVectorZero();
_vector m_vHeadPos = XMVectorZero();
private: