Merge pull request #540 from SpicyGangjeong/Model

Model
This commit is contained in:
hyunbin14
2025-12-24 14:09:51 +09:00
committed by GitHub
55 changed files with 3873 additions and 106 deletions
@@ -165,6 +165,7 @@ call Update_Resources.bat
<ClInclude Include="..\Public\AvadakedavraSide.h" />
<ClInclude Include="..\Public\CallBack_NonPlayable_Behavior.h" />
<ClInclude Include="..\Public\CallBack_NonPlayable_HitReport.h" />
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h" />
<ClInclude Include="..\Public\State_Fall.h" />
<ClInclude Include="..\Public\TransformationSide.h" />
<ClInclude Include="..\Public\Transformation.h" />
@@ -398,6 +399,7 @@ call Update_Resources.bat
<ClCompile Include="..\Private\AvadakedavraSide.cpp" />
<ClCompile Include="..\Private\CallBack_NonPlayable_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_NonPlayable_HitReport.cpp" />
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp" />
<ClCompile Include="..\Private\State_Fall.cpp" />
<ClCompile Include="..\Private\TransformationSide.cpp" />
<ClCompile Include="..\Private\Transformation.cpp" />
@@ -719,6 +719,9 @@
<ClInclude Include="..\Public\AvadakedavraSide.h">
<Filter>02.GameObjects\Effect\Effects\Avadakedavra\AvadakedavraSide</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h">
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Client.ico">
@@ -1497,6 +1500,9 @@
<Filter Include="02.GameObjects\Effect\Effects\Avadakedavra\AvadakedavraSide">
<UniqueIdentifier>{f9c3f711-4032-4455-9d70-b81c5320f8c8}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok">
<UniqueIdentifier>{93545681-c4c5-4a6a-9496-7b2e7b8a9302}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Client.cpp">
@@ -2163,6 +2169,9 @@
<ClCompile Include="..\Private\AvadakedavraSide.cpp">
<Filter>02.GameObjects\Effect\Effects\Avadakedavra\AvadakedavraSide</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Goblin_States.cpp">
@@ -0,0 +1,218 @@
#include "pch.h"
#include "CallBack_Ranrok_HitReport.h"
#include "GameInstance.h"
#include "Character_Controller.h"
#include "RigidBody_Dynamic.h"
#include "Unit.h"
#include "GameObject.h"
CCallBack_Ranrok_HitReport::CCallBack_Ranrok_HitReport()
{
}
CCallBack_Ranrok_HitReport::~CCallBack_Ranrok_HitReport()
{
}
void CCallBack_Ranrok_HitReport::BeginFrame()
{
// 매 프레임 초기화
m_vClimbNormal = { 0.f, 1.f, 0.f };
m_bGroundHit = { false };
m_fBestNormal = { 0.f };
}
void CCallBack_Ranrok_HitReport::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:
case PXOBJECT::FLOOR:
case PXOBJECT::ROAD:
if (vWorldNormal.y > 0) {
_float fDotValue = vWorldNormal.dot({ 0.f, 1.f, 0.f });
if (m_fBestNormal < fDotValue) {
m_bGroundHit = true;
m_fBestNormal = fDotValue;
m_vClimbNormal = { vWorldNormal.x, vWorldNormal.y, vWorldNormal.z };
}
}
break;
default:
break;
}
break;
case PHYSX_KIND::BODY_DYNAMIC:
{
switch (PXOBJECT(pTargetActorData->iSubKind))
{
case PXOBJECT::END:
break;
case PXOBJECT::BOX:
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
//pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
PSX::PxVec3 vCompressedDir = -vWorldNormal;
vCompressedDir.normalize();
pDynamic->addForce(vCompressedDir * fLength * 1000.f, PSX::PxForceMode::eFORCE);
} break;
default:
{
}
break;
}
} break;
case PHYSX_KIND::CCTActor:
assert(false);
break;
case PHYSX_KIND::OBSTACLEActor:
break;
default:
break;
}
}
}
void CCallBack_Ranrok_HitReport::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):
{
class CUnit* pOwner = (CUnit*)m_pController->Get_Owner();
CModel* pModel = pOwner->Get_Component<CModel>();
_uint iAnimIndex = pModel->Get_AnimIndex();
if (pOwner->Get_AnimInfo(STATEANIM::RUSH_LOOP).first == iAnimIndex) {
if (false == *m_pCollisionPlayer) {
*m_pCollisionPlayer = true;
pTargetActorData->pCharacter->Get_Owner()->Get_Component<CStat>()->Get_Damage(30.f);
pTargetActorData->pCharacter->Get_Owner()->OnCollision(pOwner);
}
}
}
break;
default:
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
pDynamic->addForce(vDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE);
}
break;
}
break;
case PHYSX_KIND::OBSTACLEActor:
break;
default:
break;
}
}
}
void CCallBack_Ranrok_HitReport::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;
//}
}
void CCallBack_Ranrok_HitReport::Set_CurrentSlop()
{
m_pController->Rewind_Grounded();
if (m_bGroundHit)
{
m_pController->Set_OnGroundFlag(m_bGroundHit);
float fDot = clamp(m_fBestNormal, -1.0f, 1.0f);
float fAngleRad = acosf(fDot);
float fAngleDeg = XMConvertToDegrees(fAngleRad);
m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal);
}
}
HRESULT CCallBack_Ranrok_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject, _bool* pCollisionPlayer)
{
m_pController = pController;
m_pPartDynamicBody = pPartDynamicObject;
m_pGameInstance = CGameInstance::GetInstance();
m_pCollisionPlayer = pCollisionPlayer;
SAFE_ADDREF(m_pController);
SAFE_ADDREF(m_pPartDynamicBody);
SAFE_ADDREF(m_pGameInstance);
return S_OK;
}
HRESULT CCallBack_Ranrok_HitReport::Finalize()
{
SAFE_RELEASE(m_pGameInstance);
SAFE_RELEASE(m_pPartDynamicBody);
SAFE_RELEASE(m_pController);
return S_OK;
}
_bool CCallBack_Ranrok_HitReport::IsOnGround()
{
return m_bGroundHit;
}
_vector CCallBack_Ranrok_HitReport::Get_GroundVector()
{
return XMLoadFloat3(&m_vClimbNormal);
}
CCallBack_Ranrok_HitReport* CCallBack_Ranrok_HitReport::Create()
{
return new CCallBack_Ranrok_HitReport();
}
+1 -1
View File
@@ -88,7 +88,7 @@ void CGoblin::Update(_float fTimeDelta)
m_pFSM->Update_State(fTimeDelta);
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
m_pModelCom->Play_Animation(fTimeDelta * m_fEasing, m_pTransformCom);
__super::Update(fTimeDelta);
@@ -270,6 +270,18 @@ void CGoblin_BattleAxe::SwingHit(_bool& bPlayerHit)
PSX::PxActor* pxHitActor = pxHits[i].actor;
if (nullptr != pxHitActor && nullptr != pxHitActor->userData) {
PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData;
ON_COLLISION_INFO tagCollInfo = {};
tagCollInfo.vWorldPos.w = 1.f;
memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &pxHits[i].position, sizeof(pxHits[i].position));
memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &pxHits[i].normal, sizeof(pxHits[i].normal));
_vector vHitDir = pUserData->pOwner->Get_WorldPostion() - this->Get_WorldPostion();
vHitDir = XMVector3Normalize(vHitDir);
XMStoreFloat4(&tagCollInfo.vHitDir, vHitDir);
tagCollInfo.fLength = pxHits[i].distance;
switch (PXOBJECT(pUserData->iSubKind))
{
case PXOBJECT::PLAYER:
@@ -280,7 +292,7 @@ void CGoblin_BattleAxe::SwingHit(_bool& bPlayerHit)
CStat* pStat = pUserData->pCharacter->Get_Owner()->Get_Component<CStat>();
pStat->Get_Damage(20.f);
bPlayerHit = true;
pUserData->pOwner->OnCollision(this);
pUserData->pOwner->OnCollision(this,&tagCollInfo);
} break;
case PXOBJECT::ALLY_HITBOX:
break;
@@ -281,9 +281,12 @@ void CGoblin::Behavior_SwingEnter()
m_bStep = true;
m_pGoblinSpector->Set_Visible(false);
m_pGoblinSpector->Spector_Trail_Visible(false);
m_pFSM->Change_State(FSMSTATE::SHUFFLE); },
0.45f);
Set_Easing(pairAnimInfo.first, 0.01f, 0.15f, 0.8f);
Set_Easing(pairAnimInfo.first, 0.2f, 0.4f, 1.4f);
}
HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
@@ -346,6 +346,7 @@ void CPlayer::OnCollision(CGameObject* pOther, void* pDesc)
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
if (CollisionDesc) {
Check_HitAngle(XMLoadFloat4(&CollisionDesc->vHitDir));
m_bMeleeHit = CollisionDesc->bIsMelee;
}
else {
m_fHitDegree = -1.f;
@@ -1751,22 +1751,26 @@ void CPlayer::Behavior_HitEnter()
break;
}
if (m_fHitDegree >= 90.f)
if (!m_bMeleeHit)
{
pairAnimInfo = m_Animation[STATEANIM::FLINCH_BWD];
}
else if (m_fHitDegree >= 45.f) {
if (m_fHitDegree >= 90.f)
{
pairAnimInfo = m_Animation[STATEANIM::FLINCH_BWD];
}
else if (m_fHitDegree >= 45.f) {
if (m_fHitCross > 0.f) {
pairAnimInfo = m_Animation[STATEANIM::FLINCH_LEFT];
if (m_fHitCross > 0.f) {
pairAnimInfo = m_Animation[STATEANIM::FLINCH_LEFT];
}
else {
pairAnimInfo = m_Animation[STATEANIM::FLINCH_RIGHT];
}
}
else {
pairAnimInfo = m_Animation[STATEANIM::FLINCH_RIGHT];
else if (m_fHitDegree >= 0.f) {
pairAnimInfo = m_Animation[STATEANIM::FLINCH_FWD];
}
}
else if(m_fHitDegree>=0.f){
pairAnimInfo = m_Animation[STATEANIM::FLINCH_FWD];
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
+3 -3
View File
@@ -3,7 +3,7 @@
#include "GameInstance.h"
#include "InfoInstance.h"
#include "CallBack_Monster_HitReport.h"
#include "CallBack_Ranrok_HitReport.h"
#include "Effect_Container.h"
#include "EffectParts.h"
#include "EffectPool.h"
@@ -60,7 +60,7 @@ HRESULT CRanrok::Initialize(void* pArg)
}
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody,&m_bCollisionPlayer);
//m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object<CEffectPool>();
//SAFE_ADDREF(m_pEffectPool);
@@ -350,7 +350,7 @@ HRESULT CRanrok::Ready_Components()
Desc.fStepOffset = { 0.12f };
Desc.fRadius = 2.f;
Desc.fHeight = 2.f;
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create();
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Ranrok_HitReport::Create();
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create();
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
Desc.fWalkableSlope = 45.f;
@@ -21,7 +21,7 @@
#include "State_FireBall.h"
#include "State_Swipe.h"
#include "State_Skill.h"
#include "State_Skill2.h"
#include "State_Rush.h"
#include "State_Pulse.h"
#include "State_Tucked.h"
#include "State_Hit.h"
@@ -883,14 +883,13 @@ void CRanrok::Add_FSM()
}
{
CState_Skill2::STATE_SKILL2_DESC Desc{};
CState_Rush::STATE_RUSH_DESC Desc{};
Desc.pOwner = this;
Desc.funcEnterEvent = [this]() { Behavior_RushEnter(); };
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_RushExitCheck(fTimedelta); };
Desc.funcExitEvent = [this]() { Behavior_RushExit(); };
Desc.funcPriorityUpdate = nullptr;
Desc.funcLateUpdate = nullptr;
m_States.emplace(FSMSTATE::RUSH, CState_Skill2::Create(&Desc));
Desc.pCollisionPlayer = &m_bCollisionPlayer;
m_States.emplace(FSMSTATE::RUSH, CState_Rush::Create(&Desc));
}
{
+56 -43
View File
@@ -464,48 +464,6 @@ void CTroll::Behavior_SwingExit()
m_pFSM->Disable_State(FSMSTATE::SWING);
}
void CTroll::SwingHit(_bool& bPlayerHit)
{
vector<PSX::PxSweepHit> pxHits;
_uint iHitCount = 0;
_float Damage = 0.f;
CheckHammerHits(iHitCount, pxHits);
{
for (_uint i = 0; i < pxHits.size(); ++i) {
PSX::PxActor* pxHitActor = pxHits[i].actor;
if (nullptr != pxHitActor && nullptr != pxHitActor->userData) {
PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData;
switch (PXOBJECT(pUserData->iSubKind))
{
case PXOBJECT::PLAYER:
{
if (true == bPlayerHit) {
continue;
}
CStat* pStat = pUserData->pCharacter->Get_Owner()->Get_Component<CStat>();
pStat->Get_Damage(20.f);
Damage = 7.f;
bPlayerHit = true;
pUserData->pOwner->OnCollision(this);
} break;
case PXOBJECT::ALLY_HITBOX:
break;
case PXOBJECT::ENVIRIONMENT:
break;
case PXOBJECT::TERRAIN:
break;
case PXOBJECT::BOX:
break;
case PXOBJECT::NPC:
break;
default:
break;
}
}
}
}
}
void CTroll::Behavior_SlamEnter()
{
pair<_uint, _bool> pairAnimInfo = {};
@@ -894,10 +852,11 @@ void CTroll::Add_FSM()
}
void CTroll::SlamHit(_bool& bPlayerHit)
void CTroll::SwingHit(_bool& bPlayerHit)
{
vector<PSX::PxSweepHit> pxHits;
_uint iHitCount = 0;
_float Damage = 0.f;
CheckHammerHits(iHitCount, pxHits);
{
for (_uint i = 0; i < pxHits.size(); ++i) {
@@ -913,6 +872,7 @@ void CTroll::SlamHit(_bool& bPlayerHit)
}
CStat* pStat = pUserData->pCharacter->Get_Owner()->Get_Component<CStat>();
pStat->Get_Damage(20.f);
Damage = 7.f;
bPlayerHit = true;
pUserData->pOwner->OnCollision(this);
} break;
@@ -934,6 +894,59 @@ void CTroll::SlamHit(_bool& bPlayerHit)
}
}
void CTroll::SlamHit(_bool& bPlayerHit)
{
vector<PSX::PxSweepHit> pxHits;
_uint iHitCount = 0;
CheckHammerHits(iHitCount, pxHits);
{
for (_uint i = 0; i < pxHits.size(); ++i) {
PSX::PxActor* pxHitActor = pxHits[i].actor;
if (nullptr != pxHitActor && nullptr != pxHitActor->userData) {
PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData;
ON_COLLISION_INFO tagCollInfo = {};
tagCollInfo.vWorldPos.w = 1.f;
memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &pxHits[i].position, sizeof(pxHits[i].position));
memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &pxHits[i].normal, sizeof(pxHits[i].normal));
_vector vHitDir = pUserData->pOwner->Get_WorldPostion() - this->Get_WorldPostion();
vHitDir = XMVector3Normalize(vHitDir);
XMStoreFloat4(&tagCollInfo.vHitDir, vHitDir);
tagCollInfo.fLength = pxHits[i].distance;
tagCollInfo.bIsMelee = true;
switch (PXOBJECT(pUserData->iSubKind))
{
case PXOBJECT::PLAYER:
{
if (true == bPlayerHit) {
continue;
}
CStat* pStat = pUserData->pCharacter->Get_Owner()->Get_Component<CStat>();
pStat->Get_Damage(20.f);
bPlayerHit = true;
pUserData->pOwner->OnCollision(this,&tagCollInfo);
} break;
case PXOBJECT::ALLY_HITBOX:
break;
case PXOBJECT::ENVIRIONMENT:
break;
case PXOBJECT::TERRAIN:
break;
case PXOBJECT::BOX:
break;
case PXOBJECT::NPC:
break;
default:
break;
}
}
}
}
}
void CTroll::CheckHammerHits(_uint& iHitCount, vector<PSX::PxSweepHit>& pxHits)
{
{
@@ -0,0 +1,57 @@
#pragma once
#include "Client_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CFSM;
NS_END
NS_BEGIN(Client)
class CCallBack_Ranrok_HitReport final : public PSX::PxUserControllerHitReport
{
// 구현 예시
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
//
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
private:
CCallBack_Ranrok_HitReport();
public:
~CCallBack_Ranrok_HitReport();
void BeginFrame();
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; // 사용자 정의 장애물과 부딪힌 경우
void Set_CurrentSlop();
public:
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject, _bool* bCollisionPlayer);
HRESULT Finalize();
_bool IsOnGround();
_vector Get_GroundVector();
private:
CCharacter_Controller* m_pController = { nullptr };
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
CGameInstance* m_pGameInstance = { nullptr };
_float3 m_vClimbNormal = { 0.f, 1.f, 0.f };
_float m_fBestNormal = { 0.f };
_bool m_bGroundHit = { false };
_bool* m_pCollisionPlayer = { nullptr };
public:
static CCallBack_Ranrok_HitReport* Create();
};
NS_END
+3 -2
View File
@@ -3,7 +3,7 @@
#include "Client_Define.h"
#include "Monster.h"
#include "CallBack_Monster_Behavior.h"
#include "CallBack_Monster_HitReport.h"
#include "CallBack_Ranrok_HitReport.h"
NS_BEGIN(Client)
@@ -55,7 +55,7 @@ class CRanrok final : public CMonster
private:
CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr };
CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr };
CCallBack_Ranrok_HitReport* m_pCallBack_HitReport = { nullptr };
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
@@ -65,6 +65,7 @@ class CRanrok final : public CMonster
_float2 m_vEtherealTimer = { 0.f, 0.16f };
_uint iIndex;
DAMAGE_INFO m_DamageInfo;
_bool m_bCollisionPlayer = { false };
private:
virtual HRESULT Initialize_Prototype() override;
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Defines.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_FireBall final : public CState_Root
{
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_FireBreath final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Fly final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Ground final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Hover final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Pulse final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Skill final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Swipe final : public CState_Root
{
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "Client_Define.h"
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Client)
NS_BEGIN(Editor)
class CState_Tucked final : public CState_Root
{
@@ -178,6 +178,7 @@ call Update_Shaders.bat
<ClInclude Include="..\Public\Blink.h" />
<ClInclude Include="..\Public\Body.h" />
<ClInclude Include="..\public\Boss_HpBer.h" />
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h" />
<ClInclude Include="..\public\Enemy_Detection.h" />
<ClInclude Include="..\Public\Goblin_BattleAxe.h" />
<ClInclude Include="..\Public\Goblin_Dagger.h" />
@@ -197,6 +198,7 @@ call Update_Shaders.bat
<ClInclude Include="..\public\Quest_Panel.h" />
<ClInclude Include="..\public\Quest_Slot.h" />
<ClInclude Include="..\public\Quest_Status.h" />
<ClInclude Include="..\Public\Ranrok.h" />
<ClInclude Include="..\Public\Skill_Data.h" />
<ClInclude Include="..\public\SpellLearn_Booster.h" />
<ClInclude Include="..\public\SpellLearn_ChaserPointer.h" />
@@ -211,12 +213,23 @@ call Update_Shaders.bat
<ClInclude Include="..\public\SpellLearn_Slot.h" />
<ClInclude Include="..\Public\State_Blink.h" />
<ClInclude Include="..\Public\State_Dead.h" />
<ClInclude Include="..\Public\State_FireBall.h" />
<ClInclude Include="..\Public\State_FireBreath.h" />
<ClInclude Include="..\Public\State_FireSweep.h" />
<ClInclude Include="..\Public\State_Fly.h" />
<ClInclude Include="..\Public\State_Ground.h" />
<ClInclude Include="..\Public\State_Hit.h" />
<ClInclude Include="..\Public\State_Hover.h" />
<ClInclude Include="..\Public\State_IdleBreak.h" />
<ClInclude Include="..\Public\State_Pulse.h" />
<ClInclude Include="..\Public\State_Rush.h" />
<ClInclude Include="..\Public\State_Shuffle.h" />
<ClInclude Include="..\Public\State_Skill.h" />
<ClInclude Include="..\Public\State_Slam.h" />
<ClInclude Include="..\Public\State_Swing.h" />
<ClInclude Include="..\Public\State_Swipe.h" />
<ClInclude Include="..\Public\State_Throw.h" />
<ClInclude Include="..\Public\State_Tucked.h" />
<ClInclude Include="..\Public\StunEffect.h" />
<ClInclude Include="..\Public\Troll.h" />
<ClInclude Include="..\Public\Troll_Rush_Hit.h" />
@@ -408,6 +421,7 @@ call Update_Shaders.bat
<ClCompile Include="..\Private\Blink.cpp" />
<ClCompile Include="..\Private\Body.cpp" />
<ClCompile Include="..\private\Boss_HpBer.cpp" />
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp" />
<ClCompile Include="..\Private\Enemy_Detection.cpp" />
<ClCompile Include="..\Private\Goblin_BattleAxe.cpp" />
<ClCompile Include="..\Private\Goblin_Dagger.cpp" />
@@ -427,6 +441,8 @@ call Update_Shaders.bat
<ClCompile Include="..\private\Quest_Panel.cpp" />
<ClCompile Include="..\private\Quest_Slot.cpp" />
<ClCompile Include="..\private\Quest_Status.cpp" />
<ClCompile Include="..\Private\Ranrok.cpp" />
<ClCompile Include="..\Private\Ranrok_States.cpp" />
<ClCompile Include="..\Private\Skill_Data.cpp" />
<ClCompile Include="..\private\SpellLearn_Booster.cpp" />
<ClCompile Include="..\private\SpellLearn_ChaserPointer.cpp" />
@@ -441,12 +457,23 @@ call Update_Shaders.bat
<ClCompile Include="..\private\SpellLearn_Slot.cpp" />
<ClCompile Include="..\Private\State_Blink.cpp" />
<ClCompile Include="..\Private\State_Dead.cpp" />
<ClCompile Include="..\Private\State_FireBall.cpp" />
<ClCompile Include="..\Private\State_FireBreath.cpp" />
<ClCompile Include="..\Private\State_FireSweep.cpp" />
<ClCompile Include="..\Private\State_Fly.cpp" />
<ClCompile Include="..\Private\State_Ground.cpp" />
<ClCompile Include="..\Private\State_Hit.cpp" />
<ClCompile Include="..\Private\State_Hover.cpp" />
<ClCompile Include="..\Private\State_IdleBreak.cpp" />
<ClCompile Include="..\Private\State_Pulse.cpp" />
<ClCompile Include="..\Private\State_Rush.cpp" />
<ClCompile Include="..\Private\State_Shuffle.cpp" />
<ClCompile Include="..\Private\State_Skill.cpp" />
<ClCompile Include="..\Private\State_Slam.cpp" />
<ClCompile Include="..\Private\State_Swing.cpp" />
<ClCompile Include="..\Private\State_Swipe.cpp" />
<ClCompile Include="..\Private\State_Throw.cpp" />
<ClCompile Include="..\Private\State_Tucked.cpp" />
<ClCompile Include="..\Private\StunEffect.cpp" />
<ClCompile Include="..\Private\Troll.cpp" />
<ClCompile Include="..\Private\Troll_Rush_Hit.cpp" />
@@ -526,9 +526,6 @@
<Filter Include="02.GameObjects\Monster\Troll">
<UniqueIdentifier>{2e89850b-eb23-46a7-9c3b-9c2965aa0b76}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Monster\Troll\Troll_State">
<UniqueIdentifier>{ed83440e-f038-4fe2-b005-4ba4093e8462}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Monster\Troll\Rock">
<UniqueIdentifier>{d5debb7c-5bea-456a-8c70-f44b5fc9e51e}</UniqueIdentifier>
</Filter>
@@ -636,7 +633,7 @@
</Filter>
<Filter Include="02.GameObjects\Layer_Effect\Effect\Magic\Blink">
<UniqueIdentifier>{3b207257-c396-473b-9906-df04b28fb0cd}</UniqueIdentifier>
</Filter>
</Filter>
<Filter Include="50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLeam_LookPointer">
<UniqueIdentifier>{ea002e2c-481e-4f1f-a16f-4e47e3a48d37}</UniqueIdentifier>
</Filter>
@@ -649,6 +646,21 @@
<Filter Include="50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Overlay">
<UniqueIdentifier>{268e67a6-fa77-4a34-84d9-b3e6f6e46a00}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Monster\Ranrok">
<UniqueIdentifier>{a1cd7b60-8dcc-4a44-98c1-e33bd8185421}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster\Ranrok">
<UniqueIdentifier>{7f9672aa-71b3-4b77-9c3b-790014eccdba}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\Troll_State">
<UniqueIdentifier>{ed83440e-f038-4fe2-b005-4ba4093e8462}</UniqueIdentifier>
</Filter>
<Filter Include="80.State\State_Combat\State_Rush">
<UniqueIdentifier>{0a3dcff9-5567-4984-a8e7-b1d2ee8d6bce}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Monster\Ranrok\RanrokState">
<UniqueIdentifier>{0c039454-c5e4-4fbc-832e-06acb0f86f43}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Editor.h">
@@ -1141,10 +1153,10 @@
<Filter>02.GameObjects\Monster\Troll</Filter>
</ClInclude>
<ClInclude Include="..\Public\Troll_State_BackHand_Swing.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\Troll_State_Rush.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\Troll_Rock.h">
<Filter>02.GameObjects\Monster\Troll\Rock</Filter>
@@ -1153,19 +1165,19 @@
<Filter>02.GameObjects\Monster\Troll\Weapon</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_IdleBreak.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Hit.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Slam.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Throw.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Swing.h">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClInclude>
<ClInclude Include="..\Public\Troll_Nomal_Smoke.h">
<Filter>02.GameObjects\Layer_Effect\Effect\Monster_Effect\Troll_Nomal_Smoke</Filter>
@@ -1293,6 +1305,45 @@
<ClInclude Include="..\Public\Blink.h">
<Filter>02.GameObjects\Layer_Effect\Effect\Magic\Blink</Filter>
</ClInclude>
<ClInclude Include="..\Public\Ranrok.h">
<Filter>02.GameObjects\Monster\Ranrok</Filter>
</ClInclude>
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h">
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster\Ranrok</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Rush.h">
<Filter>80.State\State_Combat\State_Rush</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_FireSweep.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Fly.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Ground.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Hover.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Pulse.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Skill.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Swipe.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Tucked.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_FireBall.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_FireBreath.h">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Editor.ico">
@@ -1793,13 +1844,13 @@
<Filter>02.GameObjects\Monster\Troll</Filter>
</ClCompile>
<ClCompile Include="..\Private\Troll_State_BackHand_Swing.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\Troll_State_Rush.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\Troll_States.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\Troll_Rock.cpp">
<Filter>02.GameObjects\Monster\Troll\Rock</Filter>
@@ -1808,19 +1859,19 @@
<Filter>02.GameObjects\Monster\Troll\Weapon</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Hit.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Throw.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_IdleBreak.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Slam.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Swing.cpp">
<Filter>02.GameObjects\Monster\Troll\Troll_State</Filter>
<Filter>80.State\Troll_State</Filter>
</ClCompile>
<ClCompile Include="..\Private\Troll_Nomal_Smoke.cpp">
<Filter>02.GameObjects\Layer_Effect\Effect\Monster_Effect\Troll_Nomal_Smoke</Filter>
@@ -1939,6 +1990,48 @@
<ClCompile Include="..\Private\Blink.cpp">
<Filter>02.GameObjects\Layer_Effect\Effect\Magic\Blink</Filter>
</ClCompile>
<ClCompile Include="..\Private\Ranrok.cpp">
<Filter>02.GameObjects\Monster\Ranrok</Filter>
</ClCompile>
<ClCompile Include="..\Private\Ranrok_States.cpp">
<Filter>02.GameObjects\Monster\Ranrok</Filter>
</ClCompile>
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp">
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster\Ranrok</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Rush.cpp">
<Filter>80.State\State_Combat\State_Rush</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_FireBreath.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_FireSweep.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Fly.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Ground.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Hover.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Pulse.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Skill.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Swipe.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_Tucked.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
<ClCompile Include="..\Private\State_FireBall.cpp">
<Filter>02.GameObjects\Monster\Ranrok\RanrokState</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Editor.rc">
@@ -0,0 +1,218 @@
#include "pch.h"
#include "CallBack_Ranrok_HitReport.h"
#include "GameInstance.h"
#include "Character_Controller.h"
#include "RigidBody_Dynamic.h"
#include "Unit.h"
#include "GameObject.h"
CCallBack_Ranrok_HitReport::CCallBack_Ranrok_HitReport()
{
}
CCallBack_Ranrok_HitReport::~CCallBack_Ranrok_HitReport()
{
}
void CCallBack_Ranrok_HitReport::BeginFrame()
{
// 매 프레임 초기화
m_vClimbNormal = { 0.f, 1.f, 0.f };
m_bGroundHit = { false };
m_fBestNormal = { 0.f };
}
void CCallBack_Ranrok_HitReport::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:
case PXOBJECT::FLOOR:
case PXOBJECT::ROAD:
if (vWorldNormal.y > 0) {
_float fDotValue = vWorldNormal.dot({ 0.f, 1.f, 0.f });
if (m_fBestNormal < fDotValue) {
m_bGroundHit = true;
m_fBestNormal = fDotValue;
m_vClimbNormal = { vWorldNormal.x, vWorldNormal.y, vWorldNormal.z };
}
}
break;
default:
break;
}
break;
case PHYSX_KIND::BODY_DYNAMIC:
{
switch (PXOBJECT(pTargetActorData->iSubKind))
{
case PXOBJECT::END:
break;
case PXOBJECT::BOX:
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
//pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
PSX::PxVec3 vCompressedDir = -vWorldNormal;
vCompressedDir.normalize();
pDynamic->addForce(vCompressedDir * fLength * 1000.f, PSX::PxForceMode::eFORCE);
} break;
default:
{
}
break;
}
} break;
case PHYSX_KIND::CCTActor:
assert(false);
break;
case PHYSX_KIND::OBSTACLEActor:
break;
default:
break;
}
}
}
void CCallBack_Ranrok_HitReport::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):
{
class CUnit* pOwner = (CUnit*)m_pController->Get_Owner();
CModel* pModel = pOwner->Get_Component<CModel>();
_uint iAnimIndex = pModel->Get_AnimIndex();
if (pOwner->Get_AnimInfo(STATEANIM::RUSH_LOOP).first == iAnimIndex) {
if (false == *m_pCollisionPlayer) {
*m_pCollisionPlayer = true;
pTargetActorData->pCharacter->Get_Owner()->Get_Component<CStat>()->Get_Damage(30.f);
pTargetActorData->pCharacter->Get_Owner()->OnCollision(pOwner);
}
}
}
break;
default:
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
pDynamic->addForce(vDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE);
}
break;
}
break;
case PHYSX_KIND::OBSTACLEActor:
break;
default:
break;
}
}
}
void CCallBack_Ranrok_HitReport::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;
//}
}
void CCallBack_Ranrok_HitReport::Set_CurrentSlop()
{
m_pController->Rewind_Grounded();
if (m_bGroundHit)
{
m_pController->Set_OnGroundFlag(m_bGroundHit);
float fDot = clamp(m_fBestNormal, -1.0f, 1.0f);
float fAngleRad = acosf(fDot);
float fAngleDeg = XMConvertToDegrees(fAngleRad);
m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal);
}
}
HRESULT CCallBack_Ranrok_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject, _bool* pCollisionPlayer)
{
m_pController = pController;
m_pPartDynamicBody = pPartDynamicObject;
m_pGameInstance = CGameInstance::GetInstance();
m_pCollisionPlayer = pCollisionPlayer;
SAFE_ADDREF(m_pController);
SAFE_ADDREF(m_pPartDynamicBody);
SAFE_ADDREF(m_pGameInstance);
return S_OK;
}
HRESULT CCallBack_Ranrok_HitReport::Finalize()
{
SAFE_RELEASE(m_pGameInstance);
SAFE_RELEASE(m_pPartDynamicBody);
SAFE_RELEASE(m_pController);
return S_OK;
}
_bool CCallBack_Ranrok_HitReport::IsOnGround()
{
return m_bGroundHit;
}
_vector CCallBack_Ranrok_HitReport::Get_GroundVector()
{
return XMLoadFloat3(&m_vClimbNormal);
}
CCallBack_Ranrok_HitReport* CCallBack_Ranrok_HitReport::Create()
{
return new CCallBack_Ranrok_HitReport();
}
@@ -19,6 +19,7 @@
#include "Goblin.h"
#include "Terrain.h"
#include "Troll.h"
#include "Ranrok.h"
CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -85,6 +86,9 @@ HRESULT CLevel_EffectViewer::Initialize()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster"))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CRanrok>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster"))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Sky")))){
return E_FAIL;
}
+15 -1
View File
@@ -30,6 +30,7 @@
#include "CamPosition_Shoulder.h"
#include "CamPosition_Arm.h"
#include "Wand.h"
#include "Ranrok.h"
#pragma endregion
@@ -1278,7 +1279,12 @@ HRESULT CLoader::Loading_For_UI()
}
HRESULT CLoader::Loading_For_Effect()
{
m_strMessage = TEXT("Shader Loading..");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_NPC_PBR_ANIM,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl"),
VTXANIMMESH::Elements, VTXANIMMESH::iNumElements)))) {
return E_FAIL;
}
m_strMessage = TEXT("PhysX Meshes Loading..");
{
@@ -1584,6 +1590,11 @@ HRESULT CLoader::Loading_For_Effect()
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Troll_Rock/Troll_Rock_Big.bin", XMMatrixScaling(0.00004f, 0.00004f, 0.00004f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
{
CVIBuffer_Terrain* pTerrain = CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "Hogsmeade_HeightMap.bin", 512, 512);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade"), pTerrain))) {
@@ -1736,6 +1747,9 @@ HRESULT CLoader::Loading_For_Effect()
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CRanrok>(g_iStaticLevel, CRanrok::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CBlink>(NEXT_LEVEL, CBlink::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
+724
View File
@@ -0,0 +1,724 @@
#include "pch.h"
#include "Ranrok.h"
#include "GameInstance.h"
#include "InfoInstance.h"
#include "CallBack_Ranrok_HitReport.h"
#include "Effect_Container.h"
#include "EffectPool.h"
#include "Layer.h"
#include "TrailObject.h"
#include "MapElement_Interactable.h"
#pragma region STATE
#include "State_Idle.h"
#include "State_Move.h"
#include "State_Combat.h"
#include "State_Hit.h"
#include "State_Rush.h"
#include "State_Throw.h"
#pragma endregion
CRanrok::CRanrok(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CMonster(pDevice, pContext)
{
}
CRanrok::CRanrok(const CRanrok& Prototype)
: CMonster(Prototype)
{
}
HRESULT CRanrok::Initialize_Prototype()
{
return S_OK;
}
HRESULT CRanrok::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components()))
return E_FAIL;
if (FAILED(Ready_Parts()))
return E_FAIL;
Add_FSM();
Set_Anim();
{
CFSM::FSM_DESC FSMDesc{};
FSMDesc.pStates = &m_States;
FSMDesc.pStateMask = &m_iStateMask;
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_bCollisionPlayer);
//m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object<CEffectPool>();
//SAFE_ADDREF(m_pEffectPool);
m_pCharacter_Controller->Set_Position(XMVectorSet(-44.704f, -2.860f, 16.071f, 1.f));
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-44.704f, -2.860f, 16.071f, 1.f));
Load_RanrokPos("../Bin/Resources/Data/RanrokPos/RanrokPos.xml");
return S_OK;
}
void CRanrok::Priority_Update(_float fTimeDelta)
{
__super::Priority_Update(fTimeDelta);
}
void CRanrok::Update(_float fTimeDelta)
{
if (m_pGameInstance->Key_Up(DIK_H))
{
m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_GROUND);
m_pFSM->Change_State(FSMSTATE::LAND);
}
if (m_pGameInstance->Key_Up(DIK_Y))
{
m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_AIR);
m_pFSM->Change_State(FSMSTATE::HOVER);
}
if (m_pGameInstance->Key_Up(DIK_I))
{
m_pFSM->Change_State(FSMSTATE::TUCKED);
}
m_pFSM->Update_State(fTimeDelta);
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
__super::Update(fTimeDelta);
Play_Event();
if (true == m_pCharacter_Controller->IsActive()) {
{ // 세트
m_pCallBack_HitReport->BeginFrame();
m_pCharacter_Controller->Move(fTimeDelta);
m_pCallBack_HitReport->Set_CurrentSlop();
}
m_vStunTimer.x = 0.f;
}
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);
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
for (_uint i = 0; i < ENUM_CLASS(RANROK_SKILL::END); i++)
m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta);
#pragma endregion
m_vEtherealTimer.x += fTimeDelta * 0.2f;
if (m_vEtherealTimer.x > m_vEtherealTimer.y) {
m_vEtherealTimer.x -= m_vEtherealTimer.y;
}
}
void CRanrok::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 if (true == m_pRigidBody->IsActive()) {
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose());
}
if (!m_pFSM->IsEnable(FSMSTATE::TUCKED))
{
if (true == m_bLookAt) {
m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f);
}
}
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
}
HRESULT CRanrok::Render()
{
if (!m_bVisible){
return S_OK;
}
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
RENDER eCurrentPass = m_pGameInstance->Get_CurrentRenderPass();
HRESULT hr = E_FAIL;
if (RENDER::NONBLEND == eCurrentPass) {
hr = Render_Nonblend();
}
else if (RENDER::BLEND == eCurrentPass) {
//hr = Render_Blend();
hr = S_OK;
}
return hr;
}
HRESULT CRanrok::Render_Shadow(SHADOW eType)
{
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, eType))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ, eType))) {
return E_FAIL;
}
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
for (_uint i = 0; i < iNumMeshes; i++)
{
if (FAILED(m_pShaderCom->Bind_Matrices(
"g_OffsetMatrix",
m_pModelCom->Get_OffsetMatrix(i).data(),
(_int)m_pModelCom->Get_OffsetMatrix(i).size()
)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::SHADOW)))) {
return E_FAIL;
}
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
return S_OK;
}
_vector CRanrok::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 CRanrok::OnCollision(CGameObject* pOther, void* pDesc)
{
//if (true == m_bDead) {
// return;
//}
//if (m_bFireBurst)
// return;
//ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
////m_DamageInfo.vTarget_Pos = m_pCharacter_Controller->Get_HeadPosition();
//CEffect_Container* pEffect_Container = dynamic_cast<CEffect_Container*>(pOther);
//pair<_float, _float> damagePair = {};
//if (pEffect_Container != nullptr)
//{
// _uint iSkillType = pEffect_Container->Get_SkillType();
// //damagePair = Get_Damage(m_pInfoInstance->Get_Spell_Damage(iSkillType));
// switch (iSkillType)
// {
// case ENUM_CLASS(SKILL_TYPE::DESCENDO):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::DESCENDO);
// break;
// case ENUM_CLASS(SKILL_TYPE::BOMBARDA):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::BOMBARDA);
// break;
// case ENUM_CLASS(SKILL_TYPE::JAP):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::JAP);
// break;
// case ENUM_CLASS(SKILL_TYPE::LEVIOSO):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::LEVIOSO);
// break;
// case ENUM_CLASS(SKILL_TYPE::ACCIO):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ACCIO);
// break;
// case ENUM_CLASS(SKILL_TYPE::STUPEFY):
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY);
// break;
// }
//}
//else
//{
// //damagePair = Get_Damage(m_pInfoInstance->Get_Spell_Damage(ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW)));
// CMapElement_Interactable* pProps = dynamic_cast<CMapElement_Interactable*>(pOther);
// if (pProps != nullptr)
// {
// m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW);
// }
//}
///*m_DamageInfo.fDamage = damagePair.first;
//m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo);
//if (0 == damagePair.second) {
// m_pFSM->Change_State(FSMSTATE::DEAD);
// return;
//}
//if (damagePair.second <= Get_Hp().y / 2.f && m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR))
//{
// m_pFSM->Change_State(FSMSTATE::LAND);
// return;
//}*/
//m_pFSM->Change_State(FSMSTATE::HIT);
}
void CRanrok::OnHit(CGameObject* pOther, CGameObject* pCaller)
{
}
HRESULT CRanrok::Ready_Components()
{
CTransform::TRANSFORM_DESC Desc = {};
Desc.fSpeedPerSec = 10.f;
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
Desc.fRadius = 10.f;
__super::Ready_Components(&Desc);
SAFE_RELEASE(m_pShaderCom);
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_NPC_PBR_ANIM,
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
return E_FAIL;
}
m_strModelPrototypeTag = TEXT("Prototype_Component_Ranrok_Model");
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
return E_FAIL;
}
{ // CCT
CCharacter_Controller::Character_Controller_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::RANROK);
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.12f };
Desc.fRadius = 2.f;
Desc.fHeight = 2.f;
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Ranrok_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->SetGravity(false);
}
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
{ // DO
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::RANROK);
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(), NEXT_LEVEL);
}
return S_OK;
}
HRESULT CRanrok::Ready_Parts()
{
return S_OK;
}
HRESULT CRanrok::Bind_ShaderResources()
{
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", 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;
}
HRESULT CRanrok::Render_Nonblend()
{
/*if (FAILED(Render_DeadDisolve())) {
return E_FAIL;
}
if (FAILED(Render_Disolve())) {
return E_FAIL;
}*/
for (_uint i = ENUM_CLASS(RANROK_MESH_ORDER::WINGS); i < ENUM_CLASS(RANROK_MESH_ORDER::END); ++i)
{
if (FAILED(m_pShaderCom->Bind_Matrices( "g_OffsetMatrix",
m_pModelCom->Get_OffsetMatrix(i).data(),
(_int)m_pModelCom->Get_OffsetMatrix(i).size() )))
{
return E_FAIL;
}
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
return E_FAIL;
}
if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) {
return E_FAIL;
}
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
if (m_bDrawOutLine) {
Render_OutLine();
}
#ifdef _DEBUG
if (true == m_pCharacter_Controller->IsActive()) {
if (FAILED(m_pCharacter_Controller->Render())) {
return E_FAIL;
}
}
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;
}
}
{
_bool bDisolve = false;
_float zero = 0.f;
m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool));
m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float));
}
return S_OK;
}
HRESULT CRanrok::Render_Blend()
{
_float fDiffuseUVRatio = (m_vEtherealTimer.x / m_vEtherealTimer.y);
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEtherealRatio", &fDiffuseUVRatio, sizeof(_float)))) {
return E_FAIL;
}
for (_uint i = ENUM_CLASS(RANROK_MESH_ORDER::ETHEREAL_HOT_SPINE); i < ENUM_CLASS(RANROK_MESH_ORDER::WINGS); ++i)
{
if (FAILED(m_pShaderCom->Bind_Matrices("g_OffsetMatrix",
m_pModelCom->Get_OffsetMatrix(i).data(),
(_int)m_pModelCom->Get_OffsetMatrix(i).size())))
{
return E_FAIL;
}
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
return E_FAIL;
}
if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) {
return E_FAIL;
}
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
return S_OK;
}
void CRanrok::MoveTo(_float fTimeDelta)
{
if (!m_pFSM->IsEnable(FSMSTATE::TUCKED))
return;
if (m_Points.empty())
return;
if (m_iCurrentFlow >= m_Points.size())
m_iCurrentFlow = 0;
_vector Target = m_Points[m_iCurrentFlow][m_iCurrentPoint];
_vector NextTarget;
_vector CurPos = m_pCharacter_Controller->Get_Position();
_vector vLook = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK));
_float Speed = 50.f;
_vector toTarget = Target - CurPos;
_float fDist = XMVectorGetX(XMVector3Length(toTarget));
if (m_iCurrentPoint + 1 < m_Points[m_iCurrentFlow].size() && fDist < 30.f)
{
NextTarget = m_Points[m_iCurrentFlow][m_iCurrentPoint + 1];
}
else {
NextTarget = Target;
}
if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1)
{
if (fDist < 20.f)
{
if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1)
{
m_bTucked = true;
m_pFSM->Disable_State(FSMSTATE::TUCKED);
}
m_iCurrentPoint = (m_iCurrentPoint + 1) % m_Points[m_iCurrentFlow].size();
return;
}
}
else if (fDist < 20.f)
{
if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1)
{
m_bTucked = true;
m_pFSM->Disable_State(FSMSTATE::TUCKED);
}
m_iCurrentPoint = (m_iCurrentPoint + 1) % m_Points[m_iCurrentFlow].size();
return;
}
_vector LerpTarget = XMVectorLerp(Target, NextTarget, 0.5f);
m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta,2.f);
m_pCharacter_Controller->Set_Position(CurPos + vLook * Speed * fTimeDelta);
}
HRESULT CRanrok::Load_RanrokPos(const _char* pFilePath)
{
tinyxml2::XMLDocument doc;
if (doc.LoadFile(pFilePath) != tinyxml2::XML_SUCCESS)
return E_FAIL;
tinyxml2::XMLElement* pSpellLearnInfo = doc.FirstChildElement("RanrokPosInfo");
if (!pSpellLearnInfo) return E_FAIL;
tinyxml2::XMLElement* pSpellLearnData = pSpellLearnInfo->FirstChildElement("RanrokPosData");
if (!pSpellLearnData) return E_FAIL;
tinyxml2::XMLElement* pName = pSpellLearnData->FirstChildElement("Name");
while (pName)
{
_int iCurrentFlow;
pName->QueryIntAttribute("Flow", &iCurrentFlow);
if (iCurrentFlow >= m_Points.size())
m_Points.resize(iCurrentFlow + 1);
tinyxml2::XMLElement* pPosition = pName->FirstChildElement("Position");
while (pPosition)
{
tinyxml2::XMLElement* pPos = pPosition->FirstChildElement("Pos");
if (pPos)
{
_float px{}, py{}, pz{};
pPos->QueryFloatAttribute("x", &px);
pPos->QueryFloatAttribute("y", &py);
pPos->QueryFloatAttribute("z", &pz);
m_Points[iCurrentFlow].emplace_back(XMVectorSet(px, py, pz, 1.f));
}
pPosition = pPosition->NextSiblingElement("Position");
}
pName = pName->NextSiblingElement("Name");
}
return S_OK;
}
CRanrok* CRanrok::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CRanrok* pInstance = new CRanrok(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CRanrak");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CRanrok::Clone(void* pArg, CGameObject* pOwner)
{
CRanrok* pInstance = new CRanrok(*this);
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CRanrak");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CRanrok::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_pEffectPool);
Safe_Delete(m_pCallBack_Behavior);
Safe_Delete(m_pCallBack_HitReport);
}
#ifdef _DEBUG
void CRanrok::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
if (GUI::CollapsingHeader("Ranrak")) {
__super::Describe_Entity();
string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex());
GUI::Text(AnimList.c_str());
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::Text("CurrFlow %d", m_iCurrentFlow);
_float3 Pos;
XMStoreFloat3(&Pos, Get_WorldPostion());
if (GUI::DragFloat3("Pos", (_float*)&Pos, 0.01f))
{
m_pCharacter_Controller->Set_Position(XMVectorSetW(XMLoadFloat3(&Pos), 1.f));
}
GUI::SameLine();
if (GUI::SmallButton("Copy"))
{
char buf[128];
sprintf_s(buf, "<Pos x=\"%.3f\" y=\"%.3f\" z=\"%.3f\"/>", Pos.x, Pos.y, Pos.z);
GUI::SetClipboardText(buf);
m_Points[0].push_back(XMVectorSet(Pos.x, Pos.y, Pos.z, 1.f));
}
GUI::SameLine();
if (GUI::SmallButton("Clear"))
{
m_Points[0].clear();
}
GUI::Separator();
GUI::Text("Points[0] Count : %d", (_int)m_Points[0].size());
for (_uint i = 0; i < m_Points[0].size();)
{
_vector v = m_Points[0][i];
XMFLOAT3 p;
XMStoreFloat3(&p, v);
GUI::PushID(i);
GUI::Text("[%d] (%.2f, %.2f, %.2f)", i, p.x, p.y, p.z);
GUI::SameLine();
if (GUI::SmallButton("X"))
{
m_Points[0].erase(m_Points[0].begin() + i);
GUI::PopID();
continue;
}
GUI::PopID();
i++;
}
if (GUI::Button("MovePos"))
{
m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Get_CamPosition()->x, m_pGameInstance->Get_CamPosition()->y, m_pGameInstance->Get_CamPosition()->z,1.f));
}
m_pTransformCom->Describe_Entity();
}
GUI::End();
}
#endif // _DEBUG
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_FireBall.h"
#include "Unit.h"
CState_FireBall::CState_FireBall()
:CState_Root()
{
}
void CState_FireBall::Enter()
{
__super::Enter();
}
HRESULT CState_FireBall::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_FireBall::Exit()
{
__super::Exit();
}
HRESULT CState_FireBall::Initialize(STATE_FIREBALL_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_FireBall* CState_FireBall::Create(STATE_FIREBALL_DESC* pDesc)
{
CState_FireBall* pInstance = new CState_FireBall;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_FireBall::Free()
{
__super::Free();
}
void CState_FireBall::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_FireBreath.h"
#include "Unit.h"
CState_FireBreath::CState_FireBreath()
:CState_Root()
{
}
void CState_FireBreath::Enter()
{
__super::Enter();
}
HRESULT CState_FireBreath::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_FireBreath::Exit()
{
__super::Exit();
}
HRESULT CState_FireBreath::Initialize(STATE_FIREBREATH_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_FireBreath* CState_FireBreath::Create(STATE_FIREBREATH_DESC* pDesc)
{
CState_FireBreath* pInstance = new CState_FireBreath;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_FireBreath::Free()
{
__super::Free();
}
void CState_FireBreath::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_FireSweep.h"
#include "Unit.h"
CState_FireSweep::CState_FireSweep()
:CState_Root()
{
}
void CState_FireSweep::Enter()
{
__super::Enter();
}
HRESULT CState_FireSweep::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_FireSweep::Exit()
{
__super::Exit();
}
HRESULT CState_FireSweep::Initialize(STATE_FIRESWEEP_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_FireSweep* CState_FireSweep::Create(STATE_FIRESWEEP_DESC* pDesc)
{
CState_FireSweep* pInstance = new CState_FireSweep;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_FireSweep::Free()
{
__super::Free();
}
void CState_FireSweep::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Fly.h"
#include "Unit.h"
CState_Fly::CState_Fly()
:CState_Root()
{
}
void CState_Fly::Enter()
{
__super::Enter();
}
HRESULT CState_Fly::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Fly::Exit()
{
__super::Exit();
}
HRESULT CState_Fly::Initialize(STATE_FLY_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Fly* CState_Fly::Create(STATE_FLY_DESC* pDesc)
{
CState_Fly* pInstance = new CState_Fly;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Fly::Free()
{
__super::Free();
}
void CState_Fly::Describe_Entity()
{
}
@@ -0,0 +1,65 @@
#include "pch.h"
#include "State_Ground.h"
#include "Unit.h"
CState_Ground::CState_Ground()
:CState_Root()
{
}
void CState_Ground::Enter()
{
__super::Enter();
}
HRESULT CState_Ground::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Ground::Exit()
{
__super::Exit();
}
HRESULT CState_Ground::Initialize(STATE_GROUND_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Ground* CState_Ground::Create(STATE_GROUND_DESC* pDesc)
{
CState_Ground* pInstance = new CState_Ground;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Ground::Free()
{
__super::Free();
}
void CState_Ground::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Hover.h"
#include "Unit.h"
CState_Hover::CState_Hover()
:CState_Root()
{
}
void CState_Hover::Enter()
{
__super::Enter();
}
HRESULT CState_Hover::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Hover::Exit()
{
__super::Exit();
}
HRESULT CState_Hover::Initialize(STATE_HOVER_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Hover* CState_Hover::Create(STATE_HOVER_DESC* pDesc)
{
CState_Hover* pInstance = new CState_Hover;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Hover::Free()
{
__super::Free();
}
void CState_Hover::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Pulse.h"
#include "Unit.h"
CState_Pulse::CState_Pulse()
:CState_Root()
{
}
void CState_Pulse::Enter()
{
__super::Enter();
}
HRESULT CState_Pulse::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Pulse::Exit()
{
__super::Exit();
}
HRESULT CState_Pulse::Initialize(STATE_PULSE_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Pulse* CState_Pulse::Create(STATE_PULSE_DESC* pDesc)
{
CState_Pulse* pInstance = new CState_Pulse;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Pulse::Free()
{
__super::Free();
}
void CState_Pulse::Describe_Entity()
{
}
@@ -0,0 +1,59 @@
#include "pch.h"
#include "State_Rush.h"
#include "GameInstance.h"
#include "Unit.h"
CState_Rush::CState_Rush()
:CState_Root()
{
}
void CState_Rush::Enter()
{
*m_pRushPlayerHit = false;
__super::Enter();
}
HRESULT CState_Rush::Update(_float fTimeDelta)
{
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
return S_OK;
}
void CState_Rush::Exit()
{
*m_pRushPlayerHit = false;
__super::Exit();
}
HRESULT CState_Rush::Initialize(STATE_RUSH_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_pRushPlayerHit = pDesc->pCollisionPlayer;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Rush* CState_Rush::Create(STATE_RUSH_DESC* pDesc)
{
CState_Rush* pInstance = new CState_Rush;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Rush::Free()
{
__super::Free();
}
void CState_Rush::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Skill.h"
#include "Unit.h"
CState_Skill::CState_Skill()
:CState_Root()
{
}
void CState_Skill::Enter()
{
__super::Enter();
}
HRESULT CState_Skill::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Skill::Exit()
{
__super::Exit();
}
HRESULT CState_Skill::Initialize(STATE_SKILL_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Skill* CState_Skill::Create(STATE_SKILL_DESC* pDesc)
{
CState_Skill* pInstance = new CState_Skill;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Skill::Free()
{
__super::Free();
}
void CState_Skill::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Swipe.h"
#include "Unit.h"
CState_Swipe::CState_Swipe()
:CState_Root()
{
}
void CState_Swipe::Enter()
{
__super::Enter();
}
HRESULT CState_Swipe::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Swipe::Exit()
{
__super::Exit();
}
HRESULT CState_Swipe::Initialize(STATE_SWIPE_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Swipe* CState_Swipe::Create(STATE_SWIPE_DESC* pDesc)
{
CState_Swipe* pInstance = new CState_Swipe;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Swipe::Free()
{
__super::Free();
}
void CState_Swipe::Describe_Entity()
{
}
@@ -0,0 +1,64 @@
#include "pch.h"
#include "State_Tucked.h"
#include "GameInstance.h"
#include "Unit.h"
CState_Tucked::CState_Tucked()
:CState_Root()
{
}
void CState_Tucked::Enter()
{
__super::Enter();
}
HRESULT CState_Tucked::Update(_float fTimeDelta)
{
if (nullptr != m_funcPriorityUpdate) {
m_funcPriorityUpdate(fTimeDelta);
}
if (E_FAIL == (__super::Update(fTimeDelta))) {
return E_FAIL;
}
if (nullptr != m_funcLateUpdate) {
m_funcLateUpdate(fTimeDelta);
}
return S_OK;
}
void CState_Tucked::Exit()
{
__super::Exit();
}
HRESULT CState_Tucked::Initialize(STATE_TUCKED_DESC* pDesc)
{
if (FAILED(__super::Initialize(pDesc))) {
return E_FAIL;
}
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
m_funcLateUpdate = pDesc->funcLateUpdate;
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
return S_OK;
}
CState_Tucked* CState_Tucked::Create(STATE_TUCKED_DESC* pDesc)
{
CState_Tucked* pInstance = new CState_Tucked;
if (FAILED(pInstance->Initialize(pDesc))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CState_Tucked::Free()
{
__super::Free();
}
void CState_Tucked::Describe_Entity()
{
}
@@ -0,0 +1,57 @@
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CFSM;
NS_END
NS_BEGIN(Editor)
class CCallBack_Ranrok_HitReport final : public PSX::PxUserControllerHitReport
{
// 구현 예시
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
//
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
private:
CCallBack_Ranrok_HitReport();
public:
~CCallBack_Ranrok_HitReport();
void BeginFrame();
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; // 사용자 정의 장애물과 부딪힌 경우
void Set_CurrentSlop();
public:
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject, _bool* bCollisionPlayer);
HRESULT Finalize();
_bool IsOnGround();
_vector Get_GroundVector();
private:
CCharacter_Controller* m_pController = { nullptr };
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
CGameInstance* m_pGameInstance = { nullptr };
_float3 m_vClimbNormal = { 0.f, 1.f, 0.f };
_float m_fBestNormal = { 0.f };
_bool m_bGroundHit = { false };
_bool* m_pCollisionPlayer = { nullptr };
public:
static CCallBack_Ranrok_HitReport* Create();
};
NS_END
+189
View File
@@ -0,0 +1,189 @@
#pragma once
#include "Editor_Define.h"
#include "Monster.h"
#include "CallBack_Monster_Behavior.h"
#include "CallBack_Ranrok_HitReport.h"
NS_BEGIN(Editor)
class CRanrok final : public CMonster
{
enum class RANROK_SKILL
{
FIREBREATH,
FIRESWEEP,
FIREBALL,
SWIPE,
PULSE,
RUSH,
END
};
enum class RANROK_MESH_ORDER {
ETHEREAL_HOT_SPINE,
ETHEREAL_HOT_WINGS,
ETHEREAL_HOT_ARMS,
ETHEREAL_HOT_SHELL,
ETHEREAL_AURA,
ETHEREAL_EYES,
ETHEREAL_WINGS,
WINGS,
BODY,
END
};
enum class RANROK_PHASE
{
PHASE_AIR,
PHASE_GROUND,
END
};
private:
CRanrok(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CRanrok(const CRanrok& Prototype);
virtual ~CRanrok() = default;
public:
virtual void Priority_Update(_float fTimeDelta) override;
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
virtual HRESULT Render_Shadow(SHADOW eType) 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_Ranrok_HitReport* m_pCallBack_HitReport = { nullptr };
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
class CEffectPool* m_pEffectPool = nullptr;
_float2 m_vStunTimer = { 0.f, 4.f };
_float2 m_vAuraTimer = { 0.f, 0.16f };
_float2 m_vEtherealTimer = { 0.f, 0.16f };
_uint iIndex;
_bool m_bCollisionPlayer = { false };
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
HRESULT Ready_Components();
HRESULT Ready_Parts();
HRESULT Bind_ShaderResources();
HRESULT Render_Nonblend();
HRESULT Render_Blend();
void MoveTo(_float fTimeDelta);
HRESULT Load_RanrokPos(const _char* pFilePath);
public:
static CRanrok* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
virtual void Free() override;
#ifdef _DEBUG
virtual void Describe_Entity() override;
#endif // _DEBUG
private:
virtual void Add_FSM();
virtual void Set_Anim();
_int m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_AIR);
_float m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::END)] = {};
_float m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::END)] = { 40.f,40.f ,15.f,40.f,40.f,40.f};
_float m_fTuckedTime = {};
_bool m_bFireBurst = { false };
_bool m_bTucked = {false};
_bool m_bHoverDash = { false };
_vector m_vMoveDir = XMVectorZero();
vector<vector<_vector>> m_Points;
_int m_iCurrentPoint = 0;
_int m_iCurrentFlow = 0;
_float m_fAroundAngle = 0.f;
_float m_fAroundSpeed = 1.2f;
_float m_fAroundRadius = 40.f;
_float m_fAroundTime = {};
_float m_fRushTime = {};
void Behavior_IdleEnter();
HRESULT Behavior_IdleExitCheck();
void Behavior_IdleExit();
void Behavior_IdleBreakEnter();
HRESULT Behavior_IdleBreakExitCheck();
void Behavior_IdleBreakExit();
void Behavior_MoveEnter();
HRESULT Behavior_MoveExitCheck(_float fTimeDelta);
void Behavior_MoveExit();
void Behavior_CombatEnter();
HRESULT Behavior_CombatExitCheck(_float fTimeDelta);
void Behavior_CombatExit();
void Behavior_GroundEnter();
HRESULT Behavior_GroundExitCheck(_float fTimeDelta);
void Behavior_GroundExit();
void Behavior_HoverEnter();
HRESULT Behavior_HoverExitCheck(_float fTimeDelta);
void Behavior_HoverExit();
void Behavior_FlyEnter();
HRESULT Behavior_FlyExitCheck(_float fTimeDelta);
void Behavior_FlyExit();
void Behavior_FireBreathEnter();
HRESULT Behavior_FireBreathExitCheck(_float fTimeDelta);
void Behavior_FireBreathExit();
void Behavior_FireSweepEnter();
HRESULT Behavior_FireSweepExitCheck(_float fTimeDelta);
void Behavior_FireSweepExit();
void Behavior_FireBallEnter();
HRESULT Behavior_FireBallExitCheck(_float fTimeDelta);
void Behavior_FireBallExit();
void Behavior_SwipeEnter();
HRESULT Behavior_SwipeExitCheck(_float fTimeDelta);
void Behavior_SwipeExit();
void Behavior_SkillEnter();
HRESULT Behavior_SkillExitCheck(_float fTimeDelta);
void Behavior_SkillExit();
void Behavior_RushEnter();
HRESULT Behavior_RushExitCheck(_float fTimeDelta);
void Behavior_RushExit();
void Behavior_PulseEnter();
HRESULT Behavior_PulseExitCheck(_float fTimeDelta);
void Behavior_PulseExit();
void Behavior_TuckedEnter();
HRESULT Behavior_TuckedExitCheck(_float fTimeDelta);
void Behavior_TuckedExit();
void Behavior_LandEnter();
HRESULT Behavior_LandExitCheck(_float fTimeDelta);
void Behavior_LandExit();
void Behavior_HitEnter();
HRESULT Behavior_HitExitCheck(_float fTimeDelta);
void Behavior_HitExit();
void Behavior_DeadEnter();
HRESULT Behavior_DeadExitCheck(_float fTimeDelta);
void Behavior_DeadExit();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_FireBall final : public CState_Root
{
public:
typedef struct tagFireBall : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_FIREBALL_DESC;
private:
CState_FireBall();
virtual ~CState_FireBall() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_FIREBALL_DESC* pDesc);
public:
static CState_FireBall* Create(STATE_FIREBALL_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_FireBreath final : public CState_Root
{
public:
typedef struct tagFireBreath : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_FIREBREATH_DESC;
private:
CState_FireBreath();
virtual ~CState_FireBreath() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_FIREBREATH_DESC* pDesc);
public:
static CState_FireBreath* Create(STATE_FIREBREATH_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_FireSweep final : public CState_Root
{
public:
typedef struct tagFireSweep : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_FIRESWEEP_DESC;
private:
CState_FireSweep();
virtual ~CState_FireSweep() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_FIRESWEEP_DESC* pDesc);
public:
static CState_FireSweep* Create(STATE_FIRESWEEP_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Fly final : public CState_Root
{
public:
typedef struct tagFly : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_FLY_DESC;
private:
CState_Fly();
virtual ~CState_Fly() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_FLY_DESC* pDesc);
public:
static CState_Fly* Create(STATE_FLY_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Ground final : public CState_Root
{
public:
typedef struct tagGround : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_GROUND_DESC;
private:
CState_Ground();
virtual ~CState_Ground() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_GROUND_DESC* pDesc);
public:
static CState_Ground* Create(STATE_GROUND_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Hover final : public CState_Root
{
public:
typedef struct tagHover : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_HOVER_DESC;
private:
CState_Hover();
virtual ~CState_Hover() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_HOVER_DESC* pDesc);
public:
static CState_Hover* Create(STATE_HOVER_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Pulse final : public CState_Root
{
public:
typedef struct tagPulse : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_PULSE_DESC;
private:
CState_Pulse();
virtual ~CState_Pulse() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_PULSE_DESC* pDesc);
public:
static CState_Pulse* Create(STATE_PULSE_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,34 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Rush final : public CState_Root
{
public:
typedef struct tagRush : public CState_Root::STATE_ROOT_DESC {
_bool* pCollisionPlayer = { nullptr };
}STATE_RUSH_DESC;
public:
CState_Rush();
virtual ~CState_Rush() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
_bool* m_pRushPlayerHit = { nullptr };
private:
HRESULT Initialize(STATE_RUSH_DESC* pDesc);
public:
static CState_Rush* Create(STATE_RUSH_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Skill final : public CState_Root
{
public:
typedef struct tagSkill : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_SKILL_DESC;
private:
CState_Skill();
virtual ~CState_Skill() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_SKILL_DESC* pDesc);
public:
static CState_Skill* Create(STATE_SKILL_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Swipe final : public CState_Root
{
public:
typedef struct tagSwipe : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_SWIPE_DESC;
private:
CState_Swipe();
virtual ~CState_Swipe() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_SWIPE_DESC* pDesc);
public:
static CState_Swipe* Create(STATE_SWIPE_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -0,0 +1,36 @@
#pragma once
#include "Editor_Define.h"
#include "State_Root.h"
NS_BEGIN(Editor)
class CState_Tucked final : public CState_Root
{
public:
typedef struct tagTucked : public CState_Root::STATE_ROOT_DESC {
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
}STATE_TUCKED_DESC;
public:
CState_Tucked();
virtual ~CState_Tucked() = default;
public:
virtual void Enter();
virtual HRESULT Update(_float fTimeDelta);
virtual void Exit();
private:
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
private:
HRESULT Initialize(STATE_TUCKED_DESC* pDesc);
public:
static CState_Tucked* Create(STATE_TUCKED_DESC* pDesc);
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
@@ -27,7 +27,7 @@ typedef struct tagKeyFrame
_float3 vScale = {};
_float4 vRotation = {};
_float3 vTranslation = {};
_float fTrackPosition = {};
_float fTrackPosition = {};
}KEYFRAME;
@@ -395,6 +395,7 @@ typedef struct tagOnCollsionInfo
_float4 vWorldNomal = {}; // 접촉노말
_float4 vHitDir = {}; // 시도한 move 방향
_float fLength = {}; // 작용된 힘
_bool bIsMelee = {}; // 근접공격인지 아닌지
class CGameObject* pObject = { nullptr }; // 시전자
}ON_COLLISION_INFO;
+1
View File
@@ -80,6 +80,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
_float m_fHitDegree = {};
_float m_fHitCross = {};
_bool m_bMeleeHit = {};
private:
virtual void Add_FSM() {};