수정중
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user