Merge branch 'Develope' into Bloom

This commit is contained in:
kimnuri
2025-11-26 21:41:06 +09:00
50 changed files with 589 additions and 188 deletions
@@ -170,8 +170,8 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
CameraDesc.iPriority = 51;
CameraDesc.pCameraKey = CAMERA_SHOULDER;
CameraDesc.bEnableTransitionLerp = true;
CameraDesc.bEnableFollowLerp = true;
CameraDesc.bEnableLookLerp = true;
CameraDesc.bEnableFollowLerp = false;
CameraDesc.bEnableLookLerp = false;
CameraDesc.vTransitionTime = { 0.f, 1.f };
CameraDesc.vFollowLerpTime = { 0.f, 0.16f };
CameraDesc.vLookLerpTime = { 0.f, 0.16f };
+4 -1
View File
@@ -78,7 +78,7 @@ void CGoblin::Late_Update(_float fTimeDelta)
m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION));
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
}
HRESULT CGoblin::Render()
@@ -223,7 +223,10 @@ void CGoblin::Free()
Safe_Delete(m_pCallBack_Behavior);
Safe_Delete(m_pCallBack_HitReport);
}
#ifdef _DEBUG
void CGoblin::Describe_Entity()
{
}
#endif // _DEBUG
@@ -49,7 +49,7 @@ void CGoblin::Behavior_MoveEnter()
HRESULT CGoblin::Behavior_MoveExitCheck()
{
if (m_fTargetDistance <= 3.f)
if (m_fTargetDistance <= 7.f &&m_fTargetDistance !=0.f)
m_pFSM->Change_State(FSMSTATE::COMBAT);
return E_FAIL;
@@ -66,9 +66,9 @@ void CGoblin::Behavior_CombatEnter()
m_pFSM->Enable_State(FSMSTATE::COMBAT);
m_pFSM->Enable_State(FSMSTATE::SKILL);
m_pFSM->Enable_State(FSMSTATE::SKILL2);
pairAnimInfo = m_Animation[STATEANIM::SKILL];
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
+5 -3
View File
@@ -53,6 +53,7 @@ unsigned int APIENTRY LoadingMain(void* pArg)
if (FAILED(pLoader->Loading())) {
assert(false);
int a = 0;
return 1;
}
@@ -271,7 +272,7 @@ HRESULT CLoader::Loading_For_GamePlay()
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"),
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) {
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) {
return E_FAIL;
}
@@ -321,7 +322,7 @@ HRESULT CLoader::Loading_For_GamePlay()
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity()))))
return E_FAIL;
Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
@@ -483,8 +484,9 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN
string ext = file.path().extension().string();
if (!strcmp(ext.c_str(), ".txt"))
if (!strcmp(ext.c_str(), ".txt") || !strcmp(ext.c_str(), ".fbx")){
continue;
}
_char szFilePath[MAX_PATH] = {};
@@ -73,7 +73,10 @@ void CMonster::Free()
SAFE_RELEASE(m_pPlayerTransform);
}
#ifdef _DEBUG
void CMonster::Describe_Entity()
{
}
#endif // _DEBUG
+5 -4
View File
@@ -165,8 +165,6 @@ HRESULT CPlayer::Render()
void CPlayer::Render_CameraCoordinateSystem()
{
m_Batch->Begin();
const _float fArrowLength = 2.0f;
@@ -188,7 +186,10 @@ void CPlayer::Render_CameraCoordinateSystem()
GUI::Button("##6", {100.f, 100.f}); GUI::SameLine();
GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine();
GUI::Button("##8", {100.f, 100.f});
//W CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })
//A CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , - m_vCameraRightDir.z })
//S CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })
//D CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , - m_vCameraLookDir.z })
m_Batch->DrawLine( // W
VertexPositionColor(fArrowLength * -XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::GhostWhite),
VertexPositionColor(fArrowLength * XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::Blue)
@@ -279,7 +280,7 @@ HRESULT CPlayer::Ready_Parts()
{
CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc;
Desc.pParentTransform = m_pTransformCom;
Desc.fMouseSensor = 0.5f;
Desc.fMouseSensor = 0.1f;
Desc.fShoulderDistance = 2.f;
Desc.fBackFrontRatio = 0.9f;
Desc.fCameraFocalLength = 10.f;
+159 -25
View File
@@ -101,29 +101,18 @@ void CPlayer::Behavior_IdleEnter() {
m_pFSM->Enable_State(FSMSTATE::IDLE);
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)) {
if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
}
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
}
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
}
}
m_bSprintToggle = false;
m_bWalkToggle = false;
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
// S_OK -> 현 상태 유지
// E_FAIL -> 현 상태 탈출
HRESULT CPlayer::Behavior_IdleExitCheck()
{
pair<_uint, _bool> pairAnimInfo;
// S_OK -> 현 상태 유지
// E_FAIL -> 현 상태 탈출
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
m_pFSM->Change_State(FSMSTATE::JUMP);
@@ -151,10 +140,35 @@ HRESULT CPlayer::Behavior_IdleExitCheck()
if (SUCCEEDED(InputMove())) {
m_pFSM->Change_State(FSMSTATE::MOVE);
if (m_pGameInstance->Key_Pressing(DIK_W))
{
m_pFSM->Change_State(FSMSTATE::MOVE);
return E_FAIL;
}
}
if (m_pGameInstance->Key_Down(DIK_D))
{
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
return E_FAIL;
}
if (m_pGameInstance->Key_Down(DIK_A))
{
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
return E_FAIL;
}
if (m_pGameInstance->Key_Down(DIK_S))
{
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_BWD];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
return E_FAIL;
}
if (m_pModelCom->IsFinishedAnim())
{
pairAnimInfo = m_Animation[STATEANIM::IDLE];
@@ -208,7 +222,6 @@ void CPlayer::Behavior_MoveEnter()
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
m_fAmount = 0.2f;
}
}
}
else { // While Moving
@@ -246,6 +259,10 @@ void CPlayer::Behavior_MoveEnter()
HRESULT CPlayer::Behavior_MoveExitCheck()
{
pair<_uint, _bool> pairAnimInfo;
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
_uint iCurrentAnimIndex = m_pModelCom->Get_AnimIndex();
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
m_pFSM->Change_State(FSMSTATE::JUMP);
@@ -304,16 +321,107 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
}
return E_FAIL;
}
if (SUCCEEDED(InputMove())) {
if (m_pModelCom->IsFinishedAnim() && m_pFSM->IsEnable(FSMSTATE::JOG))
{
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
_vector xmvPlayerDir = { };
{ // 이동방향 누적
if (m_pGameInstance->Key_Pressing(DIK_W)) {
xmvPlayerDir += xmvLook;
}
if (m_pGameInstance->Key_Pressing(DIK_A)) {
xmvPlayerDir -= xmvRight;
}
if (m_pGameInstance->Key_Pressing(DIK_S)) {
xmvPlayerDir -= xmvLook;
}
if (m_pGameInstance->Key_Pressing(DIK_D)) {
xmvPlayerDir += xmvRight;
}
}
xmvPlayerDir = XMVectorSetW(XMVector3Normalize(xmvPlayerDir), 0.f);
_float2 vPlayerDir = { XMVectorGetX(xmvPlayerDir), XMVectorGetZ(xmvPlayerDir) };
_float2 vCameraLookDir = { m_vCameraLookDir.x, m_vCameraLookDir.z };
_float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir);
_bool bSkipAngleCheck = { false };
if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) {
bSkipAngleCheck = true;
if (m_pModelCom->IsFinishedAnim()||
m_pFSM->IsEnable(FSMSTATE::STOP)) {
m_pFSM->Disable_State(FSMSTATE::STOP);
bSkipAngleCheck = false;
}
}
if (!bSkipAngleCheck) {
_bool bLeft = { true };
if (vDir < 0.f)
{
// + left
}
else
{
// - Right
}
_float absDir = fabsf(vDir);
if (absDir < XMConvertToRadians(160.f)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
}
else if (absDir < XMConvertToRadians(90.f)) {
// pairAnimInfo = m_Animation[STATEANIM::]
}
else if (absDir < XMConvertToRadians(112.f)) {
// pairAnimInfo = m_Animation[STATEANIM::]
}
else if (absDir < XMConvertToRadians(135.f)) {
// pairAnimInfo = m_Animation[STATEANIM::]
}
else if (absDir < XMConvertToRadians(180.f)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
}
{ // left Right
}
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
}
return S_OK;
}
m_pFSM->Change_State(FSMSTATE::IDLE);
if (m_pFSM->IsEnable(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)||
!SUCCEEDED(InputMove())) {
if (!m_pFSM->IsEnable(FSMSTATE::STOP))
{
m_pFSM->Enable_State(FSMSTATE::STOP);
if (m_pFSM->IsEnable(FSMSTATE::WALK)) {
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
else if (m_pFSM->IsEnable(FSMSTATE::SPRINT)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
else if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
}
}
else if (IsCurrentKeyFrame("Dodge"))
{
m_pFSM->Change_State(FSMSTATE::IDLE);
m_pFSM->Disable_State(FSMSTATE::STOP);
}
return S_OK;
}
return E_FAIL;
}
@@ -590,9 +698,35 @@ void CPlayer::Add_FSM()
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
};
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
_vector xmvPlayerDir = { };
{
_float3 fMove = m_pGameInstance->Get_MouseMove();
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x* 0.1f);
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.1f);
if (m_pGameInstance->Key_Pressing(DIK_A)) {
xmvPlayerDir -= xmvRight;
}
if (m_pGameInstance->Key_Pressing(DIK_D)) {
xmvPlayerDir += xmvRight;
}
}
xmvPlayerDir = XMVectorSetW(XMVector3Normalize(xmvPlayerDir), 0.f);
_float2 vPlayerDir = { XMVectorGetX(xmvPlayerDir), XMVectorGetZ(xmvPlayerDir) };
_float2 vCameraLookDir = { m_vCameraLookDir.x, m_vCameraLookDir.z };
_float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir);
_float absDir = fabsf(vDir);
if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) {
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
if (m_pGameInstance->Key_Pressing(DIK_D)&& vDir > XMConvertToRadians(-140.f) ) {
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
};
Desc.funcLateUpdate = nullptr;
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
}
+4 -1
View File
@@ -50,6 +50,8 @@ HRESULT CWand::Initialize(void* pArg)
assert(false);
return E_FAIL;
}
SAFE_ADDREF(m_pTrail);
SAFE_ADDREF(m_pEffectParts);
m_pEffectParts->Load("../Bin/Resources/Data/Effect/Lumos/Lumos", static_cast<LEVEL>(NEXT_LEVEL));
@@ -70,9 +72,10 @@ void CWand::Priority_Update(_float fTimeDelta)
m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
}
void CWand::Update(_float fTimeDelta)
+3
View File
@@ -37,8 +37,11 @@ class CGoblin final : public CMonster
static CGoblin* 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();
+4
View File
@@ -31,7 +31,11 @@ class CMonster abstract : public CUnit
public:
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
virtual void Free() override;
#ifdef _DEBUG
virtual void Describe_Entity() override;
#endif // _DEBUG
};
NS_END
+10 -1
View File
@@ -105,9 +105,18 @@ HRESULT CBombard::Ready_Child()
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
_float3 vDir = {};
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
XMStoreFloat3(&vDir, vOwnerLook * 2.f);
Desc.vRotRPY = { 0.f, 0.f, 0.f };
Desc.iSubKind = 70;
Desc.vDeltaPos = { 0.f, 0.f, 2.f };
Desc.vDeltaPos = vDir;
Desc.vLifeTime = { 0.f, 2.f };
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXEffectHitBox>(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) {
+36 -15
View File
@@ -39,7 +39,7 @@ HRESULT CDecendo::Initialize(void* pArg)
return E_FAIL;
m_wstrEffectName = L"Bombard";
m_wstrEffectName = L"Decendo";
m_pProjectile_Blur = Get_PartObject<CEditEffect>("Decendo_Proj_Blur");
m_pProjectile = Get_PartObject<CEditEffect>("Decendo_Proj");
@@ -50,8 +50,6 @@ HRESULT CDecendo::Initialize(void* pArg)
m_pProjectile->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
m_pProjectile_Blur->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
Get_PartObject<CTrailObject>()->Set_Target(m_pProjectile->Get_Component<CTransform>());
pCircle0->Set_Visible(true);
m_pProjectile->Set_Visible(true);
m_pProjectile_Blur->Set_Visible(true);
@@ -60,11 +58,11 @@ HRESULT CDecendo::Initialize(void* pArg)
SAFE_ADDREF(m_pProjectile);
//나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬
_vector vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK));
m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK));
_vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f);
_vector vQuaternion = XMQuaternionRotationAxis(vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2));
_vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2));
m_vRotateUp = XMVector3Rotate(vUp, vQuaternion);
@@ -90,19 +88,19 @@ void CDecendo::Update(_float fTimeDelta)
Update_Event(fTimeDelta);
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
m_pProjectile->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(m_vOwnerLook * 0.5f);
m_pProjectile->Get_Component<CTransform>()->Translation(m_vOwnerLook * 0.5f);
if (m_fAccTime > XM_PI)
Get_PartObject<CTrailObject>()->Trail_Update(m_pProjectile->Get_Component<CTransform>()->Get_XMWorldMatrix(), fTimeDelta);
if (m_fAccTime > XM_2PI)
return;
m_fAccTime += fTimeDelta * 3.f;
m_fAccTime += fTimeDelta * 7.5f;
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
m_pProjectile->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime));
m_pProjectile->Get_Component<CTransform>()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime));
}
@@ -132,9 +130,17 @@ HRESULT CDecendo::Ready_Child()
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
_float3 vDir = {};
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
XMStoreFloat3(&vDir , vOwnerLook * 0.5f);
Desc.vRotRPY = { 0.f, 0.f, 0.f };
Desc.iSubKind = 70;
Desc.vDeltaPos = { 0.f, 0.f, 1.f };
Desc.vDeltaPos = vDir ;
Desc.vLifeTime = { 0.f, 1.f };
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXEffectHitBox>(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) {
@@ -177,6 +183,7 @@ void CDecendo::OnCollision(CGameObject* pOther , void* pDesc)
//CTransform* pOtherTransform = p
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
for (auto& pPair : m_PartObjects)
{
pPair.second->Set_Visible(true);
@@ -185,7 +192,13 @@ void CDecendo::OnCollision(CGameObject* pOther , void* pDesc)
m_pProjectile_Blur->Set_Visible(false);
m_pProjectile->Set_Visible(false);
_vector vPlayerPos = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::POSITION);
Get_PartObject<CEditEffect>("Decendo_Down")->Get_Component<CTransform>()->LookAt(vPlayerPos);
Get_PartObject<CEditEffect>("Decendo_Cricle_S")->Set_Visible(false);
Get_PartObject<CTrailObject>()->Set_Visible(false);
@@ -208,7 +221,15 @@ void CDecendo::Free()
void CDecendo::Describe_Entity()
{
GUI::Begin("VALUE");
_float4 vValue = {};
if (GUI::InputFloat("TurnValue", (_float*)&m_fTurnValue))
{
}
GUI::End();
}
HRESULT CDecendo::Bind_ShaderResources()
@@ -55,23 +55,7 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor());
}
}
if (m_pGameInstance->Key_Up(DIK_O)) {
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBombard>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
assert(false);
return;
}
}
}
if (m_pGameInstance->Key_Up(DIK_P)) {
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
assert(false);
return;
}
}
}
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
m_pCharacter_Controller->Move(fTimeDelta);
}
@@ -49,9 +49,6 @@ void CEditEffect::Update(_float fTimeDelta)
m_pInstance_ModelCom->Drop(fTimeDelta);
if (m_EffectInfo.isBillboard)
m_pGameInstance->BillBoard(m_pTransformCom);
}
@@ -64,6 +61,10 @@ void CEditEffect::Late_Update(_float fTimeDelta)
if (m_pInstance_ModelCom == nullptr)
return;
if (m_EffectInfo.isBillboard)
m_pGameInstance->BillBoard(m_pTransformCom);
if (m_isGoStraight == true)
{
@@ -4,6 +4,7 @@
#include "GameInstance.h"
#include "EditEffect.h"
#include "TrailObject.h"
#include "GameObject.h"
#include <sstream>
@@ -215,6 +216,11 @@ void CEffect_Container::Update_Event(_float fTimeDelta)
else
{
m_bVisible = false;
for (auto& pPart : m_PartObjects)
{
pPart.second->Set_Visible(false);
}
}
}
@@ -81,7 +81,13 @@ void CEffect_Editor::Update(_float fTimeDelta)
if (m_pGameInstance->Key_Pressing(DIK_Z))
m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fTimeDelta);
Update_Event(fTimeDelta);
/* 이펙트 컨테이너 업데이트 */
//Update_Event(fTimeDelta);
/* 트레일 업데이트 */
if (m_pTrailObject != nullptr)
m_pTrailObject->Trail_Update(m_pTransformCom->Get_XMWorldMatrix(), fTimeDelta);
}
void CEffect_Editor::Late_Update(_float fTimeDelta)
@@ -13,6 +13,7 @@
#include "Dummy_PhysXPlayable.h"
#include "Dummy_PhysXMonster.h"
#include "Dummy_PhysXWall.h"
#include "Player.h"
CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -46,11 +47,11 @@ HRESULT CLevel_EffectViewer::Initialize()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Plane>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER)))
return E_FAIL;
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Sky"))))
// return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Sky"))))
return E_FAIL;
return S_OK;
@@ -130,6 +131,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag)
return E_FAIL;
}
}
{
CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{};
Desc.vPos = { -15.f, 3.f, 15.f };
@@ -140,15 +142,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag)
return E_FAIL;
}
}
{
CDummy_PhysXPlayable::PHYSXDUMMY_DESC Desc{};
Desc.vPos = { 0.f, 100.f, 0.f };
Desc.vRotRPY = { 0.f, 0.f, 0.f };
Desc.iSubKind = 10;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
return E_FAIL;
}
}
{
CDummy_PhysXMonster::PHYSXDUMMY_DESC Desc{};
Desc.vPos = { 0.f, 150.f, 5.f };
@@ -423,45 +423,42 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
_float fKeyFrame = pModel->Get_CurrentTrackPosition();
m_KeyFrames.emplace(EventName, fKeyFrame);
_char szDir[MAX_PATH] = {};
_splitpath_s(m_DummyPath, nullptr, 0, szDir, MAX_PATH, nullptr, 0, nullptr, 0);
_string szFile = "KeyFrame.bin";
_string Path = szDir + szFile;
FILE* fp = nullptr;
fopen_s(&fp, Path.c_str(), "wb");
if (!fp) return;
_uint KeyFrameSize = (_uint)m_KeyFrames.size();
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
for (auto& iter : m_KeyFrames)
{
_uint EventSize = (_uint)iter.first.size();
fwrite(&iter.second, sizeof(_float), 1, fp);
fwrite(&EventSize, sizeof(_uint), 1, fp);
fwrite(iter.first.c_str(), sizeof(_char), EventSize, fp);
}
fclose(fp);
Save_KeyFrame();
EventName[0] = '\0';
}
}
for (auto& iter : m_KeyFrames)
{
ImDrawList* draw = ImGui::GetForegroundDrawList();
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
float scale = 50.f;
string keyName = iter.first;
GUI::DragFloat(iter.first.c_str(), &iter.second);
_bool isSelected = (m_SelectedKey == keyName);
if (ImGui::Selectable(keyName.c_str(), isSelected))
{
m_SelectedKey = keyName;
}
if (isSelected)
{
ImGui::Indent();
ImGui::DragFloat("KeyFrame", &iter.second, 0.01f);
if (ImGui::Button("Delete KeyFrame"))
{
m_KeyFrames.erase(keyName);
m_SelectedKey.clear();
break;
}
ImGui::Unindent();
}
}
if (GUI::Button("Delete"))
{
m_pGameInstance->Get_Layer(NEXT_LEVEL, m_wszPreLayer)->Clear_Layer();
@@ -653,6 +650,35 @@ void CLevel_ObjectViewer::Find_Anim()
}
}
void CLevel_ObjectViewer::Save_KeyFrame()
{
_char szDir[MAX_PATH] = {};
_splitpath_s(m_DummyPath, nullptr, 0, szDir, MAX_PATH, nullptr, 0, nullptr, 0);
_string szFile = "KeyFrame.bin";
_string Path = szDir + szFile;
FILE* fp = nullptr;
fopen_s(&fp, Path.c_str(), "wb");
if (!fp) return;
_uint KeyFrameSize = (_uint)m_KeyFrames.size();
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
for (auto& iter : m_KeyFrames)
{
_uint EventSize = (_uint)iter.first.size();
fwrite(&iter.second, sizeof(_float), 1, fp);
fwrite(&EventSize, sizeof(_uint), 1, fp);
fwrite(iter.first.c_str(), sizeof(_char), EventSize, fp);
}
fclose(fp);
}
HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
{
@@ -708,8 +734,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
return E_FAIL;
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
// return E_FAIL;
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;*/
+63
View File
@@ -788,6 +788,33 @@ HRESULT CLoader::Loading_For_Effect()
return E_FAIL;
vector<future<pair<_wstring, CModel*>*>> futures = {};
futures.emplace_back(Deferred_ModelLoad(
MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity(),
TEXT("Prototype_Component_SkyboxModel")
));
futures.emplace_back(Deferred_ModelLoad(
MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f))* XMMatrixIdentity(),
TEXT("Prototype_Component_Npc_Model")
));
futures.emplace_back(Deferred_ModelLoad(
MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f)* XMMatrixIdentity(),
TEXT("Prototype_Component_Wand_Model")
));
for (auto& job : futures) {
pair<_wstring, CModel*>* pResult = job.get();
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pResult->first, pResult->second))) {
assert(false);
return E_FAIL;
}
Safe_Delete(pResult);
}
m_strMessage = TEXT("Shader Loading..");
@@ -854,6 +881,42 @@ HRESULT CLoader::Loading_For_Effect()
return E_FAIL;
/* For.Prototype_GameObject_Wand */
if (FAILED(m_pGameInstance->Add_Prototype<CWand>(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_Component_FSM */
if (FAILED(m_pGameInstance->Add_Prototype<CFSM>(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Arm */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Arm>(g_iStaticLevel, CCamPosition_Arm::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Camera_Gaze */
if (FAILED(m_pGameInstance->Add_Prototype<CCamera_Gaze>(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Player */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Socket>(g_iStaticLevel, CCamPosition_Socket::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Shoulder */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Shoulder>(g_iStaticLevel, CCamPosition_Shoulder::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_CamPosition_Target */
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Target>(g_iStaticLevel, CCamPosition_Target::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Player */
if (FAILED(m_pGameInstance->Add_Prototype<CPlayer>(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
return E_FAIL;
m_strMessage = TEXT("Loading Success!");
m_isFinished = true;
+1 -1
View File
@@ -98,7 +98,7 @@ void CPlayer::Late_Update(_float fTimeDelta)
{
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
__super::Late_Update(fTimeDelta);
}
@@ -21,6 +21,7 @@
#pragma endregion
#include "Bombard.h"
#include "Decendo.h"
#pragma region States
void CPlayer::TestKeyInput(_float fTimeDelta)
@@ -526,9 +527,23 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
{
case STATEANIM::ACCIO:
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBombard>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
assert(false);
return E_FAIL;
}
break;
case STATEANIM::DESCENDO:
{
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
assert(false);
return E_FAIL;
}
}
break;
default:
break;
+15 -5
View File
@@ -43,7 +43,6 @@ void CTrailObject::Update(_float fTimeDelta)
if (m_bVisible == false)
return;
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
if (m_TrailInfo.vDistortionTime.y == 0)
@@ -85,8 +84,14 @@ void CTrailObject::Set_Target(CTransform* pTargetTransform)
m_pParentTransformCom = pTargetTransform;
}
void CTrailObject::Trail_Update(_fmatrix WorldMat, _float fTimeDelta)
{
m_pTrailCom->Trail_Update(fTimeDelta, WorldMat);
}
#ifdef _DEBUG
HRESULT CTrailObject::Save_Trail(const _char* pPath)
{
_string strPerfectFilePath = pPath;
@@ -332,11 +337,12 @@ HRESULT CTrailObject::Ready_Components(void* pArg)
HRESULT CTrailObject::Render()
{
if (FAILED(Bind_ShaderResources()))
return E_FAIL;
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL))))
return E_FAIL;
if (FAILED(Bind_ShaderResources()))
return E_FAIL;
if (FAILED(m_pTrailCom->Render()))
return E_FAIL;
@@ -346,9 +352,11 @@ HRESULT CTrailObject::Render()
HRESULT CTrailObject::Render_Blur()
{
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
if (FAILED(Bind_ShaderResources()))
return E_FAIL;
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_TrailInfo.fBlurIntensity, sizeof(_float)))) {
return E_FAIL;
}
@@ -357,9 +365,11 @@ HRESULT CTrailObject::Render_Blur()
return E_FAIL;
}
if (FAILED(Bind_ShaderResources()))
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
return E_FAIL;
if (FAILED(m_pTrailCom->Render()))
return E_FAIL;
+42
View File
@@ -2,6 +2,8 @@
#include "Wand.h"
#include "GameInstance.h"
#include "EditEffect.h"
#include "TrailObject.h"
CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CPartObject(pDevice, pContext)
@@ -30,6 +32,27 @@ HRESULT CWand::Initialize(void* pArg)
if (FAILED(Ready_Components()))
return E_FAIL;
CPartObject::PARTOBJECT_DESC PartsDesc{};
PartsDesc.pParentTransform = m_pTransformCom;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTrailObject>(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this, &m_pTrail))) {
assert(false);
return E_FAIL;
}
if (FAILED(m_pTrail->Load_Trail("../Bin/Resources/Data/Effect/Trail/Bombard_Trail", static_cast<LEVEL>(NEXT_LEVEL))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEditEffect>(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, &m_pEffectParts))) {
assert(false);
return E_FAIL;
}
m_pEffectParts->Load("../Bin/Resources/Data/Effect/Lumos/Lumos", static_cast<LEVEL>(NEXT_LEVEL));
m_pEffectParts->Set_Visible(true);
return S_OK;
}
@@ -47,6 +70,24 @@ void CWand::Priority_Update(_float fTimeDelta)
void CWand::Update(_float fTimeDelta)
{
Describe_Entity();
m_pModelCom->Combined_BoneMatrix();
_matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root"));
BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix();
BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[0]) * m_vOffset.x;
BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[1]) * m_vOffset.y;
BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[2]) * m_vOffset.z;
m_pEffectParts->Get_Component<CTransform>()->Set_WorldMatrix(BoneMatrix);
m_pTrail->Trail_Update(BoneMatrix, fTimeDelta);
}
void CWand::Late_Update(_float fTimeDelta)
@@ -159,4 +200,5 @@ void CWand::Free()
void CWand::Describe_Entity()
{
}
+2
View File
@@ -38,6 +38,8 @@ class CDecendo final : public CEffect_Container
_vector m_vRotateUp = {};
_float m_fAccTime = {};
_float m_fLerpAmount = {};
_float m_fTurnValue = {};
_vector m_vOwnerLook = {};
public:
static CDecendo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual void Free() override;
@@ -40,6 +40,7 @@ class CLevel_ObjectViewer final : public CLevel
_wchar* Save_ModelName(const _char* Category);
void Load_KeyFrame(const _char* Name);
void Find_Anim();
void Save_KeyFrame();
private:
vector<CGameObject*> m_Objects;
@@ -55,6 +56,8 @@ class CLevel_ObjectViewer final : public CLevel
_wchar m_wszPreLayer[MAX_PATH];
_char m_DummyPath[MAX_PATH];
_char m_FindAnimName[256] = {};
string m_SelectedKey;
class CPlayer* m_Test = { nullptr };
public:
static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
+1 -7
View File
@@ -70,13 +70,7 @@ class CTrailObject final : public CPartObject
public:
void Set_Target(class CTransform* pTargetTransform);
void Set_Target(_float4x4* pMatrix)
{
if (m_pParantsMatrix != nullptr)
{
m_pParantsMatrix = pMatrix;
}
}
void Trail_Update(_fmatrix WorldMat, _float fTimeDelta);
public:
#ifdef _DEBUG
HRESULT Save_Trail(const _char* pPath);
+4
View File
@@ -35,6 +35,10 @@ class CWand final : public CPartObject
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
class CTrailObject* m_pTrail = { nullptr };
class CEditEffect* m_pEffectParts = { nullptr };
_float3 m_vOffset = { 0.f , -0.3f ,0.f};
private:
HRESULT Ready_Components();
+4 -4
View File
@@ -35,8 +35,8 @@ CAnimation::CAnimation(const CAnimation& rhs)
}
_bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform, _float m_fAmount)
{
_float fProgress = m_fTickPerSecond * fTimeDelta * m_fAnimSpeed;
m_fCurrentTrackPosition += fProgress;
m_fProgress = m_fTickPerSecond * fTimeDelta * m_fAnimSpeed;
m_fCurrentTrackPosition += m_fProgress;
if (m_fCurrentTrackPosition >= m_fDuration) {
if (false == bIsLoop) {
@@ -46,7 +46,7 @@ _bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bone
}
else {
Depart_Animation();
m_fCurrentTrackPosition = fProgress;
m_fCurrentTrackPosition = m_fProgress;
ResetRootMotion();
ProgressAnimation(Bones, pLocalPosArray, pTransform, m_fAmount);
return true;
@@ -195,6 +195,7 @@ void CAnimation::InterpAnim(CAnimation* pPreAnim, vector<CBone*>& Bones, _float
if (boneName == "Reference")
{
finalT = XMVectorZero();
}
}
@@ -207,7 +208,6 @@ void CAnimation::InterpAnim(CAnimation* pPreAnim, vector<CBone*>& Bones, _float
}
void CAnimation::CreateGPUData(ID3D11Device* pDevice)
{
vector<CHANNEL_DESC> channels;
+1 -1
View File
@@ -171,7 +171,7 @@ void CChannel::Update_TransformationMatirx(
if (Bones[m_iBoneIndex]->Compare_Name("Reference") && pTransform != nullptr)
{
GUI::Text("fCurrentTrackPosition : %f", fCurrentTrackPosition);
_float3 vCurRootPos;
XMStoreFloat3(&vCurRootPos, vTranslation);
@@ -109,6 +109,9 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
m_pMouse_Manager->Update();
//m_pSound_Manager->Update();
#ifdef _DEBUG
#ifdef 기무리
static _bool bPicking = false;
GUI::Checkbox("Picking Enable", &bPicking);
@@ -116,6 +119,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
m_pPicking->Update();
}
#endif // 기무리
#endif // _DEBUG
#ifndef 기무리
m_pPicking->Update();
#endif // !기무리
@@ -28,6 +28,7 @@ CInstance_Model::CInstance_Model(const CInstance_Model& rhs)
SAFE_ADDREF(m_pVBInstance);
}
#ifdef EDITOR_PROJECT
HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
{
@@ -51,7 +52,6 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
{
LoadData(pModelFilePath);
}
#ifdef EDITOR_PROJECT
else if (strcmp(".fbx", szEXT) == 0)
{
_char Temp[256];
@@ -66,7 +66,6 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
SaveAssimpModel(Temp , m_pAIScene);
return S_OK;
}
#endif
#pragma region Mesh
if (FAILED(Ready_Meshes())) {
return E_FAIL;
@@ -76,6 +75,47 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
return S_OK;
}
#endif
#ifndef EDITOR_PROJECT
HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
{
if (FAILED(__super::Initialize_Prototype()))
return E_FAIL;
m_iNumBuffer = 2;
XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix);
m_eType = eType;
_char szTextureFileName[MAX_PATH] = {};
_char szDir[MAX_PATH] = {};
_char szName[MAX_PATH] = {};
_char szEXT[MAX_PATH] = {};
_splitpath_s(pModelFilePath, nullptr, 0, szDir, MAX_PATH, szName, MAX_PATH, szEXT, MAX_PATH);
if (strcmp(".bin", szEXT) == 0)
{
LoadData(pModelFilePath);
}
else {
return E_FAIL;
}
#pragma region Mesh
if (FAILED(Ready_Meshes())) {
return E_FAIL;
}
#pragma endregion
return S_OK;
}
#endif
#ifdef EDITOR_PROJECT
HRESULT CInstance_Model::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
{
@@ -105,7 +145,9 @@ HRESULT CInstance_Model::Assimp_Model_Load(const _char* pModelFilePath, MODEL eT
return S_OK;
#pragma endregion
}
#endif
#ifdef EDITOR_PROJECT
HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix)
{
XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix);
@@ -694,9 +736,7 @@ HRESULT CInstance_Model::Bind_CS_Output(_uint Index, _uint iBufferIndex)
return S_OK;
}
#ifdef EDITOR_PROJECT
CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
{
CInstance_Model* pInstance = new CInstance_Model(pDevice, pContext);
@@ -709,7 +749,6 @@ CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceCont
return pInstance;
}
#endif
CComponent* CInstance_Model::Clone(void* pArg, CGameObject* pOwner)
{
+19 -19
View File
@@ -105,27 +105,32 @@ HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _cha
return m_Meshes[iMeshIndex]->Bind_BoneMatrices(m_Bones, pShader, pConstantName);
}
_bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform)
_bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform)
{
if (!m_bPlayAnim){
if (!m_bPlayAnim)
return false;
if (m_iCurrentAnimIndex < 0 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations)
return false;
}
if (-1 == m_iCurrentAnimIndex // 정지 혹은 시작을 안시켜준 애님
|| m_iCurrentAnimIndex >= (_int)m_iNumAnimations) // 애님 인덱스 초과됨
{
return false; // 잘못된 초기화
}
ComputeAnimation();
if (m_iPreAnimIndex != m_iCurrentAnimIndex && m_iPreAnimIndex != 0)
if (m_iPreAnimIndex >= 0 && m_iPreAnimIndex != m_iCurrentAnimIndex)
{
m_fBlendTime += fTimeDelta;
_float fRatio = (m_fBlendTime / m_fBlendDuration);
fRatio = min(fRatio, 1.f);
if (fRatio > 1.f) fRatio = 1.f;
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
m_Animations[m_iCurrentAnimIndex]->InterpAnim(m_Animations[m_iPreAnimIndex], m_Bones, fRatio);
CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex];
CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex];
//_bool bPreFinished = pPreAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
_bool bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
pCurAnim->InterpAnim(pPreAnim, m_Bones, fRatio);
m_bIsFinishedAnim = bCurFinished;
if (fRatio >= 1.f)
{
@@ -136,6 +141,7 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform)
else
{
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount);
m_iPreAnimIndex = m_iCurrentAnimIndex;
}
@@ -144,12 +150,6 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform)
pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix));
}
if (m_bIsFinishedAnim)
{
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
}
return m_bIsFinishedAnim;
}
@@ -163,8 +163,8 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount)
m_iCurrentAnimIndex = iIndex;
m_bIsLoop = isLoop;
m_fAmount = fAmount;
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
}
else {
m_iCurrentAnimIndex = -1;
@@ -59,7 +59,7 @@ void CMouse_Manager::Update()
}
m_ptOldMouseCur = m_ptCurrentMouseCur;
#ifdef _DEBUG
GUI::Begin("Mouse_Manager");
GUI::Text("AccumulateMomentum %f, %f", m_vMove.x, m_vMove.y);
GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y);
@@ -79,7 +79,7 @@ void CMouse_Manager::Update()
GUI::Text("INV_VPPOS: %f, %f", pt.x - (viewPort.Width * 0.5f), pt.y - (viewPort.Height * 0.5f));
GUI::End();
#endif
Picking();
}
else {
@@ -47,11 +47,12 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB
}
assert(nullptr != pShape);
// createExclusiveShape를 하면 쉐이프가 actor에 attach 된 상태로 나오기 때문에
// 쉐이프 속성만 건드려서 액터의 쉐이프를 수정함
pShape->setFlags(RigidBody.Get_ShapeFlags());
pShape->setContactOffset(RigidBody.Get_ContactOffset());
pShape->setRestOffset(0.f);
pActorDynamic->attachShape(*pShape);
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
@@ -101,7 +102,7 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
// GeoFlag 중 더블사이드는 이제 지원 안함, 할거면 노말 뒤집어서 하라고 함
// pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
// 유효성 체크
PX_ASSERT(pPxMeshGeometry.isValid());
PX_ASSERT(pPxMeshGeometry->isValid());
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
}
break;
@@ -331,10 +332,19 @@ unordered_set<PSX::PxActor*>::iterator CPhysX_Manager::Detach_Actor(PSX::PxActor
if (m_pActiveBodys.end() != iter) {
m_pActiveBodys.erase(iter); // 액터를 활성화 맵에서 분리 해주고
iterOut = m_pRestBodies.insert(&Actor).first; // 액터를 다시 쓸 수 있기 때문에 따로 보관해줌
if (m_pScene != nullptr) {
m_pScene->removeActor(Actor);
}
}
PSX::PxScene* pOwnerScene = Actor.getScene();
if (pOwnerScene == nullptr) { // 액터가 씬에 없는 경우 nullptr이 나옴
return iterOut;
}
if (pOwnerScene != m_pScene) { // 액터가 속한 씬이 아닌경우 빼면 안됨
return iterOut;
}
m_pScene->removeActor(Actor);
return iterOut;
}
@@ -475,6 +485,22 @@ HRESULT CPhysX_Manager::Initialize()
pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true);
}
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
#ifndef _DEBUG
PlaneData.eKind = PHYSX_KIND::BODY_STATIC;
PlaneData.iSubKind = UINT_MAX;
PlaneData.pOwner = nullptr;
PlaneData.pBody = nullptr;
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
pGroundPlane->userData = &PlaneData;
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
m_pScene->addActor(*pGroundPlane);;
#endif // _DEBUG
// m_pScene->overlap();??????
#ifdef EDITOR_PROJECT
#ifdef 기무리
@@ -483,8 +509,6 @@ HRESULT CPhysX_Manager::Initialize()
PlaneData.pOwner = nullptr;
PlaneData.pBody = nullptr;
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
pGroundPlane->userData = &PlaneData;
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
@@ -515,8 +539,6 @@ HRESULT CPhysX_Manager::Initialize()
PlaneData.pOwner = nullptr;
PlaneData.pBody = nullptr;
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
pGroundPlane->userData = &PlaneData;
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
@@ -547,8 +569,6 @@ HRESULT CPhysX_Manager::Initialize()
PlaneData.pOwner = nullptr;
PlaneData.pBody = nullptr;
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
pGroundPlane->userData = &PlaneData;
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
@@ -46,6 +46,8 @@ class ENGINE_DLL CAnimation : public CBase
ID3D11Buffer* Get_ChannelBuffer() { return m_pChannelBuffer; }
ID3D11ShaderResourceView* Get_KeyFrameSrv() { return m_pKeyFrameSrv; }
ID3D11ShaderResourceView* Get_ChannelSrv() { return m_pChannelSrv; }
_float Get_Progress() { return m_fProgress; }
#ifdef EDITOR_PROJECT
private:
HRESULT Initialize(const vector<class CBone*>& Bones, const aiAnimation* pAIAnimation);
@@ -84,6 +86,7 @@ class ENGINE_DLL CAnimation : public CBase
vector<_int> m_DestBones; // 이 애니메이션에서 영향을 받는 본들의 집합
vector<LERPDESC> m_StartKeyFrames; // 이 애니메이션의 영향을 받는 본들의 초기값
vector<_matrix> m_vBoneTransformationMatrix = {};
_float m_fProgress = {};
_uint m_iChannelCount;
_uint m_iKeyframeCount;
+1
View File
@@ -18,6 +18,7 @@ enum ESTATE : _u64Flag
SKILL = 1ULL << 11,
SKILL2 = 1ULL << 12,
MAPHELP = 1ULL << 13,
STOP = 1ULL << 14,
END
};
NS_END
+1
View File
@@ -35,6 +35,7 @@ class ENGINE_DLL CModel final : public CComponent
_bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f);
_bool IsFinishedAnim() const { return m_bIsFinishedAnim; }
_bool IsLoopAnim() const { return m_bIsLoop; }
void Set_CurrentTrackPosition(_float TrackPosition);
const _char* Get_AnimList(_uint iIndex);
_float Get_CurrentTrackPosition();