commit
This commit is contained in:
@@ -48,12 +48,14 @@ HRESULT CAccio::Initialize(void* pArg)
|
||||
|
||||
m_pRope_Trail = Get_PartObject<CTrailObject>("Accio_Trail");
|
||||
m_pWandLight = Get_PartObject<CEffectParts>("Wand_Light");
|
||||
m_pRotate0 = Get_PartObject<CEffectParts>("Rotate0");
|
||||
|
||||
if (m_pRope_Trail == nullptr)
|
||||
return E_FAIL;
|
||||
|
||||
SAFE_ADDREF(m_pRope_Trail);
|
||||
SAFE_ADDREF(m_pWandLight);
|
||||
SAFE_ADDREF(m_pRotate0);
|
||||
|
||||
XMStoreFloat4x4(&m_TrailWorld, XMMatrixIdentity());
|
||||
|
||||
@@ -101,6 +103,8 @@ void CAccio::Update(_float fTimeDelta)
|
||||
{
|
||||
/* 특정 대상과 충돌 했다면*/
|
||||
TrailPos.r[3] = m_pEnemyCCT->Get_Position();
|
||||
|
||||
m_pRotate0->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pEnemyCCT->Get_FootPosition());
|
||||
}
|
||||
|
||||
XMStoreFloat4x4(&m_TrailWorld, TrailPos);
|
||||
@@ -111,12 +115,16 @@ void CAccio::Update(_float fTimeDelta)
|
||||
_matrix rotMat = XMMatrixRotationAxis(XMLoadFloat3(&m_vCameraLook), m_fAccRotateTime);
|
||||
|
||||
_float fRange = m_fRange - m_fAccRotateTime / m_fAttenuation;
|
||||
|
||||
|
||||
if (fRange > 0)
|
||||
TrailPos.r[3] += rotMat.r[1] * fRange;
|
||||
}
|
||||
|
||||
m_pRope_Trail->Rope_Trail_Update(TrailPos, pPlayer->Get_WandPos(), fTimeDelta);
|
||||
if(m_isReverse == false)
|
||||
m_pRope_Trail->Rope_Trail_Update(TrailPos, pPlayer->Get_WandPos(), fTimeDelta);
|
||||
else
|
||||
m_pRope_Trail->Rope_Trail_Update(pPlayer->Get_WandPos(), TrailPos, fTimeDelta);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -266,14 +274,23 @@ void CAccio::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
CEffectParts* pCircle = Get_PartObject<CEffectParts>("Accio_Circle");
|
||||
CEffectParts* pWandLight = Get_PartObject<CEffectParts>("Wand_Light");
|
||||
CEffectParts* pSpread_Circle = Get_PartObject<CEffectParts>("Spread_Circle");
|
||||
CEffectParts* pAccio_PT = Get_PartObject<CEffectParts>("Accio_PT");
|
||||
|
||||
|
||||
pCircle->Set_Visible(false);
|
||||
pWandLight->Set_Visible(false);
|
||||
pSpread_Circle->Set_Visible(false);
|
||||
|
||||
|
||||
m_pRotate0->Set_Visible(true);
|
||||
pAccio_PT->Set_Visible(true);
|
||||
|
||||
pAccio_PT->Get_Component<CTransform>()->Set_State(STATE::POSITION, vPos);
|
||||
|
||||
m_pRope_Trail->Get_Component<CTrail>()->Rope_Fix(true);
|
||||
m_pRope_Trail->SetDissolve(true);
|
||||
|
||||
if(m_isDissolve)
|
||||
m_pRope_Trail->SetDissolve(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -283,7 +300,7 @@ void CAccio::Free()
|
||||
|
||||
SAFE_RELEASE(m_pRope_Trail);
|
||||
SAFE_RELEASE(m_pWandLight);
|
||||
|
||||
SAFE_RELEASE(m_pRotate0);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
@@ -295,8 +312,10 @@ void CAccio::Describe_Entity()
|
||||
GUI::DragFloat("Speed", &m_fLinearSpeed);
|
||||
GUI::DragFloat("Range", &m_fRange);
|
||||
GUI::DragFloat("Attenuation", &m_fAttenuation);
|
||||
GUI::Checkbox("Dissolve", &m_isDissolve);
|
||||
GUI::Checkbox("Reverse", &m_isReverse);
|
||||
GUI::InputInt("LoopTime", &m_iLoopTime);
|
||||
|
||||
|
||||
m_pRope_Trail->Describe_Entity();
|
||||
m_pRope_Trail->Get_Component<CTrail>()->Describe_Entity();
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ void CEffectPool::Priority_Update(_float fTimeDelta)
|
||||
|
||||
(*m_EffectList[ENUM_CLASS(SKILL_TYPE::ACCIO)].begin())->Describe_Entity();
|
||||
|
||||
|
||||
Describe_Entity();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -517,6 +517,34 @@ HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner, void* pArg
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CEffectPool::Reset_Pool()
|
||||
{
|
||||
for (size_t i = 0; i < ENUM_CLASS(SKILL_TYPE::END); i++)
|
||||
{
|
||||
for (auto& pEffect : m_EffectList[i])
|
||||
{
|
||||
SAFE_RELEASE(pEffect);
|
||||
}
|
||||
|
||||
m_EffectList[i].clear();
|
||||
}
|
||||
|
||||
for (auto& pEffect : m_ActiveEffectList)
|
||||
{
|
||||
SAFE_RELEASE(pEffect);
|
||||
}
|
||||
|
||||
|
||||
m_ActiveEffectList.clear();
|
||||
|
||||
|
||||
if (FAILED(Ready_Effect()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
CEffectPool* CEffectPool::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
@@ -567,6 +595,14 @@ void CEffectPool::Free()
|
||||
|
||||
void CEffectPool::Describe_Entity()
|
||||
{
|
||||
|
||||
GUI::Begin("Effect Pool");
|
||||
if (GUI::Button("Reset Pool"))
|
||||
{
|
||||
Reset_Pool();
|
||||
}
|
||||
GUI::End();
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -39,19 +39,24 @@ class CAccio final : public CEffect_Container
|
||||
|
||||
class CTrailObject* m_pRope_Trail = { nullptr };
|
||||
class CEffectParts* m_pWandLight = { nullptr };
|
||||
class CEffectParts* m_pRotate0 = { nullptr };
|
||||
|
||||
_float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치
|
||||
_float4 m_vTargetPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 타게팅 된 위치
|
||||
_float m_fLinearSpeed = 1.5f;
|
||||
_float m_fLinearSpeed = 1.f;
|
||||
_float3 m_vCameraLook = {};
|
||||
|
||||
_float4x4 m_TrailWorld = {};
|
||||
CCharacter_Controller* m_pEnemyCCT = { nullptr };
|
||||
CCharacter_Controller* m_pEnemyCCT = { nullptr };
|
||||
|
||||
_float m_fAccRotateTime = {};
|
||||
_float m_fTurnSpeed = { 65.f };
|
||||
_float m_fRange = { 1.3f };
|
||||
_float m_fAttenuation = { 35.f };
|
||||
_float m_fRange = { 1.f };
|
||||
_float m_fAttenuation = { 100.f };
|
||||
_bool m_isDissolve = { true };
|
||||
_bool m_isReverse = { false };
|
||||
_int m_iLoopTime = { 5 };
|
||||
|
||||
|
||||
public:
|
||||
static CAccio* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -27,6 +27,9 @@ class CEffectPool final : public CGameObject
|
||||
public:
|
||||
HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function<class CEffect_Container*(_uint , _uint)> AddPrototypeEvent);
|
||||
HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner, void* pArg = nullptr);
|
||||
#ifdef _DEBUG
|
||||
HRESULT Reset_Pool();
|
||||
#endif
|
||||
private:
|
||||
list<class CEffect_Container*> m_EffectList[ENUM_CLASS(SKILL_TYPE::END)] = {};
|
||||
list<class CEffect_Container*> m_ActiveEffectList = {};
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -262,7 +262,7 @@ vector Draw_Trail(PS_IN In)
|
||||
|
||||
if (g_isDissolve)
|
||||
{
|
||||
vMtrlDiffuse.a *= g_vDissolveTime.x / g_vDissolveTime.y;
|
||||
vMtrlDiffuse.a *= saturate((0.96f - g_vDissolveTime.x / g_vDissolveTime.y));
|
||||
}
|
||||
|
||||
return vMtrlDiffuse;
|
||||
|
||||
@@ -221,16 +221,19 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix)
|
||||
|
||||
void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float fDamping, _float fLength , _float fMass , _fmatrix EndWorldMatrix)
|
||||
{
|
||||
|
||||
if (m_isFix == false)
|
||||
{
|
||||
if (m_iNumCount > 2)
|
||||
{
|
||||
memmove(m_pVertices + 2, m_pVertices, sizeof(VTXPOSTEX) * (m_iNumCount - 2));
|
||||
memmove(m_pOldPosition + 2, m_pOldPosition, sizeof(_float3) * (m_iNumCount - 2));
|
||||
}
|
||||
|
||||
if (m_iNumCount >= m_iNumVertices)
|
||||
m_iNumCount -= 2;
|
||||
}
|
||||
|
||||
|
||||
m_pOldPosition[0] = m_pVertices[0].vPosition;
|
||||
m_pOldPosition[1] = m_pVertices[1].vPosition;
|
||||
|
||||
@@ -265,6 +268,9 @@ void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float f
|
||||
XMStoreFloat3(&m_pVertices[m_iNumCount - 2].vPosition, vEndLow);
|
||||
XMStoreFloat3(&m_pVertices[m_iNumCount - 1].vPosition, vEndHigh);
|
||||
|
||||
m_pOldPosition[m_iNumCount - 2] = m_pVertices[m_iNumCount - 2].vPosition;
|
||||
m_pOldPosition[m_iNumCount - 1] = m_pVertices[m_iNumCount - 1].vPosition;
|
||||
|
||||
for (_uint i = 2; i < m_iNumCount; i++) /* 고정점은 연산에서 제외 0 , 1*/
|
||||
{
|
||||
|
||||
@@ -293,7 +299,7 @@ void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float f
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
for (_uint k = 0; k < m_iNumCount - 2; k += 2) {
|
||||
|
||||
/* Low , High */
|
||||
@@ -316,14 +322,14 @@ void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float f
|
||||
_float fLowDiff = (fLength - fLowDist) / fLowDist;
|
||||
_float fHighDiff = (fLength - fHighDist) / fHighDist;
|
||||
|
||||
// 각 점을 절반씩 밀거나 당겨서 거리 맞춤
|
||||
// 각 점을 절반씩 밀거나 당겨서 거리 맞춤
|
||||
// 손잡이(Pinned)는 움직이지 않도록 질량 비율 조절 가능 (여기선 0.5씩)
|
||||
|
||||
_vector vLowOffset = vDeltaLow * (fMass * fLowDiff);
|
||||
_vector vHighOffset = vDeltaHigh * (fMass * fHighDiff);
|
||||
|
||||
// k!=0 (즉, 움직이는 마디)일 때만 vFirst를 움직임
|
||||
if (k != 0)
|
||||
if (k != 0)
|
||||
{
|
||||
vFirst[0] -= vLowOffset;
|
||||
vFirst[1] -= vHighOffset;
|
||||
@@ -344,10 +350,18 @@ void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float f
|
||||
vNext[1] += vHighOffset;
|
||||
}
|
||||
|
||||
if (k == m_iNumCount - 4)
|
||||
{
|
||||
|
||||
vFirst[0] -= vLowOffset;
|
||||
vFirst[1] -= vHighOffset;
|
||||
}
|
||||
|
||||
// --- 3. 결과 저장 ---
|
||||
|
||||
// vFirst 저장 (k=0 일 때는 vFirst가 vLow/vHigh의 값을 가지지만,
|
||||
// 움직이지 않았으므로 저장해도 무방. 하지만 명확성을 위해 조건부 저장 가능)
|
||||
|
||||
if (k != 0)
|
||||
{
|
||||
XMStoreFloat3(&m_pVertices[k].vPosition, vFirst[0]);
|
||||
@@ -360,6 +374,9 @@ void CTrail::Rope_Trail_Update(_fmatrix WorldMatrix, _float fTimeDelta, _float f
|
||||
}
|
||||
}
|
||||
|
||||
XMStoreFloat3(&m_pVertices[m_iNumCount - 2].vPosition, vEndLow);
|
||||
XMStoreFloat3(&m_pVertices[m_iNumCount - 1].vPosition, vEndHigh);
|
||||
|
||||
for (_uint i = 0; i < m_iNumCount; i += 2)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user