[add] 1202 LastRelease
This commit is contained in:
@@ -89,8 +89,6 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::DragFloat3("Camera Shoulder Position",(_float*)&m_vShoulderPosRatio,0.01f);
|
||||
GUI::DragFloat("Camera Shoulder Length",&m_fCameraFocalLength, 0.01f);
|
||||
if (m_pGameInstance->Key_Up(DIK_INSERT)) {
|
||||
|
||||
m_pBinded_Camera->Toggle_Priority();
|
||||
|
||||
@@ -41,7 +41,6 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,46 @@ void CLevel_Field::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_Field::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("필드레벨"));
|
||||
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
static _float fAccumulatedTimeSeconds = 0.0f;
|
||||
static _uint iFrameCountForFps = 0;
|
||||
static _float fCurrentFps = 0.0f;
|
||||
static _float fAverageFrameTimeMilliseconds = 0.0f;
|
||||
|
||||
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
|
||||
++iFrameCountForFps;
|
||||
|
||||
if (fAccumulatedTimeSeconds >= 1.0f)
|
||||
{
|
||||
if (fAccumulatedTimeSeconds > 0.0f)
|
||||
{
|
||||
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
|
||||
if (fCurrentFps > 0.0f)
|
||||
{
|
||||
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
|
||||
}
|
||||
}
|
||||
|
||||
fAccumulatedTimeSeconds = 0.0f;
|
||||
iFrameCountForFps = 0;
|
||||
}
|
||||
|
||||
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
|
||||
|
||||
_tchar szWindowTitle[256] = {};
|
||||
|
||||
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
|
||||
_stprintf_s(
|
||||
szWindowTitle,
|
||||
TEXT("필드레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
|
||||
fCurrentFrameTimeMilliseconds,
|
||||
fAverageFrameTimeMilliseconds,
|
||||
fCurrentFps
|
||||
);
|
||||
|
||||
SetWindowText(g_hWnd, szWindowTitle);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,46 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_GamePlay::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
|
||||
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
static _float fAccumulatedTimeSeconds = 0.0f;
|
||||
static _uint iFrameCountForFps = 0;
|
||||
static _float fCurrentFps = 0.0f;
|
||||
static _float fAverageFrameTimeMilliseconds = 0.0f;
|
||||
|
||||
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
|
||||
++iFrameCountForFps;
|
||||
|
||||
if (fAccumulatedTimeSeconds >= 1.0f)
|
||||
{
|
||||
if (fAccumulatedTimeSeconds > 0.0f)
|
||||
{
|
||||
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
|
||||
if (fCurrentFps > 0.0f)
|
||||
{
|
||||
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
|
||||
}
|
||||
}
|
||||
|
||||
fAccumulatedTimeSeconds = 0.0f;
|
||||
iFrameCountForFps = 0;
|
||||
}
|
||||
|
||||
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
|
||||
|
||||
_tchar szWindowTitle[256] = {};
|
||||
|
||||
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
|
||||
_stprintf_s(
|
||||
szWindowTitle,
|
||||
TEXT("게임플레이레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
|
||||
fCurrentFrameTimeMilliseconds,
|
||||
fAverageFrameTimeMilliseconds,
|
||||
fCurrentFps
|
||||
);
|
||||
|
||||
SetWindowText(g_hWnd, szWindowTitle);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,46 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_Logo::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
|
||||
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
static _float fAccumulatedTimeSeconds = 0.0f;
|
||||
static _uint iFrameCountForFps = 0;
|
||||
static _float fCurrentFps = 0.0f;
|
||||
static _float fAverageFrameTimeMilliseconds = 0.0f;
|
||||
|
||||
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
|
||||
++iFrameCountForFps;
|
||||
|
||||
if (fAccumulatedTimeSeconds >= 1.0f)
|
||||
{
|
||||
if (fAccumulatedTimeSeconds > 0.0f)
|
||||
{
|
||||
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
|
||||
if (fCurrentFps > 0.0f)
|
||||
{
|
||||
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
|
||||
}
|
||||
}
|
||||
|
||||
fAccumulatedTimeSeconds = 0.0f;
|
||||
iFrameCountForFps = 0;
|
||||
}
|
||||
|
||||
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
|
||||
|
||||
_tchar szWindowTitle[256] = {};
|
||||
|
||||
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
|
||||
_stprintf_s(
|
||||
szWindowTitle,
|
||||
TEXT("로고 레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
|
||||
fCurrentFrameTimeMilliseconds,
|
||||
fAverageFrameTimeMilliseconds,
|
||||
fCurrentFps
|
||||
);
|
||||
|
||||
SetWindowText(g_hWnd, szWindowTitle);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,46 @@ void CLevel_Restart::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_Restart::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("리스타트레벨"));
|
||||
_float fDeltaTimeSeconds = m_pGameInstance->Get_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
static _float fAccumulatedTimeSeconds = 0.0f;
|
||||
static _uint iFrameCountForFps = 0;
|
||||
static _float fCurrentFps = 0.0f;
|
||||
static _float fAverageFrameTimeMilliseconds = 0.0f;
|
||||
|
||||
fAccumulatedTimeSeconds += fDeltaTimeSeconds;
|
||||
++iFrameCountForFps;
|
||||
|
||||
if (fAccumulatedTimeSeconds >= 1.0f)
|
||||
{
|
||||
if (fAccumulatedTimeSeconds > 0.0f)
|
||||
{
|
||||
fCurrentFps = static_cast<_float>(iFrameCountForFps) / fAccumulatedTimeSeconds;
|
||||
if (fCurrentFps > 0.0f)
|
||||
{
|
||||
fAverageFrameTimeMilliseconds = 1000.0f / fCurrentFps;
|
||||
}
|
||||
}
|
||||
|
||||
fAccumulatedTimeSeconds = 0.0f;
|
||||
iFrameCountForFps = 0;
|
||||
}
|
||||
|
||||
_float fCurrentFrameTimeMilliseconds = fDeltaTimeSeconds * 1000.0f;
|
||||
|
||||
_tchar szWindowTitle[256] = {};
|
||||
|
||||
// 현재 프레임 시간 + 평균 FPS / 평균 프레임 타임(ms)
|
||||
_stprintf_s(
|
||||
szWindowTitle,
|
||||
TEXT("리스타트레벨입니다 | Frame: %.3f ms | Avg: %.3f ms | FPS: %.1f"),
|
||||
fCurrentFrameTimeMilliseconds,
|
||||
fAverageFrameTimeMilliseconds,
|
||||
fCurrentFps
|
||||
);
|
||||
|
||||
SetWindowText(g_hWnd, szWindowTitle);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "MapContainer.h"
|
||||
#include "PartObject.h"
|
||||
#include "MapObject_Collision.h"
|
||||
|
||||
//#include "MapObject_LOD.h"
|
||||
|
||||
@@ -44,6 +45,10 @@ void CMapContainer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CMapContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -57,7 +62,33 @@ HRESULT CMapContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapContainer::ReadyForPhysX()
|
||||
{
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ReadyForPhysX();
|
||||
}
|
||||
}
|
||||
|
||||
void CMapContainer::ConvertToPhysX()
|
||||
{
|
||||
vector<class CPartObject*>::iterator iter = m_ColiisonPartObjects.begin();
|
||||
for (; iter != m_ColiisonPartObjects.end(); ++iter) {
|
||||
CMapObject_Collision* pObject = static_cast<CMapObject_Collision*>(*iter);
|
||||
pObject->ConvertToPhysX();
|
||||
}
|
||||
}
|
||||
|
||||
void CMapContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CMapContainer::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
#include "MapElement_Light.h"
|
||||
#include "Layer.h"
|
||||
|
||||
CMapInfo::CMapInfo()
|
||||
{
|
||||
@@ -15,6 +16,41 @@ CMapInfo::CMapInfo()
|
||||
|
||||
void CMapInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
static _bool s_bConverted = { false };
|
||||
static _bool s_bReadyToCreate = { false };
|
||||
|
||||
if (true != s_bConverted || true != s_bReadyToCreate) {
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_BACKGROUND);
|
||||
if (nullptr == pLayer) {
|
||||
return;
|
||||
}
|
||||
const list<CGameObject*>* pObjects = pLayer->Get_Objects();
|
||||
|
||||
if (false == s_bReadyToCreate) {
|
||||
s_bReadyToCreate = true;
|
||||
list<CGameObject*>::const_iterator iter = pObjects->begin();
|
||||
for (; iter != pObjects->end(); ++iter) {
|
||||
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
|
||||
if (nullptr != pContainer) {
|
||||
pContainer->ReadyForPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (false == s_bConverted) {
|
||||
s_bConverted = true;
|
||||
list<CGameObject*>::const_iterator iter = pObjects->begin();
|
||||
for (; iter != pObjects->end(); ++iter) {
|
||||
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
|
||||
if (nullptr != pContainer) {
|
||||
pContainer->ConvertToPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapInfo::Change_Level()
|
||||
@@ -214,8 +250,9 @@ HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapCon
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc)))
|
||||
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc))){
|
||||
return E_FAIL;
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
@@ -263,7 +300,6 @@ HRESULT CMapInfo::Load_MapCollisionObjects(tinyxml2::XMLElement* Container, CMap
|
||||
|
||||
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
@@ -397,3 +433,49 @@ void CMapInfo::Free()
|
||||
SAFE_RELEASE(m_pContext);
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CMapInfo::Describe_Entity()
|
||||
{
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_BACKGROUND);
|
||||
if (nullptr == pLayer) {
|
||||
return;
|
||||
}
|
||||
static _bool s_bConverted = { false };
|
||||
static _bool s_bReadyToCreate = { false };
|
||||
|
||||
const list<CGameObject*>* pObjects = pLayer->Get_Objects();
|
||||
|
||||
GUI::Begin("MapInfoDesc");
|
||||
GUI::SetNextItemWidth(80.f);
|
||||
GUI::BeginChild("CollisonPartObjects");
|
||||
GUI::SetNextItemWidth(80.f);
|
||||
if (false == s_bReadyToCreate) {
|
||||
if (GUI::Button("Ready_StaticMeshesForPhyX_ALL")) {
|
||||
s_bReadyToCreate = true;
|
||||
list<CGameObject*>::const_iterator iter = pObjects->begin();
|
||||
for (; iter != pObjects->end(); ++iter) {
|
||||
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
|
||||
if (nullptr != pContainer) {
|
||||
pContainer->ReadyForPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (false == s_bConverted) {
|
||||
if (GUI::Button("Convert_StaticMeshesForPhyX_ALL")) {
|
||||
s_bConverted = true;
|
||||
list<CGameObject*>::const_iterator iter = pObjects->begin();
|
||||
for (; iter != pObjects->end(); ++iter) {
|
||||
CMapContainer* pContainer = dynamic_cast<CMapContainer*>(*iter);
|
||||
if (nullptr != pContainer) {
|
||||
pContainer->ConvertToPhysX();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GUI::EndChild();
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -72,12 +72,59 @@ HRESULT CMapObject_Collision::Initialize(void* pArg)
|
||||
|
||||
_wstring CMapObject_Collision::Get_PrototypeTag(_uint iLodIndex)
|
||||
{
|
||||
if (m_iMaxLodLevel < iLodIndex)
|
||||
if (m_iMaxLodLevel < iLodIndex){
|
||||
return m_ModelPrototypeTags[0];
|
||||
}
|
||||
|
||||
return m_ModelPrototypeTags[iLodIndex];
|
||||
}
|
||||
|
||||
void CMapObject_Collision::ReadyForPhysX()
|
||||
{
|
||||
if (true == m_bConverted) {
|
||||
return;
|
||||
}
|
||||
m_bConverted = true;
|
||||
|
||||
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
|
||||
{
|
||||
CModel* pModel = m_pModelComs[iIndexLOD];
|
||||
|
||||
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix)))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMapObject_Collision::ConvertToPhysX()
|
||||
{
|
||||
if (true == m_bReadyToCreatePhysX) {
|
||||
return;
|
||||
}
|
||||
m_bReadyToCreatePhysX = true;
|
||||
|
||||
m_RigidBodies.resize(m_iMaxLodLevel + 1);
|
||||
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
|
||||
{
|
||||
CModel* pModel = m_pModelComs[iIndexLOD];
|
||||
|
||||
_uint iNumMeshes = pModel->Get_NumMeshes();
|
||||
|
||||
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
|
||||
{
|
||||
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
|
||||
CRigidBody_Static* pRigidBody = { nullptr };
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
|
||||
Desc.pMeshName = wstrName.c_str();
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components();
|
||||
@@ -93,19 +140,6 @@ HRESULT CMapObject_Collision::Ready_Components()
|
||||
}
|
||||
|
||||
m_pModelComs.push_back(pModel);
|
||||
|
||||
// _uint iMeshes = pModel->Get_NumMeshes();
|
||||
// for (_uint iIndex = 0; iIndex < iMeshes; ++iIndex) {
|
||||
// _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
|
||||
// CRigidBody_Static* pRigidBody = { nullptr };
|
||||
// CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
|
||||
// Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
|
||||
// Desc.pMeshName = wstrName.c_str();
|
||||
// if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// m_RigidBodies[iIndexLOD].push_back(pRigidBody);
|
||||
// }
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
|
||||
@@ -26,6 +26,9 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
void ReadyForPhysX();
|
||||
void ConvertToPhysX();
|
||||
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
@@ -53,10 +56,14 @@ class CMapContainer abstract : public CContainerObject
|
||||
protected:
|
||||
_uint m_iMaxLodLevel = {};
|
||||
|
||||
vector<class CPartObject*> m_ColiisonPartObjects;
|
||||
vector<class CPartObject*> m_ColiisonPartObjects = {};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -36,6 +36,10 @@ class CMapInfo final : public CBase
|
||||
public:
|
||||
static CMapInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -20,13 +20,16 @@ class CMapObject_Collision final : public CMapPartObject // 충돌용 Mesh
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
|
||||
void ReadyForPhysX();
|
||||
void ConvertToPhysX();
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
vector<vector<CRigidBody_Static*>> m_RigidBodies;
|
||||
vector<CModel*> m_pModelComs;
|
||||
|
||||
_uint m_iLodIndex = {};
|
||||
_bool m_bReadyToCreatePhysX = { false };
|
||||
_bool m_bConverted = { false };
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
vector<_uint> m_ModelPathIndices = { };
|
||||
|
||||
Reference in New Issue
Block a user