@@ -160,6 +160,7 @@ call Update_Resources.bat
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Action_Panel.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Troll_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CameraLockOn.h" />
|
||||
<ClInclude Include="..\Public\Current_Slot_Number.h" />
|
||||
<ClInclude Include="..\Public\Current_Spell_Slot.h" />
|
||||
@@ -168,6 +169,7 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\Public\Enemy_HpBar.h" />
|
||||
<ClInclude Include="..\Public\Enemy_Info.h" />
|
||||
<ClInclude Include="..\Public\Enemy_Panel.h" />
|
||||
<ClInclude Include="..\Public\Goblin_BattleAxe.h" />
|
||||
<ClInclude Include="..\Public\Goblin_Dagger.h" />
|
||||
<ClInclude Include="..\Public\Goblin_Mage.h" />
|
||||
<ClInclude Include="..\Public\Goblin_Spector.h" />
|
||||
@@ -306,6 +308,7 @@ call Update_Resources.bat
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Action_Panel.cpp" />
|
||||
<ClCompile Include="..\Private\Broom_States.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Troll_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CameraLockOn.cpp" />
|
||||
<ClCompile Include="..\Private\Current_Slot_Number.cpp" />
|
||||
<ClCompile Include="..\Private\Current_Spell_Slot.cpp" />
|
||||
@@ -314,6 +317,7 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\Private\Enemy_HpBar.cpp" />
|
||||
<ClCompile Include="..\Private\Enemy_Info.cpp" />
|
||||
<ClCompile Include="..\Private\Enemy_Panel.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_BattleAxe.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_Dagger.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_Mage.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_Mage_States.cpp" />
|
||||
|
||||
@@ -85,24 +85,6 @@
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h">
|
||||
<Filter>02.GameObjects\PhysX</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>04.Mechanic\State</Filter>
|
||||
</ClInclude>
|
||||
@@ -424,12 +406,35 @@
|
||||
<ClInclude Include="..\Public\Goblin_Mage.h">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin_Spector.h">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h" />
|
||||
<ClInclude Include="..\Public\Goblin_Spector.h">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector</Filter>
|
||||
<ClInclude Include="..\Public\Goblin_BattleAxe.h">
|
||||
<Filter>02.GameObjects\Item\Goblin_BattleAxe</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Player</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Hitbox</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Hitbox</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Player</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Troll_Behavior.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Troll</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -909,8 +914,29 @@
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector">
|
||||
<UniqueIdentifier>{234b3dd8-4ec9-4e81-ac7f-4eacb8f53780}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\Behavior\Player">
|
||||
<UniqueIdentifier>{3f4bde42-c5a0-4c7a-8dde-23e0725534c9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\Behavior\Hitbox">
|
||||
<UniqueIdentifier>{085dcbe3-d24e-4f08-b1b5-562f8ea2ad88}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\Behavior\Monster">
|
||||
<UniqueIdentifier>{dde4f316-300a-44e2-b0ed-6b215434f672}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Hitbox">
|
||||
<UniqueIdentifier>{e8092e33-cd57-4c35-81e4-971d12dbfc3b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Monster">
|
||||
<UniqueIdentifier>{df2cce1e-7ac5-404d-922a-7f60ca0be9a4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Player">
|
||||
<UniqueIdentifier>{a79cbab1-6a8a-4d88-8102-bc3462a4ffb0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Monster\Troll">
|
||||
<UniqueIdentifier>{e12337a6-7563-4615-a8d2-a2e2e1ba1ca8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
<Filter>99.Define\00.DEFAULT</Filter>
|
||||
</ClCompile>
|
||||
@@ -980,24 +1006,6 @@
|
||||
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp">
|
||||
<Filter>02.GameObjects\PhysX</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Root.cpp">
|
||||
<Filter>04.Mechanic\State</Filter>
|
||||
</ClCompile>
|
||||
@@ -1319,15 +1327,9 @@
|
||||
<ClCompile Include="..\Private\Goblin_Mage.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin_Mage_States.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Enemy_HpBar.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Enemy_Penel\Enemy_HpBar</Filter>
|
||||
</ClCompile>
|
||||
@@ -1337,15 +1339,44 @@
|
||||
<ClCompile Include="..\Private\Enemy_Panel.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Enemy_Penel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_Spector.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin_BattleAxe.cpp">
|
||||
<Filter>02.GameObjects\Item\Goblin_BattleAxe</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Hitbox</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\Behavior\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Hitbox</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Troll_Behavior.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Troll</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
<Filter>99.Define\00.DEFAULT</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -40,8 +40,9 @@ void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
else
|
||||
else{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
|
||||
@@ -56,6 +57,18 @@ HRESULT CBuildingContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render_Shadow()
|
||||
{
|
||||
unordered_map<_string, CPartObject*>::iterator iter = m_PartObjects.begin();
|
||||
for (; iter != m_PartObjects.end(); ++iter) {
|
||||
CPartObject* pObject = (*iter).second;
|
||||
if (FAILED(pObject->Render_Shadow())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render_BoundingBox()
|
||||
{
|
||||
/* Begin_Query, End_Query 사이에 Render */
|
||||
@@ -220,3 +233,4 @@ void CBuildingContainer::Describe_Entity()
|
||||
|
||||
}
|
||||
#endif
|
||||
////////////////////////////////
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Troll_Behavior.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "RigidBody_Dynamic.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
CCallBack_Troll_Behavior::CCallBack_Troll_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
CCallBack_Troll_Behavior::~CCallBack_Troll_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
void CCallBack_Troll_Behavior::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pTargetActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(pController->getActor()->userData);
|
||||
if (nullptr == pTargetActorData) { // missing user data
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pTargetActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
{
|
||||
switch ((PXOBJECT)pTargetActorData->iSubKind)
|
||||
{
|
||||
case PXOBJECT::TERRAIN:
|
||||
//class CGameObject* pOwner = m_pController->Get_Owner();
|
||||
//_vector vLook = pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
//_float fDot = XMVectorGetX(XMVector3Dot(XMLoadFloat3((_float3*)&vDir), vLook));
|
||||
//if (fDot > cosf(XM_PIDIV4)) {
|
||||
// CModel* pModel = pOwner->Get_Component<CModel>();
|
||||
// _uint iAnimIndex = pModel->Get_AnimIndex();
|
||||
// if (STATEANIM::RUSH_LOOP == iAnimIndex) {
|
||||
// CFSM* pFSM = pOwner->Get_Component<CFSM>();
|
||||
// pFSM->Change_State(FSMSTATE::STOP);
|
||||
// }
|
||||
//}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
switch (pTargetActorData->iSubKind)
|
||||
{
|
||||
case 0:
|
||||
m_pController->ConvertToDO(*m_pPartDynamicBody);
|
||||
m_pPartDynamicBody->Add_Force(XMVectorSet(vDir.x, vDir.y, vDir.z, 0.f) * fLength * 100.f, PSX::PxForceMode::eIMPULSE);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Troll_Behavior::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러
|
||||
PSX::PxActor* pActor = pOtherController->getActor();
|
||||
|
||||
ON_COLLISION_INFO CollisionDesc = {};
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pTargetActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(pController->getActor()->userData);
|
||||
assert(nullptr != pTargetActorData); // missing user data
|
||||
|
||||
switch (pTargetActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
switch (pTargetActorData->iSubKind)
|
||||
{
|
||||
case ENUM_CLASS(PXOBJECT::PLAYER):
|
||||
break;
|
||||
default:
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Troll_Behavior::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
const void* pOtherController = hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Troll_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject)
|
||||
{
|
||||
m_pController = pController;
|
||||
m_pPartDynamicBody = pPartDynamicObject;
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pController);
|
||||
SAFE_ADDREF(m_pPartDynamicBody);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Troll_Behavior::Finalize()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pPartDynamicBody);
|
||||
SAFE_RELEASE(m_pController);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCallBack_Troll_Behavior* CCallBack_Troll_Behavior::Create()
|
||||
{
|
||||
return new CCallBack_Troll_Behavior();
|
||||
}
|
||||
@@ -124,12 +124,25 @@ HRESULT CEffectPool::Bind_ShaderResources()
|
||||
|
||||
HRESULT CEffectPool::Ready_Effect()
|
||||
{
|
||||
if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
|
||||
#ifdef 기무리
|
||||
if (FAILED(Create_Effect(SKILL_TYPE::JAP, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
|
||||
CNomalJap* pEffect = nullptr;
|
||||
|
||||
pEffect = m_pGameInstance->Clone_Prototype<CNomalJap>(iPrototypeLevel, nullptr);
|
||||
|
||||
return pEffect;}
|
||||
return pEffect; }
|
||||
))) return E_FAIL;
|
||||
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
#ifndef 기무리
|
||||
if (FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
|
||||
CNomalJap* pEffect = nullptr;
|
||||
|
||||
pEffect = m_pGameInstance->Clone_Prototype<CNomalJap>(iPrototypeLevel, nullptr);
|
||||
|
||||
return pEffect; }
|
||||
))) return E_FAIL;
|
||||
|
||||
|
||||
@@ -226,6 +239,8 @@ HRESULT CEffectPool::Ready_Effect()
|
||||
return pEffect; }
|
||||
))) return E_FAIL;
|
||||
|
||||
#endif // !기무리
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -368,6 +368,7 @@ void CEffect_Container::SweepTarget(_vector StartPos, _vector EndPos, _float fRa
|
||||
memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal));
|
||||
XMStoreFloat4(&tagCollInfo.vHitDir, vDir);
|
||||
tagCollInfo.fLength = fDistance;
|
||||
tagCollInfo.pObject = m_pOwner->Get_Owner();
|
||||
|
||||
|
||||
if (nullptr != pActor && nullptr != pActor->userData)
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Layer.h"
|
||||
#include "Player.h"
|
||||
#include "Goblin_Dagger.h"
|
||||
#include "Goblin_Spector.h"
|
||||
#include "Effect_Container.h"
|
||||
|
||||
#pragma region STATE
|
||||
@@ -45,23 +49,23 @@ HRESULT CGoblin::Initialize(void* pArg)
|
||||
|
||||
Add_FSM();
|
||||
|
||||
Set_Anim();
|
||||
Set_Anim();
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(-40.f, 5.f, -20.f, 1.f));
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(-40.f, 5.f, -20.f, 1.f));
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin::Priority_Update(_float fTimeDelta)
|
||||
@@ -85,7 +89,7 @@ void CGoblin::Update(_float fTimeDelta)
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
if (0.f == m_vStunTimer.x) {
|
||||
PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition();
|
||||
PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z);
|
||||
@@ -115,19 +119,19 @@ void CGoblin::Late_Update(_float fTimeDelta)
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform());
|
||||
}
|
||||
|
||||
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
if (true == m_bLookAt) {
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
}
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Render()
|
||||
{
|
||||
|
||||
if (!m_bVisible)
|
||||
return S_OK;
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
@@ -139,6 +143,9 @@ HRESULT CGoblin::Render()
|
||||
if (true == m_bDrawOutLine) {
|
||||
iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::OUTLINE_WRITE);
|
||||
}
|
||||
if (FAILED(Render_DeadDisolve())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
@@ -168,12 +175,52 @@ HRESULT CGoblin::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()){
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (0.f < m_fDeadRatio) {
|
||||
_bool bDisolve = false;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Render_Shadow()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", &m_pGameInstance->Get_ShadowDesc()->fFar, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::SHADOW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -206,11 +253,15 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
m_eHitSpell = STATEANIM::TUMBLE2;
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::JAP):
|
||||
{
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
if (true == Get_Damage(60.f)) {
|
||||
_float fSkillRatio = m_pInfoInstance->Get_Spell_Info(ENUM_CLASS(SKILL_TYPE::JAP)).fSpell_Damage;
|
||||
_float fCoefficient = CollisionDesc->pObject->Get_Component<CStat>()->Get_Stat(ENUM_CLASS(STAT::MAGIC));
|
||||
if (true == Get_Damage(fSkillRatio * fCoefficient)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DEAD);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::LEVIOSO):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
@@ -294,10 +345,17 @@ HRESULT CGoblin::Ready_Parts()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Get_PartObject<CGoblin_Dagger>()->Set_Visible(false);
|
||||
|
||||
|
||||
CGoblin_Spector::GOBLIN_SPECTOR_DESC Goblin_SpectorDesc{};
|
||||
|
||||
Goblin_SpectorDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Spector>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Goblin_SpectorDesc,this))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#pragma region EFFECT
|
||||
/* EFFECT */
|
||||
|
||||
@@ -305,8 +363,6 @@ HRESULT CGoblin::Ready_Parts()
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
|
||||
if (FAILED(Add_PartObject<CEffectParts>("Goblin_Particle",g_iStaticLevel, &m_pGoblin_Particle, &PartsDesc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin_BattleAxe.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "TrailObject.h"
|
||||
#include "EffectParts.h"
|
||||
|
||||
CGoblin_BattleAxe::CGoblin_BattleAxe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CGoblin_BattleAxe::CGoblin_BattleAxe(const CGoblin_BattleAxe& Prototype)
|
||||
: CPartObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CGoblin_BattleAxe::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_BattleAxe::Initialize(void* pArg)
|
||||
{
|
||||
GOBLIN_BATTLEAXE_DESC* pDesc = static_cast<GOBLIN_BATTLEAXE_DESC*> (pArg);
|
||||
m_pSocketMatrices = pDesc->pSocketMatrices;
|
||||
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(Ready_Components())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
_matrix socketMatrix = {};
|
||||
|
||||
socketMatrix = XMLoadFloat4x4(m_pSocketMatrices);
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]);
|
||||
}
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CGoblin_BattleAxe::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CGoblin_BattleAxe::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_BattleAxe::Render()
|
||||
{
|
||||
if (!m_pModelCom)
|
||||
return S_OK;
|
||||
|
||||
if (!m_bVisible)
|
||||
return S_OK;
|
||||
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_BattleAxe::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Goblin_BattleAxe_Model"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_BattleAxe::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
CGoblin_BattleAxe* CGoblin_BattleAxe::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CGoblin_BattleAxe* pInstance = new CGoblin_BattleAxe(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CGoblin_BattleAxe");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CGoblin_BattleAxe::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CGoblin_BattleAxe* pInstance = new CGoblin_BattleAxe(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CGoblin_BattleAxe");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CGoblin_BattleAxe::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGoblin_BattleAxe::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -38,7 +38,7 @@ HRESULT CGoblin_Dagger::Initialize(void* pArg)
|
||||
|
||||
void CGoblin_Dagger::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
//m_pModelCom->Combined_BoneMatrix();
|
||||
if (m_bAttach)
|
||||
{
|
||||
_matrix socketMatrix = {};
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Layer.h"
|
||||
#include "EffectPool.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Goblin_Dagger.h"
|
||||
#include "Effect_Container.h"
|
||||
#include "Wand.h"
|
||||
@@ -89,7 +90,7 @@ void CGoblin_Mage::Update(_float fTimeDelta)
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
if (0.f == m_vStunTimer.x) {
|
||||
PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition();
|
||||
PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z);
|
||||
@@ -106,10 +107,9 @@ void CGoblin_Mage::Update(_float fTimeDelta)
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
for (_uint i = 0; i < ENUM_CLASS(GOBLIN_SKILL::END); i++)
|
||||
for (_uint i = 0; i < ENUM_CLASS(GOBLIN_SKILL::END); i++){
|
||||
m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -119,14 +119,17 @@ void CGoblin_Mage::Late_Update(_float fTimeDelta)
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform());
|
||||
}
|
||||
|
||||
if (true == m_bLookAt) {
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
}
|
||||
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Mage::Render()
|
||||
@@ -172,22 +175,58 @@ HRESULT CGoblin_Mage::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (0.f < m_fDeadRatio) {
|
||||
_bool bDisolve = false;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Mage::Render_Shadow()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", &m_pGameInstance->Get_ShadowDesc()->fFar, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::SHADOW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
_vector vWorldPos = {}; // 접촉지점
|
||||
_vector vWorldNomal = {}; // 접촉노말
|
||||
_vector vHitDir = {}; // 시도한 move 방향
|
||||
_float fLength = {}; // 작용된 힘
|
||||
|
||||
_uint iSkillType = dynamic_cast<CEffect_Container*>(pOther)->Get_SkillType();
|
||||
switch (iSkillType)
|
||||
@@ -199,8 +238,16 @@ void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
m_eHitSpell = STATEANIM::TUMBLE2;
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::JAP):
|
||||
{
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
break;
|
||||
_float fSkillRatio = m_pInfoInstance->Get_Spell_Info(ENUM_CLASS(SKILL_TYPE::JAP)).fSpell_Damage;
|
||||
_float fCoefficient = CollisionDesc->pObject->Get_Component<CStat>()->Get_Stat(ENUM_CLASS(STAT::MAGIC));
|
||||
if (true == Get_Damage(fSkillRatio * fCoefficient)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DEAD);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::LEVIOSO):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
break;
|
||||
@@ -208,9 +255,9 @@ void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
m_eHitSpell = STATEANIM::KNOCKDOWN_FWD;
|
||||
break;
|
||||
}
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::BLINK))
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::BLINK)){
|
||||
m_pFSM->Change_State(FSMSTATE::HIT);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CGoblin_Mage::OnHit(CGameObject* pOther, CGameObject* pCaller)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dead.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Spell.h"
|
||||
@@ -323,6 +324,67 @@ void CGoblin_Mage::Behavior_HitExit()
|
||||
m_pFSM->Disable_State(FSMSTATE::HIT);
|
||||
}
|
||||
|
||||
void CGoblin_Mage::Behavior_DeadEnter()
|
||||
{
|
||||
m_bLookAt = false;
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::DEAD);
|
||||
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_pRigidBody->SetActive(false);
|
||||
m_pCharacter_Controller->SetActive(false);
|
||||
|
||||
_bool bStrongerKnockDown = { false };
|
||||
|
||||
switch (m_eHitSpell)
|
||||
{
|
||||
case STATEANIM::KNOCKDOWN_FWD:
|
||||
bStrongerKnockDown = true;
|
||||
break;
|
||||
case STATEANIM::TUMBLE2:
|
||||
bStrongerKnockDown = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_float fabsRadius = fabsf(m_fHitRadius);
|
||||
_uint iState = { UINT_MAX };
|
||||
|
||||
if (fabsRadius > 135.f) {
|
||||
iState = STATEANIM::DEAD_FWD;
|
||||
}
|
||||
else if (fabsRadius < 45.f) {
|
||||
iState = STATEANIM::DEAD_BWD;
|
||||
}
|
||||
else {
|
||||
if (m_fHitRadius < 0.f) {
|
||||
iState = STATEANIM::DEAD_L;
|
||||
}
|
||||
else {
|
||||
iState = STATEANIM::DEAD_R;
|
||||
}
|
||||
}
|
||||
pairAnimInfo = m_Animation[iState + bStrongerKnockDown];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Mage::Behavior_DeadExitCheck(_float fTimeDelta)
|
||||
{
|
||||
if (FLT_EPSILON > m_pModelCom->Get_CurrentTrackProgressRatio()) {
|
||||
return E_PENDING;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_Mage::Behavior_DeadExit()
|
||||
{
|
||||
m_bDead = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CGoblin_Mage::Add_FSM()
|
||||
{
|
||||
@@ -395,7 +457,22 @@ void CGoblin_Mage::Add_FSM()
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
{
|
||||
CState_Dead::STATE_DEAD_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DeadEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DeadExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DeadExit(); };
|
||||
Desc.funcLateUpdate = [this](_float fDeadRatio) {
|
||||
m_fDeadRatio = fDeadRatio;
|
||||
if (m_fDeadRatio > 1.f) {
|
||||
m_bDead = true;
|
||||
}
|
||||
};
|
||||
Desc.vDeadTimer.x = FLT_EPSILON5;
|
||||
Desc.vDeadTimer.y = 2.f;
|
||||
m_States.emplace(FSMSTATE::DEAD, CState_Dead::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Hit
|
||||
|
||||
@@ -2,16 +2,9 @@
|
||||
#include "Goblin_Spector.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Goblin.h"
|
||||
#include "Effect_Container.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 "Goblin_BattleAxe.h"
|
||||
|
||||
#include "EffectParts.h"
|
||||
|
||||
@@ -33,6 +26,8 @@ HRESULT CGoblin_Spector::Initialize_Prototype()
|
||||
|
||||
HRESULT CGoblin_Spector::Initialize(void* pArg)
|
||||
{
|
||||
GOBLIN_SPECTOR_DESC* pDesc = static_cast<GOBLIN_SPECTOR_DESC*> (pArg);
|
||||
m_pParentTransformCom = pDesc->pParentTransform;
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -42,6 +37,10 @@ HRESULT CGoblin_Spector::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Parts()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pGoblin = dynamic_cast<CGoblin*>(m_pOwner);
|
||||
SAFE_ADDREF(m_pGoblin);
|
||||
|
||||
m_vOriginScale = m_pTransformCom->Get_Scale();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -55,29 +54,37 @@ void CGoblin_Spector::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
m_Offset = _float3(0.f, 0.3f, 0.f);
|
||||
|
||||
_matrix Offset = XMMatrixTranslation(m_Offset.x,
|
||||
m_Offset.y, m_Offset.z);
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(Offset * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
|
||||
if (m_pGoblin->Get_Swing())
|
||||
{
|
||||
if (m_vScale.x <= 2.f)
|
||||
{
|
||||
m_vScale.x += fTimeDelta;
|
||||
m_vScale.y += fTimeDelta;
|
||||
m_vScale.z += fTimeDelta;
|
||||
}
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
m_pModelCom->Set_AnimationIndex(m_pGoblin->Get_Component<CModel>()->Get_AnimIndex());
|
||||
m_pModelCom->Set_CurrentTrackPosition(m_pGoblin->Get_Component<CModel>()->Get_CurrentTrackPosition());
|
||||
Get_PartObject<CGoblin_BattleAxe>()->Set_Visible(true);
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
}
|
||||
else {
|
||||
Get_PartObject<CGoblin_BattleAxe>()->Set_Visible(false);
|
||||
m_vScale = { 1.f,1.f,1.f };
|
||||
m_pTransformCom->Set_Scale(m_vOriginScale);
|
||||
m_pModelCom->Set_AnimationIndex(5);
|
||||
}
|
||||
|
||||
|
||||
Play_Event();
|
||||
|
||||
GUI::Text("%d", m_pCharacter_Controller->IsActive());
|
||||
GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y);
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
}
|
||||
else {
|
||||
if (0.f == m_vStunTimer.x) {
|
||||
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_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
m_vStunTimer.x += fTimeDelta;
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose());
|
||||
if (m_vStunTimer.y < m_vStunTimer.x) {
|
||||
m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller);
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
@@ -87,31 +94,20 @@ void CGoblin_Spector::Update(_float fTimeDelta)
|
||||
void CGoblin_Spector::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform());
|
||||
}
|
||||
|
||||
|
||||
m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Spector::Render()
|
||||
{
|
||||
if (!m_bVisible)
|
||||
if (!m_bVisible || !m_pGoblin->Get_Swing())
|
||||
return S_OK;
|
||||
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
_uint iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::SPECTOR);
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
@@ -131,68 +127,12 @@ HRESULT CGoblin_Spector::Render()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
if (FAILED(m_pCharacter_Controller->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_vector CGoblin_Spector::Get_LockOnPos()
|
||||
{
|
||||
if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) {
|
||||
return m_pCharacter_Controller->Get_Position();
|
||||
}
|
||||
else if (nullptr != m_pRigidBody) {
|
||||
return m_pRigidBody->Get_Position();
|
||||
}
|
||||
return Get_WorldPostion();
|
||||
}
|
||||
|
||||
void CGoblin_Spector::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
/*if (true == m_bDead) {
|
||||
return;
|
||||
}
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
|
||||
_uint iSkillType = dynamic_cast<CEffect_Container*>(pOther)->Get_SkillType();
|
||||
m_fHitRadius = CMyTools::Get_Direction2D(m_pTransformCom->Get_State(STATE::LOOK), XMLoadFloat4(&CollisionDesc->vHitDir));
|
||||
switch (iSkillType)
|
||||
{
|
||||
case ENUM_CLASS(SKILL_TYPE::DESCENDO):
|
||||
m_eHitSpell = STATEANIM::KNOCKDOWN_FWD;
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::FLIPENDO):
|
||||
m_eHitSpell = STATEANIM::TUMBLE2;
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::JAP):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
if (true == Get_Damage(60.f)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DEAD);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::LEVIOSO):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
break;
|
||||
default:
|
||||
m_eHitSpell = STATEANIM::KNOCKDOWN_FWD;
|
||||
break;
|
||||
}
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::BLINK)) {
|
||||
m_pFSM->Change_State(FSMSTATE::HIT);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void CGoblin_Spector::OnHit(CGameObject* pOther, CGameObject* pCaller)
|
||||
@@ -217,36 +157,6 @@ HRESULT CGoblin_Spector::Ready_Components()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR);
|
||||
Desc.pTransform = m_pTransformCom;
|
||||
Desc.eBodyType = ACTOR::CAPSULE;
|
||||
Desc.fContactOffset = 0.001f;
|
||||
Desc.fMaterial = { 1.2f, 1.0f, 0.0f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.6f;
|
||||
Desc.fHeight = 0.7f;
|
||||
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create();
|
||||
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create();
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
Desc.fWalkableSlope = 45.f;
|
||||
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));
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR);
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -255,6 +165,18 @@ HRESULT CGoblin_Spector::Ready_Components()
|
||||
|
||||
HRESULT CGoblin_Spector::Ready_Parts()
|
||||
{
|
||||
|
||||
CGoblin_BattleAxe::GOBLIN_BATTLEAXE_DESC Goblin_BattleAxe_Desc{};
|
||||
|
||||
Goblin_BattleAxe_Desc.pParentTransform = m_pTransformCom;
|
||||
Goblin_BattleAxe_Desc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand");
|
||||
|
||||
if (FAILED(Add_PartObject<CGoblin_BattleAxe>("Goblin_BattleAxe", g_iStaticLevel, nullptr, &Goblin_BattleAxe_Desc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
#pragma region EFFECT
|
||||
/* EFFECT */
|
||||
|
||||
@@ -294,8 +216,6 @@ HRESULT CGoblin_Spector::Ready_Parts()
|
||||
|
||||
#pragma endregion
|
||||
return S_OK;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Spector::Bind_ShaderResources()
|
||||
@@ -331,7 +251,7 @@ CGoblin_Spector* CGoblin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceCont
|
||||
CGameObject* CGoblin_Spector::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CGoblin_Spector* pInstance = new CGoblin_Spector(*this);
|
||||
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CGoblin_Spector");
|
||||
@@ -344,25 +264,21 @@ void CGoblin_Spector::Free()
|
||||
{
|
||||
__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_RELEASE(m_pRigidBody);
|
||||
SAFE_RELEASE(m_pSmoke);
|
||||
SAFE_RELEASE(m_pGoblin_Particle);
|
||||
SAFE_RELEASE(m_pGoblin_Particle2);
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
SAFE_RELEASE(m_pGoblin);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGoblin_Spector::Describe_Entity()
|
||||
{
|
||||
|
||||
GUI::Begin("GoblinSpector");
|
||||
_float3 vScale = m_pTransformCom->Get_Scale();
|
||||
GUI::DragFloat3("Scale", (_float*)&vScale);
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "InfoInstance.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
#include "Goblin_Dagger.h"
|
||||
@@ -31,7 +31,7 @@ void CGoblin::Behavior_IdleEnter()
|
||||
|
||||
HRESULT CGoblin::Behavior_IdleExitCheck()
|
||||
{
|
||||
if (m_fTargetDistance <= 20.f && m_fTargetDistance >=1.f)
|
||||
if (m_fTargetDistance <= 20.f && m_fTargetDistance != 0.f)
|
||||
{
|
||||
m_vOriginPos = m_pTransformCom->Get_State(STATE::POSITION);
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
@@ -49,21 +49,67 @@ void CGoblin::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
|
||||
m_bLookAt = true;
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_MoveExitCheck()
|
||||
HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex();
|
||||
|
||||
if (m_fTargetDistance <= 15.f && m_fTargetDistance >=1.f)
|
||||
|
||||
if (m_fTargetDistance >= 6.f)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else {
|
||||
if (!m_bFirstMove)
|
||||
{
|
||||
_uint Rand = m_pGameInstance->Real_Random_Int(0, 3);
|
||||
|
||||
switch (Rand)
|
||||
{
|
||||
case 0:
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_112_L];
|
||||
break;
|
||||
case 1:
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_112_R];
|
||||
break;
|
||||
case 2:
|
||||
if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_R].first) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_112_R];
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_90_L];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_L].first) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_112_L];
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_90_R];
|
||||
}
|
||||
break;
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.5f, true);
|
||||
|
||||
m_bFirstMove = true;
|
||||
m_fMoveTime = 0.f;
|
||||
return S_OK;
|
||||
}
|
||||
m_fMoveTime += fTimeDelta;
|
||||
|
||||
if (m_fMoveTime >= 2.5f)
|
||||
{
|
||||
m_bFirstMove = false;
|
||||
m_fMoveTime = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 6.f && m_fTargetDistance !=0.f)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return E_FAIL;
|
||||
@@ -96,7 +142,7 @@ HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_fTargetDistance <= 7.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f)
|
||||
if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f)
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::SWING);
|
||||
}
|
||||
@@ -126,6 +172,7 @@ void CGoblin::Behavior_SwingEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::SWING);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SWING_FWD];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true);
|
||||
m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)];
|
||||
|
||||
@@ -133,11 +180,16 @@ void CGoblin::Behavior_SwingEnter()
|
||||
[this]() {m_bStep = false; },
|
||||
0.2f);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {m_bSwing = true; },
|
||||
0.05f);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[&]() { m_bLookAt = true;
|
||||
m_bStep = true;
|
||||
m_bSwing = false;
|
||||
m_pFSM->Change_State(FSMSTATE::SHUFFLE); },
|
||||
0.4f);
|
||||
0.45f);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
|
||||
@@ -146,7 +198,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
|
||||
_uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SWING) && m_bStep)
|
||||
{
|
||||
_float fDesiredRange = 1.f;
|
||||
_float fDesiredRange = 2.f;
|
||||
_float dist = m_fTargetDistance;
|
||||
|
||||
if (dist > fDesiredRange)
|
||||
@@ -228,7 +280,7 @@ void CGoblin::Behavior_BlinkEnter()
|
||||
_matrix rot = XMMatrixRotationY(randAngleRad);
|
||||
_vector offsetDir = XMVector3TransformNormal(vPlayerLook, rot);
|
||||
|
||||
_float randDist = m_pGameInstance->Real_Random_Float(1.f, 1.5f);
|
||||
_float randDist = m_pGameInstance->Real_Random_Float(5.f, 5.5f);
|
||||
|
||||
_vector vFinalPos = vPlayerPos + offsetDir * randDist;
|
||||
|
||||
@@ -290,7 +342,7 @@ void CGoblin::Behavior_ShuffleEnter()
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT); },
|
||||
0.2f);
|
||||
0.3f);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_ShuffleExitCheck(_float fTimeDelta)
|
||||
@@ -388,6 +440,11 @@ void CGoblin::Behavior_DeadEnter()
|
||||
m_bLookAt = false;
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::DEAD);
|
||||
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_pRigidBody->SetActive(false);
|
||||
m_pCharacter_Controller->SetActive(false);
|
||||
|
||||
_bool bStrongerKnockDown = { false };
|
||||
|
||||
@@ -407,17 +464,17 @@ void CGoblin::Behavior_DeadEnter()
|
||||
_uint iState = { UINT_MAX };
|
||||
|
||||
if (fabsRadius > 135.f) {
|
||||
iState = STATEANIM::DEAD_BWD;
|
||||
iState = STATEANIM::DEAD_FWD;
|
||||
}
|
||||
else if (fabsRadius < 45.f) {
|
||||
iState = STATEANIM::DEAD_FWD;
|
||||
iState = STATEANIM::DEAD_BWD;
|
||||
}
|
||||
else {
|
||||
if (m_fHitRadius < 0.f) {
|
||||
iState = STATEANIM::DEAD_R;
|
||||
iState = STATEANIM::DEAD_L;
|
||||
}
|
||||
else {
|
||||
iState = STATEANIM::DEAD_L;
|
||||
iState = STATEANIM::DEAD_R;
|
||||
}
|
||||
}
|
||||
pairAnimInfo = m_Animation[iState + bStrongerKnockDown];
|
||||
@@ -427,8 +484,8 @@ void CGoblin::Behavior_DeadEnter()
|
||||
|
||||
HRESULT CGoblin::Behavior_DeadExitCheck(_float fTimeDelta)
|
||||
{
|
||||
if (true == m_pModelCom->IsFinishedAnim()) {
|
||||
return E_FAIL;
|
||||
if ( FLT_EPSILON > m_pModelCom->Get_CurrentTrackProgressRatio()) {
|
||||
return E_PENDING;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -456,7 +513,7 @@ void CGoblin::Add_FSM()
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
@@ -523,6 +580,14 @@ void CGoblin::Add_FSM()
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DeadEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DeadExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DeadExit(); };
|
||||
Desc.funcLateUpdate = [this](_float fDeadRatio) {
|
||||
m_fDeadRatio = fDeadRatio;
|
||||
if (m_fDeadRatio > 1.f) {
|
||||
m_bDead = true;
|
||||
}
|
||||
};
|
||||
Desc.vDeadTimer.x = FLT_EPSILON5;
|
||||
Desc.vDeadTimer.y = 2.f;
|
||||
m_States.emplace(FSMSTATE::DEAD, CState_Dead::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
@@ -559,6 +624,10 @@ void CGoblin::Set_Anim()
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 147,true }; // 147
|
||||
m_Animation[STATEANIM::JOG_START] = { 157,false };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 146,false };
|
||||
m_Animation[STATEANIM::JOG_112_L] = { 148,true };
|
||||
m_Animation[STATEANIM::JOG_112_R] = { 152,true };
|
||||
m_Animation[STATEANIM::JOG_90_L] = { 151,true };
|
||||
m_Animation[STATEANIM::JOG_90_R] = { 155,true };
|
||||
|
||||
m_Animation[STATEANIM::SHUFFLE1] = { 203,false };
|
||||
m_Animation[STATEANIM::SHUFFLE2] = { 204,false };
|
||||
@@ -654,5 +723,9 @@ void CGoblin::Set_Anim()
|
||||
|
||||
//Jog 112도 L 148
|
||||
//Jog 112도 R 152
|
||||
// Jog 90 L 151
|
||||
// Jog 90 R 155
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,35 @@ HRESULT CInstancedProp::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Render_Shadow()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", &m_pGameInstance->Get_ShadowDesc()->fFar, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_iNumMesh; i++)
|
||||
{
|
||||
if (FAILED(m_pVIBufferInstanceCom->Bind_Matrial(m_pShaderCom, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pVIBufferInstanceCom->Render(i);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
|
||||
@@ -176,7 +176,7 @@ HRESULT CLevel_GamePlay::Ready_Background()
|
||||
isReady_Background = false;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isReady_Background = false;
|
||||
isReady_Background = true;
|
||||
#endif //
|
||||
#ifdef 인혁
|
||||
isReady_Background = false;
|
||||
@@ -376,7 +376,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
{
|
||||
for (_uint i = 0; i < 1; ++i)
|
||||
for (_uint i = 0; i < 5; ++i)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
@@ -385,9 +385,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Mage>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Spector>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Troll_Rock.h"
|
||||
#include "Goblin_Dagger.h"
|
||||
#include "Wand.h"
|
||||
#include "Goblin_BattleAxe.h"
|
||||
|
||||
#pragma region ACTOR
|
||||
|
||||
@@ -293,7 +294,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
isLoad_Background = false;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isLoad_Background = false;
|
||||
isLoad_Background = true;
|
||||
#endif //
|
||||
#ifdef 인혁
|
||||
isLoad_Background = false;
|
||||
@@ -818,8 +819,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
#pragma region Global_SRV
|
||||
{
|
||||
m_pGameInstance->Load_GlobalSRV(TEXT("GLOBAL_DISOLVE_NOISE_05"), "../Bin/Resources/Textures/Effect/Noises/VFX_T_Noise05_D.png");
|
||||
m_pGameInstance->Load_GlobalSRV(TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "../Bin/Resources/Textures/Effect/Diffuse/drp_fire_Line_Vertical.png");
|
||||
}
|
||||
#pragma endregion
|
||||
//#pragma region UI_ANI
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"),
|
||||
// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349))))
|
||||
@@ -1360,7 +1365,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Weapon_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Rock_Big_Model"),
|
||||
@@ -1368,7 +1373,11 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Dagger_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin", XMMatrixScaling(0.0002f, 0.0002f, 0.0002f) * XMMatrixRotationX(XMConvertToRadians(90.f)) * XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_BattleAxe_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
@@ -1713,83 +1722,83 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//#pragma region MAP_INSTANCE
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA */
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_OakTree_MedA.bin",
|
||||
// "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A */
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_BearBerry_A.bin",
|
||||
// "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_OwlPost_Window_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleA_L_Rectangle_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_Retangle_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleA_L_Square_Double_C.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_Quid_Window_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_Ollivanders_Box_Window.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_L_Double_Single_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_Round_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_Door1a.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//
|
||||
// /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b*/
|
||||
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"),
|
||||
// CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
// "../Bin/Resources/Models/InstanceProp/SM_HM_Door2b.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
// return E_FAIL;
|
||||
//#pragma endregion
|
||||
//
|
||||
|
||||
#pragma region MAP_INSTANCE
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_OakTree_MedA.bin",
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_BearBerry_A.bin",
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_OwlPost_Window_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleA_L_Rectangle_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_Retangle_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleA_L_Square_Double_C.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_Quid_Window_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_Ollivanders_Box_Window.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_L_Double_Single_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_WindowsStyleC_Round_Double_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_Door1a.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_HM_Door2b.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
#pragma endregion
|
||||
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Box */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
@@ -1905,6 +1914,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin_Dagger>(g_iStaticLevel, CGoblin_Dagger::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Goblin_BattleAxe */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin_BattleAxe>(g_iStaticLevel, CGoblin_BattleAxe::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Broom */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBroom>(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "MapContainer.h"
|
||||
#include "PartObject.h"
|
||||
#include "MapObject_Collision.h"
|
||||
#include "MapObject_Render.h"
|
||||
|
||||
//#include "MapObject_LOD.h"
|
||||
|
||||
@@ -62,21 +63,51 @@ HRESULT CMapContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapContainer::Render_Shadow()
|
||||
{
|
||||
unordered_map<_string, CPartObject*>::iterator iter = m_PartObjects.begin();
|
||||
for (; iter != m_PartObjects.end(); ++iter) {
|
||||
CPartObject* pObject = (*iter).second;
|
||||
if (FAILED(pObject->Render_Shadow())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapContainer::ReadyForPhysX()
|
||||
{
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ReadyForPhysX();
|
||||
if (true == m_bHasCollisionMesh) {
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ReadyForPhysX();
|
||||
}
|
||||
}
|
||||
else {
|
||||
unordered_map<_string, CPartObject*>::iterator iter = m_PartObjects.begin();
|
||||
for (; iter != m_PartObjects.end(); ++iter) {
|
||||
CMapObject_Render* pObject = static_cast<CMapObject_Render*>((*iter).second);
|
||||
pObject->ReadyForPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapContainer::ConvertToPhysX()
|
||||
{
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ConvertToPhysX();
|
||||
if (true == m_bHasCollisionMesh) {
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ConvertToPhysX();
|
||||
}
|
||||
}
|
||||
else {
|
||||
unordered_map<_string, CPartObject*>::iterator iter = m_PartObjects.begin();
|
||||
for (; iter != m_PartObjects.end(); ++iter) {
|
||||
CMapObject_Render* pObject = static_cast<CMapObject_Render*>((*iter).second);
|
||||
pObject->ConvertToPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,22 @@ void CMapObject_Collision::ReadyForPhysX()
|
||||
{
|
||||
CModel* pModel = m_pModelComs[iIndexLOD];
|
||||
|
||||
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix)))) {
|
||||
assert(false);
|
||||
_matrix parentMatrix = m_pParentTransformCom->Get_XMWorldMatrix();
|
||||
_matrix idenMatrix = XMMatrixIdentity();
|
||||
_bool bSkip = { false };
|
||||
for (_int i = 0; i < 4; ++i) {
|
||||
if (false == XMVector4NearEqual(idenMatrix.r[i], parentMatrix.r[i], XMVectorReplicate(FLT_EPSILON5))) {
|
||||
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix)))) {
|
||||
assert(false);
|
||||
}
|
||||
bSkip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (false == bSkip) {
|
||||
if (FAILED(pModel->Ready_PhysXMeshes(m_pParentTransformCom->Get_XMWorldMatrix()))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ void CMapObject_Render::Update(_float fTimeDelta)
|
||||
|
||||
void CMapObject_Render::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this);
|
||||
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), m_fRadius)) {
|
||||
|
||||
m_fCamDepth = XMVectorGetX(XMVector3LengthSq(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat4(&m_vExtentPosition)));
|
||||
@@ -142,7 +141,9 @@ HRESULT CMapObject_Render::Render_Shadow()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_iNumMeshe; i++)
|
||||
_uint iMeshes = m_pModelComs[0]->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
@@ -160,6 +161,52 @@ HRESULT CMapObject_Render::Render_Shadow()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapObject_Render::ReadyForPhysX()
|
||||
{
|
||||
if (true == m_bConverted) {
|
||||
return;
|
||||
}
|
||||
m_bConverted = true;
|
||||
|
||||
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
|
||||
{
|
||||
CModel* pModel = m_pModelComs[iIndexLOD];
|
||||
|
||||
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix)))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapObject_Render::ConvertToPhysX()
|
||||
{
|
||||
if (true == m_bReadyToCreatePhysX) {
|
||||
return;
|
||||
}
|
||||
m_bReadyToCreatePhysX = true;
|
||||
|
||||
m_RigidBodies.resize(m_iMaxLodLevel + 1);
|
||||
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
|
||||
{
|
||||
CModel* pModel = m_pModelComs[iIndexLOD];
|
||||
|
||||
_uint iNumMeshes = pModel->Get_NumMeshes();
|
||||
|
||||
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
|
||||
{
|
||||
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
|
||||
CRigidBody_Static* pRigidBody = { nullptr };
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
|
||||
Desc.pMeshName = wstrName.c_str();
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_wstring CMapObject_Render::Get_PrototypeTag(_uint iLodIndex)
|
||||
{
|
||||
if (m_iMaxLodLevel < iLodIndex)
|
||||
@@ -260,6 +307,12 @@ void CMapObject_Render::Free()
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
|
||||
for (_uint i = 0; i < m_RigidBodies.size(); ++i) {
|
||||
for (_uint j = 0; j < m_RigidBodies[i].size(); ++j) {
|
||||
SAFE_RELEASE(m_RigidBodies[i][j]);
|
||||
}
|
||||
} m_RigidBodies.clear();
|
||||
|
||||
for (auto& pModel : m_pModelComs)
|
||||
SAFE_RELEASE(pModel);
|
||||
m_pModelComs.clear();
|
||||
|
||||
@@ -57,6 +57,34 @@ void CMonster::Late_Update(_float fTimeDelta)
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render_DeadDisolve()
|
||||
{
|
||||
if (FLT_EPSILON3 * 10 < m_fDeadRatio) {
|
||||
_bool bDisolve = true;
|
||||
_float fDisolveAmount = 0.1f;
|
||||
_float fDisolveEdgeWidth = 0.1f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDeadRatio, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveAmount", &fDisolveAmount, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveEdgeWidth", &fDisolveEdgeWidth, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_NOISE_05"), "g_DeadDisolveTexture"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "g_DeadDisolveBurnTexture"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render_OutLine()
|
||||
{
|
||||
m_bDrawOutLine = false;
|
||||
|
||||
@@ -571,6 +571,7 @@ void CPlayer::Describe_Entity()
|
||||
|
||||
GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition());
|
||||
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
|
||||
GUI::Text("AnimSpeed %.2f", m_pModelCom->Get_AnimSpeed());
|
||||
|
||||
GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
|
||||
@@ -518,6 +518,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT];
|
||||
m_fAnimSpeed = 1.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -525,7 +526,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
|
||||
m_fAmount = 0.5f;
|
||||
m_fAmount = 0.3f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
else {
|
||||
@@ -550,6 +551,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT];
|
||||
m_fAnimSpeed = 1.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -557,7 +559,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
|
||||
m_fAmount = 0.5f;
|
||||
m_fAmount = 0.3f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
@@ -575,6 +577,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
else
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
m_fAnimSpeed = 1.2f;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -586,12 +589,13 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
|
||||
m_fAmount = 0.5f;
|
||||
m_fAmount = 0.3f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio, m_fAnimSpeed);
|
||||
m_fAmount = 1.f;
|
||||
m_fAnimSpeed = 1.f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,11 +611,13 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
m_pFSM->Enable_State(FSMSTATE::STOP);
|
||||
if (m_pFSM->IsEnable(FSMSTATE::WALK)) {
|
||||
m_bWalkToggle = false;
|
||||
m_pFSM->Disable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pFSM->IsEnable(FSMSTATE::SPRINT)) {
|
||||
m_bSprintToggle = false;
|
||||
m_pFSM->Disable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,17 @@ void CState_Dead::Enter()
|
||||
|
||||
HRESULT CState_Dead::Update(_float fTimeDelta)
|
||||
{
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
HRESULT hr = (__super::Update(fTimeDelta));
|
||||
switch (hr)
|
||||
{
|
||||
case E_PENDING:
|
||||
m_vDeadTimer.x += fTimeDelta;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_funcLateUpdate(m_vDeadTimer.x / m_vDeadTimer.y);
|
||||
if (m_vDeadTimer.x >= m_vDeadTimer.y) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
@@ -33,7 +43,8 @@ HRESULT CState_Dead::Initialize(STATE_DEAD_DESC* pDesc)
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
m_vDeadTimer = pDesc->vDeadTimer;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,18 @@ HRESULT CStreetContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Render_Shadow()
|
||||
{
|
||||
unordered_map<_string, CPartObject*>::iterator iter = m_PartObjects.begin();
|
||||
for (; iter != m_PartObjects.end(); ++iter) {
|
||||
CPartObject* pObject = (*iter).second;
|
||||
if (FAILED(pObject->Render_Shadow())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Troll_Weapon.h"
|
||||
#include "Troll_Rock.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Effect_Container.h"
|
||||
#include "EffectParts.h"
|
||||
|
||||
@@ -84,7 +85,7 @@ void CTroll::Update(_float fTimeDelta)
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
}
|
||||
else {
|
||||
else if (true == m_pRigidBody->IsActive()) {
|
||||
if (0.f == m_vStunTimer.x) {
|
||||
PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition();
|
||||
PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z);
|
||||
@@ -97,7 +98,6 @@ void CTroll::Update(_float fTimeDelta)
|
||||
m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
@@ -106,6 +106,8 @@ void CTroll::Update(_float fTimeDelta)
|
||||
for (_uint i = 0; i < ENUM_CLASS(TROLL_SKILL::END); i++)
|
||||
m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -137,6 +139,7 @@ void CTroll::Late_Update(_float fTimeDelta)
|
||||
m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this);
|
||||
}
|
||||
|
||||
HRESULT CTroll::Render()
|
||||
@@ -189,6 +192,38 @@ HRESULT CTroll::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTroll::Render_Shadow()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", &m_pGameInstance->Get_ShadowDesc()->fFar, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::SHADOW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_vector CTroll::Get_LockOnPos()
|
||||
{
|
||||
if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) {
|
||||
@@ -203,10 +238,6 @@ _vector CTroll::Get_LockOnPos()
|
||||
void CTroll::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
_vector vWorldPos = {}; // 접촉지점
|
||||
_vector vWorldNomal = {}; // 접촉노말
|
||||
_vector vHitDir = {}; // 시도한 move 방향
|
||||
_float fLength = {}; // 작용된 힘
|
||||
|
||||
_uint iSkillType = dynamic_cast<CEffect_Container*>(pOther)->Get_SkillType();
|
||||
switch (iSkillType)
|
||||
|
||||
@@ -254,7 +254,6 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta)
|
||||
}
|
||||
else {
|
||||
m_fRushTime += fTimeDelta;
|
||||
|
||||
if (m_fRushTime >= 1.5f)
|
||||
{
|
||||
m_fRushTime = 0.f;
|
||||
@@ -267,15 +266,18 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta)
|
||||
}
|
||||
if (iCurrAnimIndex == m_Animation[STATEANIM::RUSH_END].first)
|
||||
{
|
||||
if (m_fCross > 0)
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
if (m_fDegree >= 90.f)
|
||||
{
|
||||
if (m_fCross > 0)
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {m_bLookAt = true; },
|
||||
0.3f);
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {m_bLookAt = true; },
|
||||
0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
@@ -346,8 +348,8 @@ void CTroll::Behavior_SwingEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::SWING);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SWING_FWD];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] =
|
||||
m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)];
|
||||
|
||||
@@ -382,8 +384,8 @@ void CTroll::Behavior_SlamEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::SLAM);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SLAM];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] =
|
||||
m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)];
|
||||
|
||||
@@ -414,8 +416,10 @@ void CTroll::Behavior_BackHandSwingEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::BACKHAND_SWING);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] =
|
||||
m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)];
|
||||
|
||||
@@ -622,10 +626,10 @@ void CTroll::Set_Anim()
|
||||
m_Animation[STATEANIM::IDLE] = { 16,true };
|
||||
m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R] = { 7,false };
|
||||
m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L] = { 8,false };
|
||||
m_Animation[STATEANIM::IDLE_BREAK1] = { 11,false };
|
||||
m_Animation[STATEANIM::IDLE_BREAK2] = { 141,false };
|
||||
m_Animation[STATEANIM::IDLE_BREAK3] = { 14,false };
|
||||
m_Animation[STATEANIM::IDLE_BREAK4] = { 143,false };
|
||||
m_Animation[STATEANIM::IDLE_BREAK1] = { 11,false }; // 땅2번구르기
|
||||
m_Animation[STATEANIM::IDLE_BREAK2] = { 141,false }; // 방망이
|
||||
m_Animation[STATEANIM::IDLE_BREAK3] = { 14,false }; // 땅구르기
|
||||
m_Animation[STATEANIM::IDLE_BREAK4] = { 143,false }; // 소리지르기
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 22,true };
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class CBuildingContainer final : public CMapContainer // OCCLUSION CONTAINER
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow()override;
|
||||
virtual HRESULT Render_BoundingBox() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_Troll_Behavior final : public PSX::PxUserControllerHitReport
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
private:
|
||||
CCallBack_Troll_Behavior();
|
||||
public:
|
||||
~CCallBack_Troll_Behavior();
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
// 충돌알림!!
|
||||
// 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까?
|
||||
virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우
|
||||
|
||||
virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
|
||||
public:
|
||||
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject);
|
||||
HRESULT Finalize();
|
||||
private:
|
||||
CCharacter_Controller* m_pController = { nullptr };
|
||||
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
public:
|
||||
static CCallBack_Troll_Behavior* Create();
|
||||
};
|
||||
NS_END
|
||||
@@ -26,10 +26,11 @@ class CGoblin final : public CMonster
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
virtual _vector Get_LockOnPos() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override;
|
||||
virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override;
|
||||
|
||||
_bool Get_Swing() { return m_bSwing; }
|
||||
|
||||
private:
|
||||
CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
@@ -66,20 +67,23 @@ class CGoblin final : public CMonster
|
||||
virtual void Set_Anim();
|
||||
|
||||
_float m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = {};
|
||||
_float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = { 5.f,2.f,15.f };
|
||||
_float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = { 6.f,2.f,15.f };
|
||||
|
||||
_bool m_bStep = { false };
|
||||
_float m_fTpTime = {};
|
||||
_float m_fAirTime = {};
|
||||
_bool m_bStep = { false };
|
||||
_float m_fTpTime = {};
|
||||
_float m_fAirTime = {};
|
||||
_vector m_vOriginPos = {};
|
||||
_float m_fLength = {};
|
||||
_float m_fLength = {};
|
||||
_bool m_bSwing = { false };
|
||||
_float m_fMoveTime = {};
|
||||
_bool m_bFirstMove = {};
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck();
|
||||
HRESULT Behavior_MoveExitCheck(_float fTimeDelta);
|
||||
void Behavior_MoveExit();
|
||||
|
||||
void Behavior_CombatEnter();
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CGoblin_BattleAxe final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagGoblinBattleAxe : public CPartObject::PARTOBJECT_DESC
|
||||
{
|
||||
const _float4x4* pSocketMatrices = { };
|
||||
}GOBLIN_BATTLEAXE_DESC;
|
||||
private:
|
||||
CGoblin_BattleAxe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CGoblin_BattleAxe(const CGoblin_BattleAxe& Prototype);
|
||||
virtual ~CGoblin_BattleAxe() = 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;
|
||||
virtual HRESULT Render() override;
|
||||
public:
|
||||
|
||||
private:
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CGoblin_BattleAxe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override;
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -26,6 +26,7 @@ class CGoblin_Mage final : public CMonster
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override;
|
||||
virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override;
|
||||
|
||||
@@ -97,6 +98,9 @@ class CGoblin_Mage final : public CMonster
|
||||
HRESULT Behavior_HitExitCheck(_float fTimeDelta);
|
||||
void Behavior_HitExit();
|
||||
|
||||
void Behavior_DeadEnter();
|
||||
HRESULT Behavior_DeadExitCheck(_float fTimeDelta);
|
||||
void Behavior_DeadExit();
|
||||
private:
|
||||
class CEffectPool* m_pEffectPool = nullptr;
|
||||
};
|
||||
|
||||
@@ -5,10 +5,19 @@
|
||||
#include "CallBack_Monster_Behavior.h"
|
||||
#include "CallBack_Monster_HitReport.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CGoblin_Spector final : public CMonster
|
||||
{
|
||||
public:
|
||||
typedef struct tagSpector
|
||||
{
|
||||
CTransform* pParentTransform = { nullptr };
|
||||
}GOBLIN_SPECTOR_DESC;
|
||||
private:
|
||||
CGoblin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CGoblin_Spector(const CGoblin_Spector& Prototype);
|
||||
@@ -19,19 +28,18 @@ class CGoblin_Spector final : public CMonster
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual _vector Get_LockOnPos() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override;
|
||||
virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override;
|
||||
|
||||
|
||||
private:
|
||||
CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
_float2 m_vStunTimer = { 0.f, 4.f };
|
||||
class CGoblin* m_pGoblin = { nullptr };
|
||||
CTransform* m_pParentTransformCom = { nullptr };
|
||||
_uint iIndex;
|
||||
_float3 m_Offset = {};
|
||||
_float3 m_vOriginScale = {};
|
||||
_float3 m_vScale = { 1.f, 1.f, 1.f };
|
||||
|
||||
|
||||
|
||||
class CEffectParts* m_pSmoke = { nullptr };
|
||||
@@ -54,6 +62,13 @@ class CGoblin_Spector final : public CMonster
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
_bool m_bStep = { false };
|
||||
_float m_fTpTime = {};
|
||||
_float m_fAirTime = {};
|
||||
_vector m_vOriginPos = {};
|
||||
_float m_fLength = {};
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -29,6 +29,7 @@ class CInstancedProp final : public CGameObject
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow()override;
|
||||
|
||||
private:
|
||||
_uint m_iNumMesh = {};
|
||||
|
||||
@@ -25,6 +25,7 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
|
||||
void ReadyForPhysX();
|
||||
void ConvertToPhysX();
|
||||
@@ -42,7 +43,7 @@ class CMapContainer abstract : public CContainerObject
|
||||
if (nullptr == pPartObject) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_bHasCollisionMesh = true;
|
||||
m_ColiisonPartObjects.push_back(pPartObject);
|
||||
|
||||
return S_OK;
|
||||
@@ -54,8 +55,8 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
|
||||
protected:
|
||||
_uint m_iMaxLodLevel = {};
|
||||
|
||||
_uint m_iMaxLodLevel = {};
|
||||
_bool m_bHasCollisionMesh = { false };
|
||||
vector<class CPartObject*> m_ColiisonPartObjects = {};
|
||||
|
||||
public:
|
||||
|
||||
@@ -24,6 +24,8 @@ class CMapObject_Render final : public CMapPartObject // Render PartObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
void ReadyForPhysX();
|
||||
void ConvertToPhysX();
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
@@ -33,12 +35,15 @@ class CMapObject_Render final : public CMapPartObject // Render PartObject
|
||||
MAPOBJECT_RENDER_TYPE m_Type = {};
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
vector<CModel*> m_pModelComs;
|
||||
vector<vector<CRigidBody_Static*>> m_RigidBodies;
|
||||
|
||||
_uint m_iLodIndex = {};
|
||||
_uint m_iShaderPass = {};
|
||||
_uint m_iNumMeshe = {};
|
||||
|
||||
_float m_fRadius = { 0.f };
|
||||
_bool m_bReadyToCreatePhysX = { false };
|
||||
_bool m_bConverted = { false };
|
||||
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
|
||||
@@ -16,6 +16,7 @@ class CMonster abstract : public CUnit
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render_DeadDisolve();
|
||||
virtual HRESULT Render_OutLine() override;
|
||||
virtual void Set_DrawOutLine();
|
||||
_float4 Get_TargetPos() { return m_vTargetPos; }
|
||||
@@ -29,6 +30,7 @@ class CMonster abstract : public CUnit
|
||||
_float4 m_vTargetPos = { };
|
||||
_float3 m_vToTargetDir = { };
|
||||
_float m_fTargetDistance = { FLT_MAX };
|
||||
_float m_fDeadRatio = { 0.f };
|
||||
_bool m_bDrawOutLine = { false };
|
||||
_bool m_bLookAt = { true };
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ class CPlayer final : public CUnit
|
||||
_float m_fInputTime = {};
|
||||
_bool m_bRatio = { false };
|
||||
_bool m_bAim = { false };
|
||||
_float m_fAnimSpeed = {};
|
||||
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
|
||||
@@ -35,9 +35,9 @@ class CSkill_Data final : public CBase
|
||||
private:
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
_int m_iSpell_Count{};
|
||||
SPELL_INFO SpellInfo[34] = {};
|
||||
_float m_iSpell_CoolTime[34] = {};
|
||||
_int m_iSpell_Count{};
|
||||
SPELL_INFO SpellInfo[34] = {};
|
||||
_float m_iSpell_CoolTime[34] = {};
|
||||
|
||||
_bool m_bNoCool = { false };
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ class CState_Dead final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagLand : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
_float2 vDeadTimer = { 0.f, 2.f };
|
||||
function<void(_float)> funcLateUpdate = { nullptr };
|
||||
}STATE_DEAD_DESC;
|
||||
private:
|
||||
CState_Dead();
|
||||
@@ -21,7 +22,8 @@ class CState_Dead final : public CState_Root
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_DEAD_DESC* pDesc);
|
||||
|
||||
_float2 m_vDeadTimer = { 0.f, 2.f };
|
||||
function<void(_float)> m_funcLateUpdate = { nullptr };
|
||||
public:
|
||||
static CState_Dead* Create(STATE_DEAD_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -17,6 +17,7 @@ class CStreetContainer final : public CMapContainer // NON OCCLUSION CONTAINER
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -29,6 +29,7 @@ class CTroll final : public CMonster
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Shadow() override;
|
||||
virtual _vector Get_LockOnPos() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override;
|
||||
virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override;
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -375,4 +375,21 @@ float3 Filmic_ToneMapper(float3 vColor)
|
||||
}
|
||||
|
||||
|
||||
float4 ApplyDissolve(Texture2D DisolveTexture, float fDisolveRatio, float fDisolveAmount, float fDisolveEdgeWidth, float4 vDisolveEdgeColor, float4 vMtrlDiffuse, float2 vTexcoord)
|
||||
{
|
||||
float4 vDisolve = DisolveTexture.Sample(DefaultSampler, vTexcoord);
|
||||
float fDisolveValue = vDisolve.r;
|
||||
|
||||
float fDisolveThreshold = saturate(fDisolveRatio + fDisolveAmount);
|
||||
|
||||
clip(fDisolveValue - fDisolveThreshold); // 진짜 잘려나감
|
||||
|
||||
float edgeWidth = max(fDisolveEdgeWidth, FLT_EPSILON5); // 불타는 라인
|
||||
float edgeFactor = smoothstep(fDisolveThreshold, fDisolveThreshold + edgeWidth, fDisolveValue);
|
||||
|
||||
vMtrlDiffuse.rgb = lerp(vDisolveEdgeColor.rgb, vMtrlDiffuse.rgb, edgeFactor);
|
||||
|
||||
return vMtrlDiffuse;
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -569,8 +569,8 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vPreShadowTexcoord.y = (vPreShadowPosition.y / vPreShadowPosition.w) * -0.5f + 0.5f;
|
||||
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.25f, 1.f, lerp(fVisibility_Dynamic_Near, fVisibility_Static, vDepthDesc.y));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
bool g_bRimLight;
|
||||
bool g_bUseNormalMap;
|
||||
bool g_bDisolve;
|
||||
|
||||
float g_fFar;
|
||||
float g_LifeRatio;
|
||||
@@ -16,6 +17,11 @@ float3 g_vOutLineColor;
|
||||
float g_fOutLineScale;
|
||||
float g_fOutLineThickness;
|
||||
float g_fOutLinePower;
|
||||
float g_fDisolveRatio;
|
||||
float g_fDisolveAmount;
|
||||
float g_fDisolveEdgeWidth;
|
||||
|
||||
vector g_vDisolveEdgeColor;
|
||||
vector g_vCamPosition;
|
||||
|
||||
Texture2D g_DiffuseTexture;
|
||||
@@ -27,6 +33,9 @@ Texture2D g_TransmissionTexture;
|
||||
Texture2D g_EmissiveTexture;
|
||||
Texture2D g_AmbientTexture;
|
||||
Texture2D g_AmbientOcclusionTexture;
|
||||
Texture2D g_UnknownTexture;
|
||||
Texture2D g_DeadDisolveTexture;
|
||||
Texture2D g_DeadDisolveBurnTexture;
|
||||
|
||||
|
||||
bool g_bBinded_Texture[AI_TEXTURE_TYPE_MAX * 27];
|
||||
@@ -257,6 +266,11 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
|
||||
float4 vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
if (true == g_bDisolve)
|
||||
{
|
||||
float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vMtrlDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vMtrlDiffuse, In.vTexcoord);
|
||||
}
|
||||
//if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true))
|
||||
//{
|
||||
// float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
@@ -472,20 +486,14 @@ PS_OUT PS_SPECTOR_MAIN(PS_IN In)
|
||||
|
||||
float4 vMtrlDiffuse = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
//if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true))
|
||||
//{
|
||||
// float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
// vMtrlDiffuse *= vTransmission;
|
||||
//}
|
||||
//if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true))
|
||||
//{
|
||||
// float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
// vMtrlDiffuse += vEmissive;
|
||||
//}
|
||||
if (vMtrlDiffuse.a < 0.2f)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
if (vMtrlDiffuse.r > 0.3f)
|
||||
{
|
||||
vMtrlDiffuse.rgb *= float3(2.f, 1.f, 1.f);
|
||||
}
|
||||
|
||||
float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
|
||||
|
||||
@@ -5,6 +5,7 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
bool g_bUVTargetDiffuse;
|
||||
bool g_bAdditiveDisolve;
|
||||
bool g_bDisolve;
|
||||
|
||||
float g_LifeRatio;
|
||||
float g_fFar;
|
||||
@@ -34,6 +35,7 @@ Texture2D g_TransmissionTexture;
|
||||
Texture2D g_EmissiveTexture;
|
||||
Texture2D g_AmbientTexture;
|
||||
Texture2D g_AmbientOcclusionTexture;
|
||||
Texture2D g_UnknownTexture;
|
||||
|
||||
bool g_bBinded_Texture[AI_TEXTURE_TYPE_MAX * 27];
|
||||
|
||||
@@ -46,6 +48,7 @@ Texture2D g_GlassTexture;
|
||||
TextureCube g_CubeTexture;
|
||||
Texture2D g_NormalLargeTexture;
|
||||
Texture2D g_NormalSubTexture;
|
||||
Texture2D g_DeadDisolveTexture;
|
||||
|
||||
float g_fNormalValue1;
|
||||
float g_fNormalValue2;
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 319 KiB |
@@ -2030,8 +2030,8 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_SK_WPN_Troll_Club07_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Troll\\SK_WPN_Troll_Club07.fbx", XMMatrixIdentity())))) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_SK_WPN_GOB_SmallSword_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Goblins\\SK_WPN_GOB_SmallSword.fbx", XMMatrixIdentity())))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -375,4 +375,21 @@ float3 Filmic_ToneMapper(float3 vColor)
|
||||
}
|
||||
|
||||
|
||||
float4 ApplyDissolve(Texture2D DisolveTexture, float fDisolveRatio, float fDisolveAmount, float fDisolveEdgeWidth, float4 vDisolveEdgeColor, float4 vMtrlDiffuse, float2 vTexcoord)
|
||||
{
|
||||
float4 vDisolve = DisolveTexture.Sample(DefaultSampler, vTexcoord);
|
||||
float fDisolveValue = vDisolve.r;
|
||||
|
||||
float fDisolveThreshold = saturate(fDisolveRatio + fDisolveAmount);
|
||||
|
||||
clip(fDisolveValue - fDisolveThreshold); // 진짜 잘려나감
|
||||
|
||||
float edgeWidth = max(fDisolveEdgeWidth, FLT_EPSILON5); // 불타는 라인
|
||||
float edgeFactor = smoothstep(fDisolveThreshold, fDisolveThreshold + edgeWidth, fDisolveValue);
|
||||
|
||||
vMtrlDiffuse.rgb = lerp(vDisolveEdgeColor.rgb, vMtrlDiffuse.rgb, edgeFactor);
|
||||
|
||||
return vMtrlDiffuse;
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -569,8 +569,8 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vPreShadowTexcoord.y = (vPreShadowPosition.y / vPreShadowPosition.w) * -0.5f + 0.5f;
|
||||
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.25f, 1.f, lerp(fVisibility_Dynamic_Near, fVisibility_Static, vDepthDesc.y));
|
||||
|
||||
|
||||
@@ -520,6 +520,16 @@ _bool CGameInstance::isIn_LocalFrustum(_fvector vLocalPos, _float fRadius)
|
||||
return m_pPipeLine->isIn_LocalFrustum(vLocalPos, fRadius);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Bind_GlobalSRV(CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName)
|
||||
{
|
||||
return m_pPipeLine->Bind_GlobalSRV(pShader, wszKeyGlobalSRV, pConstantName);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder)
|
||||
{
|
||||
return m_pPipeLine->Load_GlobalSRV(wszKeyGlobalSRV, pathSRVFolder);
|
||||
}
|
||||
|
||||
void CGameInstance::Add_Light(_uint _iCurrentLevel, CLight* _pLight)
|
||||
{
|
||||
m_pLight_Manager->Add_Light(_iCurrentLevel, _pLight);
|
||||
|
||||
@@ -553,6 +553,7 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader)
|
||||
pConstantName = "g_AmbientOcclusionTexture";
|
||||
break;
|
||||
case aiTextureType_UNKNOWN:
|
||||
pConstantName = "g_UnknownTexture";
|
||||
break;
|
||||
case aiTextureType_SHEEN:
|
||||
break;
|
||||
|
||||
@@ -307,7 +307,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform)
|
||||
return m_bIsFinishedAnim;
|
||||
}
|
||||
|
||||
void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio)
|
||||
void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio, _float fAnimSpeed)
|
||||
{
|
||||
if (m_iCurrentAnimIndex == iIndex)
|
||||
return;
|
||||
@@ -324,7 +324,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _boo
|
||||
m_iPreAnimIndex = m_iCurrentAnimIndex;
|
||||
|
||||
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
|
||||
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
|
||||
m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(1.f);
|
||||
}
|
||||
|
||||
m_fBlendTime = 0.f;
|
||||
@@ -336,7 +336,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _boo
|
||||
m_bRatio = bRatio;
|
||||
|
||||
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
|
||||
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
|
||||
m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fAnimSpeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "PipeLine.h"
|
||||
#include "Shader.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CPipeLine::CPipeLine()
|
||||
:m_pGameInstance(CGameInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
void CPipeLine::Set_Transform(D3DTS eState, _fmatrix TransformStateMatrix)
|
||||
@@ -63,6 +68,29 @@ _bool CPipeLine::isIn_LocalFrustum(_fvector vLocalPos, _float fRadius)
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT CPipeLine::Bind_GlobalSRV(CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName)
|
||||
{
|
||||
ID3D11ShaderResourceView* pSRV = Find_GlobalShader(wszKeyGlobalSRV);
|
||||
if (FAILED(pShader->Bind_SRV(pConstantName, pSRV))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPipeLine::Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder)
|
||||
{
|
||||
ID3D11ShaderResourceView* pSRV = Find_GlobalShader(wszKeyGlobalSRV);
|
||||
if (nullptr != pSRV) {
|
||||
return E_FAIL;
|
||||
}
|
||||
pSRV = m_pGameInstance->Add_Resource(pathSRVFolder.string().c_str());
|
||||
if (nullptr == pSRV) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_mapGlobalSRV.emplace(wszKeyGlobalSRV, pSRV);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPipeLine::Update()
|
||||
{
|
||||
for (_uint i = ENUM_CLASS(D3DTS::VIEW_INV); i < ENUM_CLASS(D3DTS::END); ++i)
|
||||
@@ -112,6 +140,15 @@ void CPipeLine::Make_Planes(const _float4* pPoints, _float4* pPlanes)
|
||||
XMStoreFloat4(&pPlanes[5], XMPlaneFromPoints(XMLoadFloat4(&pPoints[0]), XMLoadFloat4(&pPoints[1]), XMLoadFloat4(&pPoints[2])));
|
||||
}
|
||||
|
||||
ID3D11ShaderResourceView* CPipeLine::Find_GlobalShader(const _tchar* wszKeyGlobalSRV)
|
||||
{
|
||||
auto iter = m_mapGlobalSRV.find(wszKeyGlobalSRV);
|
||||
if (iter == m_mapGlobalSRV.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return (*iter).second;
|
||||
}
|
||||
|
||||
CPipeLine* CPipeLine::Create()
|
||||
{
|
||||
CPipeLine* pInstance = new CPipeLine();
|
||||
@@ -127,4 +164,9 @@ CPipeLine* CPipeLine::Create()
|
||||
void CPipeLine::Free()
|
||||
{
|
||||
__super::Free();
|
||||
for (auto& pairSRV : m_mapGlobalSRV) {
|
||||
SAFE_RELEASE(pairSRV.second);
|
||||
}
|
||||
m_mapGlobalSRV.clear();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
@@ -137,13 +137,18 @@ HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal)
|
||||
m_pRigidBody->setAngularVelocity(PSX::PxZERO()); // DO 객체 이동 제거
|
||||
m_pRigidBody->setLinearVelocity(PSX::PxZERO());
|
||||
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody); // 현재 액터 비활성화
|
||||
m_bActive = false;
|
||||
Detach_Actor();
|
||||
CCTOriginal.SetActive(true);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Detach_Actor()
|
||||
{
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody); // 현재 액터 비활성화
|
||||
m_bActive = false;
|
||||
}
|
||||
|
||||
_vector CRigidBody_Dynamic::Get_Position()
|
||||
{
|
||||
PSX::PxVec3 pxPos = m_pRigidBody->getGlobalPose().p;
|
||||
|
||||
@@ -122,7 +122,7 @@ _bool CStat::Get_Damage(_float fDamage)
|
||||
{
|
||||
_bool bResultDead = { false };
|
||||
_float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)) - fDamage;
|
||||
if (fCurHp < 0) { fCurHp = 0; bResultDead = true; }
|
||||
if (fCurHp <= 0) { fCurHp = 0; bResultDead = true; }
|
||||
Set_Stat(ENUM_CLASS(STAT::HP), fCurHp);
|
||||
return bResultDead;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class ENGINE_DLL CComponent abstract : public CBase
|
||||
|
||||
public:
|
||||
virtual HRESULT Render() { return S_OK; }
|
||||
virtual class CGameObject* Get_Owner() { return m_pOwner; }
|
||||
|
||||
protected:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
@@ -35,4 +36,4 @@ class ENGINE_DLL CComponent abstract : public CBase
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -400,7 +400,7 @@ typedef struct tagOnCollsionInfo
|
||||
_float4 vWorldNomal = {}; // 접촉노말
|
||||
_float4 vHitDir = {}; // 시도한 move 방향
|
||||
_float fLength = {}; // 작용된 힘
|
||||
|
||||
class CGameObject* pObject = { nullptr }; // 시전자
|
||||
}ON_COLLISION_INFO;
|
||||
|
||||
typedef struct tagKeyFrameDesc
|
||||
|
||||
@@ -138,6 +138,8 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
void Transform_Frustum_ToLocalSpace(_fmatrix WorldMatrixInverse);
|
||||
_bool isIn_WorldFrustum(_fvector vWorldPos, _float fRadius);
|
||||
_bool isIn_LocalFrustum(_fvector vLocalPos, _float fRadius);
|
||||
HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName);
|
||||
HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder);
|
||||
|
||||
#pragma endregion
|
||||
#pragma region LIGHT_MANAGER
|
||||
|
||||
@@ -35,7 +35,7 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌
|
||||
_bool Play_Anim(_float fTimeDelta, CTransform* pTransform);
|
||||
_bool Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform);
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false);
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false,_float fAnimSpeed = 1.f);
|
||||
void Set_Second_AnimationIndex(_uint iIndex, _uint BoneIndex, _bool isLoop = false);
|
||||
_bool IsFinishedAnim() const { return m_bIsFinishedAnim; }
|
||||
_bool IsFinishedSecondAnim() const { return m_bIsSecondFinishedAnim; }
|
||||
|
||||
@@ -21,11 +21,13 @@ class CPipeLine final : public CBase
|
||||
_bool isIn_WorldFrustum(_fvector vWorldPos, _float fRadius);
|
||||
_bool isIn_LocalFrustum(_fvector vLocalPos, _float fRadius);
|
||||
|
||||
|
||||
HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName);
|
||||
HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder);
|
||||
public:
|
||||
void Update();
|
||||
|
||||
private:
|
||||
class CGameInstance* m_pGameInstance = { nullptr };
|
||||
_float4x4 m_TransformStateMatrices[ENUM_CLASS(D3DTS::END)] = {};
|
||||
_float4 m_vCamPosition = {};
|
||||
|
||||
@@ -34,9 +36,12 @@ class CPipeLine final : public CBase
|
||||
_float4 m_vWorldPlanes[6] = {};
|
||||
_float4 m_vLocalPlanes[6] = {};
|
||||
|
||||
unordered_map<_wstring, ID3D11ShaderResourceView*> m_mapGlobalSRV = {};
|
||||
private:
|
||||
HRESULT Initialize();
|
||||
void Make_Planes(const _float4* pPoints, _float4* pPlanes);
|
||||
ID3D11ShaderResourceView* Find_GlobalShader(const _tchar* wszKeyGlobalSRV);
|
||||
|
||||
public:
|
||||
static CPipeLine* Create();
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -44,6 +44,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
void Set_Kinematic(_bool bKinematic);
|
||||
|
||||
HRESULT ConvertToCCT(class CCharacter_Controller& CCTOriginal);
|
||||
void Detach_Actor();
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ enum ESTATE
|
||||
IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4,
|
||||
MOVE,
|
||||
WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START,WALK_STOP,
|
||||
JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,
|
||||
JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,JOG_112_L,JOG_112_R,JOG_90_L,JOG_90_R,
|
||||
SPRINT,
|
||||
JUMP,JUMP_JOG,JUMP_SPRINT,
|
||||
LAND,
|
||||
|
||||
Reference in New Issue
Block a user