@@ -38,6 +38,7 @@ struct ParticleValue
|
||||
|
||||
float fSizeDrag;
|
||||
float3 vDeltaSize;
|
||||
float2 vDelay;
|
||||
};
|
||||
|
||||
|
||||
@@ -79,6 +80,17 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
particleValue.vDelay.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDelay.x < particleValue.vDelay.y)
|
||||
{
|
||||
|
||||
g_VBInstanceOutput[iIndex] = particle;
|
||||
g_ParticleValueOutput[iIndex] = particleValue;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
|
||||
@@ -97,7 +109,7 @@ void CS_MAIN(
|
||||
|
||||
particle.vLifeTime.x = 0.f;
|
||||
particleValue.vAniIndex.x = 0.f;
|
||||
|
||||
particleValue.vDelay.x = 0.f;
|
||||
|
||||
g_VBInstanceOutput[iIndex] = particle;
|
||||
g_ParticleValueOutput[iIndex] = particleValue;
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Bombard.h" />
|
||||
<ClInclude Include="..\Public\Broom.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h" />
|
||||
@@ -174,8 +175,13 @@
|
||||
<ClInclude Include="..\Public\Client_Define.h" />
|
||||
<ClInclude Include="..\Public\Client_Enum.h" />
|
||||
<ClInclude Include="..\Public\Client_Macro.h" />
|
||||
<ClInclude Include="..\Public\PhysXEffectHitBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXWall.h" />
|
||||
<ClInclude Include="..\Public\EffectParts.h" />
|
||||
<ClInclude Include="..\Public\EffectObject.h" />
|
||||
<ClInclude Include="..\Public\Effect_Container.h" />
|
||||
<ClInclude Include="..\Public\NomalJap.h" />
|
||||
<ClInclude Include="..\Public\SkyBox.h" />
|
||||
<ClInclude Include="..\Public\InfoInstance.h" />
|
||||
<ClInclude Include="..\Public\Level_Field.h" />
|
||||
@@ -197,6 +203,7 @@
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\Public\TrailObject.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
<ClInclude Include="Client.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
@@ -204,6 +211,7 @@
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Bombard.cpp" />
|
||||
<ClCompile Include="..\Private\Broom.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp" />
|
||||
@@ -215,11 +223,17 @@
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp" />
|
||||
<ClCompile Include="..\Private\PhysXEffectHitBox.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Socket.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Target.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXWall.cpp" />
|
||||
<ClCompile Include="..\Private\EffectParts.cpp" />
|
||||
<ClCompile Include="..\Private\EffectObject.cpp" />
|
||||
<ClCompile Include="..\Private\Effect_Container.cpp" />
|
||||
<ClCompile Include="..\Private\NomalJap.cpp" />
|
||||
<ClCompile Include="..\Private\Player_States.cpp" />
|
||||
<ClCompile Include="..\Private\SkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\InfoInstance.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Field.cpp" />
|
||||
@@ -245,6 +259,7 @@
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\Private\TrailObject.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -73,9 +73,6 @@
|
||||
<ClInclude Include="..\Public\CamPosition.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Cameras</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\SkyBox.h">
|
||||
<Filter>02.GameObjects\SkyBox</Filter>
|
||||
</ClInclude>
|
||||
@@ -127,6 +124,27 @@
|
||||
<ClInclude Include="..\Public\State_Move.h">
|
||||
<Filter>04.Mechanic\State\Movement\Move</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Effect_Container.h">
|
||||
<Filter>02.GameObjects\Effect\Effect_Container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\EffectParts.h">
|
||||
<Filter>02.GameObjects\Effect\EffectParts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\EffectObject.h">
|
||||
<Filter>02.GameObjects\Effect\EffectObject</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\TrailObject.h">
|
||||
<Filter>02.GameObjects\Effect\TrailObject</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Bombard.h">
|
||||
<Filter>02.GameObjects\Effect\Effects\Bombard</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\NomalJap.h">
|
||||
<Filter>02.GameObjects\Effect\Effects\NomalJap</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\PhysXEffectHitBox.h">
|
||||
<Filter>02.GameObjects\PhysX\EffectHitBox</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Socket.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Socket</Filter>
|
||||
</ClInclude>
|
||||
@@ -136,6 +154,9 @@
|
||||
<ClInclude Include="..\Public\CamPosition_Shoulder.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -329,6 +350,33 @@
|
||||
<Filter Include="04.Mechanic\State\Movement\Move">
|
||||
<UniqueIdentifier>{0a3f9629-27d1-411c-806e-b550af8f1ca1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect">
|
||||
<UniqueIdentifier>{23fc95c4-0db3-4569-bd37-4d9bc32938ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effect_Container">
|
||||
<UniqueIdentifier>{a88b2e75-92f7-4bed-b12a-76fb8763f533}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\EffectParts">
|
||||
<UniqueIdentifier>{482050d0-23dc-4744-b0db-0673a84f40e7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\EffectObject">
|
||||
<UniqueIdentifier>{129abdf3-e499-467e-aca8-917e66827890}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\TrailObject">
|
||||
<UniqueIdentifier>{b3077955-b37e-41f8-bb7a-7b1483fcecdc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effects">
|
||||
<UniqueIdentifier>{6fc43376-8b17-4888-b347-9beef7bee2ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effects\Bombard">
|
||||
<UniqueIdentifier>{3a613328-d01e-43e5-a095-9a6912cb3cf0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effects\NomalJap">
|
||||
<UniqueIdentifier>{639cba10-a93e-465c-a921-4541fe317446}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\EffectHitBox">
|
||||
<UniqueIdentifier>{54169d8d-f771-4638-a71e-3aca3eeff9bb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition\Player\Target">
|
||||
<UniqueIdentifier>{1f9c16e8-b675-419f-b166-b79662407259}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -338,6 +386,9 @@
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition\Socket">
|
||||
<UniqueIdentifier>{2e4f0394-e25c-4508-937a-7e73d005ae5f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\Camera_Gaze">
|
||||
<UniqueIdentifier>{470c4db5-b306-4fb8-8338-0a99ac77ac89}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -397,9 +448,6 @@
|
||||
<ClCompile Include="..\Private\CamPosition.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Cameras</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\SkyBox.cpp">
|
||||
<Filter>02.GameObjects\SkyBox</Filter>
|
||||
</ClCompile>
|
||||
@@ -451,6 +499,27 @@
|
||||
<ClCompile Include="..\Private\State_Move.cpp">
|
||||
<Filter>04.Mechanic\State\Movement\Move</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Effect_Container.cpp">
|
||||
<Filter>02.GameObjects\Effect\Effect_Container</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\EffectParts.cpp">
|
||||
<Filter>02.GameObjects\Effect\EffectParts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\EffectObject.cpp">
|
||||
<Filter>02.GameObjects\Effect\EffectObject</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\TrailObject.cpp">
|
||||
<Filter>02.GameObjects\Effect\TrailObject</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Bombard.cpp">
|
||||
<Filter>02.GameObjects\Effect\Effects\Bombard</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\NomalJap.cpp">
|
||||
<Filter>02.GameObjects\Effect\Effects\NomalJap</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\PhysXEffectHitBox.cpp">
|
||||
<Filter>02.GameObjects\PhysX\EffectHitBox</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Socket.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Socket</Filter>
|
||||
</ClCompile>
|
||||
@@ -460,6 +529,12 @@
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player_States.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
#include "pch.h"
|
||||
#include "Bombard.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "EffectParts.h"
|
||||
#include "PhysXEffectHitBox.h"
|
||||
|
||||
|
||||
CBombard::CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CEffect_Container{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CBombard::CBombard(const CBombard& rhs)
|
||||
: CEffect_Container(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CBombard::Initialize_Prototype()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
|
||||
HRESULT CBombard::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Bombard/")))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_wstrEffectName = L"Bombard";
|
||||
|
||||
CPartObject* pShootPt = Get_PartObject<CEffectParts>("Bombard_Shoot_Pt");
|
||||
m_pLight_Projectile = Get_PartObject<CEffectParts>("Bombard_Projectile");
|
||||
CPartObject* pCircle0 = Get_PartObject<CEffectParts>("Bombard_Circle0");
|
||||
|
||||
pShootPt->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
m_pLight_Projectile->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
pCircle0->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
pCircle0->Set_Visible(true);
|
||||
pShootPt->Set_Visible(true);
|
||||
m_pLight_Projectile->Set_Visible(true);
|
||||
|
||||
SAFE_ADDREF(m_pLight_Projectile);
|
||||
m_fDuration = 2.5f;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CBombard::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CBombard::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
Update_Event(fTimeDelta);
|
||||
|
||||
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
|
||||
m_pLight_Projectile->Get_Component<CTransform>()->Translation(vOwnerLook * 2.f);
|
||||
}
|
||||
|
||||
void CBombard::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
|
||||
}
|
||||
|
||||
HRESULT CBombard::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBombard::Ready_Child()
|
||||
{
|
||||
CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{};
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
|
||||
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
Desc.iSubKind = 70;
|
||||
Desc.vDeltaPos = { 0.f, 0.f, 2.f };
|
||||
Desc.vLifeTime = { 0.f, 2.f };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPhysXEffectHitBox>(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CBombard* CBombard::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CBombard* pInstance = new CBombard(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CBombard");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
||||
CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CBombard* pInstance = new CBombard(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CBombard");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CBombard::OnCollision(CGameObject* pOther , void* pDesc)
|
||||
{
|
||||
//CTransform* pOtherTransform = p
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
|
||||
for (auto& pPair : m_PartObjects)
|
||||
{
|
||||
pPair.second->Set_Visible(true);
|
||||
pPair.second->Get_Component<CTransform>()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos);
|
||||
}
|
||||
|
||||
|
||||
m_pLight_Projectile->Set_Visible(false);
|
||||
Get_PartObject<CEffectParts>("Bombard_Shoot_Pt")->Set_Visible(false);
|
||||
|
||||
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
Get_PartObject<CEffectParts>("Bombard_Smoke")->Get_Component<CTransform>()->Translation(vOwnerLook);
|
||||
|
||||
Get_PartObject<CEffectParts>("Bombard_Circle0")->Set_Visible(false);
|
||||
|
||||
m_pPhysHitBox->Set_Dead();
|
||||
}
|
||||
|
||||
void CBombard::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
//if(m_pPhysHitBox != nullptr)
|
||||
// if (m_pPhysHitBox->Get_Depth() == false)
|
||||
// SAFE_RELEASE(m_pPhysHitBox);
|
||||
|
||||
SAFE_RELEASE(m_pLight_Projectile);
|
||||
|
||||
}
|
||||
|
||||
void CBombard::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CBombard::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,18 +38,6 @@ void CBroom::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CBroom::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
static _uint m_iIndex = 0;
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_1))
|
||||
m_iIndex++;
|
||||
if (m_pGameInstance->Key_Down(DIK_2))
|
||||
m_iIndex--;
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(m_iIndex);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,12 @@ HRESULT CCamPosition_Shoulder::Initialize(void* pArg)
|
||||
m_vAccDegreeXY = { 0.f, 0.f };
|
||||
m_fCameraFocalLength = pDesc->fCameraFocalLength;
|
||||
m_fBackFrontRatio = pDesc->fBackFrontRatio;
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)) * m_fShoulderDistance);
|
||||
|
||||
m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio = pDesc->vInitialLook;
|
||||
m_vShoulderStartRatio.x *= -1.f;
|
||||
m_pTransformCom->Set_State(STATE::POSITION,
|
||||
m_pParentTransformCom->Get_State(STATE::POSITION)
|
||||
+ XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)) * m_fShoulderDistance);
|
||||
|
||||
_vector vShoulderPos = Get_WorldPostion();
|
||||
_vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f);
|
||||
@@ -56,6 +60,9 @@ HRESULT CCamPosition_Shoulder::Initialize(void* pArg)
|
||||
|
||||
void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bMovable) {
|
||||
m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor;
|
||||
m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor;
|
||||
@@ -80,6 +87,12 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_O)) {
|
||||
m_pBinded_Camera->Toggle_Priority();
|
||||
}
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
Describe_Entity();
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
@@ -88,13 +101,28 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
m_pGameInstance->Toggle_MouseCenter();
|
||||
}
|
||||
if (m_pGameInstance->Key_Up(DIK_P)) {
|
||||
m_vShoulderPosRatio.x *= -1.f;
|
||||
m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio;
|
||||
m_vShoulderStartRatio.x *= -1.f;
|
||||
m_bLerp = true;
|
||||
m_vLerpTimer.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CCamPosition_Shoulder::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bLerp) {
|
||||
m_vLerpTimer.x += fTimeDelta;
|
||||
XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTimer.x / m_vLerpTimer.y));
|
||||
if (m_vLerpTimer.x > m_vLerpTimer.y) {
|
||||
m_bLerp = false;
|
||||
m_vLerpTimer.x = 0.f;
|
||||
|
||||
m_vShoulderPosRatio = m_vShoulderOtherRatio;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Shoulder::Render()
|
||||
@@ -136,14 +164,19 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
CameraDesc.pFollowTarget = m_pTarget_FollowPart;
|
||||
CameraDesc.pLookTarget = m_pTarget_LookPart;
|
||||
CameraDesc.iPriority = 51;
|
||||
CameraDesc.pCameraKey = CAMERA_SHOULDER;
|
||||
CameraDesc.bEnableTransitionLerp = true;
|
||||
CameraDesc.bEnableFollowLerp = true;
|
||||
CameraDesc.bEnableLookLerp = true;
|
||||
CameraDesc.vTransitionTime = { 0.f, 1.f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vLookLerpTime = { 0.f, 0.16f };
|
||||
|
||||
CCamera_Gaze* pCamera = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &m_pBinded_Camera)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_SHOULDER"));
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, m_pBinded_Camera, CAMERA_SHOULDER);
|
||||
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -14,10 +14,14 @@ CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs)
|
||||
|
||||
void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false);
|
||||
}
|
||||
|
||||
void CCamera_Debug::Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
_float3 vCamPos = {};
|
||||
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
@@ -68,6 +72,9 @@ void CCamera_Debug::Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Debug::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Render()
|
||||
@@ -97,8 +104,6 @@ HRESULT CCamera_Debug::Initialize(void* pArg)
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -133,7 +138,7 @@ CCamera_Debug* CCamera_Debug::Create(ID3D11Device* pDevice, ID3D11DeviceContext*
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CCamera_Debug* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
CGameObject* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
|
||||
@@ -13,9 +13,27 @@ CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs)
|
||||
|
||||
void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (false == m_bIsCurrentTransition) {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
if (m_bEnable_FollowLerp) {
|
||||
_vector vNewPos = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vFollowPos_Src), XMLoadFloat3(&m_vFollowPos_Dest), m_vFollowLerpTime.x / m_vFollowLerpTime.y), 1.f);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, vNewPos);
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
}
|
||||
if (m_bEnable_LookLerp) {
|
||||
_vector vNewLook = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vLookPos_Src), XMLoadFloat3(&m_vLookPos_Dest), m_vLookLerpTime.x / m_vLookLerpTime.y), 1.f);
|
||||
m_pTransformCom->LookAt(vNewLook);
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
m_bActive = true;
|
||||
__super::Bind_Matrices();
|
||||
@@ -23,22 +41,81 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("%d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
Update_LerpTimer(fTimeDelta);
|
||||
|
||||
Describe_Entity();
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
m_vLookLerpTime.x += fTimeDelta;
|
||||
if (m_vLookLerpTime.y <= m_vLookLerpTime.x) {
|
||||
m_vLookLerpTime.x = 0.f;
|
||||
m_bEnable_LookLerp = false;
|
||||
XMStoreFloat3(&m_vLookPos_Src, XMLoadFloat3(&m_vLookPos_Dest));
|
||||
XMStoreFloat3(&m_vLookPos_Dest, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
}
|
||||
|
||||
if (true == m_bEnable_FollowLerp) {
|
||||
m_vFollowLerpTime.x += fTimeDelta;
|
||||
if (m_vFollowLerpTime.y <= m_vFollowLerpTime.x) {
|
||||
m_vFollowLerpTime.x = 0.f;
|
||||
m_bEnable_FollowLerp = false;
|
||||
XMStoreFloat3(&m_vFollowPos_Src, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
XMStoreFloat3(&m_vFollowPos_Dest, m_pFollowTarget->Get_WorldPostion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Enable_FollowLerp()
|
||||
{
|
||||
m_bEnable_FollowLerp = true;
|
||||
m_vFollowLerpTime.x = 0.f;
|
||||
XMStoreFloat3(&m_vFollowPos_Src, m_pFollowTarget->Get_WorldPostion());
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Enable_LookLerp()
|
||||
{
|
||||
m_bEnable_LookLerp = true;
|
||||
m_vLookLerpTime.x = 0.f;
|
||||
XMStoreFloat3(&m_vLookPos_Src, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Toggle_Priority()
|
||||
{
|
||||
if (m_iPriority == 99) {
|
||||
m_iPriority = 51;
|
||||
}
|
||||
else {
|
||||
m_iPriority = 99;
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, false);
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Initialize(void* pArg)
|
||||
{
|
||||
|
||||
@@ -52,7 +129,6 @@ HRESULT CCamera_Gaze::Initialize(void* pArg)
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
@@ -61,12 +137,10 @@ HRESULT CCamera_Gaze::Ready_Components(void* pArg)
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamera_Gaze* pInstance = new CCamera_Gaze(pDevice, pContext);
|
||||
@@ -78,7 +152,6 @@ CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CCamera_Gaze* pInstance = new CCamera_Gaze(*this);
|
||||
@@ -91,13 +164,35 @@ CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner)
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Camera_Gaze_Describe");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z);
|
||||
GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z);
|
||||
GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z);
|
||||
GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z);
|
||||
GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp);
|
||||
if (true == m_bEnable_TransitionLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y);
|
||||
GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::Checkbox("LookLerp", &m_bEnable_LookLerp);
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y);
|
||||
GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp);
|
||||
if (true == m_bEnable_FollowLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y);
|
||||
GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,665 @@
|
||||
#include "pch.h"
|
||||
#include "EffectObject.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CEffectObject::CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CEffectObject::CEffectObject(const CEffectObject& rhs)
|
||||
:CPartObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CEffectObject::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CEffectObject::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CEffectObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture")))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pInstance_ModelCom->Render(i)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Render_Blur()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_EffectInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_EffectInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLUR)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pInstance_ModelCom->Render(i)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel)
|
||||
{
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pDissolve_TextureCom);
|
||||
SAFE_RELEASE(m_pEmissive_TextureCom);
|
||||
|
||||
SAFE_RELEASE(m_pInstance_ModelCom);
|
||||
|
||||
if (m_pLightCom != nullptr)
|
||||
SAFE_RELEASE(m_pLightCom);
|
||||
|
||||
_string strPerfectFilePath = pFilePath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
HANDLE hFile = CreateFileW(
|
||||
CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름
|
||||
GENERIC_READ, // 읽기 모드
|
||||
FILE_SHARE_READ, // 다른 프로세스도 읽기 가능
|
||||
NULL,
|
||||
OPEN_EXISTING, // 기존 파일 열기
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// 나중에 패키징할때 패스를 저장할거임
|
||||
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_EffectInfo.LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION);
|
||||
m_EffectInfo.LightDesc.iLevel = ENUM_CLASS(eLevel);
|
||||
|
||||
if (m_EffectInfo.LightDesc.eType != LIGHT::DIRECTIONAL) // 0이 아닐때만 생성
|
||||
{
|
||||
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_EffectInfo.isDiffuse)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strDiffuseName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isNoise)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strNoiseName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isMasking)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMaskingName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isDissolve)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strDissolveName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName),
|
||||
reinterpret_cast<CComponent**>(&m_pDissolve_TextureCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strEmissiveName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName),
|
||||
reinterpret_cast<CComponent**>(&m_pEmissive_TextureCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isDistortion)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strDistortionName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName),
|
||||
reinterpret_cast<CComponent**>(&m_pDistortion_TextureCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strModelName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName),
|
||||
reinterpret_cast<CComponent**>(&m_pInstance_ModelCom))))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_pInstance_ModelCom->Load_InstanceModel(hFile);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT CEffectObject::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_EffectInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_EffectInfo.isMasking, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_EffectInfo.isDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_EffectInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissive", &m_EffectInfo.isEmissive, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_EffectInfo.isDistortion, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_EffectInfo.isDiffuseUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_EffectInfo.isMaskUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseUVMove", &m_EffectInfo.isNoiseUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isReverseDissolve", &m_EffectInfo.isReverseDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolve", &m_EffectInfo.isEmissiveDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskClampSample", &m_EffectInfo.isMaskClampSample, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_EffectInfo.isNoiseColor, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_EffectInfo.isNoiseAlpha, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNomalDissolve", &m_EffectInfo.isNomalDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_EffectInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_EffectInfo.fEmissiveStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_EffectInfo.vDiffuseUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_EffectInfo.vMaskingUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vNoiseUVGainAmount", &m_EffectInfo.vNoiseUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_EffectInfo.vDiffuseDistortionUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_EffectInfo.vMaskDistortionUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_EffectInfo.vUVMaskCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_EffectInfo.iMaskMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_EffectInfo.iDiffuseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskDistortionMoveLerpOption", &m_EffectInfo.iMaskDistortionMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseDistortionMoveLerpOption", &m_EffectInfo.iDiffuseDistortionMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_EffectInfo.fDiffuseAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_EffectInfo.fSoftenExp, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_EffectInfo.fSoftStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_EffectInfo.fCoreBoost, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_EffectInfo.fRadius, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_EffectInfo.fSoftMaskEdge, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_EffectInfo.fSoftMask, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pNoise_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pNoise_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_NoiseTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pMasking_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDissolve_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDissolve_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DissolveTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pEmissive_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pEmissive_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_EmissiveTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDistortion_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Ready_Components(void* pArg)
|
||||
{
|
||||
CTransform::TRANSFORM_DESC TransformDesc = {};
|
||||
|
||||
TransformDesc.fRadius = 20.f;
|
||||
TransformDesc.fRotationPerSec = 10.f;
|
||||
TransformDesc.fSpeedPerSec = 10.f;
|
||||
|
||||
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
//나중에 로드할 때 라이트를 값을 입력받아서 생성 하자
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Initialize(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CEffectObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pDissolve_TextureCom);
|
||||
SAFE_RELEASE(m_pEmissive_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pInstance_ModelCom);
|
||||
|
||||
if(m_pLightCom != nullptr)
|
||||
SAFE_RELEASE(m_pLightCom);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
#include "pch.h"
|
||||
#include "EffectParts.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Instance_Model.h"
|
||||
|
||||
CEffectParts::CEffectParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CEffectObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CEffectParts::CEffectParts(const CEffectParts& rhs)
|
||||
: CEffectObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CEffectParts::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectParts::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
Set_Visible(false);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CEffectParts::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CEffectParts::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_pInstance_ModelCom == nullptr)
|
||||
return;
|
||||
|
||||
m_pInstance_ModelCom->Drop(fTimeDelta);
|
||||
|
||||
if (m_EffectInfo.isBillboard)
|
||||
m_pGameInstance->BillBoard(m_pTransformCom);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CEffectParts::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_pInstance_ModelCom == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
if (m_EffectInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
}
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
|
||||
}
|
||||
|
||||
|
||||
HRESULT CEffectParts::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_MODEL, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
CEffectParts* CEffectParts::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CEffectParts* pInstance = new CEffectParts(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CEffectParts");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CEffectParts::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CEffectParts* pInstance = new CEffectParts(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CEffectParts");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CEffectParts::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
}
|
||||
|
||||
void CEffectParts::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
#include "pch.h"
|
||||
#include "Effect_Container.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "EffectParts.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
|
||||
#include <sstream>
|
||||
|
||||
CEffect_Container::CEffect_Container(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CContainerObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CEffect_Container::CEffect_Container(const CEffect_Container& rhs)
|
||||
: CContainerObject(rhs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Initialize_Prototype()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CEffect_Container::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CEffect_Container::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CEffect_Container::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CEffect_Container::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Load_Directory(const _char* pPath)
|
||||
{
|
||||
|
||||
for (const auto& file : filesystem::directory_iterator(pPath))
|
||||
{
|
||||
if (file.is_directory())
|
||||
continue;
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (strcmp(ext.c_str(), ".bin"))
|
||||
continue;
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
CEffectParts* pEffectParts = nullptr;
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
|
||||
|
||||
/*이펙트 껍데기 생성*/
|
||||
|
||||
_wstring wstrFileName = file.path().stem().wstring(); //이름 넣기
|
||||
|
||||
if (FAILED(Add_PartObject<CEffectParts>(CMyTools::ToString(wstrFileName), g_iStaticLevel, &pEffectParts, &PartsDesc))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/*이펙트 로드 로드*/
|
||||
size_t iPos = {};
|
||||
_string strFilePath = szFilePath;
|
||||
|
||||
while ((iPos = strFilePath.find(".bin")) != std::string::npos) {
|
||||
strFilePath.erase(iPos, 4);
|
||||
};
|
||||
|
||||
|
||||
if (FAILED(pEffectParts->Load(strFilePath.c_str(),static_cast<LEVEL>(NEXT_LEVEL))))
|
||||
{
|
||||
Safe_Release(pEffectParts);
|
||||
continue;
|
||||
}
|
||||
|
||||
Safe_Release(pEffectParts);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Ready_Components(void* pArg)
|
||||
{
|
||||
CTransform::TRANSFORM_DESC TransformDesc = {};
|
||||
|
||||
TransformDesc.fRadius = 20.f;
|
||||
TransformDesc.fRotationPerSec = 10.f;
|
||||
TransformDesc.fSpeedPerSec = 10.f;
|
||||
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Ready_Child()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CEffect_Container::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CEffect_Container::Update_Event(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_fPreAccTime = m_fAccTime;
|
||||
m_fAccTime += fTimeDelta;
|
||||
|
||||
if (m_fAccTime >= m_fDelay || m_isDelayed == false) // 아직 딜레이되지 않았고 딜레이를 넘어섰다면
|
||||
{
|
||||
m_isDelayed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (m_fAccTime >= m_fDuration) // 듀레이션을 넘어섰다면
|
||||
{
|
||||
if (m_isLoop)
|
||||
{
|
||||
m_fAccTime = 0.f;
|
||||
m_fPreAccTime = 0.f;
|
||||
m_isDelayed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (auto& pPair : m_Events) // 이벤트들을 비교하면서 실행함
|
||||
{
|
||||
if (pPair.first >= m_fPreAccTime && pPair.first <= m_fAccTime)
|
||||
{
|
||||
pPair.second();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ HRESULT CLevel_Field::Initialize()
|
||||
|
||||
void CLevel_Field::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -31,14 +31,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Layer_UI(LAYER_UI))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_Effect(LAYER_EFFECT))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -54,7 +49,7 @@ HRESULT CLevel_GamePlay::Initialize()
|
||||
|
||||
void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
@@ -94,7 +89,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
{
|
||||
/*CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
@@ -104,7 +99,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 99;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
@@ -112,9 +107,12 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) {
|
||||
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -130,11 +128,6 @@ HRESULT CLevel_GamePlay::Ready_Markers()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Effect(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
@@ -148,8 +141,9 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CSkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CSkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_SKYBOX))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 0.f, 0.f };
|
||||
|
||||
@@ -23,7 +23,7 @@ HRESULT CLevel_Logo::Initialize()
|
||||
|
||||
void CLevel_Logo::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ HRESULT CLevel_Restart::Initialize()
|
||||
|
||||
void CLevel_Restart::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -17,8 +17,23 @@
|
||||
#include "Wand.h"
|
||||
#include "SkyBox.h"
|
||||
#include "Broom.h"
|
||||
|
||||
#pragma region PHYSX
|
||||
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "PhysXEffectHitBox.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region EFFECT
|
||||
|
||||
#include "EffectParts.h"
|
||||
#include "Bombard.h"
|
||||
#include "TrailObject.h"
|
||||
#include "Instance_Model.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: m_pDevice{ pDevice }
|
||||
@@ -128,6 +143,66 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Effect/Noises", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Effect/Diffuse", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Effect/Flipbooks", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Effect/Gradients", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_MESH,
|
||||
@@ -152,6 +227,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"),
|
||||
VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Heavy Wall
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
@@ -168,6 +249,8 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
Desc.vAutoDamping = { 100.f, 100.f };
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -204,6 +287,57 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CEffectParts>(g_iStaticLevel, CEffectParts::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTrailObject>(g_iStaticLevel, CTrailObject::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBombard>(NEXT_LEVEL, CBombard::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Models/Effect/Goo", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Models/Effect/NomalMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
|
||||
CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CGamePlay_Canvas>(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) {
|
||||
@@ -256,6 +390,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBroom>(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXWall>(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -264,6 +399,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CPhysXEffectHitBox>(g_iStaticLevel, CPhysXEffectHitBox::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("정보를 불러오는 중입니다.");
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
@@ -315,6 +454,31 @@ HRESULT CLoader::Loading_For_Restart()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent)
|
||||
{
|
||||
for (const auto& file : filesystem::directory_iterator(pDirectoryPath))
|
||||
{
|
||||
if (file.is_directory())
|
||||
continue;
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (!strcmp(ext.c_str(), ".txt"))
|
||||
continue;
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
wstring wstrFileName = pPreName + file.path().stem().wstring();
|
||||
|
||||
AddPrototypeEvent(wstrFileName, szFilePath);
|
||||
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID)
|
||||
{
|
||||
CLoader* pInstance = new CLoader(pDevice, pContext);
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
#include "pch.h"
|
||||
#include "NomalJap.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "EffectParts.h"
|
||||
#include "PhysXEffectHitBox.h"
|
||||
|
||||
|
||||
CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CEffect_Container{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CNomalJap::CNomalJap(const CNomalJap& rhs)
|
||||
: CEffect_Container(rhs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Initialize_Prototype()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
m_wstrEffectName = L"Nomal_Jap";
|
||||
|
||||
m_PartObjects.begin()->second->Set_Visible(true);
|
||||
m_PartObjects.begin()->second->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
m_fDuration = 5.f;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CNomalJap::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CNomalJap::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
Update_Event(fTimeDelta);
|
||||
}
|
||||
|
||||
void CNomalJap::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Ready_Child()
|
||||
{
|
||||
CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{};
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
|
||||
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
Desc.iSubKind = 70;
|
||||
Desc.vDeltaPos = { 0.f, 0.f, 2.f };
|
||||
Desc.vLifeTime = { 0.f, 2.f };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPhysXEffectHitBox>(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CNomalJap* CNomalJap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CNomalJap* pInstance = new CNomalJap(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CNomalJap");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
||||
CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CNomalJap* pInstance = new CNomalJap(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CNomalJap");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc)
|
||||
{
|
||||
//CTransform* pOtherTransform = p
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
|
||||
for (auto& pPair : m_PartObjects)
|
||||
{
|
||||
pPair.second->Set_Visible(true);
|
||||
pPair.second->Get_Component<CTransform>()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos);
|
||||
}
|
||||
|
||||
m_PartObjects.begin()->second->Set_Visible(false);
|
||||
|
||||
m_pPhysHitBox->Set_Dead();
|
||||
}
|
||||
|
||||
void CNomalJap::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
//if(m_pPhysHitBox != nullptr)
|
||||
// if (m_pPhysHitBox->Get_Depth() == false)
|
||||
// SAFE_RELEASE(m_pPhysHitBox);
|
||||
|
||||
}
|
||||
|
||||
void CNomalJap::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
#include "pch.h"
|
||||
#include "PhysXEffectHitBox.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CPhysXEffectHitBox::CPhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CPhysXEffectHitBox::CPhysXEffectHitBox(const CPhysXEffectHitBox& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos));
|
||||
m_vLifeTime.x += fTimeDelta;
|
||||
if (m_vLifeTime.x > m_vLifeTime.y) {
|
||||
m_bDead = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Render()
|
||||
{
|
||||
//if (FAILED(Bind_ShaderResources())) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pModelCom->Render(0))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pCharacter_Controller->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PHYSXDUMMY_DESC* pDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z);
|
||||
m_vDeltaPos = pDesc->vDeltaPos;
|
||||
m_vLifeTime = pDesc->vLifeTime;
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = pDesc->iSubKind;
|
||||
Desc.pTransform = m_pTransformCom;
|
||||
Desc.eBodyType = ACTOR::BOX;
|
||||
Desc.fContactOffset = 0.1f;
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_EffectHitBox_HitReport::Create();
|
||||
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_EffectHitBox_Behavior::Create();
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CPhysXEffectHitBox* CPhysXEffectHitBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPhysXEffectHitBox* pInstance = new CPhysXEffectHitBox(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CPhysXEffectHitBox");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CPhysXEffectHitBox::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CPhysXEffectHitBox* pInstance = new CPhysXEffectHitBox(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CPhysXEffectHitBox");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Free()
|
||||
{
|
||||
if (nullptr == m_pGameInstance) {
|
||||
m_pCharacter_Controller->SetActive(false);
|
||||
PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition();
|
||||
PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z);
|
||||
m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor());
|
||||
|
||||
|
||||
}
|
||||
__super::Free();
|
||||
if (nullptr != m_pCallBack_Behavior) {
|
||||
m_pCallBack_Behavior->Finalize();
|
||||
}
|
||||
if (nullptr != m_pCallBack_HitReport) {
|
||||
m_pCallBack_HitReport->Finalize();
|
||||
}
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
@@ -21,6 +20,8 @@
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Bombard.h"
|
||||
|
||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
{
|
||||
@@ -38,15 +39,17 @@ HRESULT CPlayer::Initialize_Prototype()
|
||||
|
||||
HRESULT CPlayer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
if (FAILED(Ready_Components())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(Ready_Parts()))
|
||||
if (FAILED(Ready_Parts())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Load_KeyFrame();
|
||||
|
||||
@@ -54,6 +57,8 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Set_Anim();
|
||||
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
@@ -77,27 +82,23 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
|
||||
IsSprint();
|
||||
IsWalk();
|
||||
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
|
||||
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
Describe_Entity();
|
||||
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
TestKeyInput(fTimeDelta);
|
||||
}
|
||||
|
||||
void CPlayer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
@@ -107,6 +108,8 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CPlayer::Render()
|
||||
{
|
||||
if (!m_bVisible)
|
||||
return S_OK;
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -155,13 +158,15 @@ HRESULT CPlayer::Ready_Components()
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
@@ -207,48 +212,6 @@ HRESULT CPlayer::Ready_Parts()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//{
|
||||
// CCamPosition_Socket::CAMERAPOSITION_PLAYER_DESC Desc{};
|
||||
|
||||
// Desc.pParentTransform = m_pTransformCom;
|
||||
|
||||
// if (FAILED(Add_PartObject<CCamPosition_Socket>("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc)))
|
||||
// {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// CCamPosition_Arm::CameraArm_DESC CameraArmDesc{};
|
||||
// XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
// CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
// CameraArmDesc.fEye = { 0.f, 10.f, 10.f };
|
||||
// CameraArmDesc.fMouseSensor = 0.4f;
|
||||
// CameraArmDesc.fDistance = 4.f;
|
||||
// CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
// if (FAILED(Add_PartObject<CCamPosition_Arm>("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{};
|
||||
// CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
// CameraDesc.fNear = 0.1f;
|
||||
// CameraDesc.fFar = 300.f;
|
||||
// CameraDesc.fSpeedPerSec = 5.f;
|
||||
// CameraDesc.fRotationPerSec = XMConvertToRadians(90.f);
|
||||
// CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart;
|
||||
// CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart;
|
||||
// CameraDesc.iPriority = 51;
|
||||
|
||||
// CCamera_Gaze* pCamera = { nullptr };
|
||||
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera)))
|
||||
// {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW"));
|
||||
//}
|
||||
|
||||
{
|
||||
CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc;
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
@@ -277,430 +240,11 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
HRESULT CPlayer::InputSystem()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
|| m_pGameInstance->Key_Down(DIK_5)
|
||||
|| m_pGameInstance->Key_Down(DIK_6))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSkill()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_1)
|
||||
//|| m_pGameInstance->Key_Down(DIK_C)
|
||||
//|| m_pGameInstance->Key_Down(DIK_V)
|
||||
//|| m_pGameInstance->Key_Down(DIK_T)
|
||||
//|| m_pGameInstance->Key_Down(DIK_G)
|
||||
//|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::spr]
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Move
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else {
|
||||
// ?
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) {
|
||||
// OtherMove -> AnotherMove
|
||||
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) {
|
||||
// Combat -> Move
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
//else if (true == bLeft){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
//}
|
||||
//else if (true == bRight){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)){
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Jump
|
||||
// pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
m_Animation[STATEANIM::CAST] = { 696,false };
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
}
|
||||
#pragma endregion STATE
|
||||
|
||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPlayer* pInstance = new CPlayer(pDevice, pContext);
|
||||
@@ -765,30 +309,18 @@ void CPlayer::Describe_Entity()
|
||||
GUI::DragFloat3("Pos", Pos3);
|
||||
|
||||
|
||||
_float RotR,RotU,RotL;
|
||||
_float RotR, RotU, RotL;
|
||||
RotR = XMVectorGetX(m_pTransformCom->Get_State(STATE::RIGHT));
|
||||
RotU = XMVectorGetY(m_pTransformCom->Get_State(STATE::UP));
|
||||
RotL = XMVectorGetZ(m_pTransformCom->Get_State(STATE::LOOK));
|
||||
|
||||
float Rot3[3] = { RotR, RotU,RotL };
|
||||
GUI::DragFloat3("Rot", Rot3);
|
||||
|
||||
}
|
||||
|
||||
_bool CPlayer::IsSprint()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LSHIFT))
|
||||
{
|
||||
return m_bSprintToggle = !m_bSprintToggle;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
_bool CPlayer::IsWalk()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_C))
|
||||
{
|
||||
return m_bWalkToggle = !m_bWalkToggle;
|
||||
}
|
||||
return false;
|
||||
string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex());
|
||||
GUI::Text(AnimList.c_str());
|
||||
|
||||
GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,648 @@
|
||||
#include "pch.h"
|
||||
#include "Player.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Bombard.h"
|
||||
|
||||
#pragma region States
|
||||
void CPlayer::TestKeyInput(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F1))
|
||||
{
|
||||
m_eSpell = STATEANIM::ACCIO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F2))
|
||||
{
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3))
|
||||
{
|
||||
m_eSpell = STATEANIM::DEPULSO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F4))
|
||||
{
|
||||
m_eSpell = STATEANIM::DIFFINDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F5))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_ENTER;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F6))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_EXIT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputAction()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSpell()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)) {
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
}
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) {
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
if (m_bSprintToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_C)) {
|
||||
m_bWalkToggle = !m_bWalkToggle;
|
||||
m_bSprintToggle = false;
|
||||
if (m_bWalkToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::WALK | FSMSTATE::JOG | FSMSTATE::SPRINT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
m_pFSM->Enable_State(FSMSTATE::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::DEPULSO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DEPULSO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DIFFINDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DIFFINDO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_ENTER:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_EXIT:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_EXIT];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
default:
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_R))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.1f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell()))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::SPELL].first <= iIndex && m_Animation[STATEANIM::SPELL].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.15f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat"))
|
||||
{
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::ACCIO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
|
||||
break;
|
||||
case STATEANIM::DESCENDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_eSpell = STATEANIM::END;
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::SPELL] = { 696,false };
|
||||
m_Animation[STATEANIM::MAPHELP] = { 122,false };
|
||||
m_Animation[STATEANIM::ACCIO] = { 417,false };
|
||||
m_Animation[STATEANIM::DESCENDO] = { 418,false };
|
||||
m_Animation[STATEANIM::DEPULSO] = { 782,false };
|
||||
m_Animation[STATEANIM::DIFFINDO] = { 786,false };
|
||||
m_Animation[STATEANIM::LUMOS] = { 782,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
@@ -39,7 +39,7 @@ void CSkyBox::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CSkyBox::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object<CCamera_Gaze>()->Get_WorldPostion());
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_CamXMPosition());
|
||||
}
|
||||
|
||||
void CSkyBox::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -15,9 +15,15 @@ void CState_Combat::Enter()
|
||||
|
||||
HRESULT CState_Combat::Update(_float fTimeDelta)
|
||||
{
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -31,7 +37,8 @@ HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc)
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pOwner = pDesc->pOwner;
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
#include "pch.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Trail.h"
|
||||
|
||||
|
||||
CTrailObject::CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CTrailObject::CTrailObject(const CTrailObject& rhs)
|
||||
: CPartObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CTrailObject::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CTrailObject::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
}
|
||||
|
||||
void CTrailObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
{
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
HANDLE hFile = CreateFileW(
|
||||
CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름
|
||||
GENERIC_READ, // 읽기 모드
|
||||
FILE_SHARE_READ, // 다른 프로세스도 읽기 가능
|
||||
NULL,
|
||||
OPEN_EXISTING, // 기존 파일 열기
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
|
||||
m_strPath = strPerfectFilePath;
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailDiffuseName = szName;
|
||||
|
||||
m_isDiffuse = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailNoiseName = szName;
|
||||
|
||||
m_isNoise = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
m_isMask = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pTrailCom->Load_Trail(hFile);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTrail::TRAIL_DESC pTrailDesc;
|
||||
|
||||
pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f);
|
||||
pTrailDesc.vLow = _float3(0.f, -1.f, 0.f);
|
||||
|
||||
if (FAILED(Add_Component<CTrail>(ENUM_CLASS(LEVEL::STATIC), &m_pTrailCom, &pTrailDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Render()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTrailCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
CTrailObject* CTrailObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CTrailObject* pInstance = new CTrailObject(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CTrailObject");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CTrailObject::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CTrailObject* pInstance = new CTrailObject(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CTrailObject");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CTrailObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pTrailCom);
|
||||
}
|
||||
|
||||
void CTrailObject::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
if (FAILED(m_pTrailCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pNoise_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pNoise_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_NoiseTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pMasking_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Effect_Container.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CBombard final : public CEffect_Container
|
||||
{
|
||||
private:
|
||||
CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CBombard(const CBombard& rhs);
|
||||
virtual ~CBombard() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
HRESULT Ready_Child();
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override;
|
||||
private:
|
||||
_wstring m_wstrEffectName = {};
|
||||
class CPhysXEffectHitBox* m_pPhysHitBox = {};
|
||||
class CPartObject* m_pLight_Projectile = {};
|
||||
public:
|
||||
static CBombard* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual void Free() override;
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -43,8 +43,16 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
_float2 m_vAccDegreeXY = {};
|
||||
_float3 m_vShoulderPosRatio = { 1.f, 2.f, -1.f };
|
||||
|
||||
_float3 m_vShoulderStartRatio = { 1.f, 2.f, -1.f };
|
||||
_float3 m_vShoulderOtherRatio = { 1.f, 2.f, -1.f };
|
||||
|
||||
_bool m_bLerp = { false };
|
||||
_float2 m_vLerpTimer = { 0.f, 1.f };
|
||||
|
||||
|
||||
CCamPosition_Target* m_pTarget_LookPart = { nullptr };
|
||||
CCamPosition_Target* m_pTarget_FollowPart = { nullptr };
|
||||
class CCamera_Gaze* m_pBinded_Camera = { nullptr };
|
||||
|
||||
public:
|
||||
static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -13,7 +13,6 @@ class CCamera_Debug final : public CCamera
|
||||
_float3 vEye{}, vAt{};
|
||||
_float fMouseSensor{};
|
||||
}CAMERA_DEBUG_DESC;
|
||||
|
||||
private:
|
||||
CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamera_Debug(const CCamera_Debug& rhs);
|
||||
@@ -39,7 +38,7 @@ class CCamera_Debug final : public CCamera
|
||||
|
||||
public:
|
||||
static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamera_Debug* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@ class CCamera_Gaze final : public CCamera
|
||||
public:
|
||||
typedef struct tagCamera_Gaze : public CCamera::CAMERA_DESC
|
||||
{
|
||||
_bool bTransitionLerp = { false };
|
||||
_bool bLookLerp = { false };
|
||||
_bool bFollowLerp = { false };
|
||||
}CAMERA_GAZE_DESC;
|
||||
private:
|
||||
CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -22,6 +19,10 @@ class CCamera_Gaze final : public CCamera
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
void Update_LerpTimer(Engine::_float fTimeDelta);
|
||||
void Enable_FollowLerp();
|
||||
void Enable_LookLerp();
|
||||
void Toggle_Priority();
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Client {
|
||||
#pragma region OBJECT
|
||||
|
||||
#define CAMERA_DEBUG TEXT("CAMERA_DEBUG")
|
||||
#define CAMERA_SHOULDER TEXT("CAMERA_SHOULDER")
|
||||
#pragma endregion
|
||||
#pragma region COMPONENT
|
||||
|
||||
@@ -38,6 +39,7 @@ namespace Client {
|
||||
#define LAYER_FLOOR TEXT("Layer_Floor")
|
||||
#define LAYER_WALL TEXT("Layer_Wall")
|
||||
#define LAYER_CUBE TEXT("Layer_Cube")
|
||||
#define LAYER_SKYBOX TEXT("Layer_SkyBox")
|
||||
#define LAYER_EDITOR_CAMERA TEXT("Layer_Editor_Camera")
|
||||
#define LAYER_BACKGROUND TEXT("Layer_BackGround")
|
||||
#define LAYER_MARKER TEXT("Layer_Marker")
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CInstance_Model;
|
||||
class CShader;
|
||||
class CTexture;
|
||||
class CLight;
|
||||
class CTrail;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CEffectObject abstract : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagEffectInfo
|
||||
{
|
||||
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
_float2 vDiffuseUVGainAmount = {};
|
||||
_float2 vMaskingUVGainAmount = {};
|
||||
_float2 vNoiseUVGainAmount = {};
|
||||
|
||||
_float2 vDiffuseDistortionUVGainAmount = {};
|
||||
_float2 vMaskDistortionUVGainAmount = {};
|
||||
|
||||
_float2 vUVCutting = { 1.f ,1.f };
|
||||
_float2 vUVMaskCutting = { 1.f ,1.f };
|
||||
|
||||
_int iMaskMoveLerpOption = { 0 };
|
||||
_int iDiffuseMoveLerpOption = { 0 };
|
||||
_int iNoiseMoveLerpOption = { 0 };
|
||||
|
||||
_int iMaskDistortionMoveLerpOption = { 0 };
|
||||
_int iDiffuseDistortionMoveLerpOption = { 0 };
|
||||
|
||||
_int iBlurWeight = { 0 };
|
||||
|
||||
|
||||
_bool isDiffuse = {};
|
||||
_bool isMasking = {};
|
||||
_bool isDissolve = {};
|
||||
_bool isNoise = {};
|
||||
_bool isEmissive = {};
|
||||
_bool isDistortion = {};
|
||||
_bool isDiffuseUVMove = {};
|
||||
_bool isNoiseUVMove = {};
|
||||
_bool isMaskUVMove = {};
|
||||
_bool isBlur = {};
|
||||
_bool isBillboard = {};
|
||||
|
||||
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
_float fDiffuseAlpha = { 1.f };
|
||||
_float fBlurIntensity = {};
|
||||
_float fNoiseDistortionIntensity = {};
|
||||
_float fEmissiveStrength = { 0.f };
|
||||
|
||||
LIGHT_DESC LightDesc = {};
|
||||
RENDER eRenderOrder = { RENDER::EFFECT };
|
||||
|
||||
_bool isReverseDissolve = {};
|
||||
|
||||
EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT };
|
||||
|
||||
_bool isEmissiveDissolve = { false };
|
||||
|
||||
_bool isMaskClampSample = { false };
|
||||
_bool isNoiseColor = { false };
|
||||
_bool isNoiseAlpha = { false };
|
||||
_bool isNomalDissolve = {};
|
||||
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
|
||||
protected:
|
||||
CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CEffectObject(const CEffectObject& rhs);
|
||||
virtual ~CEffectObject() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta);
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Late_Update(_float fTimeDelta);
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Blur() override;
|
||||
public:
|
||||
HRESULT Load(const _char* pFilePath, LEVEL eLevel);
|
||||
|
||||
protected:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
protected:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pNoise_TextureCom = { nullptr };
|
||||
CTexture* m_pMasking_TextureCom = { nullptr };
|
||||
CTexture* m_pDissolve_TextureCom = { nullptr };
|
||||
CTexture* m_pEmissive_TextureCom = { nullptr };
|
||||
CTexture* m_pDistortion_TextureCom = { nullptr };
|
||||
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CLight* m_pLightCom = { nullptr };
|
||||
|
||||
CInstance_Model* m_pInstance_ModelCom = { nullptr };
|
||||
|
||||
|
||||
protected:
|
||||
EFFECT_INFO m_EffectInfo = {};
|
||||
_string m_strDiffuseName = {};
|
||||
_string m_strNoiseName = {};
|
||||
_string m_strMaskingName = {};
|
||||
_string m_strDissolveName = {};
|
||||
_string m_strModelName = {};
|
||||
_string m_strEmissiveName = {};
|
||||
_string m_strDistortionName = {};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "EffectObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CEffectParts final : public CEffectObject
|
||||
{
|
||||
private:
|
||||
CEffectParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CEffectParts(const CEffectParts& rhs);
|
||||
virtual ~CEffectParts() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
|
||||
public:
|
||||
static CEffectParts* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "ContainerObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CEffect_Container abstract : public CContainerObject
|
||||
{
|
||||
protected:
|
||||
CEffect_Container(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CEffect_Container(const CEffect_Container& rhs);
|
||||
virtual ~CEffect_Container() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override;
|
||||
public:
|
||||
HRESULT Load_Directory(const _char* pPath);
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
HRESULT Ready_Child();
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
|
||||
void Update_Event(_float fTimeDelta);
|
||||
|
||||
protected:
|
||||
_wstring m_wstrEffectName = {};
|
||||
|
||||
_bool m_isLoop = {};
|
||||
|
||||
_float m_fAccTime = {};
|
||||
_float m_fPreAccTime = {};
|
||||
_float m_fDuration = {};
|
||||
_float m_fDelay = {};
|
||||
_bool m_isDelayed = { false };
|
||||
|
||||
map<_float, function<void()>> m_Events = {};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -27,7 +27,6 @@ class CLevel_GamePlay final : public CLevel
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Camera();
|
||||
HRESULT Ready_Layer_Sound();
|
||||
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Player(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag);
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class CLoader final : public CBase
|
||||
HRESULT Loading_For_GamePlay();
|
||||
HRESULT Loading_For_Field();
|
||||
HRESULT Loading_For_Restart();
|
||||
|
||||
private:
|
||||
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
|
||||
public:
|
||||
static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID);
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Effect_Container.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CNomalJap final : public CEffect_Container
|
||||
{
|
||||
private:
|
||||
CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CNomalJap(const CNomalJap& rhs);
|
||||
virtual ~CNomalJap() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
HRESULT Ready_Child();
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override;
|
||||
private:
|
||||
_wstring m_wstrEffectName = {};
|
||||
class CPhysXEffectHitBox* m_pPhysHitBox = {};
|
||||
public:
|
||||
static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual void Free() override;
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "CallBack_EffectHitBox_Behavior.h"
|
||||
#include "CallBack_EffectHitBox_HitReport.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CPhysXEffectHitBox final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc
|
||||
{
|
||||
_float3 vPos = {};
|
||||
_float3 vRotRPY = {};
|
||||
_uint iSubKind = {};
|
||||
_float3 vDeltaPos = {};
|
||||
_float2 vLifeTime = {};
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CPhysXEffectHitBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CPhysXEffectHitBox(const CPhysXEffectHitBox& rhs);
|
||||
virtual ~CPhysXEffectHitBox() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CCallBack_EffectHitBox_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
CCallBack_EffectHitBox_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
_float3 m_vDeltaPos = {};
|
||||
_float2 m_vLifeTime = { };
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CPhysXEffectHitBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -7,21 +7,12 @@ NS_BEGIN(Client)
|
||||
|
||||
class CPlayer final : public CUnit
|
||||
{
|
||||
public:
|
||||
struct InputCondition
|
||||
{
|
||||
FSMSTATE::ESTATE state;
|
||||
function<_bool()> checker;
|
||||
};
|
||||
|
||||
private:
|
||||
CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CPlayer(const CPlayer& Prototype);
|
||||
virtual ~CPlayer() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
@@ -33,10 +24,10 @@ class CPlayer final : public CUnit
|
||||
size_t m_iStateMask = { 0 };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
vector<InputCondition> m_InputConditions;
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
|
||||
class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr };
|
||||
@@ -46,6 +37,8 @@ class CPlayer final : public CUnit
|
||||
class CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
class CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Ready_Parts();
|
||||
HRESULT Bind_ShaderResources();
|
||||
@@ -57,15 +50,21 @@ class CPlayer final : public CUnit
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
private:
|
||||
void TestKeyInput(_float fTimeDelta);
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
_bool IsSprint();
|
||||
_bool IsWalk();
|
||||
|
||||
HRESULT InputSystem();
|
||||
HRESULT InputSkill();
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
HRESULT InputSpell();
|
||||
|
||||
STATEANIM::ESTATE m_eSpell = { STATEANIM::END };
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
@@ -87,17 +86,11 @@ class CPlayer final : public CUnit
|
||||
HRESULT Behavior_DodgeExitCheck();
|
||||
void Behavior_DodgeExit();
|
||||
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
void Behavior_CombatEnter();
|
||||
HRESULT Behavior_CombatExitCheck();
|
||||
void Behavior_CombatExit();
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -8,7 +8,8 @@ class CState_Combat final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_COMBAT_DESC;
|
||||
private:
|
||||
CState_Combat();
|
||||
@@ -19,6 +20,10 @@ class CState_Combat final : public CState_Root
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_COMBAT_DESC* pDesc);
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "EffectObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CTexture;
|
||||
class CTrail;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CTrailObject final : public CPartObject
|
||||
{
|
||||
private:
|
||||
CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTrailObject(const CTrailObject& rhs);
|
||||
virtual ~CTrailObject() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
public:
|
||||
HRESULT Load_Trail(const _char* pPath, LEVEL eLevel);
|
||||
private:
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
public:
|
||||
static CTrailObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
|
||||
private:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pNoise_TextureCom = { nullptr };
|
||||
CTexture* m_pMasking_TextureCom = { nullptr };
|
||||
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CTrail* m_pTrailCom = { nullptr };
|
||||
|
||||
_string m_strTrailDiffuseName = {};
|
||||
_string m_strTrailNoiseName = {};
|
||||
_string m_strTrailMaskingName = {};
|
||||
|
||||
_string m_strPath = {};
|
||||
_string m_strName = {};
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isNoise = {};
|
||||
_bool m_isMask = {};
|
||||
|
||||
EFFECT_TYPE m_eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
};
|
||||
|
||||
NS_END
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -33,7 +33,9 @@ Texture2D g_ShadowTexture;
|
||||
Texture2D g_PreShadowTexture;
|
||||
Texture2D g_BlurTexture;
|
||||
Texture2D g_BlurXTexture;
|
||||
|
||||
Texture2D g_BlurWeightTexture;
|
||||
Texture2D g_BlurWeightXTexture;
|
||||
|
||||
Texture2D g_SurfaceTexture;
|
||||
|
||||
@@ -313,12 +315,33 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
float g_fWeights[32] =
|
||||
//float g_fWeights[32] =
|
||||
//{
|
||||
// 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000,
|
||||
// 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800,
|
||||
// 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200,
|
||||
// 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200
|
||||
//};
|
||||
|
||||
float g_fWeights[128] =
|
||||
{
|
||||
0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000,
|
||||
0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800,
|
||||
0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200,
|
||||
0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200
|
||||
0.000209902, 0.000241594, 0.000277451, 0.000317919, 0.000363477, 0.000414637, 0.000471944, 0.000535974,
|
||||
0.000607333, 0.000686659, 0.000774615, 0.000871889, 0.00097919, 0.00109725, 0.00122679, 0.00136858,
|
||||
0.00152334, 0.00169183, 0.00187477, 0.00207285, 0.00228675, 0.0025171, 0.00276448, 0.0030294,
|
||||
0.00331231, 0.00361356, 0.00393342, 0.00427205, 0.00462949, 0.00500564, 0.0054003, 0.00581308,
|
||||
0.00624346, 0.00669075, 0.00715411, 0.0076325, 0.00812472, 0.0086294, 0.009145, 0.0096698,
|
||||
0.0102019, 0.0107393, 0.0112798, 0.0118211, 0.0123608, 0.0128962, 0.0134249, 0.0139441,
|
||||
0.0144511, 0.0149431, 0.0154174, 0.0158713, 0.0163021, 0.0167073, 0.0170844, 0.0174311,
|
||||
0.0177452, 0.0180246, 0.0182676, 0.0184726, 0.0186383, 0.0187635, 0.0188474, 0.0188895,
|
||||
|
||||
0.0188895, 0.0188474, 0.0187635, 0.0186383, 0.0184726, 0.0182676, 0.0180246, 0.0177452,
|
||||
0.0174311, 0.0170844, 0.0167073, 0.0163021, 0.0158713, 0.0154174, 0.0149431, 0.0144511,
|
||||
0.0139441, 0.0134249, 0.0128962, 0.0123608, 0.0118211, 0.0112798, 0.0107393, 0.0102019,
|
||||
0.0096698, 0.009145, 0.0086294, 0.00812472, 0.0076325, 0.00715411, 0.00669076, 0.00624346,
|
||||
0.00581308, 0.0054003, 0.00500564, 0.00462948, 0.00427205, 0.00393342, 0.00361356, 0.00331231,
|
||||
0.0030294, 0.00276448, 0.0025171, 0.00228675, 0.00207285, 0.00187477, 0.00169183, 0.00152334,
|
||||
0.00136858, 0.00122679, 0.00109725, 0.000979191, 0.000871889, 0.000774615, 0.000686658, 0.000607333,
|
||||
0.000535973, 0.000471944, 0.000414637, 0.000363477, 0.000317919, 0.000277451, 0.000241594, 0.000209902
|
||||
};
|
||||
|
||||
|
||||
@@ -395,30 +418,25 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
//}
|
||||
float4 vColor = 0.f;
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
int iBlurWeight = (int)(round(g_BlurWeightXTexture.Sample(ClampSampler, In.vTexcoord).r) * 128.f);
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
int iBlurMin;
|
||||
int iBlurMax;
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
iBlurMin = -1 * (iBlurWeight / 2) + 1;
|
||||
iBlurMax = iBlurWeight / 2;
|
||||
|
||||
// // 변수로 루프돌리려면 반드시 필요함
|
||||
|
||||
|
||||
for (int i = -63; i < 64; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -429,6 +447,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
struct PS_OUT_BLUR_X
|
||||
{
|
||||
float4 vBlurX : SV_TARGET0;
|
||||
float4 vBlurWeight : SV_TARGET1;
|
||||
};
|
||||
|
||||
|
||||
@@ -439,35 +458,38 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
float2 vTexcoord;
|
||||
float4 vColor = 0.f;
|
||||
|
||||
//TODO 블러 조절 해보려햇는데 실패함..
|
||||
float fBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r;
|
||||
int iBlurWeight = (int) (round(fBlurWeight) * 128.f);
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
int iBlurMin;
|
||||
int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
iBlurMin = -1 * (iBlurWeight / 2) + 1;
|
||||
iBlurMax = iBlurWeight / 2;
|
||||
|
||||
//for (int i = -15; i < 16; ++i)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
// vTexcoord.x = In.vTexcoord.x;
|
||||
// vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
// vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
//Out.vBackBuffer += vColor;
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
|
||||
for (int i = -63; i < 64; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
Out.vBlurWeight = fBlurWeight;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user