This commit is contained in:
SpicyGangjeong
2026-05-31 11:56:32 +09:00
parent a5941affee
commit 782c0000ff
59 changed files with 245 additions and 311 deletions
@@ -109,7 +109,7 @@ HRESULT CBroomRacerAI::Initialize(void* pArg)
void CBroomRacerAI::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
}
@@ -17,11 +17,11 @@ CCamera_Model::CCamera_Model(const CCamera_Model& rhs)
void CCamera_Model::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
_float3 vCamPos = {};
_float3 vCamMomentum = {};
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentVelocity());
#ifdef _DEBUG
GUI::Text("Cam_Model Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
GUI::Text("v %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
@@ -36,7 +36,7 @@ HRESULT CEffectParts::Initialize(void* pArg)
void CEffectParts::Priority_Update(_float fTimeDelta)
{
if (m_EffectInfo.isMotionBlur == true)
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CEffectParts::Update(_float fTimeDelta)
+3 -3
View File
@@ -57,7 +57,7 @@ HRESULT CElf::Initialize(void* pArg)
void CElf::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_iEntered -= 1;
if (m_iEntered < 0) {
m_iEntered = 0;
@@ -507,7 +507,7 @@ HRESULT CElf::Ready_Components(void* pArg)
{ // DO
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
@@ -580,7 +580,7 @@ void CElf::Describe_Entity()
}
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
if (GUI::Button("Move To Player"))
+1 -1
View File
@@ -680,7 +680,7 @@ void CGoblin::Describe_Entity()
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_float3 Pos;
@@ -780,7 +780,7 @@ void CGoblin_Assassin::Describe_Entity()
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_float3 Pos;
@@ -375,7 +375,7 @@ HRESULT CGoblin_Assassin::Behavior_DashExitCheck(_float fTimeDelta)
_float4 RootMomentum = m_pModelCom->Get_RootBoneMomentum();
_vector RootDelta = XMLoadFloat4(&RootMomentum);
_float dashDist = XMVectorGetX(XMVector3Length(RootDelta));
m_pTransformCom->AccumulateMomentum(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f);
m_pTransformCom->AccumulatevVelocity(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f);
if (fRatio >= 0.7f)
{
@@ -974,7 +974,7 @@ void CGoblin_Assassin::HitState_Behavior(_float fTimeDelta)
_float ease = 1.f - (t * t);
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
m_pTransformCom->AccumulateMomentum(Force);
m_pTransformCom->AccumulatevVelocity(Force);
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
}
@@ -50,7 +50,7 @@ void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta)
XMStoreFloat4(&m_vStartGripPos, Get_WorldPostion());
}
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pModelCom->Combined_BoneMatrix();
_matrix socketMatrix = {};
@@ -38,7 +38,7 @@ HRESULT CGoblin_Dagger::Initialize(void* pArg)
void CGoblin_Dagger::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
m_pModelCom->Combined_BoneMatrix();
if (m_bAttach)
@@ -563,7 +563,7 @@ void CGoblin_Mage::Describe_Entity()
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_float3 Pos;
@@ -859,7 +859,7 @@ void CGoblin_Mage::HitState_Behavior(_float fTimeDelta)
_float ease = 1.f - (t * t);
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
m_pTransformCom->AccumulateMomentum(Force);
m_pTransformCom->AccumulatevVelocity(Force);
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
}
@@ -313,7 +313,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
vDistance = XMVector4Normalize(vDistance);
_float step = dist - fDesiredRange;
m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 2.f);
m_pTransformCom->AccumulatevVelocity(vDistance * step * fTimeDelta * 2.f);
}
}
@@ -938,7 +938,7 @@ void CGoblin::HitState_Behavior(_float fTimeDelta)
_float ease = 1.f - (t * t);
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
m_pTransformCom->AccumulateMomentum(Force);
m_pTransformCom->AccumulatevVelocity(Force);
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
}
@@ -39,7 +39,7 @@ HRESULT CGoblin_Sword::Initialize(void* pArg)
void CGoblin_Sword::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pModelCom->Combined_BoneMatrix();
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
@@ -81,7 +81,7 @@ HRESULT CHuman_Duelist::Initialize(void* pArg)
void CHuman_Duelist::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
@@ -641,7 +641,7 @@ void CHuman_Duelist::Describe_Entity()
}
m_pCharacter_Controller->Describe_Entity();
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_char label[256];
for (auto& iter : m_KeyFrames)
@@ -31,7 +31,7 @@ void CInfoInstance::Update(_float fTimeDelta)
m_pInteractiveInfo->Update(fTimeDelta);
m_pEffectInfo->Update(fTimeDelta);
m_pCutSceneInfo->Update(fTimeDelta);
}
}
void CInfoInstance::Change_Level()
{
@@ -41,7 +41,6 @@ void CInfoInstance::Change_Level()
m_pSkillInfo->Change_Level();
m_pInteractiveInfo->Change_Level();
m_pEffectInfo->Change_Level();
// UI_Event.clear();
m_pCutSceneInfo->Clear_AllEvents();
}
@@ -166,40 +166,6 @@ HRESULT CLevel_GamePlay::Initialize()
void CLevel_GamePlay::Update(_float fTimeDelta)
{
_bool bStartCinematic = { true };
#ifdef _DEBUG
#ifdef 기무리
bStartCinematic = false;
#elif 진우
bStartCinematic = true;
#elif Bin
bStartCinematic = false;
#elif gimch
bStartCinematic = true;
#elif 나
bStartCinematic = false;
#endif
#endif // _DEBUG
#ifdef RELEASE_DEBUGGER
if (m_pGameInstance->Key_Down(DIK_F5)) {
m_pGameInstance->Toggle_RenderCollider();
}
#endif
if (bStartCinematic && false == m_bIntroCinematic) {
m_bIntroCinematic = true;
bStartCinematic = false;
_string strCutSceneName = "CarriageIntro";
m_pInfoInstance->Active_Event(strCutSceneName);
}
if (m_pGameInstance->Key_Pressing(DIK_0)) {
if (m_pGameInstance->Key_Up(DIK_1))
{
m_pGameInstance->Set_LevelToChange();
}
}
m_pInfoInstance->Update(fTimeDelta);
if (true == m_pGameInstance->Check_LevelShouldChange()) {
@@ -208,7 +174,9 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
UI_STATE eState = UI_STATE::LEVELCHANGE;
m_pInfoInstance->Event_CallBack(TEXT("Canvas_Change"), &eState);
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) {
if (FAILED(m_pGameInstance->Change_Level(
CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)
))) {
return;
}
}
@@ -236,7 +236,7 @@ HRESULT CMapElement_Chest::Ready_Components(void* pArg)
// RIGID_BODY
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);
Desc.bAutoOwnerTranslation = true;
Desc.bAutoTranslation = true;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HIDDEN_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
@@ -179,7 +179,7 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg)
{ // RIGID_BODY
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR);
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
+1 -1
View File
@@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg)
void CMonster::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
}
@@ -51,7 +51,7 @@ HRESULT CNPC_EleazarFig::Initialize(void* pArg)
void CNPC_EleazarFig::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_iEntered -= 1;
if (m_iEntered < 0) {
m_iEntered = 0;
@@ -304,7 +304,7 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg)
{ // DO
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG);
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
@@ -21,7 +21,7 @@ CNPC_Ollivander::CNPC_Ollivander(const CNPC_Ollivander& Prototype)
void CNPC_Ollivander::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_iEntered -= 1;
if (m_iEntered < 0) {
m_iEntered = 0;
@@ -314,7 +314,7 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg)
{ // DO
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
@@ -33,12 +33,12 @@ HRESULT CPhysXEffectHitBox::Initialize(void* pArg)
void CPhysXEffectHitBox::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CPhysXEffectHitBox::Update(_float fTimeDelta)
{
m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos));
m_pTransformCom->AccumulatevVelocity(XMLoadFloat3(&m_vDeltaPos));
}
void CPhysXEffectHitBox::Late_Update(_float fTimeDelta)
@@ -49,6 +49,7 @@ void CPhysXEffectHitBox::Late_Update(_float fTimeDelta)
if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
}
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
}
HRESULT CPhysXEffectHitBox::Render()
+3 -3
View File
@@ -141,7 +141,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
{
ReLockOnTarget();
SetGravity();
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
@@ -576,7 +576,7 @@ void CPlayer::Trigger(CTimeSocket& Socket)
m_pTransformCom->Set_State(STATE::POSITION, vNewPos);
m_pCharacter_Controller->Set_Position(vNewPos);
m_pTransformCom->RotationQ(pContents->pxTransform.q);
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
} break;
case TIMESOCKET_FUNC::TRANSLATION_LERP:
{
@@ -1196,7 +1196,7 @@ void CPlayer::Describe_Entity()
m_pCharacter_Controller->Describe_Entity();
GUI::Checkbox("Battle", &m_bDuel_ZOnlyMove);
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_char label[256];
for (auto& iter : m_KeyFrames)
@@ -596,7 +596,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
}
_vector vLook = m_pTransformCom->Get_State(STATE::LOOK);
vLook = XMVector3Normalize(vLook);
m_pTransformCom->AccumulateMomentum(vLook *fTimeDelta *0.8f);
m_pTransformCom->AccumulatevVelocity(vLook *fTimeDelta *0.8f);
}
else if (SUCCEEDED(InputMove())) {
m_fMoveTime += fTimeDelta;
+2 -2
View File
@@ -59,7 +59,7 @@ void CRandomNpc::Priority_Update(_float fTimeDelta)
if (!m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())) {
return;
}
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_iEntered -= 1;
if (m_iEntered < 0) {
m_iEntered = 0;
@@ -448,7 +448,7 @@ HRESULT CRandomNpc::Ready_Components(void* pArg)
{ // DO
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
+1 -1
View File
@@ -787,7 +787,7 @@ HRESULT CRanrok::Ready_SubParts()
m_pRanrokCombinedBoneMatrices[ENUM_CLASS(RANROK_ENUM_BONEMATRICES::TAIL2)] = m_pTail2_BoneMat = m_pModelCom->Get_BoneMatrixPtr("tail_12");
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.bAutoOwnerTranslation = false;
Desc.bAutoTranslation = false;
Desc.iSubKind = ENUM_CLASS(PXOBJECT::RANROK_BODY);
for (_uint i = 0; i < ENUM_CLASS(RANROK_ENUM_BONEMATRICES::END); ++i) {
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_RANROK_BODY"), (CComponent**)&m_pTargetableDO[i], &Desc))) {
@@ -803,7 +803,7 @@ HRESULT CRanrok::Behavior_RushExitCheck(_float fTimeDelta)
vLook = XMVector3Normalize(vLook);
_vector vPos = m_pCharacter_Controller->Get_Position();
_vector vNextPos = vPos + vLook * 10.f * fTimeDelta;
m_pTransformCom->AccumulateMomentum(vLook * 10.f * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(vLook * 10.f * fTimeDelta);
return S_OK;
}
+1 -1
View File
@@ -52,7 +52,7 @@ HRESULT CTerrain::Initialize(void* pArg)
void CTerrain::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CTerrain::Update(_float fTimeDelta)
@@ -55,7 +55,7 @@ HRESULT CTroll_Weapon::Initialize(void* pArg)
void CTroll_Weapon::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pModelCom->Combined_BoneMatrix();
_matrix socketMatrix = {};
+1 -1
View File
@@ -44,7 +44,7 @@ HRESULT CWand::Initialize(void* pArg)
void CWand::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pModelCom->Combined_BoneMatrix();
#ifdef _DEBUG
Describe_Entity();
@@ -322,37 +322,28 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv)
return normalize(n);
}
// BackGround ForeGround 합은 1
float2 ComputeDepthWeights(float fCenterDepth, float fSampleDepth, float fDepthScale)
{
float delta = fSampleDepth - fCenterDepth;
// backgroundWeight: sample이 더 멀수록 증가
float backgroundWeight = saturate(0.5f + fDepthScale * delta);
float foregroundWeight = 1.0f - backgroundWeight;
float fBackgroundWeight = saturate(0.5f + fDepthScale * delta);
float fForegroundWeight = 1.0f - fBackgroundWeight;
return float2(backgroundWeight, foregroundWeight);
return float2(fBackgroundWeight, fForegroundWeight);
}
float ComputeSpreadWeight(float fOffsetLength, float fSpreadLength, float fPixelToSampleUnitsScale)
float ComputeSpreadWeight(float fStepOffset, float fSpreadLength, float fVelocityScale)
{
return saturate(fPixelToSampleUnitsScale * fSpreadLength - fOffsetLength + 1.f);
return saturate(fVelocityScale * fSpreadLength - fStepOffset + 1.f);
}
// fCenterDepth : 현재 중심 픽셀의 깊이
// fSampleDepth : 샘플 픽셀의 깊이
// fOffsetLength : 중심에서 샘플까지의 거리
// fCenterSpreadLength : 중심 픽셀의 블러 반경
// fSampleSpreadLength : 샘플 픽셀의 블러 반경
// fPixelToSampleUnitsScale : spread/offset 단위
// fDepthScale : 깊이 차이에 얼마나 민감하게 전경/배경을 나눌지
float SampleWeight(float fCenterDepth, float fSampleDepth, float fOffsetLength, float fCenterSpreadLength,
float fSampleSpreadLength, float fPixelToSampleUnitsScale, float fDepthScale)
float SampleWeight(float fCenterDepth, float fSampleDepth, float fStepOffset, float fCenterSpreadLength,
float fSampleSpreadLength, float fVelocityScale, float fDepthScale)
{
float2 vDepthCompare = ComputeDepthWeights(fCenterDepth, fSampleDepth, fDepthScale);
float fSpreadCenter = ComputeSpreadWeight(fOffsetLength, fCenterSpreadLength, fPixelToSampleUnitsScale);
float fSpreadSample = ComputeSpreadWeight(fOffsetLength, fSampleSpreadLength, fPixelToSampleUnitsScale);
float fCenter = ComputeSpreadWeight(fStepOffset, fCenterSpreadLength, fVelocityScale);
float fSample = ComputeSpreadWeight(fStepOffset, fSampleSpreadLength, fVelocityScale);
return vDepthCompare.x * fSpreadCenter + vDepthCompare.y * fSpreadSample;
return vDepthCompare.x * fCenter + vDepthCompare.y * fSample;
}
float4x4 RotateX(float fAngle)
@@ -598,24 +589,26 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f)
{
float2 vReturnVelocity = float2(0.5f, 0.5f);
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5)
{
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) {
return vReturnVelocity;
}
{
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
currentNDC.y *= -1.f;
previousNDC.y *= -1.f;
currentNDC.y *= -1.f;
previousNDC.y *= -1.f;
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
velocityUV *= fIntensity;
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
// UV 델타
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
velocityUV *= fIntensity;
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5
vReturnVelocity = velocityUV * 0.5f + 0.5f;
}
return vReturnVelocity;
}
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos)
{
return CalcVelocityUV(vCurrentProjPos, vPreviousProjPos, 1.0f);
@@ -269,33 +269,34 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
float2 vCenterUV = In.vTexcoord;
float2 vFullResolutionTexelSize = 1.f / g_vResolution;
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y;
float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy;
bool bBorrowedVelocityFromTile = false;
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y * g_fFar;
float2 vCenterVelocity = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
float2 vCenterVeloPixel = vCenterVelocity * g_vResolution.xy;
bool bBorrowedVelocity = false;
float2 vBlurVelo = vCenterVelo;
float2 vBlurVeloPixel = vCenterVeloPixel; // 프레임당 픽셀 이동량
float2 vBlurVelocity = vCenterVelocity;
float2 vBlurVelocityPixel = vCenterVelocity * g_vResolution.xy; // 프레임당 픽셀 이동량
float fVelocityEpsilon = 0.5f;
if (length(vBlurVeloPixel) < fVelocityEpsilon)
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
{
// 사실상 정지해 있던 픽셀이면 텐트벨로시티맵에서 빌려옴
vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
vBlurVeloPixel = vBlurVelo * g_vResolution.xy;
bBorrowedVelocityFromTile = true;
vBlurVelocity = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
vBlurVelocityPixel = vBlurVelocity * g_vResolution.xy;
bBorrowedVelocity = true;
}
if (length(vBlurVeloPixel) < fVelocityEpsilon) {
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
{
// 텐트벨로시티맵에서 빌려온 픽셀또한 정지해 있었으면 원본 그대로 반환
Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV);
Out.vVelocity = float2(0.5f, 0.5f);
return Out;
}
float fPixelSpeed = length(vBlurVeloPixel);
float fPixelSpeed = length(vBlurVelocityPixel);
float2 vBlurDirPixel = (vBlurVeloPixel / max(fPixelSpeed, FLT_EPSILON5));
float2 vBlurDirPixel = (vBlurVelocityPixel / max(fPixelSpeed, FLT_EPSILON5));
// 픽셀의 속도로 블러 반경을 가변적으로 돌림
float fBlurRadiusPixel = clamp(fPixelSpeed * 0.4f , 0.f, g_fMBMaxBlurRadius);
@@ -308,39 +309,40 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
float fSamplePixelSpeed = fBlurRadiusPixel / max((float) iMaxRadius, 1.f);
// 샘플유닛의 크기
float fScalePixelToSampleUnit = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
float fVelocityScale = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f);
float2 vAccVeloSum = float2(0.f, 0.f);
float fAccWeight = 0.f;
// 센터의 스프레드 길이
float2 vReferenceVelocityPixel = bBorrowedVelocityFromTile ? vBlurVeloPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
float2 vReferenceVelocityPixel = bBorrowedVelocity ? vBlurVelocityPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
float fCurrentVelocityVector = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
[loop]
for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) {
float fOffset = (float) abs(iInterval);
float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed);
for (int iStep = -iMaxRadius; iStep <= iMaxRadius; ++iStep)
{
float fOffset = (float) abs(iStep);
float2 vOffsetPixel = vBlurDirPixel * ((float) iStep * fSamplePixelSpeed);
float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize;
if (false == IsValidUV(vSamplingUV)) {
continue;
}
float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y;
float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy;
float fSampleDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y * g_fFar;
float2 vSampledVelocity = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
float2 vSampledVelocityPixel = vSampledVelocity * g_vResolution.xy;
// 샘플의 스프레드 길이
float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel));
float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, fBlurRadiusPixel);
if (true == bBorrowedVelocityFromTile)
float fSampleVelocityVector = clamp(abs(dot(vSampledVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel);
if (true == bBorrowedVelocity)
{
fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel);
fSampleVelocityVector = max(fSampleVelocityVector, fCurrentVelocityVector);
}
// 샘플과 센터의 (깊이테스트 + 스프레드테스트)
float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth);
float fWeightCalculated = SampleWeight(fCenterDepth, fSampleDepth, fOffset,
fCurrentVelocityVector, fSampleVelocityVector, fVelocityScale, fDepthScale);
if (fWeightCalculated <= 0.f) {
continue;
@@ -348,7 +350,7 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV);
vAccColorSum += vSampledColor * fWeightCalculated;
vAccVeloSum += vSampledVelo * fWeightCalculated;
vAccVeloSum += vSampledVelocity * fWeightCalculated;
fAccWeight += fWeightCalculated;
}
float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5);
@@ -819,6 +821,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
// 경계 블렌딩 폭. 경계 섞는 비중
float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음
float g_fStaticShadowBlendWidthRatio = 0.05f;
// 경계 주변 부드럽게 할 비중
float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio,
@@ -832,14 +835,16 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
// 1번째 방법
//Dynamic - > Static
//부드럽게 전환
float fStaticShadowBlendEndRatio = min(1.0f, g_fCascadeSplitRatioFar + g_fStaticShadowBlendWidthRatio);
float fStaticShadowBlendWeight = smoothstep(
g_fCascadeSplitRatioFar,
fStaticShadowBlendEndRatio,
fDepthRatio
);
float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static);
float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar;
float fStaticShadowBlendWidthRatio = 0.05f;
float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio);
float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio);
float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight);
float fStaticAdjusted = lerp(1.0f, fVisibility_Static, fStaticShadowBlendWeight);
float fVisibilityCombined = fVisibilityDynamic * fStaticAdjusted;
// 2번째 방법
// Dynamic * Static 항상 최소곱
//float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static);
@@ -1324,42 +1329,43 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In)
vCenterViewPosition /= vCenterViewPosition.w;
}
float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f);
float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix);
float3 vCenterNormal = mul(vNormal, (float3x3) g_ViewMatrix);
float2 vNoiseScale = g_vResolution / 4.f;
float3 vNoise = g_SSAONoiseTexture.Sample(SSAODataSampler, uv * vNoiseScale).xyz;
float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal));
float3 vBiNormal = cross(vCenterViewNormal, vTangent);
float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal);
float3 vTangent = normalize(vNoise - vCenterNormal * dot(vNoise, vCenterNormal));
float3 vBiNormal = cross(vCenterNormal, vTangent);
float3x3 TBNMatrix = float3x3(vTangent, vBiNormal, vCenterNormal);
float fOcclusion = 0.f;
[loop]
for (uint i = 0; i < g_iKernelSize; ++i)
{
float3 vViewSamplePosVec = mul(g_SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW
float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f);
float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix);
float3 vSampleVector= mul(g_SamplePos[i].xyz, TBNMatrix);
float4 vSampleViewPosition = vCenterViewPosition + float4(vSampleVector * g_fSSAORadius, 0.f);
float4 vNDCSampleOffset = mul(vSampleViewPosition, g_ProjMatrix);
vNDCSampleOffset /= vNDCSampleOffset.w;
float2 sampleUV;
sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
float2 vSampleUV;
vSampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
vSampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
if (sampleUV.x < 0 || sampleUV.x > 1
|| sampleUV.y < 0 || sampleUV.y > 1) {
if (vSampleUV.x < 0 || vSampleUV.x > 1
|| vSampleUV.y < 0 || vSampleUV.y > 1)
{
continue;
}
float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar;
float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
float fRecordedDepth = g_DepthTexture.Sample(PointSampler, vSampleUV).y * g_fFar;
float fIsOccluded = (fRecordedDepth < vSampleViewPosition.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth));
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vSampleViewPosition.z - fRecordedDepth));
fIsOccluded *= fRangeCheck;
fOcclusion += fIsOccluded;
}
fOcclusion = saturate(1.f - (fOcclusion * g_fSSAOStrength / g_iKernelSize) * fRatio);
Out.fOcclusion = fOcclusion ;
Out.fOcclusion = fOcclusion;
return Out;
}
@@ -40,12 +40,12 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h
{
case 23: // 무거운데 올라갈 수 있는 벽
if (m_pGameInstance->Key_Pressing(DIK_E)) {
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
}
else if (m_pGameInstance->Key_Pressing(DIK_R)) {
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
}
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
break;
case 24: // 문짝
{
@@ -39,7 +39,7 @@ HRESULT CDummyObject::Initialize(void* pArg)
void CDummyObject::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CDummyObject::Update(_float fTimeDelta)
@@ -34,12 +34,12 @@ HRESULT CDummy_PhysXEffectHitBox::Initialize(void* pArg)
void CDummy_PhysXEffectHitBox::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CDummy_PhysXEffectHitBox::Update(_float fTimeDelta)
{
m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos));
m_pTransformCom->AccumulatevVelocity(XMLoadFloat3(&m_vDeltaPos));
}
void CDummy_PhysXEffectHitBox::Late_Update(_float fTimeDelta)
@@ -16,7 +16,7 @@ CDummy_PhysXMonster::CDummy_PhysXMonster(const CDummy_PhysXMonster& rhs) :
void CDummy_PhysXMonster::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
}
@@ -26,16 +26,16 @@ void CDummy_PhysXMonster::Update(_float fTimeDelta)
GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y);
if (true == m_pCharacter_Controller->IsActive()) {
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
m_pCharacter_Controller->Move(fTimeDelta);
m_vStunTimer.x = 0.f;
@@ -21,30 +21,30 @@ CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs):
void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
}
void CDummy_PhysXPlayable::Update(_float fTimeDelta)
{
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) {
if (m_pGameInstance->Key_Pressing(DIK_SPACE)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Pressing(DIK_C)) {
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
}
if (m_pGameInstance->Key_Down(DIK_V)) {
m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor(), m_pGameInstance->Get_CurrentLevelID());
@@ -56,7 +56,7 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
}
}
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
m_pCharacter_Controller->Move(fTimeDelta);
}
@@ -43,7 +43,7 @@ HRESULT CEditEffect::Initialize(void* pArg)
void CEditEffect::Priority_Update(_float fTimeDelta)
{
if(m_EffectInfo.isMotionBlur == true)
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
}
void CEditEffect::Update(_float fTimeDelta)
+1 -1
View File
@@ -476,7 +476,7 @@ void CGoblin::Describe_Entity()
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_float3 Pos;
@@ -210,7 +210,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
vDistance = XMVector4Normalize(vDistance);
_float step = dist - fDesiredRange;
m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 1.5f);
m_pTransformCom->AccumulatevVelocity(vDistance * step * fTimeDelta * 1.5f);
}
}
@@ -67,7 +67,6 @@ void CLevel_Logo::Update(_float fTimeDelta)
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT))))
return;
#endif // 진우
}
HRESULT CLevel_Logo::Render()
+1 -1
View File
@@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg)
void CMonster::Priority_Update(_float fTimeDelta)
{
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
}
+2 -2
View File
@@ -117,7 +117,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
ReLockOnTarget();
if (m_pCharacter_Controller->Get_GravityAmount() > 0.f)
SetGravity();
m_pTransformCom->RewindMomentum();
m_pTransformCom->ResetVelocityVector();
__super::Priority_Update(fTimeDelta);
@@ -530,7 +530,7 @@ void CPlayer::Describe_Entity()
}
_float4 vMomentum = {};
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
_char label[256];
for (auto& iter : m_KeyFrames)
@@ -101,6 +101,7 @@ vector g_vFogColor;
float g_fDepthPackExponent;
Texture3D g_VolumeTexture;
float g_fCascadeBlendRatio = 0.02f;
float g_fWeights_32[32] =
{
@@ -813,42 +814,20 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
/* 광원의 NDC에서 샘플링 */
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x, g_vShadowRadiusTexel.x);
float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y, g_vShadowRadiusTexel.y);
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
float fVisibilityStatic = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
////////////////////////////
// 케스케이드
float fDepthRatio = saturate(vDepthDesc.y);
// 경계 블렌딩 폭. 경계 섞는 비중
float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음
float fCascadeBlend_Front = smoothstep(g_fCascadeSplitRatioNear - g_fCascadeBlendRatio,
g_fCascadeSplitRatioNear + g_fCascadeBlendRatio, fDepthRatio);
// 경계 주변 부드럽게 할 비중
float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio,
g_fCascadeSplitRatioNear + fShadowCascadeBlendWidthRatio, fDepthRatio);
//float fCascadeBlend_MiddleToFar = smoothstep(g_fCascadeSplitRatioFar - fShadowCascadeBlendWidthRatio,
//g_fCascadeSplitRatioFar + fShadowCascadeBlendWidthRatio, fDepthRatio);
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_Front);
float fStaticShadowBlendWeight = smoothstep(g_fCascadeSplitRatioFar - g_fCascadeBlendRatio,
g_fCascadeSplitRatioFar + g_fCascadeBlendRatio, fDepthRatio);
// Near -> Middle
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle);
// 1번째 방법
//Dynamic - > Static
//부드럽게 전환
float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static);
float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar;
float fStaticShadowBlendWidthRatio = 0.05f;
float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio);
float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio);
float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight);
// 2번째 방법
// Dynamic * Static 항상 최소곱
//float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static);
// 3번째 방법
// Dynamic , Static 최소값만 취함
//float fVisibilityCombined = min(fVisibilityDynamic, fVisibility_Static);
fVisibilityStatic = lerp(1.0f, fVisibilityStatic, fStaticShadowBlendWeight);
float fVisibilityCombined = fVisibilityDynamic * fVisibilityStatic;
// 최소 밝기
float fShadowMultiplier = lerp(g_fMinShadowBrightness, 1.0f, saturate(fVisibilityCombined));
@@ -262,9 +262,9 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta)
_float fDistanceFromGround = XMVectorGetX(XMVector3Dot(vFootToHitPos, vSurfaceNormal));
_float fDotUpNormal = (fabsf(fDotUp) < FLT_EPSILON) ? FLT_EPSILON: fDotUp;
_float fCurrentMomentumY = (-fDistanceFromGround / fDotUpNormal) * 0.3f;
_vector vCurrentMomentum = m_pTransform->Get_CurrentMomentum();
_vector vCurrentMomentum = m_pTransform->Get_CurrentVelocity();
m_pTransform->Set_CurrentMomentum( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) );
m_pTransform->Set_CurrentVelocity( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) );
Set_OnGroundFlag(true);
if (m_fCurrentSlopeDegree < m_fWalkableSlopeDegree * 0.5f) {
m_bSlide = false;
@@ -292,17 +292,17 @@ void CCharacter_Controller::Move(_float fTimeDelta)
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
if (true == m_bGravity) {
if (0 >= m_iIsOnGround) { // 공중: 무조건 중력
m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f));
m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f));
}
else if ((iCoyote_Counter) >= m_iIsOnGround) {
UpdateGroundByCast(fTimeDelta);// 바닥에 플레이어 붙이게 함
}
else if (m_fCurrentSlopeDegree > m_fWalkableSlopeDegree) { // 너무 가파른 경사: 중력
m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
m_bSlide = true;
}
}
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum());
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentVelocity());
m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles);
}
@@ -61,7 +61,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
#endif // _DEBUG
#ifndef _DEBUG
m_pThreadHolder = CThreadHolder::Create(12);
m_pThreadHolder = CThreadHolder::Create(8);
#endif // !_DEBUG
if (nullptr == m_pThreadHolder) {
@@ -149,28 +149,17 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
m_pKey_Manager->Update();
m_pMouse_Manager->Update();
m_pSound_Manager->Update();
#ifdef _DEBUG
m_pResource_Manager->Describe_Entity();
m_pFog->Update_Fog();
#endif // _DEBUG
m_pPicking->Update();
m_pObject_Manager->Priority_Update(fExcuteTimeDelta);
m_pPipeLine->Update();
m_pObject_Manager->Update(fExcuteTimeDelta);
m_pPhysX_Manager->Update(fExcuteTimeDelta);
m_pObject_Manager->Late_Update(fExcuteTimeDelta);
m_pVolumetric->Dispatch();
m_pLevel_Manager->Update(fExcuteTimeDelta);
m_pObject_Manager->Clear_DeadObj();
//m_pObstacle_Manager->Refresh_Region();
}
HRESULT CGameInstance::Draw()
+1 -1
View File
@@ -575,7 +575,7 @@ void CModel::Update_RootBone(_float Amount)
vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f);
if (m_bRootBone) {
m_pTransform->AccumulateMomentum(vDeltaWorld);
m_pTransform->AccumulateVelocity(vDeltaWorld);
}
else {
XMStoreFloat4(&m_RootBoneMomentum, vDeltaWorld);
@@ -207,7 +207,7 @@ void CMouse_Manager::Describe_Entity()
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Mouse_Manager")) {
GUI::Text("AccumulateMomentum %.2f, %.2f", m_vMove.x, m_vMove.y);
GUI::Text("AccumulateVelocity %.2f, %.2f", m_vMove.x, m_vMove.y);
GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y);
GUI::Text("Lock %d", m_bLockMouseToCenter);
POINT pt = Get_MouseViewPortPos();
@@ -488,7 +488,7 @@ void CPhysX_Manager::Update_Kinematic()
continue;
}
PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pBody->userData;
if (false == pUserData->bAutoOwnerTranslation) {
if (false == pUserData->bAutoTranslation) {
continue;
}
const CTransform* pTransform = pUserData->pOwner->Get_Component<CTransform>();
@@ -497,9 +497,9 @@ void CPhysX_Manager::Update_Kinematic()
}
}
}
for (list<PSX::PxActor*>::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) {
Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID());
ReleasedActor = ReleasedList.erase(ReleasedActor);
for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) {
Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID());
iterActor = ReleasedList.erase(iterActor);
}
}
@@ -520,7 +520,6 @@ void CPhysX_Manager::Update(_float fTimeDelta)
}
{ // Post
Update_Dynamic_ActiveActors();
//Update_Dynamic_AllActors();
}
#ifdef _DEBUG
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX"));
@@ -540,7 +539,7 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors()
ReleasedList.emplace_back(ppActiveActors[i]);
continue;
}
if (false == pUserData->bAutoOwnerTranslation) {
if (false == pUserData->bAutoTranslation) {
continue;
}
CTransform* pTransform = pUserData->pOwner->Get_Component<CTransform>();
@@ -549,13 +548,14 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors()
_float3 vOriginalScale = pTransform->Get_Scale();
_matrix WorldMatrix = {};
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(),
XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
pTransform->Set_WorldMatrix(WorldMatrix);
}
}
for (list<PSX::PxActor*>::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) {
Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID());
ReleasedActor = ReleasedList.erase(ReleasedActor);
for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) {
Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID());
iterActor = ReleasedList.erase(iterActor);
}
}
+19 -19
View File
@@ -361,10 +361,10 @@ void CPipeLine::Make_LightBoxes()
_matrix ViewInvMatrix = XMMatrixInverse(nullptr, ViewMatrix);
// Cascaded Shadow Map (3단계: Near / Middle / Far)
for (_uint iIndex = 0; iIndex < 3; ++iIndex)
for (_uint iCSMIndex = 0; iCSMIndex < 3; ++iCSMIndex)
{
_float4 vCascadePoints8[8] = {};
Get_CascadePoints8(m_vShadowViewPoints, iIndex, vCascadePoints8);
Get_CascadePoints8(m_vShadowViewPoints, iCSMIndex, vCascadePoints8);
// AABB 초기값 설정 (첫 번째 점 기준)
_float fMinX = vCascadePoints8[0].x;
@@ -387,12 +387,6 @@ void CPipeLine::Make_LightBoxes()
fMaxZ = max(fMaxZ, vCascadePoints8[iPointIndex].z);
}
// 각 Cascade 별로 결과를 저장할 Plane 배열 선택
_float4* targetPlanes = nullptr;
if (iIndex == 0) targetPlanes = m_vNearShadowViewBoxPlane;
if (iIndex == 1) targetPlanes = m_vMiddleShadowViewBoxPlane;
if (iIndex == 2) targetPlanes = m_vFarShadowViewBoxPlane;
// Shadow Box 여유 공간 추가 (Shadow clipping 방지 / 안정성 확보)
fMinX += m_vShadowMarginMin.x;
fMaxX += m_vShadowMarginMax.x;
@@ -404,7 +398,7 @@ void CPipeLine::Make_LightBoxes()
// Cascade 별 Shadow Map 해상도 설정
_uint iShadowWidth = { 0 };
_uint iShadowHeight = { 0 };
switch (iIndex)
switch (iCSMIndex)
{
case 0:
iShadowWidth = g_iNearShadowWidth;
@@ -424,25 +418,31 @@ void CPipeLine::Make_LightBoxes()
Adjust_ShadowTexcel(fMinX, fMinY, fMaxX, fMaxY, iShadowWidth, iShadowHeight);
// 각 Cascade 별로 결과를 저장할 Plane 배열 선택
_float4* pTargetPlanes = nullptr;
if (iCSMIndex == 0) pTargetPlanes = m_vNearShadowViewBoxPlane;
if (iCSMIndex == 1) pTargetPlanes = m_vMiddleShadowViewBoxPlane;
if (iCSMIndex == 2) pTargetPlanes = m_vFarShadowViewBoxPlane;
// Light-Space AABB를 Plane 형태로 변환 (Frustum 형태)
// 물체는 그대로 World 좌표 사용
// Plane vs Bounding Volume 테스트만 수행
targetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left
targetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right
targetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom
targetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top
targetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near
targetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far
pTargetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left
pTargetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right
pTargetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom
pTargetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top
pTargetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near
pTargetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far
// Orthographic Projection 생성 Off-Center 방식 사용
_matrix ProjMatrix = XMMatrixOrthographicOffCenterLH(fMinX, fMaxX, fMinY, fMaxY, fMinZ, fMaxZ);
// Light View / View Inverse 저장
XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix);
XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix);
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix);
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix);
// Light Projection / Projection Inverse 저장
XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix);
XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix));
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix);
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix));
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ void CRenderer::Render()
Render_NonBlend();
Render_Decal();
Render_EffectNonBlend();
Render_SSAO();\
Render_SSAO();
Render_SSAO_BLUR();
Render_LightAcc();
Render_Combined();
@@ -394,7 +394,7 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg)
m_tagData.pOwner = m_pOwner;
XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
m_tagData.pBody = this;
m_tagData.bAutoOwnerTranslation = pDesc->bAutoOwnerTranslation;
m_tagData.bAutoTranslation = pDesc->bAutoTranslation;
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this, m_pGameInstance->Get_NextLevelID());
m_pRigidBody->setCMassLocalPose(m_PxMassCenter);
m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag);
+20 -20
View File
@@ -276,32 +276,32 @@ void CTransform::Translation(_fvector vTrans)
Set_State(STATE::POSITION, Get_State(STATE::POSITION) + XMVectorSetW(vTrans, 0.f));
}
void CTransform::AccumulateMomentum(_fvector vMomentum)
void CTransform::AccumulateVelocity(_fvector vVelocity)
{
XMStoreFloat3(&m_vMomentum, (XMLoadFloat3(&m_vMomentum) + XMVectorSetW(vMomentum, 0.f)));
XMStoreFloat3(&m_vVelocityVector, (XMLoadFloat3(&m_vVelocityVector) + XMVectorSetW(vVelocity, 0.f)));
}
_vector CTransform::Get_CurrentMomentum() const
void CTransform::ResetVelocityVector()
{
return XMLoadFloat3(&m_vMomentum);
}
void CTransform::Set_CurrentMomentum(_fvector vMomentum)
{
XMStoreFloat3(&m_vMomentum, vMomentum);
}
_vector CTransform::Get_EstimatedPositionByMomentum() const
{
return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vMomentum), 1.f);
}
void CTransform::RewindMomentum()
{
m_vMomentum = m_vBackMomentum;
m_vBackMomentum = { 0.f, 0.f, 0.f };
m_vVelocityVector = m_vBackVelocityVector;
m_vBackVelocityVector = { 0.f, 0.f, 0.f };
m_PrevMatrix = m_WorldMatrix;
}
void CTransform::BookMomentum(_fvector vMomentum)
_vector CTransform::Get_CurrentVelocity() const
{
XMStoreFloat3(&m_vBackMomentum, (XMLoadFloat3(&m_vBackMomentum) + XMVectorSetW(vMomentum, 0.f)));
return XMLoadFloat3(&m_vVelocityVector);
}
void CTransform::Set_CurrentVelocity(_fvector vVelocity)
{
XMStoreFloat3(&m_vVelocityVector, vVelocity);
}
_vector CTransform::Get_EstimatedPositionByVelocityVector() const
{
return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vVelocityVector), 1.f);
}
void CTransform::BookVelocity(_fvector vVelocity)
{
XMStoreFloat3(&m_vBackVelocityVector, (XMLoadFloat3(&m_vBackVelocityVector) + XMVectorSetW(vVelocity, 0.f)));
}
void CTransform::Turn(_fvector vAxis, _float fTimeDelta)
@@ -1560,7 +1560,7 @@ static void DemoWindowWidgetsDragAndDrop()
};
static int mode = 0;
if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine();
if (ImGui::RadioButton("AccumulateMomentum", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
if (ImGui::RadioButton("AccumulateVelocity", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; }
static const char* names[9] =
{
@@ -1584,7 +1584,7 @@ static void DemoWindowWidgetsDragAndDrop()
// Display preview (could be anything, e.g. when dragging an image we could decide to display
// the filename and a small preview of the image, etc.)
if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); }
if (mode == Mode_Move) { ImGui::Text("AccumulateMomentum %s", names[n]); }
if (mode == Mode_Move) { ImGui::Text("AccumulateVelocity %s", names[n]); }
if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
ImGui::EndDragDropSource();
}
+8 -8
View File
@@ -128,14 +128,6 @@ enum class PHYSX_KIND {
OBSTACLEActor,
};
enum class PHYSX_JOINT {
D6,
DISTANCE,
REVOLUTE,
FIXED,
END
};
enum class PXOBJECT : _uint {
#pragma region NOT_DEFINE
NOT_DEFINE = 0,
@@ -240,6 +232,14 @@ enum class PXOBJECT : _uint {
END = 999
};
enum class PHYSX_JOINT {
D6,
DISTANCE,
REVOLUTE,
FIXED,
END
};
enum class HIT_TYPE
{
HIT_NONE = 0, // 히트모션 없음
+2 -2
View File
@@ -23,7 +23,7 @@
#endif // !_DEBUG
//#ifdef 기무리
#define DEBUG_MOTIONBLUR
//#define DEBUG_MOTIONBLUR
//#define DEBUG_SSAO
//#define DEBUG_SHADOW
//#define DEBUG_CAMERAS
@@ -48,7 +48,7 @@
#endif // !_DEBUG
#ifdef _DEBUG
#ifdef 기무리
#ifdef golde
#undef ASSERT_NURI
#define ASSERT_NURI(expression) assert(expression)
#define MSG_BOX(_message) MessageBox(NULL, TEXT(_message), L"System Message", MB_OK); assert(false);
@@ -376,7 +376,7 @@ typedef struct tagVertexInstance_UIDesc
typedef struct tagPHYSX_USERDATA {
PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED;
_bool bAutoOwnerTranslation = true;
_bool bAutoTranslation = true;
class CGameObject* pOwner = { nullptr };
_float4x4 BeforeMatrix = { };
@@ -19,7 +19,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
typedef struct tagRigidBody_DYNAMIC_Desc : public CRigidBody::RIGIDBODY_DESC
{
_bool bAutoOwnerTranslation = true;
_bool bAutoTranslation = true;
}RIGIDBODY_DYNAMIC_DESC;
private:
@@ -62,8 +62,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
_vector Get_Position();
void Set_Position(_vector vPos, _bool bTeleport);
void Set_Rotation(_vector vRotQ, _bool bTeleport);
void Set_AutoOwnerTranlation(_bool bAutoOwnerTranslation) { m_tagData.bAutoOwnerTranslation = bAutoOwnerTranslation; };
_bool Get_AutoOwnerTranlation() { return m_tagData.bAutoOwnerTranslation; };
void Set_AutoOwnerTranlation(_bool bAutoTranslation) { m_tagData.bAutoTranslation = bAutoTranslation; };
_bool Get_AutoOwnerTranlation() { return m_tagData.bAutoTranslation; };
void Set_Transform(_matrix WorldMatrix, _bool bTeleport);
void Set_Transform(_vector vPos, _vector vRotQ, _bool bTeleport);
+8 -8
View File
@@ -63,13 +63,13 @@ class ENGINE_DLL CTransform final :
void Translation(_float3& vTrans);
void Translation(_fvector vTrans);
void AccumulateMomentum(_fvector vMomentum);
_vector Get_CurrentMomentum() const;
void Set_CurrentMomentum(_fvector vMomentum);
void RewindMomentum();
void AccumulateVelocity(_fvector vVelocity);
_vector Get_CurrentVelocity() const;
void Set_CurrentVelocity(_fvector vVelocity);
void ResetVelocityVector();
_vector Get_EstimatedPositionByMomentum() const;
void BookMomentum(_fvector vMomentum);
_vector Get_EstimatedPositionByVelocityVector() const;
void BookVelocity(_fvector vVelocity);
void Turn(_fvector vAxis, _float fTimeDelta);
void TurnAngle(_float4 vAxis, _float fAngle);
@@ -103,8 +103,8 @@ class ENGINE_DLL CTransform final :
_float4x4 m_PrevMatrix = {};
_float m_fRadius = { 20.f };
_float3 m_vMomentum = {}; // 현재 프레임에 계산된 이동량
_float3 m_vBackMomentum = {}; // 다음 프레임에 계산될 이동량
_float3 m_vVelocityVector = {}; // 현재 프레임에 계산된 이동량
_float3 m_vBackVelocityVector = {}; // 다음 프레임에 계산될 이동량
#ifdef RELEASE_DEBUGGER
_float3 m_vRotation = {0.f, 0.f, 0.f};