Merge branch 'Develope' into Effect

This commit is contained in:
GiJungSUk
2025-12-24 15:05:35 +09:00
90 changed files with 5555 additions and 2863 deletions
File diff suppressed because it is too large Load Diff
@@ -165,7 +165,9 @@ 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\State_FireBall.h" />
<ClInclude Include="..\Public\TransformationSide.h" />
<ClInclude Include="..\Public\Transformation.h" />
<ClInclude Include="..\Public\LightningSide.h" />
@@ -242,7 +244,6 @@ call Update_Resources.bat
<ClInclude Include="..\Public\RaceRing.h" />
<ClInclude Include="..\Public\State_AncientSpell.h" />
<ClInclude Include="..\Public\State_Broom_TurboFly.h" />
<ClInclude Include="..\Public\State_FireBall.h" />
<ClInclude Include="..\Public\State_FireBreath.h" />
<ClInclude Include="..\Public\State_FireSweep.h" />
<ClInclude Include="..\Public\State_Ground.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" />
@@ -605,9 +605,6 @@
<ClInclude Include="..\Public\State_FireBreath.h">
<Filter>04.Mechanic\State\State_Combat\State_FireBreath</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_FireBall.h">
<Filter>04.Mechanic\State\State_Combat\State_FireBall</Filter>
</ClInclude>
<ClInclude Include="..\Public\State_Pulse.h">
<Filter>04.Mechanic\State\State_Combat\State_Pulse</Filter>
</ClInclude>
@@ -719,6 +716,12 @@
<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>
<ClInclude Include="..\Public\State_FireBall.h">
<Filter>04.Mechanic\State\State_Combat\State_FireBall</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();
}
@@ -143,6 +143,7 @@ void CCallBack_Troll_HitReport::onControllerHit(const PSX::PxControllersHit& hit
if (false == *m_pCollisionPlayer) {
*m_pCollisionPlayer = true;
pTargetActorData->pCharacter->Get_Owner()->Get_Component<CStat>()->Get_Damage(30.f);
pTargetActorData->pCharacter->Get_Owner()->OnCollision(pOwner);
}
}
}
+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)
@@ -27,6 +27,7 @@
#include "Goblin_Mage.h"
#include "Goblin_Spector.h"
#include "NPC_Ollivander.h"
#include "NPC_EleazarFig.h"
#include "BroomRacerAI.h"
#include "Ranrok.h"
#pragma endregion
@@ -580,9 +581,21 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CNPC_Ollivander>(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) {
return E_FAIL;
{
CNPC_Ollivander::NPCDESC NPCDesc{};
NPCDesc.vPos = _float4(40.f, 4.f, 68.9f, 1.f);
NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f);
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CNPC_Ollivander>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) {
return E_FAIL;
}
}
{
CNPC_EleazarFig::NPCDESC NPCDesc{};
NPCDesc.vPos = _float4(101.f, 14.f, 100.f, 1.f);
NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f);
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CNPC_EleazarFig>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) {
return E_FAIL;
}
}
return S_OK;
+12 -1
View File
@@ -31,6 +31,7 @@
#include "Goblin_Spector.h"
#include "Troll.h"
#include "NPC_Ollivander.h"
#include "NPC_EleazarFig.h"
#include "BroomRacerAI.h"
#include "Ranrok.h"
@@ -1878,6 +1879,11 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Professor_EleazarFig_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/SubTroll/troll.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
return E_FAIL;
@@ -1893,7 +1899,7 @@ HRESULT CLoader::Loading_For_GamePlay()
#pragma region ITEM
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity()))))
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/SK_Wands_Amit.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity()))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Potion_Model"),
@@ -2786,6 +2792,11 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
/* For.Prototype_GameObject_EleazarFig */
if (FAILED(m_pGameInstance->Add_Prototype<CNPC_EleazarFig>(g_iStaticLevel, CNPC_EleazarFig::Create(m_pDevice, m_pContext)))){
return E_FAIL;
}
/* For.Prototype_GameObject_Ranrok */
if (FAILED(m_pGameInstance->Add_Prototype<CRanrok>(g_iStaticLevel, CRanrok::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
@@ -487,7 +487,7 @@ void CMapElement_Interactable::Free()
SAFE_RELEASE(m_pRigidBody);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pEffectPool);
if (nullptr != m_pInfoInstance) {
CInfoInstance* pInfo = m_pInfoInstance;
m_pInfoInstance = nullptr;
@@ -253,6 +253,18 @@ HRESULT CMonster::Render_Disolve()
return S_OK;
}
void CMonster::Set_Easing(_uint iAnimIndex,_float fEasingStartRatio,_float fEasingEndRatio,_float fEasingTime)
{
Add_Event(iAnimIndex,
[this, fEasingTime]() {m_fEasing = fEasingTime;},
fEasingStartRatio);
Add_Event(iAnimIndex,
[this]() {m_fEasing = 1.f; },
fEasingEndRatio);
}
void CMonster::Free()
{
__super::Free();
@@ -4,6 +4,8 @@
#include "GameInstance.h"
#include "InfoInstance.h"
#include "Player.h"
#include "CallBack_NonPlayable_Behavior.h"
#include "CallBack_NonPlayable_HitReport.h"
CNPC_EleazarFig::CNPC_EleazarFig(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CUnit(pDevice, pContext)
@@ -25,23 +27,27 @@ void CNPC_EleazarFig::Priority_Update(_float fTimeDelta)
void CNPC_EleazarFig::Update(_float fTimeDelta)
{
m_pFSM->Update_State(fTimeDelta);
if (m_pModelCom->IsFinishedAnim()) {
m_pModelCom->Set_AnimationIndex(m_pGameInstance->Random_Int(0, 19), false);
}
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
__super::Update(fTimeDelta);
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
{ // 세트
m_pCallBack_HitReport->BeginFrame();
m_pCharacter_Controller->Move(fTimeDelta);
m_pCallBack_HitReport->Set_CurrentSlop();
}
}
void CNPC_EleazarFig::Late_Update(_float fTimeDelta)
{
m_pTransformCom->Set_State(STATE::POSITION, m_pTransformCom->Get_EstimatedPositionByMomentum());
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition());
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
__super::Late_Update(fTimeDelta);
}
@@ -72,6 +78,7 @@ HRESULT CNPC_EleazarFig::Render()
}
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;
@@ -145,6 +152,19 @@ HRESULT CNPC_EleazarFig::Bind_ShaderResources()
return S_OK;
}
_bool CNPC_EleazarFig::CastToPlayer()
{
_vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION);
_vector vTargetPos = {};
pair<CUnit*, CTransform*> pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION));
vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION);
_float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos));
if (fLength < m_fEncounterDistance) {
return true;
}
return false;
}
HRESULT CNPC_EleazarFig::Initialize_Prototype()
{
return S_OK;
@@ -158,14 +178,28 @@ HRESULT CNPC_EleazarFig::Initialize(void* pArg)
if (FAILED(Ready_Components(pArg))) {
return E_FAIL;
}
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(40.f, 4.f, 68.9f, 1.f));
m_pModelCom->Set_AnimationIndex(m_pGameInstance->Random_Int(0, 19), false);
NPCDESC* pDesc = static_cast<NPCDESC*>(pArg);
_vector vPos = XMLoadFloat4(&pDesc->vPos);
m_pTransformCom->Set_State(STATE::POSITION, vPos);
m_pCharacter_Controller->Set_Position(vPos);
m_pTransformCom->Rotation(XMLoadFloat4(&pDesc->vRotQ));
m_pModelCom->Set_AnimationIndex(0, true);
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller);
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller);
return S_OK;
}
HRESULT CNPC_EleazarFig::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
CTransform::TRANSFORM_DESC Desc = {};
Desc.fSpeedPerSec = 10.f;
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
Desc.fRadius = 10.f;
if (FAILED(__super::Ready_Components(&Desc))) {
return E_FAIL;
}
@@ -174,11 +208,33 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg)
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
return E_FAIL;
}
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GerboldOlivander_Model"),
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Professor_EleazarFig_Model"),
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
return E_FAIL;
}
{ // CCT
CCharacter_Controller::Character_Controller_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
Desc.pTransform = m_pTransformCom;
Desc.eBodyType = ACTOR::CAPSULE;
Desc.fContactOffset = 0.0001f;
Desc.fMaterial = { 1.2f, 1.0f, 0.0f };
Desc.bAutoStepping = { false };
Desc.fStepOffset = { 0.02f };
Desc.fRadius = 0.5f;
Desc.fHeight = 0.6f;
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_NonPlayable_HitReport::Create();
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_NonPlayable_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(true);
}
return S_OK;
}
@@ -209,30 +265,25 @@ CGameObject* CNPC_EleazarFig::Clone(void* pArg, CGameObject* pOwner)
void CNPC_EleazarFig::Free()
{
__super::Free();
SAFE_RELEASE(m_pCharacter_Controller);
if (nullptr != m_pInfoInstance) {
CInfoInstance* pInfo = m_pInfoInstance;
m_pInfoInstance = nullptr;
}
if (nullptr != m_pCallBack_Behavior) {
m_pCallBack_Behavior->Finalize();
}
if (nullptr != m_pCallBack_HitReport) {
m_pCallBack_HitReport->Finalize();
}
Safe_Delete(m_pCallBack_Behavior);
Safe_Delete(m_pCallBack_HitReport);
}
#ifdef _DEBUG
void CNPC_EleazarFig::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
if (GUI::CollapsingHeader("Ollivander")) {
m_pModelCom->Describe_Entity();
if (ImGui::TreeNode("ANIM STATE")) {
for (auto& pState : m_States)
{
if (ImGui::Button(to_string(pState.first).c_str()))
{
m_pFSM->Change_State(pState.first);
}
}
GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str());
ImGui::TreePop();
}
}
GUI::End();
}
#endif // _DEBUG
@@ -237,8 +237,14 @@ HRESULT CNPC_Ollivander::Initialize(void* pArg)
if (FAILED(Ready_Components(pArg))) {
return E_FAIL;
}
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(40.f, 4.f, 68.9f, 1.f));
m_pCharacter_Controller->Set_Position(XMVectorSet(40.f, 4.f, 68.9f, 1.f));
NPCDESC* pDesc = static_cast<NPCDESC*>(pArg);
_vector vPos = XMLoadFloat4(&pDesc->vPos);
m_pTransformCom->Set_State(STATE::POSITION, vPos);
m_pCharacter_Controller->Set_Position(vPos);
m_pTransformCom->Rotation(XMLoadFloat4(&pDesc->vRotQ));
m_pModelCom->Set_AnimationIndex(0, true);
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller);
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller);
+8 -7
View File
@@ -142,15 +142,15 @@ void CPlayer::Update(_float fTimeDelta)
m_pFSM->Update_State(fTimeDelta);
Play_SpellHitAnim();
/* _float ratio = m_pModelCom->Get_CurrentTrackProgressRatio();
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
_float ease = 1.f;
if (ratio < 0.4f)
ease = 1.15f;
else if (ratio > 0.85f)
ease = 0.85f; */
_float ease = 1.f + powf(fRatio, 3.f) * 0.6f;
m_pModelCom->Play_Animation(fTimeDelta /** ease*/, m_pTransformCom);
if (m_pFSM->IsEnable(FSMSTATE::SPELL | FSMSTATE::LIGHT_ATTACK | FSMSTATE::COMBAT | FSMSTATE::ANCIENT_SPELL))
m_pModelCom->Play_Animation(fTimeDelta * ease, m_pTransformCom);
else {
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
}
Play_Event();
@@ -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;
@@ -1314,9 +1314,9 @@ HRESULT CPlayer::Behavior_LightAttackExitCheck(_float fTimeDelta)
return E_FAIL;
}
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell()))
if ( SUCCEEDED(InputSpell()))
{
if (fRatio >= 0.3f)
if (fRatio >= 0.1f)
{
m_pFSM->Change_State(FSMSTATE::COMBAT);
return E_FAIL;
@@ -1395,7 +1395,6 @@ void CPlayer::Behavior_SpellEnter()
0.01f);
fRatio = 0.2f;
}
}
else {
pairAnimInfo = m_Animation[STATEANIM::SPELL_180_R];
@@ -1430,7 +1429,7 @@ HRESULT CPlayer::Behavior_SpellExitCheck()
_uint iIndex = m_pModelCom->Get_AnimIndex();
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
if (SUCCEEDED(InputSpell()))
if (SUCCEEDED(InputSpell())&&!m_bSpellHit)
{
_uint iCurr = m_pModelCom->Get_AnimIndex();
_uint iStart = m_Animation[STATEANIM::SPELL].first;
@@ -1485,7 +1484,7 @@ HRESULT CPlayer::Behavior_SpellExitCheck()
}
else if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell()))
{
if (fRatio >= 0.3f)
if (fRatio >= 0.5f)
{
m_pFSM->Change_State(FSMSTATE::COMBAT);
return E_FAIL;
@@ -1752,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);
}
@@ -2560,13 +2563,14 @@ void CPlayer::Play_SpellHitAnim()
{
case ENUM_CLASS(SKILL_TYPE::ACCIO):
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.5f);
break;
case ENUM_CLASS(SKILL_TYPE::DESCENDO):
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.5f);
break;
}
m_pFSM->Change_State(FSMSTATE::SPELL);
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
m_bSpellHit = false;
if (m_pModelCom->IsFinishedAnim())
+22 -50
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;
@@ -520,10 +520,7 @@ void CRanrok::MoveTo(_float fTimeDelta)
_vector Target = m_Points[m_iCurrentFlow][m_iCurrentPoint];
_vector NextTarget;
if (m_iCurrentPoint + 1 <= m_Points[m_iCurrentFlow].size())
{
NextTarget = m_Points[m_iCurrentFlow][m_iCurrentPoint + 1];
}
_vector CurPos = m_pCharacter_Controller->Get_Position();
_vector vLook = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK));
@@ -532,9 +529,17 @@ void CRanrok::MoveTo(_float fTimeDelta)
_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 < 15.f)
if (fDist < 20.f)
{
if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1)
{
@@ -546,7 +551,7 @@ void CRanrok::MoveTo(_float fTimeDelta)
return;
}
}
else if (fDist < 50.f)
else if (fDist < 20.f)
{
if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1)
{
@@ -558,48 +563,13 @@ void CRanrok::MoveTo(_float fTimeDelta)
return;
}
m_pTransformCom->LookAt_Lerp(Target, fTimeDelta, 1.f);
_vector LerpTarget = XMVectorLerp(Target, NextTarget, 0.5f);
m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta,2.f);
m_pCharacter_Controller->Set_Position(CurPos + vLook * Speed * fTimeDelta);
}
void CRanrok::AroundPoint(_float fTimeDelta)
{
m_fAroundTime += fTimeDelta;
if (m_fAroundTime >= 6.f)
{
m_fAroundTime = 0.f;
m_iCurrentFlow++;
}
else {
_vector Center = XMVectorSet(16.141f, -50.299f, 221.423f, 1.f);
m_fAroundAngle += m_fAroundSpeed * fTimeDelta;
if (m_fAroundAngle > XM_2PI) m_fAroundAngle -= XM_2PI;
_float x = cosf(m_fAroundAngle) * m_fAroundRadius;
_float z = sinf(m_fAroundAngle) * m_fAroundRadius;
_vector TargetPos = Center + XMVectorSet(x, 0.f, z, 0.f);
_vector CurPos = m_pCharacter_Controller->Get_Position();
_vector vDir = TargetPos - CurPos;
_float dist = XMVectorGetX(XMVector3Length(vDir));
if (dist > 0.001f)
{
vDir = XMVector3Normalize(vDir);
_float moveSpeed = 50.f;
_vector NextPos = CurPos + vDir * (moveSpeed * fTimeDelta);
m_pCharacter_Controller->Set_Position(NextPos);
}
m_pTransformCom->LookAt_Horizontal_Lerp(Center, fTimeDelta, 3.f);
}
}
HRESULT CRanrok::Load_RanrokPos(const _char* pFilePath)
{
tinyxml2::XMLDocument doc;
@@ -711,10 +681,12 @@ void CRanrok::Describe_Entity()
GUI::SameLine();
if (GUI::SmallButton("Copy"))
{
char buf[64];
sprintf_s(buf, "%.3ff, %.3ff, %.3ff", Pos.x, Pos.y, Pos.z);
{
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));
}
@@ -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"
@@ -456,17 +456,15 @@ void CRanrok::Behavior_SwipeEnter()
m_pFSM->Enable_State(FSMSTATE::SWIPE);
if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND))
{
_int iRand = m_pGameInstance->Real_Random_Int(0, 1);
switch (iRand)
if (m_fCross > 0)
{
case 0:
pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_L];
break;
case 1:
pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_R];
break;
}
else {
pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_R];
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::SWIPE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::SWIPE)];
@@ -532,23 +530,9 @@ HRESULT CRanrok::Behavior_RushExitCheck(_float fTimeDelta)
m_fRushTime += fTimeDelta;
if (m_fRushTime >= 2.5f && iCurrAnimIndex == m_Animation[STATEANIM::RUSH_LOOP].first)
{
if (m_fDegree >= 60.f)
{
if (m_fCross < 0)
{
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L];
}
else {
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R];
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
else
{
m_pFSM->Change_State(FSMSTATE::GROUND);
m_pFSM->Change_State(FSMSTATE::SWIPE);
return E_FAIL;
}
}
else if (iCurrAnimIndex == m_Animation[STATEANIM::RUSH_LOOP].first)
{
@@ -899,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));
}
{
+1 -1
View File
@@ -88,7 +88,7 @@ void CTroll::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);
+62 -46
View File
@@ -101,7 +101,6 @@ void CTroll::Behavior_IdleBreakEnter()
break;
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
m_pModelCom->Set_BlendDuration(0.6f);
}
HRESULT CTroll::Behavior_IdleBreakExitCheck()
@@ -117,7 +116,6 @@ HRESULT CTroll::Behavior_IdleBreakExitCheck()
void CTroll::Behavior_IdleBreakExit()
{
m_pFSM->Disable_State(FSMSTATE::IDLEBREAK);
m_pModelCom->Set_BlendDuration(0.3f);
}
void CTroll::Behavior_MoveEnter()
@@ -442,6 +440,8 @@ void CTroll::Behavior_SwingEnter()
m_pWeaponTrail->Set_Visible(false);
},
0.6f);
Set_Easing(pairAnimInfo.first, 0.2f, 0.4f, 1.3f);
}
HRESULT CTroll::Behavior_SwingExitCheck(_float fTimeDelta)
@@ -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 = {};
@@ -538,6 +496,7 @@ void CTroll::Behavior_SlamEnter()
m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_ATTACK, this);
}, 0.3f);
Set_Easing(pairAnimInfo.first, 0.2f, 0.4f, 1.3f);
}
HRESULT CTroll::Behavior_SlamExitCheck(_float fTimeDelta)
@@ -558,7 +517,7 @@ HRESULT CTroll::Behavior_SlamExitCheck(_float fTimeDelta)
return S_OK;
}
else if (fRatio >= 0.4f) {
else if (fRatio >= 0.6f) {
m_bLookAt = true;
m_pFSM->Change_State(FSMSTATE::IDLEBREAK);
return E_FAIL;
@@ -597,6 +556,8 @@ void CTroll::Behavior_BackHandSwingEnter()
m_pWeaponTrail->Set_Visible(false);
},
0.9f);
Set_Easing(pairAnimInfo.first, 0.2f, 0.4f, 1.3f);
}
HRESULT CTroll::Behavior_BackHandSwingExitCheck(_float fTimeDelta)
@@ -891,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) {
@@ -910,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;
@@ -931,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
+2
View File
@@ -52,6 +52,7 @@ class CMonster abstract : public CUnit
_bool m_bDisolve = { false };
_float m_fDegree = {};
_float m_fCross = {};
_float m_fEasing = { 1.f };
_int m_eHitState = { ENUM_CLASS(HIT_STATE::END) };
protected:
@@ -60,6 +61,7 @@ class CMonster abstract : public CUnit
HRESULT Ready_Components(void* pArg);
void Set_Target(CUnit& pTarget, CTransform& pTransform);
virtual HRESULT Render_Disolve();
void Set_Easing(_uint iAnimIndex, _float fEasingStartRatio, _float fEasingEndRatio, _float fEasingTime);
public:
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
virtual void Free() override;
@@ -7,6 +7,11 @@ NS_BEGIN(Client)
class CNPC_EleazarFig final : public CUnit
{
public:
typedef struct tagNpcInitDesc {
_float4 vPos;
_float4 vRotQ;
}NPCDESC;
protected:
CNPC_EleazarFig(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CNPC_EleazarFig(const CNPC_EleazarFig& Prototype);
@@ -20,12 +25,21 @@ class CNPC_EleazarFig final : public CUnit
virtual HRESULT Render_Shadow(SHADOW eType) override;
protected:
CInfoInstance* m_pInfoInstance = { nullptr };
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr };
class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr };
CUnit* m_pPlayerAllyUnit = { nullptr };
_bool m_bEntered = { false };
_float2 m_vEnteringTimer = { 0.f, 1.f };
_float m_fEncounterDistance = { 10.f };
protected:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
HRESULT Ready_Components(void* pArg);
HRESULT Bind_ShaderResources() override;
_bool CastToPlayer();
public:
static CNPC_EleazarFig* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -7,6 +7,11 @@ NS_BEGIN(Client)
class CNPC_Ollivander final : public CUnit
{
public:
typedef struct tagNpcInitDesc {
_float4 vPos;
_float4 vRotQ;
}NPCDESC;
protected:
CNPC_Ollivander(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CNPC_Ollivander(const CNPC_Ollivander& Prototype);
+3 -3
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;
@@ -75,7 +76,6 @@ class CRanrok final : public CMonster
HRESULT Render_Nonblend();
HRESULT Render_Blend();
void MoveTo(_float fTimeDelta);
void AroundPoint(_float fTimeDelta);
HRESULT Load_RanrokPos(const _char* pFilePath);
public:
static CRanrok* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
+1
View File
@@ -97,6 +97,7 @@ class CTroll final : public CMonster
_float m_fRushTime = {};
_float m_fAttackDelay = {};
void Behavior_IdleEnter();
HRESULT Behavior_IdleExitCheck();
void Behavior_IdleExit();
@@ -1,28 +1,5 @@
<RanrokPosInfo>
<RanrokPosData>
<Name Flow="3">
<Position>
<Pos x="14.121" y="-41.890" z="248.021"/>
</Position>
<Position>
<Pos x="-12.558" y="-28.878" z="236.451"/>
</Position>
<Position>
<Pos x="-20.145" y="-48.688" z="216.771"/>
</Position>
<Position>
<Pos x="11.854" y="-50.864" z="182.233"/>
</Position>
<Position>
<Pos x="44.661" y="-52.001" z="202.435"/>
</Position>
<Position>
<Pos x="29.840" y="-60.349" z="212.004"/>
</Position>
<Position>
<Pos x="23.993" y="-58.307" z="220.465"/>
</Position>
</Name>
<Name Flow="2">
<Position>
<Pos x="16.141" y="-50.299" z="221.423"/>
@@ -30,7 +30,7 @@
</MI_Professor_EleazarFig_Hair>
<MI_HUM_N_Heads_Eye ShaderIndex = "2" OutLineWrite="2">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Eye_Iris_D" Extension=".dds"/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Eye_Iris_D" Extension=".png"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
@@ -57,17 +57,17 @@
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_HUM_N_Heads_Eye>
<MI_HUM_N_Heads_Eyelash ShaderIndex = "0" OutLineWrite="0">
<MI_HUM_N_Heads_Eyelash ShaderIndex = "5" OutLineWrite="5">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Old_M_Hair_Fig_DAO_MSK" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_DefaultGrey_D" Extension=".png"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="T_Old_M_Hair_Fig_THV_MSK" Extension=".dds"/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
@@ -231,4 +231,63 @@
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_Professor_EleazarFig_Lower_02>
<MI_Old_M_Head_Professor_Fig_Head ShaderIndex = "6" OutLineWrite="16">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_Head_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_Professor_EleazarFig_Head_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="T_Professor_EleazarFig_Head_SRXO" Extension=".dds"/>
</MI_Old_M_Head_Professor_Fig_Head>
<MI_ClothSim ShaderIndex = "3" OutLineWrite="3">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_Lower_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="" Extension=""/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_ClothSim>
</Material>
@@ -0,0 +1,293 @@
<Material>
<MI_Professor_EleazarFig_Hair ShaderIndex = "5" OutLineWrite="5">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Old_M_Hair_Fig_DAO_MSK" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_DefaultGrey_D" Extension=".png"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="T_Old_M_Hair_Fig_THV_MSK" Extension=".dds"/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_Professor_EleazarFig_Hair>
<MI_HUM_N_Heads_Eye ShaderIndex = "2" OutLineWrite="2">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Eye_Iris_D" Extension=".png"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="BaseFlattenNormalMap" Extension=".png"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_HUM_N_Heads_Eye>
<MI_HUM_N_Heads_Eyelash ShaderIndex = "5" OutLineWrite="5">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Old_M_Hair_Fig_DAO_MSK" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_DefaultGrey_D" Extension=".png"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="T_Old_M_Hair_Fig_THV_MSK" Extension=".dds"/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_HUM_N_Heads_Eyelash>
<MI_HUM_N_Heads_Teeth ShaderIndex = "1" OutLineWrite="1">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_HUM_Head_Teeth_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_HUM_Head_Teeth_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="T_Old_M_Hair_Fig_THV_MSK" Extension=".dds"/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="T_HUM_Head_Teeth_SRXO" Extension=".dds"/>
</MI_HUM_N_Heads_Teeth>
<MI_HUM_N_Heads_EyeOcclusion ShaderIndex = "3" OutLineWrite="3">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Eye_Sclera_D" Extension=".png"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="BaseFlattenNormalMap" Extension=".png"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_HUM_N_Heads_EyeOcclusion>
<MI_HUM_M_Arms_ArmsOld_Fig ShaderIndex = "6" OutLineWrite="6">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_HUM_M_Body_ArmsOld01_Fig_D" Extension=".png"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_HUM_M_Body_ArmsOld01_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="T_HUM_M_Body_ArmsOld0_Fig_SRXO" Extension=".dds"/>
</MI_HUM_M_Arms_ArmsOld_Fig>
<MI_Professor_EleazarFig_02 ShaderIndex = "20" OutLineWrite="21">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="T_Professor_EleazaFig_SRO" Extension=".dds"/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_Professor_EleazaFig_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="T_Professor_EleazarFig_MRO" Extension=".dds"/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="T_Professor_EleazaFig_A" Extension=".dds"/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="T_Professor_EleazaFig_SRO" Extension=".dds"/>
</MI_Professor_EleazarFig_02>
<MI_Professor_EleazarFig_Lower_02 ShaderIndex = "8" OutLineWrite="22">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_Lower_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_Professor_EleazarFig_Lower_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="T_Professor_EleazarFig_Lower_MRO" Extension=".dds"/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_Professor_EleazarFig_Lower_02>
<MI_Old_M_Head_Professor_Fig_Head ShaderIndex = "6" OutLineWrite="16">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_Head_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="T_Professor_EleazarFig_Head_N" Extension=".dds"/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="T_Professor_EleazarFig_Head_SRXO" Extension=".dds"/>
</MI_Old_M_Head_Professor_Fig_Head>
<MI_ClothSim ShaderIndex = "3" OutLineWrite="3">
<aiTextureType_NONE Index="0" Filename="" Extension=""/>
<aiTextureType_DIFFUSE Index="1" Filename="T_Professor_EleazarFig_Lower_D" Extension=".dds"/>
<aiTextureType_SPECULAR Index="2" Filename="" Extension=""/>
<aiTextureType_AMBIENT Index="3" Filename="" Extension=""/>
<aiTextureType_EMISSIVE Index="4" Filename="" Extension=""/>
<aiTextureType_HEIGHT Index="5" Filename="" Extension=""/>
<aiTextureType_NORMALS Index="6" Filename="" Extension=""/>
<aiTextureType_SHININESS Index="7" Filename="" Extension=""/>
<aiTextureType_OPACITY Index="8" Filename="" Extension=""/>
<aiTextureType_DISPLACEMENT Index="9" Filename="" Extension=""/>
<aiTextureType_LIGHTMAP Index="10" Filename="" Extension=""/>
<aiTextureType_REFLECTION Index="11" Filename="" Extension=""/>
<aiTextureType_BASE_COLOR Index="12" Filename="" Extension=""/>
<aiTextureType_NORMAL_CAMERA Index="13" Filename="" Extension=""/>
<aiTextureType_EMISSION_COLOR Index="14" Filename="" Extension=""/>
<aiTextureType_METALNESS Index="15" Filename="" Extension=""/>
<aiTextureType_DIFFUSE_ROUGHNESS Index="16" Filename="" Extension=""/>
<aiTextureType_AMBIENT_OCCLUSION Index="17" Filename="" Extension=""/>
<aiTextureType_UNKNOWN Index="18" Filename="" Extension=""/>
<aiTextureType_SHEEN Index="19" Filename="" Extension=""/>
<aiTextureType_CLEARCOAT Index="20" Filename="" Extension=""/>
<aiTextureType_TRANSMISSION Index="21" Filename="" Extension=""/>
<aiTextureType_MAYA_BASE Index="22" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR Index="23" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_COLOR Index="24" Filename="" Extension=""/>
<aiTextureType_MAYA_SPECULAR_ROUGHNESS Index="25" Filename="" Extension=""/>
<aiTextureType_ANISOTROPY Index="26" Filename="" Extension=""/>
</MI_ClothSim>
</Material>
Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

@@ -1295,6 +1295,38 @@ PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In)
Out.fBlur = fResult;
return Out;
}
struct PS_OUT_DECAL
{
float4 vDiffuse : SV_TARGET0;
};
PS_OUT_DECAL PS_DECAL(PS_IN In)
{
PS_OUT_DECAL Out;
float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
float fViewZ = vDepthDesc.y * g_fFar;
float4 vPosition, vPreShadowPosition;
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
vPosition.z = vDepthDesc.x;
vPosition.w = 1.f;
vPosition = vPosition * fViewZ;
vPosition = mul(vPosition, g_invmatProj);
vPosition = mul(vPosition, g_invMatView);
vPreShadowPosition = vPosition;
return Out;
}
technique11 DefaultTechnique
{
pass DebugPass // 0
@@ -1509,4 +1541,14 @@ technique11 DefaultTechnique
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MOTIONBLUR_TENTSAMPLE();
}
pass DecalPass // 22
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_None, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_DECAL();
}
}
@@ -2,6 +2,7 @@
#include "Engine_Shader_Defines.hlsli"
float4x4 g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
float4x4 g_WorldMatrixInv, g_ViewMatrixInv, g_ProjMatrixInv;
float4x4 g_PrevWorldMatrix, g_PrevViewMatrix, g_PrevProjMatrix;
int g_bUVTargetDiffuse;
@@ -79,6 +80,8 @@ Texture2D g_NormalLargeTexture;
Texture2D g_NormalSubTexture;
Texture2D g_DeadDisolveTexture;
Texture2D g_DepthTexture;
float g_fNormalValue1;
float g_fNormalValue2;
float g_fNormalValue3;
@@ -100,6 +103,12 @@ float g_fRimPower;
float g_fRimStrength;
float4 g_vRimColor;
float g_fWinSizeX;
float g_fWinSizeY;
float4 g_vMaskColorRed;
float4 g_vMaskColorGreen;
float4 g_vMaskColorBlue;
struct VS_IN
{
@@ -133,6 +142,14 @@ struct VS_OUT_SHADOW
float4 vPosition : SV_POSITION;
};
struct VS_OUT_DECAL
{
float4 vPosition : SV_POSITION;
float3 vNormal : NORMAL;
float3 vTangent : TANGENT;
float3 vBinormal : BINORMAL;
};
VS_OUT_BLUR VS_MAIN_BLUR(VS_IN In)
{
@@ -185,6 +202,22 @@ VS_OUT VS_MAIN(VS_IN In)
return Out;
}
VS_OUT_DECAL VS_MAIN_DECAL(VS_IN In)
{
VS_OUT_DECAL Out;
matrix matWV, matWVP;
matWV = mul(g_WorldMatrix, g_ViewMatrix);
matWVP = mul(matWV, g_ProjMatrix);
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), g_WorldMatrix)).xyz;
Out.vTangent = normalize(mul(vector(In.vTangent, 0.f), g_WorldMatrix)).xyz;
Out.vBinormal = normalize(mul(vector(In.vBinormal, 0.f), g_WorldMatrix)).xyz;
return Out;
}
VS_OUT_BLUR VS_BLOOM(VS_IN In)
{
VS_OUT_BLUR Out;
@@ -853,6 +886,86 @@ PS_OUT PS_LEVIOSO(PS_IN In)
return Out;
}
struct PS_IN_DECAL
{
float4 vPosition : SV_POSITION;
float3 vNormal : NORMAL;
float3 vTangent : TANGENT;
float3 vBinormal : BINORMAL;
};
struct PS_OUT_DELCAL
{
float4 vAlbedo : SV_TARGET0;
float4 vNormal : SV_TARGET1;
float4 vSurface : SV_Target2;
};
PS_OUT_DELCAL PS_MAIN_DECAL(PS_IN_DECAL In)
{
PS_OUT_DELCAL Out;
float2 vDepthUV;
vDepthUV.x = In.vPosition.x / g_fWinSizeX;
vDepthUV.y = In.vPosition.y / g_fWinSizeY;
float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vDepthUV);
float fViewZ = vDepthDesc.y * g_fFar;
float4 vPosition;
vPosition.x = vDepthUV.x * 2.f - 1.f;
vPosition.y = vDepthUV.y * -2.f + 1.f;
vPosition.z = vDepthDesc.x;
vPosition.w = 1.f;
float4 vViewPos = mul(vPosition, g_ProjMatrixInv);
vViewPos /= vViewPos.w;
float4 vWorldPos = mul(vViewPos, g_ViewMatrixInv);
vector vLocalPos = mul(vWorldPos, g_WorldMatrixInv);
float3 ObjectAbsPos = abs(vLocalPos.xyz);
clip(0.5f - ObjectAbsPos);
float2 vDecalUV = vLocalPos.xz + 0.5f;
float4 vMaskColor = g_MaskingTexture.Sample(DefaultSampler, vDecalUV);
if (vMaskColor.a < 0.2f)
{
discard;
}
float4 vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, vDecalUV);
float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, vDecalUV);
float fMaskWeight = vMaskColor.r + vMaskColor.g + vMaskColor.b;
float4 vDiffuseColor = vMaskColor.r * g_vMaskColorRed +
vMaskColor.g * g_vMaskColorGreen +
vMaskColor.b * g_vMaskColorBlue;
vDiffuseColor /= fMaskWeight;
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix));
Out.vAlbedo = vDiffuseColor;
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.5f);
float fSurfaceParam = g_fUsingSurfaceParams;
if (true == AlmostEqual7(g_fUsingSurfaceParams, 0.f))
{
fSurfaceParam = 0.f;
}
Out.vSurface = vSurface;
return Out;
}
technique11 MeshTechnique11
{
@@ -1071,4 +1184,14 @@ technique11 MeshTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_LEVIOSO();
}
pass DecalPass // 22
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN_DECAL();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN_DECAL();
}
}
@@ -2,12 +2,15 @@
#include "Engine_Shader_Defines.hlsli"
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
matrix g_WorldMatrixInv, g_ViewMatrixInv, g_ProjMatrixInv;
float g_fFar;
float g_fNormalThreshold;
float3 g_vContainerMin;
float3 g_vContainerMax;
Texture2D g_DepthTexture;
Texture2D g_DiffuseTexture;
struct VS_IN
{
@@ -52,6 +55,48 @@ PS_OUT PS_MAIN(PS_IN In)
return Out;
}
PS_OUT PS_DECAL(PS_IN In)
{
PS_OUT Out;
float2 vDepthUV;
vDepthUV.x = In.vPosition.x / 1920.f;
vDepthUV.y = In.vPosition.y / 1080.f;
float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vDepthUV);
float fViewZ = vDepthDesc.y * g_fFar;
float4 vPosition;
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
vPosition.x = vDepthUV.x * 2.f - 1.f;
vPosition.y = vDepthUV.y * -2.f + 1.f;
vPosition.z = vDepthDesc.x;
vPosition.w = 1.f;
float4 vViewPos = mul(vPosition, g_ProjMatrixInv);
vViewPos /= vViewPos.w;
float4 vWorldPos = mul(vViewPos, g_ViewMatrixInv);
vector vLocalPos = mul(vWorldPos, g_WorldMatrixInv);
float3 ObjectAbsPos = abs(vLocalPos.xyz);
clip(0.5f - ObjectAbsPos);
float2 vDecalUV = vLocalPos.xz + 0.5f;
float4 Color = g_DiffuseTexture.Sample(DefaultSampler, vDecalUV);
if (0.3f > Color.a)
discard;
Out.vColor = Color; //float4(1.f, vDecalUV.x, vDecalUV.y, 1.f);
return Out;
}
PS_OUT PS_DEBUG(PS_IN In)
{
PS_OUT Out;
@@ -83,4 +128,13 @@ technique11 NorTechnique11
PixelShader = compile ps_5_0 PS_DEBUG();
}
pass Decal
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_DECAL();
}
}
@@ -178,6 +178,8 @@ 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\DummyDecal.h" />
<ClInclude Include="..\public\Enemy_Detection.h" />
<ClInclude Include="..\Public\Goblin_BattleAxe.h" />
<ClInclude Include="..\Public\Goblin_Dagger.h" />
@@ -197,6 +199,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 +214,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 +422,8 @@ 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\DummyDecal.cpp" />
<ClCompile Include="..\Private\Enemy_Detection.cpp" />
<ClCompile Include="..\Private\Goblin_BattleAxe.cpp" />
<ClCompile Include="..\Private\Goblin_Dagger.cpp" />
@@ -427,6 +443,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 +459,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,24 @@
<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>
<Filter Include="02.GameObjects\Dummys\DummyDecal">
<UniqueIdentifier>{ebd7a1c2-4914-4956-ad9c-a0fc2e857f56}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Editor.h">
@@ -1141,10 +1156,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 +1168,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 +1308,48 @@
<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>
<ClInclude Include="..\public\DummyDecal.h">
<Filter>02.GameObjects\Dummys\DummyDecal</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Editor.ico">
@@ -1793,13 +1850,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 +1865,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 +1996,51 @@
<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>
<ClCompile Include="..\private\DummyDecal.cpp">
<Filter>02.GameObjects\Dummys\DummyDecal</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();
}
@@ -13,11 +13,6 @@ CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs)
}
void CCamera_Debug::Priority_Update(_float fTimeDelta)
{
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false);
}
void CCamera_Debug::Update(_float fTimeDelta)
{
if (false == m_bActive) {
return;
@@ -40,7 +35,7 @@ void CCamera_Debug::Update(_float fTimeDelta)
}
#endif // gimch
if (m_bMovable) {
#pragma region Position
_float fSpeed = 5.f;
@@ -77,6 +72,13 @@ void CCamera_Debug::Update(_float fTimeDelta)
}
__super::Bind_Matrices();
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false);
}
void CCamera_Debug::Update(_float fTimeDelta)
{
}
void CCamera_Debug::Late_Update(_float fTimeDelta)
@@ -0,0 +1,244 @@
#include "pch.h"
#include "DummyDecal.h"
#include "GameInstance.h"
CDummyDecal::CDummyDecal(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject{ pDevice, pContext }
{
}
CDummyDecal::CDummyDecal(const CDummyDecal& rhs)
: CGameObject(rhs)
, m_fWinSizeX{rhs.m_fWinSizeX}
, m_fWinSizeY{rhs.m_fWinSizeY}
{
}
HRESULT CDummyDecal::Initialize_Prototype()
{
m_fWinSizeX = g_iWinSizeX;
m_fWinSizeY = g_iWinSizeY;
return S_OK;
}
HRESULT CDummyDecal::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
m_vMaskRed = _float4(1.f, 0.f, 0.f, 1.f);
m_vMaskGreen = _float4(1.f, 1.f, 1.f, 1.f);
m_vMaskBlue = _float4(1.f, 1.f, 1.f, 1.f);
return S_OK;
}
void CDummyDecal::Priority_Update(_float fTimeDelta)
{
}
void CDummyDecal::Update(_float fTimeDelta)
{
Describe_Entity();
}
void CDummyDecal::Late_Update(_float fTimeDelta)
{
//if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
m_pGameInstance->Add_RenderGroup(RENDER::DECAL, this);
//}
}
HRESULT CDummyDecal::Render()
{
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
_uint iNumMesh = m_pModelCom->Get_NumMeshes();
for (_uint i = 0; i < iNumMesh; i++)
{
if (FAILED(m_pShaderCom->Bind_SRV("g_MaskingTexture", m_pMaskTextureCom->Get_SRV(0)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_SRV("g_NormalTexture", m_pNormalTextureCom->Get_SRV(0)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_SRV("g_SurfaceParamsTexture", m_pSurfaceTextureCom->Get_SRV(0)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(22))) {
return E_FAIL;
}
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
return S_OK;
}
HRESULT CDummyDecal::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
/* Com_Texture */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Decal_MSK"),
reinterpret_cast<CComponent**>(&m_pMaskTextureCom))))
return E_FAIL;
/* Com_Texture */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Decal_Noraml"),
reinterpret_cast<CComponent**>(&m_pNormalTextureCom))))
return E_FAIL;
/* Com_Texture */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Base_MRO"),
reinterpret_cast<CComponent**>(&m_pSurfaceTextureCom))))
return E_FAIL;
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_DecalBox"),
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 CDummyDecal::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;
}
_float4x4 WorldInv = {};
XMStoreFloat4x4(&WorldInv, m_pTransformCom->Get_WorldMatrixInv());
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrixInv", &WorldInv))) {
return E_FAIL;
}
// Base MRO
// g_fUsingSurfaceParams 15.f / 27.f;
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrixInv", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrixInv", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
return E_FAIL;
}
/*if (FAILED(m_pShaderCom->Bind_RawValue("g_fNormalThreshold", &m_fNormalThreshold, sizeof(_float)))) {
return E_FAIL;
}*/
if (FAILED(m_pShaderCom->Bind_RawValue("g_fWinSizeX", &m_fWinSizeX, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fWinSizeY", &m_fWinSizeY, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskColorRed", &m_vMaskRed, sizeof(_float4)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskColorGreen", &m_vMaskGreen, sizeof(_float4)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskColorBlue", &m_vMaskBlue, sizeof(_float4)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShaderCom, "g_DepthTexture"))) {
return E_FAIL;
}
return S_OK;
}
CDummyDecal* CDummyDecal::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CDummyDecal* pInstance = new CDummyDecal(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CDummyDecal");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CDummyDecal::Clone(void* pArg, CGameObject* pOwner)
{
CDummyDecal* pInstance = new CDummyDecal(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CDummyDecal");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CDummyDecal::Free()
{
__super::Free();
SAFE_RELEASE(m_pMaskTextureCom);
SAFE_RELEASE(m_pNormalTextureCom);
SAFE_RELEASE(m_pSurfaceTextureCom);
SAFE_RELEASE(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
}
void CDummyDecal::Describe_Entity()
{
GUI::Begin("TEST DECAL");
_float fAgle = XMConvertToDegrees(m_fNormalThreshold);
GUI::InputFloat("m_fNormalThreshold", &fAgle);
GUI::ColorEdit4("Mask Red", (_float*)&m_vMaskRed);
GUI::ColorEdit4("Mask Green", (_float*)&m_vMaskGreen);
GUI::ColorEdit4("Mask Blue", (_float*)&m_vMaskBlue);
m_fNormalThreshold = XMConvertToRadians(fAgle);
m_pTransformCom->Describe_Entity();
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
{
_float3 vPosition = {};
if (m_pGameInstance->isPicking(&vPosition))
{
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f));
}
}
GUI::End();
}
@@ -84,6 +84,10 @@ pair<CUnit*, CTransform*> CInfoInstance::Get_NearestPlayerAlly(_fvector vPos)
{
return m_pMonsterInfo->Get_NearestPlayerAlly(vPos);
}
HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath)
{
return m_pMapInfo->Load_MapObjects(pFilePath);
}
#pragma endregion
#pragma region MAP_INFO
@@ -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) }
@@ -40,25 +41,29 @@ HRESULT CLevel_EffectViewer::Initialize()
{
return E_FAIL;
}
if (FAILED(Ready_Layer_BackGround(TEXT("Layer_Background"))))
{
return E_FAIL;
}
if (FAILED(Ready_Layer_Effect(TEXT("Layer_Effect"))))
{
return E_FAIL;
}
CTerrain::TERRAIN_DESC Desc = {};
/* Hogsmeade */
//CTerrain::TERRAIN_DESC Desc = {};
///* Hogsmeade */
Desc.isEdit = false;
Desc.iAlphaSizeX = 2048;
Desc.iAlphaSizeY = 2048;
Desc.vPosition = _float3(-194, 18.5f, -153.f);
Desc.strAlphaMapTag = "Hogsmeade_AlphaMap.bin";
Desc.strHeightMapTag = "Hogsmeade_HeightMap.bin";
Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade");
//Desc.isEdit = false;
//Desc.iAlphaSizeX = 2048;
//Desc.iAlphaSizeY = 2048;
//Desc.vPosition = _float3(-194, 18.5f, -153.f);
//Desc.strAlphaMapTag = "Hogsmeade_AlphaMap.bin";
//Desc.strHeightMapTag = "Hogsmeade_HeightMap.bin";
//Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade");
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Terrain"), &Desc)))
return E_FAIL;
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Terrain"), &Desc)))
// return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectPool>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함!
@@ -85,6 +90,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;
}
@@ -195,6 +203,16 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag)
return S_OK;
}
HRESULT CLevel_EffectViewer::Ready_Layer_BackGround(const _wstring& strLayerTag)
{
_float4 vColor = _float4(0.2f, 0.2f, 0.2f, 1.f);
m_pGameInstance->Set_FogColor(vColor);
m_pGameInstance->Set_Fog(10.f, 5.f);
m_pInfoInstance->Load_MapObjects("Dungeon_Map_Data");
return S_OK;
}
CLevel_EffectViewer* CLevel_EffectViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
@@ -56,8 +56,10 @@ void CLevel_Logo::Update(_float fTimeDelta)
}
GUI::End();
#ifdef gimch
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::MAP))))
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT))))
return;
//if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::MAP))))
// return;
#endif // gimch
#ifdef 기무리
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT))))
@@ -16,6 +16,7 @@
#include "MapElement_Lake.h"
#include "MapElement_Door.h"
#include "MapElement_Chest.h"
#include "DummyDecal.h"
CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -120,6 +121,9 @@ HRESULT CLevel_MapViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
HRESULT CLevel_MapViewer::Ready_Layer_Background(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummyDecal>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;
@@ -11,6 +11,7 @@
#include "Layer.h"
#include "GameObject.h"
#include "DummyObject.h"
#include "EffectPool.h"
#include "DummySkyBox.h"
#include "MainLight.h"
@@ -756,12 +757,19 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag)
HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
{
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test)))
return E_FAIL;*/
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectPool>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함!
//{
// return E_FAIL;
//}
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test)))
// return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;*/
+157 -5
View File
@@ -6,6 +6,7 @@
#include "Camera_Debug.h"
#include "DummyRect.h"
#include "DummyDecal.h"
#include "MainApp.h"
#include "Dummy_Cube.h"
#include "MainLight.h"
@@ -30,6 +31,7 @@
#include "CamPosition_Shoulder.h"
#include "CamPosition_Arm.h"
#include "Wand.h"
#include "Ranrok.h"
#pragma endregion
@@ -208,6 +210,7 @@
#include "Dummy_Globe.h"
#pragma endregion
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
@@ -1278,7 +1281,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..");
{
@@ -1595,6 +1603,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))) {
@@ -1618,6 +1631,105 @@ HRESULT CLoader::Loading_For_Effect()
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapElement_Static>(g_iStaticLevel, CMapElement_Static::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapElement_Interactable>(g_iStaticLevel, CMapElement_Interactable::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_LOD>(g_iStaticLevel, CMapObject_LOD::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Collision>(g_iStaticLevel, CMapObject_Collision::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"),
VTXPOS::Elements, VTXPOS::iNumElements)))) {
return E_FAIL;
}
/* For.Prototype_Component_VIBuffer_Box */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
CVIBuffer_Box::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_Component_OcclusionQuery */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
COcclusionQuery::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_BuildingContainer */
if (FAILED(m_pGameInstance->Add_Prototype<CBuildingContainer>(g_iStaticLevel, CBuildingContainer::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* Lake_Cube_D */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lake_Cube_D"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Models/Lake/SkyCube.dds"), 0)))) {
return E_FAIL;
}
#pragma region DUNGEON_MAP
vector<_wstring> ModelPrototypeTags = {};
vector<filesystem::path> ModelPrototypePath = {};
/* Cave Wall */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Wall",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Props */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Props",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* ArenaFloor */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/ArenaFloor",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Center_Structure_AnteChamber */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/Center_Structure/AnteChamber",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Center_Structure_Core */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/Center_Structure/Core",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_ConjuredDragonAttackZones */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/ConjuredDragonAttackZones",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_Barriers */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/Rock_Barriers",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_SM_Repository_FloatingGround */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/SM_Repository_FloatingGround",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_SM_Repository_Stage3MoveableRocks */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/Stage3MoveableRocks",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_Interactables */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository/BreakingRocks/LG_E",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_Main */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Meshes/Repository",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Sanctum_Dungeon_Rock_Main */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Sanctum_Dungeon/Interactables",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Cavern_Dungeon_Rocks */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Cavern_Dungeon/Mesh/Rocks",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
#pragma endregion
m_strMessage = TEXT("Shader Loading..");
@@ -1747,6 +1859,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;
@@ -2292,6 +2407,11 @@ HRESULT CLoader::Loading_For_ObjectViewer()
{
m_strMessage = TEXT("Texture 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;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
return E_FAIL;
@@ -2331,7 +2451,7 @@ HRESULT CLoader::Loading_For_ObjectViewer()
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SK_ConjuredDragon_Model"),
// CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Characters\\Creatures\\Dragons\\ConjuredDragon\\SK_ConjuredDragon.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) {
// CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Wands\\CharacterWands\\SK_Wands_Amit.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) {
// return E_FAIL;
//}
@@ -2441,6 +2561,16 @@ HRESULT CLoader::Loading_For_ObjectViewer()
TEXT("Prototype_Component_ConjuredDragon_Model")
));
futures.emplace_back(Deferred_ModelLoad(
MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
TEXT("Prototype_Component_Professor_EleazarFig_Model")
));
futures.emplace_back(Deferred_ModelLoad(
MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig_Anim.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
TEXT("Prototype_Component_Professor_EleazarFig_Model")
));
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_ConjuredDragon_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;
@@ -2546,7 +2676,6 @@ HRESULT CLoader::Loading_For_ObjectViewer()
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext))))
return E_FAIL;
///* For.Prototype_GameObject_Terrain */
//if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
// return E_FAIL;
@@ -2622,6 +2751,21 @@ HRESULT CLoader::Loading_For_MapViewer()
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures//T_LandscapeStreamingProxy_0_LOD1_Summer_D.png"), 0)))) {
return E_FAIL;
}
/* Base_MRO */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Base_MRO"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("C:/MeshTable/Game/Environment//MasterMaterials/BaseTextures/T_Base011_MRO.dds"), 0)))) {
return E_FAIL;
}
/* Decal_MSK */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Decal_MSK"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("C:/MeshTable/Game/Environment/Sanctum_Dungeon/Textures/Repository/T_Rift_Material_MSK.dds"), 0)))) {
return E_FAIL;
}
/* Decal_Noraml */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Decal_Noraml"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("C:/MeshTable/Game/Environment/Sanctum_Dungeon/Textures/Repository/T_Rift_Veins_N.dds"), 0)))) {
return E_FAIL;
}
/* Terrain_Diffuse */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"),
@@ -2721,6 +2865,11 @@ HRESULT CLoader::Loading_For_MapViewer()
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity()))))
return E_FAIL;
/* For.Prototype_Component_DecalBox */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_DecalBox"),
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/Decal/DecalBox.fbx", XMMatrixIdentity()))))
return E_FAIL;
#pragma region MAP_LANDS
/* For.Prototype_Component_Hogsmead_Land */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Hogsmead_Land"),
@@ -2781,7 +2930,6 @@ HRESULT CLoader::Loading_For_MapViewer()
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Terrain*/
//if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain",
// ".bin", false, ModelPrototypeTags, ModelPrototypePath)))
@@ -3028,7 +3176,7 @@ if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Interactabl
#pragma region HOGWART
_bool bHogwartLoad = { true };
_bool bHogwartLoad = { false };
/* Hogwart LOD */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD",
@@ -3898,6 +4046,10 @@ if(isLoad_Map)
if (FAILED(m_pGameInstance->Add_Prototype<CMapElement_Lake>(g_iStaticLevel, CMapElement_Lake::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CDummyDecal */
if (FAILED(m_pGameInstance->Add_Prototype<CDummyDecal>(g_iStaticLevel, CDummyDecal::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_MapObject_Manager */
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath))))
return E_FAIL;
+202 -1
View File
@@ -6,6 +6,9 @@
#include "MapObject_Collision.h"
#include "MapElement_Light.h"
#include "Layer.h"
#include "MapElement_Static.h"
#include "MapElement_Interactable.h"
#include "MapObject_LOD.h"
CMapInfo::CMapInfo()
{
@@ -54,6 +57,204 @@ void CMapInfo::Change_Level()
{
}
HRESULT CMapInfo::Load_MapObjects(const _char* pFilePath)
{
tinyxml2::XMLDocument xmlDoc;
string strPath = "../Bin/Resources/Data/Map/" + string(pFilePath) + ".xml";
if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str())))
return E_FAIL;
tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Land");
if (nullptr == root)
{
MSG_BOX("Failed to Find root");
return S_OK;
}
/* Container */
for (auto* Container = root->FirstChildElement("Container"); Container; Container = Container->NextSiblingElement("Container"))
{
const _char* pName = {};
Container->QueryStringAttribute("Name", &pName);
#pragma region ADD_CONTAINER_OBJECT
CBuildingContainer* pContainerObject = { nullptr };
CMapContainer::MAP_CONTAINER_DESC ContainerDesc = {};
auto* ContainerPosition = Container->FirstChildElement("Position");
ContainerPosition->QueryFloatAttribute("x", &ContainerDesc.vPosition.x);
ContainerPosition->QueryFloatAttribute("y", &ContainerDesc.vPosition.y);
ContainerPosition->QueryFloatAttribute("z", &ContainerDesc.vPosition.z);
auto* ContainerScale = Container->FirstChildElement("Scale");
ContainerScale->QueryFloatAttribute("x", &ContainerDesc.vScale.x);
ContainerScale->QueryFloatAttribute("y", &ContainerDesc.vScale.y);
ContainerScale->QueryFloatAttribute("z", &ContainerDesc.vScale.z);
auto* ContainerRotation = Container->FirstChildElement("Rotation");
ContainerRotation->QueryFloatAttribute("x", &ContainerDesc.vRotation.x);
ContainerRotation->QueryFloatAttribute("y", &ContainerDesc.vRotation.y);
ContainerRotation->QueryFloatAttribute("z", &ContainerDesc.vRotation.z);
ContainerDesc.strName = string(pName);
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
g_iStaticLevel, g_iStaticLevel, TEXT("Layer_Building"), &ContainerDesc, nullptr, &pContainerObject)))
{
MSG_BOX("Faield Clone Building");
return E_FAIL;
}
#pragma endregion
#pragma region ADD_PARTOBJECT
for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
{
_uint iLodLevel = {};
_uint iKeyIndex = {};
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
#pragma region MAPOBJECT_LOD
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
Desc.iMaxLodLevel = iLodLevel;
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
CMapObject_LOD* pMapObject;
if (FAILED(pContainerObject->Add_Part<CMapObject_LOD>(strKey, g_iStaticLevel, &pMapObject, &Desc)))
return E_FAIL;
pMapObject->Set_KeyIndex(iKeyIndex);
SAFE_RELEASE(pMapObject);
#pragma endregion
}
#pragma endregion
pContainerObject->Set_BoundingBox();
#pragma region ADD_COLLISION
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
{
_uint iLodLevel = {};
_uint iKeyIndex = {};
Collision->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
Collision->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
#pragma region MAPOBJECT_LOD
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = Collision->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
Desc.iMaxLodLevel = iLodLevel;
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
/* Position */
tinyxml2::XMLElement* Position = Collision->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = Collision->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = Collision->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
#pragma endregion
SAFE_RELEASE(pContainerObject);
}
#pragma endregion
}
for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
{
MAPOBJECT_LOD_DESC Desc = {};
MAPOBJECT_TYPE eType = {};
Object->QueryUnsignedAttribute("Type", (_uint*)(&eType));
Object->QueryUnsignedAttribute("Lod_Level", &Desc.iMaxLodLevel);
auto* Position = Object->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
auto* Scale = Object->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
auto* Rotation = Object->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
string strTag = {};
for (auto* PrototypeTag = Object->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
if (MAPOBJECT_TYPE::ELEMENT_STATIC == eType)
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Static>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc);
else if (MAPOBJECT_TYPE::ELEMENT_INTERACT == eType)
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interactable"), &Desc);
}
return S_OK;
}
HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
{
@@ -86,10 +287,10 @@ void CMapInfo::Free()
{
__super::Free();
SAFE_RELEASE(m_pGameInstance);
SAFE_RELEASE(m_pInfoInstance);
SAFE_RELEASE(m_pDevice);
SAFE_RELEASE(m_pContext);
SAFE_RELEASE(m_pGameInstance);
}
#ifdef _DEBUG
+106 -59
View File
@@ -1329,82 +1329,129 @@ void CPlayer::Add_FSM()
void CPlayer::Set_Anim()
{
m_Animation[STATEANIM::IDLE] = { 266,true };
m_Animation[STATEANIM::IDLE_AIM] = { 5,true };
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
m_Animation[STATEANIM::IDLE] = { 894,true }; //266
m_Animation[STATEANIM::IDLE_AIM] = { 6,true };
m_Animation[STATEANIM::IDLE_TURN_L] = { 271,false };
m_Animation[STATEANIM::IDLE_TURN_R] = { 431,false };
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 269,false };
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
m_Animation[STATEANIM::WALK_LEFT] = { 337,false };
m_Animation[STATEANIM::WALK_RIGHT] = { 504,false };
m_Animation[STATEANIM::WALK_BWD] = { 352,false };
m_Animation[STATEANIM::WALK_FWD] = { 626,true };
m_Animation[STATEANIM::WALK_LEFT] = { 338,false };
m_Animation[STATEANIM::WALK_RIGHT] = { 505,false };
m_Animation[STATEANIM::WALK_BWD] = { 353,false };
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
m_Animation[STATEANIM::WALK_STOP] = { 345,false };
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
m_Animation[STATEANIM::JOG_LEFT] = { 164,false }; // Turn
m_Animation[STATEANIM::JOG_RIGHT] = { 185,false };// Turn
m_Animation[STATEANIM::JOG_BWD] = { 154,false }; // Turn
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
m_Animation[STATEANIM::JOG_FWD] = { 168,true };
m_Animation[STATEANIM::JOG_LEFT] = { 304,false }; // Turn 164
m_Animation[STATEANIM::JOG_RIGHT] = { 308,false };// Turn 185
m_Animation[STATEANIM::JOG_BWD] = { 155,false }; // Turn
m_Animation[STATEANIM::JOG_STOP] = { 447,false };
m_Animation[STATEANIM::JOG_AIM_LEFT] = { 171,true };
m_Animation[STATEANIM::JOG_AIM_RIGHT] = { 175,true };
m_Animation[STATEANIM::JOG_AIM_BWD] = { 166,true };
m_Animation[STATEANIM::JOG_AIM_LEFT] = { 172,true };
m_Animation[STATEANIM::JOG_AIM_RIGHT] = { 176,true };
m_Animation[STATEANIM::JOG_AIM_BWD] = { 167,true };
m_Animation[STATEANIM::JUMP] = { 205,false };
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
m_Animation[STATEANIM::JUMP] = { 206,false };
m_Animation[STATEANIM::JUMP_JOG] = { 204,false };
m_Animation[STATEANIM::JUMP_SPRINT] = { 208,false };
m_Animation[STATEANIM::FALL_LOOP] = { 30,true };
m_Animation[STATEANIM::SPRINT] = { 599,true };
m_Animation[STATEANIM::SPRINT] = { 600,true };
m_Animation[STATEANIM::LAND] = { 259,false };
m_Animation[STATEANIM::LAND] = { 260,false };
m_Animation[STATEANIM::LAND_TO_JOG] = { 248,false };
m_Animation[STATEANIM::LAND_TO_SPRINT] = { 250,false };
m_Animation[STATEANIM::LAND_HARD] = { 256,false };
m_Animation[STATEANIM::LAND_MID] = { 258,false };
m_Animation[STATEANIM::LAND_SOFT] = { 260,false };
m_Animation[STATEANIM::DODGE] = { 878,false }; // 879 880
m_Animation[STATEANIM::DODGE_BLINK] = { 874,false };
m_Animation[STATEANIM::SLIDE_STOP_R] = { 569,false };
m_Animation[STATEANIM::SLIDE_START_R] = { 567,false };
m_Animation[STATEANIM::SLIDE_LOOP_R] = { 565,true };
m_Animation[STATEANIM::SKILL] = { 593,false };
m_Animation[STATEANIM::SKILL2] = { 991,false };
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
m_Animation[STATEANIM::SPELL] = { 772,false };
m_Animation[STATEANIM::MAPHELP] = { 122,false };
m_Animation[STATEANIM::POTION] = { 114,false }; // 114 포션 // 909 루모스
m_Animation[STATEANIM::ACCIO] = { 417,false };
m_Animation[STATEANIM::DESCENDO] = { 857,false };
m_Animation[STATEANIM::DEPULSO] = { 858,false };
m_Animation[STATEANIM::DIFFINDO] = { 862,false };
m_Animation[STATEANIM::LUMOS] = { 910,true };
m_Animation[STATEANIM::LUMOS_STOP] = { 912,false };
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
m_Animation[STATEANIM::ANCIENT_THROW] = { 919,false };
m_Animation[STATEANIM::DODGE] = { 879,false };
m_Animation[STATEANIM::DODGE_BLINK] = { 875,false };
m_Animation[STATEANIM::SKILL] = { 594,false };
m_Animation[STATEANIM::SKILL2] = { 992,false };
m_Animation[STATEANIM::HIT_L] = { 1124,false };
m_Animation[STATEANIM::HIT_R] = { 1125,false };
m_Animation[STATEANIM::LIGHT_ATTACK] = { 414,false };
m_Animation[STATEANIM::LIGHT_ATTACK_180_R] = { 810,false };
m_Animation[STATEANIM::BROOM_IDLE] = { 710,true };
m_Animation[STATEANIM::BROOM_FWD] = { 711,true };
m_Animation[STATEANIM::BROOM_LEFT] = { 713,true };
m_Animation[STATEANIM::BROOM_RIGHT] = { 714,true };
m_Animation[STATEANIM::BROOM_DOWN] = { 712,true };
m_Animation[STATEANIM::BROOM_UP] = { 715,true };
m_Animation[STATEANIM::LIGHT_ATTACK_90_L] = { 802,false };
m_Animation[STATEANIM::LIGHT_ATTACK_90_R1] = { 850,false };
m_Animation[STATEANIM::LIGHT_ATTACK_90_R2] = { 854,false };
m_Animation[STATEANIM::LIGHT_ATTACK_90_R3] = { 855,false };
m_Animation[STATEANIM::BROOM_MOUNT] = { 734,false };
m_Animation[STATEANIM::BROOM_MOUNT_END] = { 737,false };
m_Animation[STATEANIM::BROOM_HOVER_START] = { 699,false };
m_Animation[STATEANIM::BROOM_DISMOUNT] = { 738,false };
m_Animation[STATEANIM::SPELL] = { 773,false };
m_Animation[STATEANIM::SPELL_180_R] = { 838,false };
m_Animation[STATEANIM::SPELL_90_L] = { 827,false };
m_Animation[STATEANIM::MAPHELP] = { 123,false };
m_Animation[STATEANIM::POTION] = { 116,false };
m_Animation[STATEANIM::ACCIO] = { 760,false };
m_Animation[STATEANIM::DESCENDO] = { 858,false };
m_Animation[STATEANIM::DEPULSO] = { 859,false };
m_Animation[STATEANIM::DIFFINDO] = { 863,false };
m_Animation[STATEANIM::LUMOS] = { 911,true };
m_Animation[STATEANIM::LUMOS_STOP] = { 913,false };
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 586,false };
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 587,false };
m_Animation[STATEANIM::ANCIENT_THROW] = { 920,false };
m_Animation[STATEANIM::AVADA_KEDAVRA] = { 0,false };
m_Animation[STATEANIM::BROOM_HOVER_IDLE] = { 703,true };
m_Animation[STATEANIM::BROOM_HOVER_FWD] = { 700,true };
m_Animation[STATEANIM::BROOM_HOVER_LEFT] = { 701,true };
m_Animation[STATEANIM::BROOM_HOVER_RIGHT] = { 702,true };
m_Animation[STATEANIM::ANCIENT_LIGHTNING] = { 1002,false };
m_Animation[STATEANIM::SPELL_FAIL] = { 907,false };
m_Animation[STATEANIM::JOG_AIM_STOP_L] = { 295,false };
m_Animation[STATEANIM::JOG_AIM_STOP_R] = { 456,false };
m_Animation[STATEANIM::JOG_AIM_STOP_BWD] = { 444,false };
m_Animation[STATEANIM::PARRY_180] = { 954,false };
m_Animation[STATEANIM::PARRY2] = { 914,false };
m_Animation[STATEANIM::PARRY3] = { 916,false };
m_Animation[STATEANIM::PARRY4] = { 922,false };
m_Animation[STATEANIM::HIT_L] = { 1210,false };
m_Animation[STATEANIM::HIT_R] = { 1211,false };
m_Animation[STATEANIM::FLINCH_BWD] = { 1070,false };
m_Animation[STATEANIM::FLINCH_FWD] = { 1071,false };
m_Animation[STATEANIM::FLINCH_LEFT] = { 1072,false };
m_Animation[STATEANIM::FLINCH_RIGHT] = { 1073,false };
m_Animation[STATEANIM::KNOCKBACK] = { 1088,false };
m_Animation[STATEANIM::BROOM_IDLE] = { 711,true };
m_Animation[STATEANIM::BROOM_FWD] = { 712,true };
m_Animation[STATEANIM::BROOM_LEFT] = { 714,true };
m_Animation[STATEANIM::BROOM_RIGHT] = { 715,true };
m_Animation[STATEANIM::BROOM_DOWN] = { 713,true };
m_Animation[STATEANIM::BROOM_UP] = { 716,true };
m_Animation[STATEANIM::BROOM_REVELIO] = { 679,false };
m_Animation[STATEANIM::BROOM_TURBO_DOWN] = { 717,true };
m_Animation[STATEANIM::BROOM_TURBO_FWD] = { 718,true };
m_Animation[STATEANIM::BROOM_TURBO_LEFT] = { 719,true };
m_Animation[STATEANIM::BROOM_TURBO_RIGHT] = { 720,true };
m_Animation[STATEANIM::BROOM_TURBO_UP] = { 721,true };
m_Animation[STATEANIM::BROOM_MOUNT] = { 735,false };
m_Animation[STATEANIM::BROOM_MOUNT_END] = { 738,false };
m_Animation[STATEANIM::BROOM_HOVER_START] = { 700,false };
m_Animation[STATEANIM::BROOM_DISMOUNT] = { 739,false };
m_Animation[STATEANIM::BROOM_HOVER_IDLE] = { 704,true };
m_Animation[STATEANIM::BROOM_HOVER_FWD] = { 701,true };
m_Animation[STATEANIM::BROOM_HOVER_LEFT] = { 702,true };
m_Animation[STATEANIM::BROOM_HOVER_RIGHT] = { 703,true };
m_Animation[STATEANIM::BROOM_HOVER_REVELIO] = { 722,false };
m_Animation[STATEANIM::JOG_AIM_STOP_L] = { 296,false };
m_Animation[STATEANIM::JOG_AIM_STOP_R] = { 457,false };
m_Animation[STATEANIM::JOG_AIM_STOP_BWD] = { 445,false };
m_Animation[STATEANIM::SPELL_LEARNING_FAIL] = { 1286,false };
m_Animation[STATEANIM::SPELL_LEARNING_LOOP] = { 1287,true };
m_Animation[STATEANIM::SPELL_LEARNING_START] = { 1288,false };
m_Animation[STATEANIM::SPELL_LEARNING_SUCCESS] = { 1289,false };
m_Animation[STATEANIM::SPELL_LEARNING_WANDWAVE] = { 1290,false };
//루모스 스탑 912
+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
@@ -0,0 +1,55 @@
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CModel;
class CShader;
NS_END
NS_BEGIN(Editor)
class CDummyDecal final : public CGameObject
{
private:
CDummyDecal(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CDummyDecal(const CDummyDecal& rhs);
virtual ~CDummyDecal() = default;
public:
virtual void Priority_Update(_float fTimeDelta) override;
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
private:
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
CTexture* m_pMaskTextureCom = { nullptr };
CTexture* m_pNormalTextureCom = { nullptr };
CTexture* m_pSurfaceTextureCom = { nullptr };
_float m_fNormalThreshold = {};
_float m_fWinSizeX = {};
_float m_fWinSizeY = {};
_float4 m_vMaskRed = {};
_float4 m_vMaskGreen = {};
_float4 m_vMaskBlue = {};
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Bind_ShaderResources() override;
public:
static CDummyDecal* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
};
NS_END
+4 -3
View File
@@ -24,8 +24,9 @@ class CDummy_Cube final : public CGameObject
virtual HRESULT Render() override;
private:
CModel* m_pModelCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CTexture* m_pTextureCom = { nullptr };
private:
@@ -41,4 +42,4 @@ class CDummy_Cube final : public CGameObject
void Describe_Entity() override;
};
NS_END
NS_END
@@ -40,6 +40,7 @@ class CInfoInstance final : public CBase
pair<CUnit*, CTransform*> Get_NearestPlayerAlly(_fvector vPos);
#pragma endregion
#pragma region MAP_INFO
HRESULT Load_MapObjects(const _char* pFilePath);
#pragma endregion
#pragma region Spell_INFO
HRESULT Load_SpellInfo(const _char* pFilePath);
@@ -23,6 +23,7 @@ class CLevel_EffectViewer final : public CLevel
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
HRESULT Ready_Layer_PhysX(const _wstring& strLayerTag);
HRESULT Ready_Layer_BackGround(const _wstring& strLayerTag);
PhsXUserData m_PlaneData = {};
class CInfoInstance* m_pInfoInstance = { nullptr };
+2 -2
View File
@@ -18,11 +18,11 @@ class CMapInfo final : public CBase
void Update(_float fTimeDelta);
void Change_Level();
HRESULT Load_MapObjects(const _char* pFilePath);
HRESULT Load_BuildingContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject);
/*HRESULT Load_BuildingContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject);
HRESULT Load_StreetContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject);
HRESULT Load_MapRenderObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject);
HRESULT Load_MapCollisionObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject);
HRESULT Load_LightElements(const _char* pFileName);
HRESULT Load_LightElements(const _char* pFileName);*/
private:
CGameInstance* m_pGameInstance = { nullptr };
+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
@@ -1295,6 +1295,38 @@ PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In)
Out.fBlur = fResult;
return Out;
}
struct PS_OUT_DECAL
{
float4 vDiffuse : SV_TARGET0;
};
PS_OUT_DECAL PS_DECAL(PS_IN In)
{
PS_OUT_DECAL Out;
float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
float fViewZ = vDepthDesc.y * g_fFar;
float4 vPosition, vPreShadowPosition;
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
vPosition.z = vDepthDesc.x;
vPosition.w = 1.f;
vPosition = vPosition * fViewZ;
vPosition = mul(vPosition, g_invmatProj);
vPosition = mul(vPosition, g_invMatView);
vPreShadowPosition = vPosition;
return Out;
}
technique11 DefaultTechnique
{
pass DebugPass // 0
@@ -1509,4 +1541,14 @@ technique11 DefaultTechnique
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MOTIONBLUR_TENTSAMPLE();
}
pass DecalPass // 22
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_None, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_DECAL();
}
}
@@ -10,6 +10,7 @@ void CRenderer::Render()
Render_Priority();
Render_Shadow();
Render_NonBlend();
Render_Decal();
Render_SSAO();
Render_SSAO_BLUR();
Render_LightAcc();
@@ -328,6 +329,30 @@ void CRenderer::Render_NonBlend()
COMPUTE_TIMEDELTA("Timer_Render_NonBlend");
}
void CRenderer::Render_Decal()
{
EVENTSCOPE_("Render_Decal");
if (FAILED(m_pGameInstance->Begin_MRT_NonClear(TEXT("MRT_Decal")))) {
return;
}
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::DECAL)])
{
if (nullptr != pRenderObject) {
if (FAILED(pRenderObject->Render())) {
assert(false);
}
}
SAFE_RELEASE(pRenderObject);
}
m_RenderObjects[ENUM_CLASS(RENDER::DECAL)].clear();
if (FAILED(m_pGameInstance->End_MRT())) {
return;
}
}
void CRenderer::Render_LightAcc()
{
COMPUTE_TIMEDELTA("Timer_Render_LightAcc");
@@ -517,6 +517,17 @@ HRESULT CRenderer::Initialize()
return E_FAIL;
}
/* MRT_Decal */
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Decal"), TEXT("Target_Diffuse")))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Decal"), TEXT("Target_Normal")))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Decal"), TEXT("Target_Surface")))) {
return E_FAIL;
}
}
m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr);
@@ -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
@@ -113,6 +113,7 @@ class CRenderer final : public CBase
void Render_Priority();
void Render_Shadow();
void Render_NonBlend();
void Render_Decal();
void Render_Blur();
void Render_SSAO();
void Render_SSAO_BLUR();
+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() {};