[add] Global_ITEM_WIDTH_Macro

[add] JointDebugger
This commit is contained in:
kimnuri
2026-01-01 18:40:57 +09:00
parent 0662ca9c16
commit 00e5fa55ff
55 changed files with 632 additions and 499 deletions
@@ -75,13 +75,27 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h
case PXOBJECT::DOOR:
{
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
_float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f));
if (fDot > 0) {
pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE);
if (pDynamic->getRigidBodyFlags().isSet(PSX::PxRigidBodyFlag::eKINEMATIC)){
pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
}
else {
pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE);
pDynamic->wakeUp();
PSX::PxVec3 vCompressedDir = hit.dir;
if (vCompressedDir.magnitudeSquared() < FLT_EPSILON5) {
vCompressedDir = -hit.worldNormal;
}
vCompressedDir.normalize();
PSX::PxVec3 hingeAxis = PSX::PxVec3(0.f, 1.f, 0.f);
PSX::PxVec3 vForceDir = vCompressedDir - hingeAxis * vCompressedDir.dot(hingeAxis);
if (vForceDir.magnitudeSquared() < FLT_EPSILON5){
break;
}
vForceDir.normalize();
float forceMagnitude = PSX::PxClamp(fLength * 600.f, 0.f, 2000.f);
PSX::PxRigidBodyExt::addForceAtPos(*pDynamic, vForceDir * forceMagnitude, { (_float)hit.worldPos.x, (_float)hit.worldPos.y, (_float)hit.worldPos.z }, PSX::PxForceMode::eFORCE);
pTargetActorData->pOwner->OnCollision();
} break;
default:
{
@@ -105,7 +105,7 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
#ifndef 기무리
if (dynamic_cast<CPlayer*>(m_pOwner)->Get_UIState() == ENUM_CLASS(UI_STATE::GAMEPLAYER))
{
m_bMovable = true;
@@ -113,6 +113,7 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
else {
m_bMovable = false;
}
#endif // 기무리
if (m_pGameInstance->Key_Up(DIK_PGDN)) {
m_bDampingParentPos = !m_bDampingParentPos;
}
@@ -87,8 +87,8 @@ HRESULT CEffectPool::Initialize(void* pArg)
m_isActiveMonsterEffectCreate = true;
#endif //
#ifdef 기무리
m_isActiveEffectCreate = true;
m_isActiveMonsterEffectCreate = true;
m_isActiveEffectCreate = false;
m_isActiveMonsterEffectCreate = false;
#endif //
#ifdef 나
m_isActiveEffectCreate = false;
+1 -1
View File
@@ -580,7 +580,7 @@ void CGoblin::Free()
void CGoblin::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Goblin")) {
GUI::Checkbox("LookAt", &m_bLookAt);
@@ -661,7 +661,7 @@ void CGoblin_Assassin::Free()
void CGoblin_Assassin::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Goblin")) {
GUI::Checkbox("LookAt", &m_bLookAt);
@@ -356,7 +356,7 @@ void CGoblin_Assassin_Spector::Free()
void CGoblin_Assassin_Spector::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("GoblinSpector")) {
_float3 vScale = m_pTransformCom->Get_Scale();
GUI::DragFloat3("Scale", (_float*)&vScale);
@@ -518,7 +518,7 @@ void CGoblin_Mage::Free()
void CGoblin_Mage::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Goblin_Mage")) {
GUI::Checkbox("LookAt", &m_bLookAt);
@@ -337,7 +337,7 @@ void CGoblin_Spector::Free()
void CGoblin_Spector::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("GoblinSpector")) {
_float3 vScale = m_pTransformCom->Get_Scale();
GUI::DragFloat3("Scale", (_float*)&vScale);
@@ -340,7 +340,7 @@ HRESULT CLevel_GamePlay::Ready_Background()
#ifdef 기무리
isReady_Background = true;
isReady_Hogsmeade = true;
isReady_Hogwart = true;
isReady_Hogwart = false;
#endif //
#ifdef 나
isReady_Background = true;
+15 -16
View File
@@ -235,7 +235,6 @@
#pragma endregion
#pragma endregion
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: m_pDevice{ pDevice }
, m_pContext{ pContext }
@@ -386,7 +385,7 @@ HRESULT CLoader::Loading_For_GamePlay()
#endif //
#ifdef 기무리
isLoad_Background = true;
isLoad_Hogwart = true;
isLoad_Hogwart = false;
isLoad_UI_SEQUANTIAL = true;
isLoad_NPC = true;
isLoad_Monster = true;
@@ -1716,7 +1715,7 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.fDensity = 0.01f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 12.f, 12.f };
Desc.vAutoDamping = { 12.f, 120.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_JOINT_ANCHOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
@@ -1731,13 +1730,13 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
Desc.vMatInfo = { 0.5f, 0.5f, 0.001f };
Desc.fContactOffset = { 0.005f };
Desc.vhalfGeometryInfo = { 0.25f, 0.25f, 0.25f };
Desc.vhalfGeometryInfo = { 0.75f, 0.25f, 0.25f };
Desc.fDensity = 0.01f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 1200.f, 1200.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 1.9f, 0.f };
Desc.vLocalTranslation = { 0.f, 1.0f, 0.f };
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
@@ -1754,7 +1753,7 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.fDensity = 0.01f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 12.f, 12.f };
Desc.vAutoDamping = { 12.f, 120.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
@@ -1769,7 +1768,7 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
Desc.vMatInfo = { 0.5f, 0.5f, 0.01f };
Desc.fContactOffset = { 0.01f };
Desc.vhalfGeometryInfo = { 0.12f, 0.25f, 0.f };
Desc.vhalfGeometryInfo = { 0.06f, 0.25f, 0.f };
Desc.fDensity = 122.f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
@@ -1842,25 +1841,25 @@ HRESULT CLoader::Loading_For_GamePlay()
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
{
Desc.eType = ACTOR::BOX;
Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC };
Desc.ePxRigidBodyFlags = { /*PSX::PxRigidBodyFlag::eKINEMATIC*/ };
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
Desc.vMatInfo = { 0.5f, 0.5f, 0.1f };
Desc.fContactOffset = { 0.05f };
Desc.vhalfGeometryInfo = { 0.35f, 0.65f, 0.15f };
Desc.vhalfGeometryInfo = { 0.5f, 1.f, 0.125f };
Desc.fDensity = 1.f;
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(0.f, 1.f, 0.f));
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.5f, 0.f, 0.f };
Desc.vLocalTranslation = { 0.5f, 1.375f, 0.f };
Desc.pxMassCenter = pxPivotTransform;
Desc.eLockFlag = {
PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X |
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X |
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y |
PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z |
PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y |
PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X |
PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z
//PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z |
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y |
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X |
//PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z
};
Desc.vAutoDamping = { 10.f, 10.f };
}
+5 -5
View File
@@ -69,7 +69,7 @@ void CMainApp::Update(_float fTimeDelta)
#ifdef _DEBUG
m_pGameInstance->Present_TimeCost();
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::SliderFloat("fTimeMult", &g_fTimeMult, 0.01f, 4.f);
GUI::End();
m_pGameInstance->Update_Engine(fTimeDelta * g_fTimeMult);
@@ -222,13 +222,13 @@ HRESULT CMainApp::Ready_Prototypes()
HRESULT CMainApp::Ready_IMGUI()
{
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
GUI::CreateContext();
ImGuiIO& io = GUI::GetIO(); (void)io;
ImFont* font = nullptr;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
ImGui::StyleColorsDark();
GUI::StyleColorsDark();
ImGui_ImplWin32_Init(g_hWnd);
ImGui_ImplDX11_Init(m_pDevice, m_pContext);
@@ -255,7 +255,7 @@ HRESULT CMainApp::Release_IMGUI()
{
ImGui_ImplDX11_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
GUI::DestroyContext();
return S_OK;
}
+127 -131
View File
@@ -40,91 +40,59 @@ HRESULT CMapElement_Door::Initialize(void* pArg)
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
m_pTransformCom->Set_Scale(pDesc->vScale);
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
XMStoreFloat4((_float4*)&m_pxStartQuat, m_pTransformCom->Get_QuarternionVector());
XMStoreFloat4x4(&m_InitialMatrix, m_pTransformCom->Get_XMWorldMatrix());
m_vRadianYAngle.y = pDesc->vRotation.z;
m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-70.f);
m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(70.f);
{ // RIGID_BODY
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
}
m_pActor = (PSX::PxRigidDynamic*)m_pRigidBody->Get_Actor();
return S_OK;
}
void CMapElement_Door::Priority_Update(_float fTimeDelta)
{
if (m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) {
GUI::Text("m_vKinematicTimer %.3f", m_vKinematicTimer.x);
if (m_vKinematicTimer.x != 0) {
m_vKinematicTimer.x += fTimeDelta;
if (m_vKinematicTimer.x < m_vKinematicTimer.z) {
// 행렬없이 럴프 버전
_float fTime = max(0.f, ((m_vKinematicTimer.x - m_vKinematicTimer.y) / (m_vKinematicTimer.z - m_vKinematicTimer.y)));
Lerp_Matrix(fTime);
//Lerp_NonMatrix(fTime);
if (m_vKinematicTimer.y < m_vKinematicTimer.x) {
m_vKinematicTimer.x = 0.f;
}
else {
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
}
else {
ActingIdle();
}
}
void CMapElement_Door::ActingIdle()
{
_float fCurrentDegree = XMConvertToDegrees(m_pJoint->getAngle());
GUI::Text("%.2f", fCurrentDegree);
GUI::Text("%.2f", m_pJoint->getVelocity());
if (fabsf(fCurrentDegree) >= 2.f) { // 각도가 벌어져 있는데
if (false == m_bDrive) { // 드라이브 중이 아니면 드라이브시킴
m_bDrive = true;
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true);
m_pJoint->setDriveForceLimit(120.f);
}
if (true == m_bDrive) { // 드라이브 중이면
if (fCurrentDegree > 0.f) {
}
else {
m_pJoint->setDriveVelocity(40.f);
}
}
}
else { // 각도가 안벌어져 있음
if (true == m_bDrive && fCurrentDegree < 0.3f) { // 드라이브 중지 트리거
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, false);
}
}
}
void CMapElement_Door::Update(_float fTimeDelta)
{
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
}
void CMapElement_Door::Late_Update(_float fTimeDelta)
{
_vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
if (!(m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)) {
_float fPitch = XMVectorGetX(vRPY);
_float fYaw = XMVectorGetY(vRPY);
_float fRoll = XMVectorGetZ(vRPY);
_float fClampedYaw = ClampRadian(fYaw);
if (fClampedYaw != fYaw) {
_vector vNewQuat = XMQuaternionRotationRollPitchYaw(fPitch, fClampedYaw, fRoll);
PSX::PxTransform actorPose = m_pActor->getGlobalPose();
PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose();
PSX::PxVec3 vpxMassLocal = massLocalPose.p;
PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal);
_vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f);
_vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f);
_float3 vScale = m_pTransformCom->Get_Scale();
_matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale));
_matrix RotationMatrix = XMMatrixRotationQuaternion(vNewQuat);
_matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal);
_matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld);
// 최종 월드 행렬
_matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴
* (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용
m_pTransformCom->Set_WorldMatrix(world);
m_pActor->setGlobalPose(XMWorldToPx_NoScaleNoFlip(world));
m_pActor->setAngularVelocity(PSX::PxVec3(0));
m_pActor->setLinearVelocity(PSX::PxVec3(0));
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true);
m_vKinematicTimer.x = 0.f;
}
}
if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) {
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
}
@@ -161,6 +129,15 @@ HRESULT CMapElement_Door::Render()
return S_OK;
}
void CMapElement_Door::OnCollision(CGameObject* pOther, void* pDesc)
{
if (0.f != m_vKinematicTimer.x) {
return;
}
m_vKinematicTimer.x = FLT_EPSILON3;
}
HRESULT CMapElement_Door::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
@@ -187,12 +164,49 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg)
ELEMENT_DOOR_DESC* pPhysXDummyDesc = static_cast<ELEMENT_DOOR_DESC*>(pArg);
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPosition), 1.f));
m_pTransformCom->Set_Scale(pPhysXDummyDesc->vScale);
m_pTransformCom->Rotation(XMConvertToRadians(pPhysXDummyDesc->vRotation.x), XMConvertToRadians(pPhysXDummyDesc->vRotation.y), XMConvertToRadians(pPhysXDummyDesc->vRotation.z));
{ // RIGID_BODY
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR);
Desc.bAutoOwnerTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
m_pActor = (PSX::PxRigidDynamic*)m_pRigidBody->Get_Actor();
m_pRigidBody->Move_Kinematic(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_QuarternionVector(), true);
}
PSX::PxTransform doorWorldPose = m_pActor->getGlobalPose();
PSX::PxVec3 hingePivotWorld = PSX::PxVec3(39.64f, 5.12f, 71.f);
PSX::PxVec3 hingeAxisWorld = doorWorldPose.q.rotate(PSX::PxVec3(0.f, 1.f, 0.f)).getNormalized();
PSX::PxTransform jointWorldPose;
jointWorldPose.p = hingePivotWorld;
jointWorldPose.q = CMyTools::Calc_RevJointPosFromWorldHingeAxis(hingeAxisWorld);
PSX::PxTransform localFrameDoor = doorWorldPose.transformInv(jointWorldPose);
m_pJoint = (PSX::PxRevoluteJoint*)m_pGameInstance->Create_PxJoint(PHYSX_JOINT::REVOLUTE, nullptr, jointWorldPose, m_pActor, localFrameDoor);
m_pJoint->setLimit(PSX::PxJointAngularLimitPair(-XMConvertToRadians(100.f), XMConvertToRadians(100.f)));
m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, true);
m_pJoint->setDriveForceLimit(120.f);
m_pJoint->setConstraintFlag(PSX::PxConstraintFlag::eVISUALIZATION, true);
m_pActor->setLinearVelocity(PSX::PxVec3(0.f, 0.f, 0.f));
m_pActor->setAngularVelocity(PSX::PxVec3(0.f, 0.f, 0.f));
m_pActor->putToSleep();
return S_OK;
}
HRESULT CMapElement_Door::Bind_ShaderResources()
{
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
_float3 vScale = m_pTransformCom->Get_Scale();
_float4x4 WorldMatirx = {};
PSX::PxTransform pxPos = m_pRigidBody->Get_GlobalPosition();
XMStoreFloat4x4(&WorldMatirx, XMMatrixAffineTransformation(XMLoadFloat3(&vScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxPos.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxPos.p), 1.f)));
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &WorldMatirx))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
@@ -209,67 +223,6 @@ HRESULT CMapElement_Door::Bind_ShaderResources()
return S_OK;
}
void CMapElement_Door::Lerp_Matrix(_float fTime)
{
{
_float4x4 OutMatrix = {};
_float4x4 CurrentMatrix = {};
XMStoreFloat4x4(&CurrentMatrix, m_pTransformCom->Get_XMWorldMatrix());
CMyTools::MatrixLerp(&CurrentMatrix, &m_InitialMatrix, OutMatrix, fTime);
m_pTransformCom->Set_WorldMatrix(OutMatrix);
}
}
void CMapElement_Door::Lerp_NonMatrix(_float fTime)
{
{
_vector vCurrQ = m_pTransformCom->Get_QuarternionVector();
_vector vInitialQ = XMLoadFloat4((_float4*)&m_pxStartQuat);
_vector vLerpQuat = XMVector4Normalize(XMVectorLerp(vCurrQ, vInitialQ, fTime));
PSX::PxTransform actorPose = m_pActor->getGlobalPose();
PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose();
PSX::PxVec3 vpxMassLocal = massLocalPose.p;
PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal);
_vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f);
_vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f);
_float3 vScale = m_pTransformCom->Get_Scale();
_matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale));
_matrix RotationMatrix = XMMatrixRotationQuaternion(vLerpQuat);
_matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal);
_matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld);
// 최종 월드 행렬
_matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴
* (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용
m_pTransformCom->Set_WorldMatrix(world);
}
}
_float CMapElement_Door::ClampRadian(_float fNewRadian)
{
// [x, z] 사이로 잘라주는 단순한 클램프
_float minYaw = m_vRadianYAngle.x;
_float maxYaw = m_vRadianYAngle.z;
// 라디안 노멀라이즈 ([-pi, pi] 같은 범위로)
fNewRadian = CMyTools::NormalizeRadian(fNewRadian);
if (fNewRadian < minYaw) {
fNewRadian = minYaw;
}
else if (fNewRadian > maxYaw) {
fNewRadian = maxYaw;
}
return fNewRadian;
}
CMapElement_Door* CMapElement_Door::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CMapElement_Door* pInstance = new CMapElement_Door(pDevice, pContext);
@@ -313,7 +266,50 @@ void CMapElement_Door::Free()
#ifdef _DEBUG
void CMapElement_Door::Describe_Entity()
{
GUI::Begin("PhysX");
if (GUI::CollapsingHeader("Door")) {
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("DOOR")) {
{
GUI::Text("Velo : %.2f", m_pJoint->getVelocity());
PSX::PxTransform pxActorLocalPos = m_pJoint->getLocalPose(PSX::PxJointActorIndex::eACTOR1);
if (true == CMyTools::DescribePxTransform(pxActorLocalPos, (size_t)this)) {
m_pJoint->setLocalPose(PSX::PxJointActorIndex::eACTOR1, pxActorLocalPos);
}
}
{
PSX::PxTransform pxRelativeLocalPos = m_pJoint->getRelativeTransform();
PSX::PxVec3 vAxis = {};
_float fAngle = {};
pxRelativeLocalPos.q.toRadiansAndUnitAxis(fAngle, vAxis);
GUI::Text("RelPos : %.2f %.2f %.2f", pxRelativeLocalPos.p.x, pxRelativeLocalPos.p.y, pxRelativeLocalPos.p.z);
GUI::Text("fAngle vAxis : %.2f %.2f %.2f %.2f", fAngle, vAxis.x, vAxis.y, vAxis.z);
}
_float fDrive = m_pJoint->getDriveVelocity();
_float fDriveDegree = XMConvertToDegrees(fDrive);
if (GUI::DragFloat("Drive", &fDriveDegree, 1.f, -180.f, 180.f, "%.2f")) {
fDrive = XMConvertToRadians(fDriveDegree);
m_pJoint->setDriveVelocity(fDrive);
}
_float2 vDriveLimit = {};
_float2 vSpring = {};
{
auto pxDriveLimit = m_pJoint->getLimit();
vDriveLimit = { pxDriveLimit.lower, pxDriveLimit.upper };
vSpring.x = pxDriveLimit.stiffness;
vSpring.y = pxDriveLimit.damping;
//pxDriveLimit.;
}
if (GUI::DragFloat2("Limit ", (_float*)&vDriveLimit, XMConvertToRadians(1.f), -XMConvertToRadians(180.f), XMConvertToRadians(180.f), "%.2f")) {
m_pJoint->setLimit(PSX::PxJointAngularLimitPair(vDriveLimit.x, vDriveLimit.y, PSX::PxSpring(vSpring.x, vSpring.y)));
}
if (GUI::DragFloat2("Spring Damping", (_float*)&vSpring, 1.f, 0.f, 100.f, "%.2f")) {
m_pJoint->setLimit(PSX::PxJointAngularLimitPair(vDriveLimit.x, vDriveLimit.y, PSX::PxSpring(vSpring.x, vSpring.y)));
}
m_pRigidBody->Describe_Entity();
}
}
GUI::End();
}
#endif // _DEBUG
+3 -3
View File
@@ -286,11 +286,11 @@ void CMonster::Free()
void CMonster::Describe_Entity()
{
if (ImGui::TreeNode("ANIM STATE")) {
if (GUI::TreeNode("ANIM STATE")) {
for (auto& pState : m_States)
{
if (ImGui::Button(to_string(pState.first).c_str()))
if (GUI::Button(to_string(pState.first).c_str()))
{
m_pFSM->Change_State(pState.first);
}
@@ -299,7 +299,7 @@ void CMonster::Describe_Entity()
GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str());
ImGui::TreePop();
GUI::TreePop();
}
}
@@ -158,19 +158,6 @@ HRESULT CNPC_EleazarFig::Bind_ShaderResources()
return S_OK;
}
_bool CNPC_EleazarFig::CastToPlayer()
{
_vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION);
_vector vTargetPos = {};
pair<CUnit*, CTransform*> pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION));
vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION);
_float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos));
if (fLength < m_fEncounterDistance) {
return true;
}
return false;
}
void CNPC_EleazarFig::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)
{
CPlayer* pPlayer = dynamic_cast<CPlayer*>(pCaster);
@@ -257,7 +244,6 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg)
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL);
}
return S_OK;
@@ -44,6 +44,7 @@ void CNPC_Ollivander::Update(_float fTimeDelta)
}
m_pNPCInteraction->Set_Visible(0 < m_iEntered);
m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true);
}
void CNPC_Ollivander::Late_Update(_float fTimeDelta)
@@ -169,19 +170,6 @@ HRESULT CNPC_Ollivander::Bind_ShaderResources()
return S_OK;
}
_bool CNPC_Ollivander::CastToPlayer()
{
_vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION);
_vector vTargetPos = {};
pair<CUnit*, CTransform*> pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION));
vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION);
_float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos));
if (fLength < m_fEncounterDistance) {
return true;
}
return false;
}
HRESULT CNPC_Ollivander::Initialize_Prototype()
{
return S_OK;
@@ -241,8 +229,8 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg)
Desc.fMaterial = { 1.2f, 1.0f, 0.0f };
Desc.bAutoStepping = { false };
Desc.fStepOffset = { 0.02f };
Desc.fRadius = 0.5f;
Desc.fHeight = 0.6f;
Desc.fRadius = 0.2f;
Desc.fHeight = 0.3f;
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_NonPlayable_HitReport::Create();
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_NonPlayable_Behavior::Create();
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
@@ -259,7 +247,6 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg)
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL);
}
+6 -25
View File
@@ -278,7 +278,6 @@ HRESULT CPlayer::Render()
return E_FAIL;
}
m_pModelCom->Bind_OutPut_SRV_VS(26, 0);
m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0);
@@ -332,13 +331,15 @@ void CPlayer::Update_CameraShake(_float fTimeDelta)
}
HRESULT CPlayer::Update_RaycastElements()
{
if (false == m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER)) {
if (E_FAIL == m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER)) {
m_iRayHitCount = 0;
return E_FAIL;
}
_vector vCameraPos = m_pGameInstance->Get_CamXMPosition();
_vector vCameraDir = m_pGameInstance->Get_CameraLook();
vector<PSX::PxRaycastHit> m_vRayHits = {};
_bool bHit = m_pGameInstance->RayCast(vCameraDir, vCameraDir, m_fRayDistance, m_vRayHits.data(), (_uint)m_vRayHits.size(), m_iRayHitCount);
m_vRayHits.resize(12);
_bool bHit = m_pGameInstance->RayCast(vCameraPos, vCameraDir, m_fRayDistance, m_vRayHits.data(), (_uint)m_vRayHits.size(), m_iRayHitCount);
if (true == bHit) {
CMyTools::SortHitsByDistance(m_vRayHits);
for (_uint i = 0; i < m_iRayHitCount; ++i) {
@@ -653,19 +654,6 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder)
}
}
//array<_int, 256> paletteMask{};
//paletteMask.fill(0);
//for (_uint i = 0; i < paletteCount; ++i)
//{
// if (i == 29)
// continue;
// _uint global = boneIndices[i];
// paletteMask[i] = globalMask[global];
//}
//m_pShaderCom->Bind_IntArray("g_RobeBoneMask", paletteMask.data(), 256);
GUI::DragFloat("TempWeight", &m_fTempWeight, 0.01f);
if (FAILED(m_pShaderCom->Bind_RawValue("g_TempWeight", &m_fTempWeight, sizeof(_float)))) {
@@ -681,13 +669,6 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder)
{
return E_FAIL;
}
if (nullptr != m_pRobePart) {
if (FAILED(m_pRobePart->Bind_PrevBoneMatrices(m_pShaderCom, "g_PrevBoneMatrices"))) {
return E_FAIL;
}
}
}
break;
#endif // _DEBUG
@@ -834,7 +815,7 @@ void CPlayer::Render_CameraCoordinateSystem()
GUI::Begin("CAMERA", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Player_CAM_COOORD")) {
GUI::Text("%d", m_LockOnInfo.pUnit);
@@ -877,7 +858,7 @@ void CPlayer::Render_CameraCoordinateSystem()
void CPlayer::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("PLAYER_DESC")) {
if (true == GUI::Button("ShaderRefresh")) {
m_pShaderCom->Shader_Refresh();
+36 -49
View File
@@ -32,16 +32,7 @@ void CPlayerRobe::Update(_float fTimeDelta)
void CPlayerRobe::Late_Update(_float fTimeDelta)
{
#ifdef _DEBUG
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) {
PSX::PxConstraintFlags pxConstraintFlags = m_pDynamicJoints[i]->getConstraintFlags();
const bool bBroken = (pxConstraintFlags.isSet(PSX::PxConstraintFlag::eBROKEN));
if (true == bBroken) {
assert(false);
}
}
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
#endif // _DEBUG
}
HRESULT CPlayerRobe::Render()
@@ -58,12 +49,12 @@ HRESULT CPlayerRobe::Update_RobeSocketPosition()
PSX::PxTransform pxTransform = {};
_matrix WorldMatrix = {};
_matrix OwnerInvWorldMatrix = m_pParentTransformCom->Get_WorldMatrixInv();
{
pxTransform = m_pRobeMainAnchor->Get_GlobalPosition();
WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTransform.p), 1.f));
_fmatrix LocalMatrix = WorldMatrix * OwnerInvWorldMatrix;
m_pModelCom->Set_BoneCombinedTransformation("Hips_Cloth", LocalMatrix);
}
//{
// pxTransform = m_pRobeMainAnchor->Get_GlobalPosition();
// WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTransform.p), 1.f));
// _fmatrix LocalMatrix = WorldMatrix * OwnerInvWorldMatrix;
// m_pModelCom->Set_BoneCombinedTransformation("Hips_Cloth", LocalMatrix);
//}
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) {
pxTransform = m_pRobeJointAnchor[i]->Get_GlobalPosition();
WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTransform.p), 1.f));
@@ -75,14 +66,6 @@ HRESULT CPlayerRobe::Update_RobeSocketPosition()
return S_OK;
}
HRESULT CPlayerRobe::Bind_PrevBoneMatrices(CShader* pShader, const _char* pConstant)
{
HRESULT hr = E_FAIL;
hr = pShader->Bind_Matrices(pConstant, m_PrevRobeBoneMatrices.data(), m_iBoneNum);
m_pModelCom->Capture_BoneMatrices(ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END), m_PrevRobeBoneMatrices);
return hr;
}
HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld)
{
@@ -96,12 +79,12 @@ HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DY
PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor();
PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor();
PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
return S_OK;
}
@@ -224,13 +207,6 @@ HRESULT CPlayerRobe::Render_BonePhysX()
});
Render_Legs();
_vector vRouteColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x0000ff, 1.f);
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
// if (nullptr != m_pRobeJointRoute[i]) {
// m_pRobeJointRoute[i]->Render([this]() {
// m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
// });
// }
//}
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) {
m_pRobeJointAnchor[i]->Render([this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
@@ -324,11 +300,11 @@ HRESULT CPlayerRobe::Ready_Components()
PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor();
PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor();
PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
}
}
{
@@ -349,11 +325,11 @@ HRESULT CPlayerRobe::Ready_Components()
PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor();
PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor();
PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
}
}
{
@@ -374,11 +350,11 @@ HRESULT CPlayerRobe::Ready_Components()
PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor();
PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor();
PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y--
PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose);
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose);
}
}
}
@@ -619,10 +595,21 @@ void CPlayerRobe::Describe_Entity()
GUI::Begin("PhysX");
if (GUI::CollapsingHeader("Robe")) {
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) {
if (GUI::BeginChild(("Child ID: " + to_string((size_t)(this))).c_str())) {
_uint iActor0 = i;
if (GUI::TreeNode(("Child ID: " + to_string(iActor0)).c_str())) {
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
PSX::PxTransform pxDrivePos0 = m_pDynamicJoints[iActor0]->getDrivePosition();
if (true == CMyTools::DescribePxTransform(pxDrivePos0, iActor0)) {
m_pDynamicJoints[iActor0]->setDrivePosition(pxDrivePos0);
}
{
_bool bModified = false;
if (CMyTools::Modify_D6Joint(*m_pDynamicJoints[iActor0], iActor0)) {
bModified = true;
}
GUI::TreePop();
}
}
GUI::EndChild();
}
}
GUI::End();
@@ -433,6 +433,13 @@ HRESULT CRanrok::Render_Nonblend()
return E_FAIL;
}
#ifdef _DEBUG
#ifdef 기무리
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
return E_FAIL;
}
#endif // 기무리
#endif // _DEBUG
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
return E_FAIL;
}
+1 -1
View File
@@ -252,7 +252,7 @@ void CTerrain::Free()
void CTerrain::Describe_Entity()
{
GUI::Begin("Renderer", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
size_t iIndex = (size_t)this;
@@ -278,7 +278,7 @@ void CTroll_Rock::Free()
void CTroll_Rock::Describe_Entity()
{
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("TrollRock")) {
GUI::Checkbox("Visible", &m_bVisible);
}
@@ -22,20 +22,20 @@ class CMapElement_Door final : public CMapElement
public:
virtual void Priority_Update(_float fTimeDelta) override;
void ActingIdle();
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
virtual void OnCollision(CGameObject* pOther, void* pDesc)override;
private:
CRigidBody* m_pRigidBody = { nullptr };
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
PSX::PxRigidDynamic* m_pActor = { nullptr };
PSX::PxRevoluteJoint* m_pJoint = { nullptr };
_float3 m_vRadianYAngle = {};
_float3 m_vKinematicTimer = { 0.f, 2.f, 2.3f };
PSX::PxQuat m_pxStartQuat = {};
_float4x4 m_InitialMatrix = {};
_bool m_bDrive = { false };
#ifdef _DEBUG
_bool m_bUseSelectColor = { true };
@@ -50,9 +50,6 @@ class CMapElement_Door final : public CMapElement
virtual HRESULT Initialize(void* pArg) override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Bind_ShaderResources() override;
void Lerp_Matrix(_float fTime);
void Lerp_NonMatrix(_float fTime);
_float ClampRadian(_float fNewRadian);
public:
static CMapElement_Door* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -41,7 +41,6 @@ class CNPC_EleazarFig final : public CUnit
virtual HRESULT Initialize(void* pArg) override;
HRESULT Ready_Components(void* pArg);
HRESULT Bind_ShaderResources() override;
_bool CastToPlayer();
public:
static CNPC_EleazarFig* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -45,7 +45,6 @@ class CNPC_Ollivander final : public CUnit
virtual HRESULT Initialize(void* pArg) override;
HRESULT Ready_Components(void* pArg);
HRESULT Bind_ShaderResources() override;
_bool CastToPlayer();
public:
static CNPC_Ollivander* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -33,7 +33,6 @@ class CPlayerRobe final : public CPartObject
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
HRESULT Update_RobeSocketPosition();
HRESULT Bind_PrevBoneMatrices(CShader* pShader, const _char* pConstant);
vector<_float4x4> Get_RobeJointAnchorMatrix() const { return m_ReconstructedJointAnchorMatirces; }
_float4x4 Get_RobeJointAnchorMatrix(_uint iIndex) const { return m_ReconstructedJointAnchorMatirces[iIndex]; }
private:
@@ -88,6 +88,7 @@ float g_fMBSampleBias;
vector g_vLightDiffuse;
vector g_vLightAmbient;
vector g_vLightSpecular;
float g_fLightSpecularMaximum;
float g_fFogDensity;
float g_fFogPow;
@@ -483,7 +484,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -569,7 +570,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -670,7 +671,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -1590,7 +1590,7 @@ technique11 DefaultTechnique
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
VertexShader = compile vs_5_0 VS_MAIN_LEGACY();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_Dragon_Body();
}
+28 -28
View File
@@ -130,7 +130,7 @@ void CEditEffect::Reference_Mat_For_EditEffect()
const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" , "DISTORTION" , "EMISSIVE"};
if (ImGui::Combo("OPTION", &m_iSelectTextureNum, pCompute, 6))
if (GUI::Combo("OPTION", &m_iSelectTextureNum, pCompute, 6))
{
}
switch (m_iSelectTextureNum)
@@ -481,18 +481,18 @@ void CEditEffect::Describe_Entity()
}
if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
if (GUI::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
{
m_EffectInfo.eRenderOrder = static_cast<RENDER>(iCurrentItem);
}
if (ImGui::Combo("Effect Type", &iCurrentType, pEffectType, ENUM_CLASS(EFFECT_TYPE::END)))
if (GUI::Combo("Effect Type", &iCurrentType, pEffectType, ENUM_CLASS(EFFECT_TYPE::END)))
{
m_EffectInfo.eEffectType = static_cast<EFFECT_TYPE>(iCurrentType);
}
if (ImGui::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::END)))
if (GUI::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::END)))
{
m_EffectInfo.eShaderPass = static_cast<SHADER_PASS_INSTANCE_MODEL>(iCurrentPass);
}
@@ -522,11 +522,11 @@ void CEditEffect::Describe_Entity()
GUI::ColorEdit4("MixColor", (_float*)&m_EffectInfo.vColor);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
m_pShaderCom->Describe_Entity();
ImGui::PopItemWidth();
GUI::PopItemWidth();
@@ -539,13 +539,13 @@ void CEditEffect::Describe_Entity()
GUI::Checkbox("BlurNoEmissive", &m_EffectInfo.isBlurNoEmissive);
GUI::Checkbox("BlurDissolve", &m_EffectInfo.isBlurDissolve);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f);
GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 2.f, 0, 128);
GUI::Checkbox("BlurColor", &m_EffectInfo.isBlurColor);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::ColorEdit4("BlurColor", (_float*)&m_EffectInfo.vBlurColor);
GUI::TreePop();
@@ -564,7 +564,7 @@ void CEditEffect::Describe_Entity()
{
if (GUI::TreeNode("BLOOM"))
{
if (ImGui::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END)))
if (GUI::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END)))
{
m_EffectInfo.eBloomType = static_cast<BLOOM_TYPE>(iCurrentBloomType);
}
@@ -572,9 +572,9 @@ void CEditEffect::Describe_Entity()
GUI::Checkbox("BloomDissolve", &m_EffectInfo.isBloomDissolve);
GUI::Checkbox("BloomReverseDissolve", &m_EffectInfo.isBloomReverseDissolve);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("fBloomStrength", &m_EffectInfo.fBloomStrength, 0.001f, 0.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::TreePop();
}
@@ -589,7 +589,7 @@ void CEditEffect::Describe_Entity()
if (GUI::TreeNode("EMISSIVE"))
{
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("EmissiveStrength", &m_EffectInfo.fEmissiveStrength, 0.005f, 0.f, 1.f);
GUI::DragFloat("Radius", &m_EffectInfo.fRadius, 0.005f , 0.f);
GUI::DragFloat("CoreBoost", &m_EffectInfo.fCoreBoost, 0.005f , 0.f);
@@ -597,7 +597,7 @@ void CEditEffect::Describe_Entity()
GUI::DragFloat("SoftenExp", &m_EffectInfo.fSoftenExp, 0.005f , 0.f);
GUI::DragFloat("EmissiveColorCut", &m_EffectInfo.fEmissiveColorCut, 0.005f , 0.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive);
@@ -731,7 +731,7 @@ void CEditEffect::Describe_Entity()
GUI::DragFloat("Diffuse Alpha", &m_EffectInfo.fDiffuseAlpha , 0.01f, 0.f, 1.f);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::Checkbox("DiffuseUVMove", &m_EffectInfo.isDiffuseUVMove);
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_EffectInfo.vUVCutting);
@@ -743,14 +743,14 @@ void CEditEffect::Describe_Entity()
_int iDiffuseMoveLerpOption = (_int)m_EffectInfo.iDiffuseMoveLerpOption;
if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9))
if (GUI::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9))
{
m_EffectInfo.iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
}
GUI::Spacing();
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("DIFFUSE_TEX"))
{
@@ -794,14 +794,14 @@ void CEditEffect::Describe_Entity()
GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove);
GUI::Checkbox("MaskClampSample", &m_EffectInfo.isMaskClampSample);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat2("MaskOffset", (_float*)&m_EffectInfo.vMaskOffset, 0.01f);
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f);
GUI::Spacing();
GUI::DragFloat("SoftMask", &m_EffectInfo.fSoftMask, 0.01f, 0.f);
GUI::DragFloat("fSoftMaskEdge", &m_EffectInfo.fSoftMaskEdge, 0.01f, 0.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::Spacing();
@@ -809,7 +809,7 @@ void CEditEffect::Describe_Entity()
_int iMaskMoveLerpOption = (_int)m_EffectInfo.iMaskMoveLerpOption;
if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9))
if (GUI::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9))
{
m_EffectInfo.iMaskMoveLerpOption = iMaskMoveLerpOption;
}
@@ -856,7 +856,7 @@ void CEditEffect::Describe_Entity()
GUI::Checkbox("StopDissolveSmoothStep", &m_EffectInfo.isNoDissolveSmoothStep);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::Spacing();
GUI::Checkbox("DissolveMove", &m_EffectInfo.isDissolveMove);
GUI::DragFloat2("DissolveUVGainAmount", (_float*)&m_EffectInfo.vDissolveUVGainAmount, 0.01f);
@@ -873,7 +873,7 @@ void CEditEffect::Describe_Entity()
GUI::Spacing();
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("DISSOLV_TEX"))
{
@@ -904,7 +904,7 @@ void CEditEffect::Describe_Entity()
{
if (GUI::TreeNode("DISTORTION"))
{
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("DistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
@@ -914,7 +914,7 @@ void CEditEffect::Describe_Entity()
_int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseDistortionMoveLerpOption;
if (ImGui::Combo("LerpDiffuseDistortionMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9))
if (GUI::Combo("LerpDiffuseDistortionMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9))
{
m_EffectInfo.iDiffuseDistortionMoveLerpOption = iDiffuseNoiseMoveLerpOption;
}
@@ -925,14 +925,14 @@ void CEditEffect::Describe_Entity()
_int iMaskNoiseMoveLerpOption = (_int)m_EffectInfo.iMaskDistortionMoveLerpOption;
if (ImGui::Combo("Lerp MaskDistortionMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9))
if (GUI::Combo("Lerp MaskDistortionMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9))
{
m_EffectInfo.iMaskDistortionMoveLerpOption = iMaskNoiseMoveLerpOption;
}
GUI::Spacing();
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("DISTORTION_TEX"))
{
@@ -977,11 +977,11 @@ void CEditEffect::Describe_Entity()
GUI::ColorEdit4("NoiseColor", (_float*)&m_EffectInfo.vNoiseColor);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat2("NoiseUVGainAmount", (_float*)&m_EffectInfo.vNoiseUVGainAmount, 0.01f);
GUI::DragFloat2("UVNoiseCutting", (_float*)&m_EffectInfo.vUVNoiseCutting, 0.01f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::Spacing();
@@ -989,7 +989,7 @@ void CEditEffect::Describe_Entity()
_int iNoiseMoveLerpOption = (_int)m_EffectInfo.iNoiseMoveLerpOption;
if (ImGui::Combo("Lerp NoiseMove Option", &iNoiseMoveLerpOption, pLerp, 9))
if (GUI::Combo("Lerp NoiseMove Option", &iNoiseMoveLerpOption, pLerp, 9))
{
m_EffectInfo.iNoiseMoveLerpOption = iNoiseMoveLerpOption;
}
@@ -551,7 +551,7 @@ void CEffect_Editor::Free()
void CEffect_Editor::Describe_Entity()
{
ImGui::Begin("Effect Editor");
GUI::Begin("Effect Editor");
GUI::TextColored(ImVec4(1.f, 0.f, 1.f, 1.f), m_strCurrentEffectName.c_str());
@@ -566,27 +566,27 @@ void CEffect_Editor::Describe_Entity()
GUI::Checkbox("TRAIL WAND POS", &m_isWandPos);
}
ImGui::End();
GUI::End();
ImGui::Begin("Reference Material");
GUI::Begin("Reference Material");
if (m_pEditEffect != nullptr)
m_pEditEffect->Reference_Mat_For_EditEffect();
ImGui::End();
GUI::End();
ImGui::Begin("Effect Hierarchy");
GUI::Begin("Effect Hierarchy");
#pragma region PopUp
if (ImGui::IsItemClicked(ImGuiMouseButton_Right))
ImGui::OpenPopup("Effect Hierarchy");
if (GUI::IsItemClicked(ImGuiMouseButton_Right))
GUI::OpenPopup("Effect Hierarchy");
if (ImGui::BeginPopup("Effect Hierarchy"))
if (GUI::BeginPopup("Effect Hierarchy"))
{
if (ImGui::MenuItem("Create Effect"))
if (GUI::MenuItem("Create Effect"))
{
CPartObject::PARTOBJECT_DESC PartsDesc{};
@@ -595,12 +595,12 @@ void CEffect_Editor::Describe_Entity()
if (FAILED(Add_PartObject<CEditEffect>("EffectObject" + to_string(m_iNumPart++), ENUM_CLASS(LEVEL::EFFECT), nullptr, &PartsDesc)))
{
ImGui::EndPopup();
GUI::EndPopup();
return;
}
}
if (ImGui::MenuItem("Create Trail"))
if (GUI::MenuItem("Create Trail"))
{
if (m_pTrailObject == nullptr)
@@ -612,7 +612,7 @@ void CEffect_Editor::Describe_Entity()
if (FAILED(Add_PartObject<CTrailObject>("TrailObject", ENUM_CLASS(LEVEL::EFFECT), &m_pTrailObject, &PartsDesc)))
{
ImGui::EndPopup();
GUI::EndPopup();
}
CTrailObject* pTrailObject = m_pTrailObject;
@@ -622,7 +622,7 @@ void CEffect_Editor::Describe_Entity()
}
}
ImGui::EndPopup();
GUI::EndPopup();
}
#pragma endregion
@@ -650,7 +650,7 @@ void CEffect_Editor::Describe_Entity()
if (GUI::BeginPopup(strName.c_str()))
{
if (ImGui::MenuItem("Delete Effect"))
if (GUI::MenuItem("Delete Effect"))
{
auto iter = m_PartObjects.begin();
advance(iter, iIndex); // 이터레이터를 증가시킨다
@@ -708,9 +708,9 @@ void CEffect_Editor::Describe_Entity()
ImGui::End();
GUI::End();
ImGui::Begin("Effect Save");
GUI::Begin("Effect Save");
GUI::InputTextMultiline("FILE PATH", m_szBuffer, sizeof(m_szBuffer), ImVec2(250, 25));
@@ -803,7 +803,7 @@ void CEffect_Editor::Describe_Entity()
m_pEffectPool->Describe_Entity();
ImGui::End();
GUI::End();
}
@@ -333,10 +333,10 @@ void CInstancedProp::Describe_Entity()
#endif // _DEBUG
_float3 vMove = {};
ImGui::Text("----- Transfrom ----");
ImGui::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
ImGui::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
ImGui::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
GUI::Text("----- Transfrom ----");
GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
m_pTransformCom->Move_Right(vMove.x);
m_pTransformCom->Move_Up(vMove.y);
@@ -451,25 +451,25 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
_bool isSelected = (m_SelectedKey == keyName);
if (ImGui::Selectable(keyName.c_str(), isSelected))
if (GUI::Selectable(keyName.c_str(), isSelected))
{
m_SelectedKey = keyName;
}
if (isSelected)
{
ImGui::Indent();
GUI::Indent();
ImGui::DragFloat("KeyFrame", &iter.second, 0.01f);
GUI::DragFloat("KeyFrame", &iter.second, 0.01f);
if (ImGui::Button("Delete KeyFrame"))
if (GUI::Button("Delete KeyFrame"))
{
m_KeyFrames.erase(keyName);
m_SelectedKey.clear();
break;
}
ImGui::Unindent();
GUI::Unindent();
}
}
@@ -563,8 +563,8 @@ void CLevel_ObjectViewer::Parts_Object_Setting()
}
for (auto& iter : m_KeyFrames)
{
ImDrawList* draw = ImGui::GetForegroundDrawList();
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
ImDrawList* draw = GUI::GetForegroundDrawList();
ImVec2 center = GUI::GetMainViewport()->GetCenter();
float scale = 50.f;
GUI::DragFloat(iter.first.c_str(), &iter.second);
+4 -4
View File
@@ -200,13 +200,13 @@ HRESULT CMainApp::Ready_Prototypes()
HRESULT CMainApp::Ready_IMGUI()
{
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
GUI::CreateContext();
ImGuiIO& io = GUI::GetIO(); (void)io;
ImFont* font = nullptr;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
ImGui::StyleColorsDark();
GUI::StyleColorsDark();
ImGui_ImplWin32_Init(g_hWnd);
ImGui_ImplDX11_Init(m_pDevice, m_pContext);
@@ -233,7 +233,7 @@ HRESULT CMainApp::Release_IMGUI()
{
ImGui_ImplDX11_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
GUI::DestroyContext();
return S_OK;
}
@@ -230,14 +230,14 @@ void CMapObject_Collision::Describe_Entity()
if (nullptr == m_pGameInstance)
return;
//ImGui::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str());
//GUI::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str());
GUI::Checkbox("Visible", &m_bVisible);
_float3 vMove = {};
ImGui::Text("----- Transfrom ----");
ImGui::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
ImGui::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
ImGui::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
GUI::Text("----- Transfrom ----");
GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
m_pTransformCom->Move_Right(vMove.x);
m_pTransformCom->Move_Up(vMove.y);
@@ -254,22 +254,22 @@ void CMapObject_Collision::Describe_Entity()
m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat3(&m_vPosition));
}
}
ImGui::Text("----- Rotation ----");
ImGui::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
ImGui::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f);
ImGui::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f);
GUI::Text("----- Rotation ----");
GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
GUI::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f);
GUI::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f);
ImGui::Text("----- Scale ----");
ImGui::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f);
ImGui::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f);
ImGui::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f);
GUI::Text("----- Scale ----");
GUI::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f);
GUI::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f);
GUI::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f);
m_vScale.x = max(0.01f, m_vScale.x);
m_vScale.y = max(0.01f, m_vScale.y);
m_vScale.z = max(0.01f, m_vScale.z);
if (ImGui::Button("Delete"))
if (GUI::Button("Delete"))
m_bDead = true;
if (GUI::Button("Bake_StaticPhysXMesh")) {
@@ -1954,7 +1954,7 @@ void CMapObject_Manager::Update_PrototypeList()
continue;
}
if (ImGui::Button(CMyTools::ToString(Tag).c_str()))
if (GUI::Button(CMyTools::ToString(Tag).c_str()))
{
if (ADD_TYPE::CONTAINER == m_eType)
Create_PartObject(Tag);
@@ -1974,7 +1974,7 @@ void CMapObject_Manager::Update_PrototypeList()
auto& Tag = m_ModelPrototypeTags[i];
if (_wstring::npos != Tag.find(L"COL") && _wstring::npos == Tag.find(L"Lod")) {
if (ImGui::Button(CMyTools::ToString(Tag).c_str()))
if (GUI::Button(CMyTools::ToString(Tag).c_str()))
{
vector<_uint> LodModelIndices;
@@ -2029,7 +2029,7 @@ void CMapObject_Manager::Update_ObjectList()
if (ADD_TYPE::CONTAINER == m_eType)
{
if (ImGui::CollapsingHeader("Map Objects", ImGuiTreeNodeFlags_DefaultOpen))
if (GUI::CollapsingHeader("Map Objects", ImGuiTreeNodeFlags_DefaultOpen))
{
if (false == m_MapObjects.empty())
{
@@ -2044,7 +2044,7 @@ void CMapObject_Manager::Update_ObjectList()
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
if (ImGui::Button(strSrc.c_str()))
if (GUI::Button(strSrc.c_str()))
{
m_pSelectObject = pCurrentMapObject;
}
@@ -2052,7 +2052,7 @@ void CMapObject_Manager::Update_ObjectList()
}
}
if (ImGui::CollapsingHeader("COL", ImGuiTreeNodeFlags_DefaultOpen))
if (GUI::CollapsingHeader("COL", ImGuiTreeNodeFlags_DefaultOpen))
{
for (auto pMapObject : m_Collision)
{
@@ -2065,7 +2065,7 @@ void CMapObject_Manager::Update_ObjectList()
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
if (ImGui::Button(strSrc.c_str()))
if (GUI::Button(strSrc.c_str()))
{
m_pSelectObject = pCurrentMapObject;
}
@@ -2100,7 +2100,7 @@ void CMapObject_Manager::Update_ObjectList()
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
if (ImGui::Button(strSrc.c_str()))
if (GUI::Button(strSrc.c_str()))
{
m_pSelectElemnt = pCurrentMapObject;
}
+3 -3
View File
@@ -172,11 +172,11 @@ void CMonster::Free()
void CMonster::Describe_Entity()
{
if (ImGui::TreeNode("ANIM STATE")) {
if (GUI::TreeNode("ANIM STATE")) {
for (auto& pState : m_States)
{
if (ImGui::Button(to_string(pState.first).c_str()))
if (GUI::Button(to_string(pState.first).c_str()))
{
m_pFSM->Change_State(pState.first);
}
@@ -185,7 +185,7 @@ void CMonster::Describe_Entity()
GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str());
ImGui::TreePop();
GUI::TreePop();
}
}
+16 -16
View File
@@ -534,11 +534,11 @@ void CTrailObject::Describe_Entity()
if (GUI::TreeNode("TRAIL"))
{
if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
if (GUI::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
{
m_TrailInfo.eRenderOrder = static_cast<RENDER>(iCurrentItem);
}
if (ImGui::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_POSTEX::END)))
if (GUI::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_POSTEX::END)))
{
m_TrailInfo.eShaderPass = static_cast<SHADER_PASS_POSTEX>(iCurrentPass);
}
@@ -586,10 +586,10 @@ void CTrailObject::Describe_Entity()
GUI::Checkbox("Blur", &m_TrailInfo.isBlur);
GUI::Checkbox("OnlyBlur", &m_TrailInfo.isOnlyBlur);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("BlurIntensity", &m_TrailInfo.fBlurIntensity, 0.005f, 0.f, 1.f);
GUI::DragInt("BlurWeight", &m_TrailInfo.iBlurWeight, 2.f, 0, 128);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::TreePop();
}
@@ -599,7 +599,7 @@ void CTrailObject::Describe_Entity()
{
GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vEmissive);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("EmissiveStrength", &m_TrailInfo.fEmissiveStrength, 0.01f, 0.f);
GUI::DragFloat("SoftenExp", &m_TrailInfo.fSoftenExp, 0.01f, 0.f);
@@ -607,7 +607,7 @@ void CTrailObject::Describe_Entity()
GUI::DragFloat("CoreBoost", &m_TrailInfo.fCoreBoost, 0.01f, 0.f);
GUI::DragFloat("Radius", &m_TrailInfo.fRadius, 0.01f, 0.f , 1.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
GUI::TreePop();
}
@@ -616,7 +616,7 @@ void CTrailObject::Describe_Entity()
{
if (GUI::TreeNode("BLOOM"))
{
if (ImGui::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END)))
if (GUI::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END)))
{
m_TrailInfo.eBloomType = static_cast<BLOOM_TYPE>(iCurrentBloomType);
}
@@ -624,7 +624,7 @@ void CTrailObject::Describe_Entity()
GUI::Checkbox("BloomDissolve", &m_TrailInfo.isBloomDissolve);
GUI::Checkbox("BloomReverseDissolve", &m_TrailInfo.isBloomReverseDissolve);
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("fBloomStrength", &m_TrailInfo.fBloomStrength, 0.001f, 0.f);
GUI::DragFloat2("fBloomTime", (_float*)&m_TrailInfo.vBloomTime, 0.001f, 0.f);
@@ -639,9 +639,9 @@ void CTrailObject::Describe_Entity()
{
_string strName = {};
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("Diffuse Alpha", &m_TrailInfo.fDiffuseAlpha, 0.01f, 0.f, 1.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("DIFFUSE TEX"))
{
@@ -666,10 +666,10 @@ void CTrailObject::Describe_Entity()
{
_string strName = {};
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("SoftMask", &m_TrailInfo.fSoftMask, 0.01f, 0.f);
GUI::DragFloat("fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, 0.01f, 0.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("MASK TEX"))
{
@@ -693,11 +693,11 @@ void CTrailObject::Describe_Entity()
{
_string strName = {};
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::Checkbox("NoiseColor", &m_TrailInfo.isNoiseColor);
GUI::Checkbox("NoiseAlpha", &m_TrailInfo.isNoiseAlpha);
GUI::DragFloat("NoiseStrength", &m_TrailInfo.fNoiseStrength, 0.01f, 0.f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("NOISE TEX"))
{
@@ -725,14 +725,14 @@ void CTrailObject::Describe_Entity()
_float2 vDiffuseDistortioUVAmount = {};
_float2 vMaskDistortionUVAmount = {};
ImGui::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::DragFloat("DistortionIntensity", &m_TrailInfo.fDistortionIntensity, 0.005f, 0.f, 1.f);
GUI::InputFloat("DistortionTime", &m_TrailInfo.vDistortionTime.y, 0.1f, 0.f);
GUI::DragFloat2("DiffuseDistortionUVAmount", (_float*)&m_TrailInfo.vDiffuseDistortioUVAmount, 0.1f);
GUI::DragFloat2("MaskDistortionUVAmount", (_float*)&m_TrailInfo.vMaskDistortionUVAmount, 0.1f);
ImGui::PopItemWidth();
GUI::PopItemWidth();
if (GUI::TreeNode("DISTORTION TEX"))
{
@@ -88,6 +88,7 @@ float g_fMBSampleBias;
vector g_vLightDiffuse;
vector g_vLightAmbient;
vector g_vLightSpecular;
float g_fLightSpecularMaximum;
float g_fFogDensity;
float g_fFogPow;
@@ -483,7 +484,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -569,7 +570,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -670,7 +671,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb;
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
Out.vShade = float4(vFinalDiffuse, 1.f);
Out.vSpecular = float4(vFinalSpecular, 0.f);
@@ -451,7 +451,7 @@ void CCharacter_Controller::Free()
#ifdef _DEBUG
void CCharacter_Controller::Describe_Entity()
{
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Character_Controller") ){
GUI::Text("Gravity : %d ", m_bGravity);
m_pTransform->Describe_Entity();
@@ -20,7 +20,7 @@ HRESULT CDynamic_D6Joint::Initialize_Prototype()
HRESULT CDynamic_D6Joint::Initialize(void* pArg)
{
DYNAMICJOINT_DESC* pDesc = static_cast<DYNAMICJOINT_DESC*>(pArg);
m_pJoint = m_pGameInstance->Create_PxD6Joint(pDesc->pActor0, pDesc->pActor1, *pDesc->pxJointWorldPos);
m_pJoint = m_pGameInstance->Create_BasicPxD6Joint(pDesc->pActor0, pDesc->pActor1, *pDesc->pxJointWorldPos);
return S_OK;
}
#ifdef _DEBUG
@@ -53,7 +53,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
}
#ifdef _DEBUG
#ifdef 기무리
m_pThreadHolder = CThreadHolder::Create(12);
m_pThreadHolder = CThreadHolder::Create(8);
#elif Bin
m_pThreadHolder = CThreadHolder::Create(8);
#else
@@ -409,7 +409,7 @@ void CGameInstance::Present_TimeCost() const
+ m_fTimer_PhysX
+ m_fTimer_Level;
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
GUI::Begin("Previous_Frame_Timer", 0, IMGUI_GLOBAL_BEGIN_FLAG);
if (GUI::CollapsingHeader("Detail"))
@@ -1059,9 +1059,9 @@ PSX::PxJoint* CGameInstance::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor
{
return m_pPhysX_Manager->Create_PxJoint(eType, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1);
}
PSX::PxD6Joint* CGameInstance::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos)
PSX::PxD6Joint* CGameInstance::Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos)
{
return m_pPhysX_Manager->Create_PxD6Joint(pActor0, pActor1, pxJointWorldPos);
return m_pPhysX_Manager->Create_BasicPxD6Joint(pActor0, pActor1, pxJointWorldPos);
}
_bool CGameInstance::SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer)
{
@@ -876,14 +876,14 @@ void CInstance_Model::Free()
void CInstance_Model::Describe_Entity()
{
if (ImGui::TreeNode("Model Option"))
if (GUI::TreeNode("Model Option"))
{
const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" };
ImGui::Separator(); ImGui::Spacing();
ImGui::PushItemWidth(120);
GUI::Separator(); GUI::Spacing();
GUI::PushItemWidth(120);
if (ImGui::InputInt("NumInstance", &m_InstanceDesc.iNumInstance))
if (GUI::InputInt("NumInstance", &m_InstanceDesc.iNumInstance))
{
Change_NumInstance();
}
@@ -926,57 +926,57 @@ void CInstance_Model::Describe_Entity()
if (GUI::TreeNode("Transform"))
{
if (ImGui::DragFloat3("Center", reinterpret_cast<_float*>(&m_InstanceDesc.vCenter)))
if (GUI::DragFloat3("Center", reinterpret_cast<_float*>(&m_InstanceDesc.vCenter)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("Range", reinterpret_cast<_float*>(&m_InstanceDesc.vRange)))
if (GUI::DragFloat3("Range", reinterpret_cast<_float*>(&m_InstanceDesc.vRange)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin)))
if (GUI::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("SizeMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMax)))
if (GUI::DragFloat3("SizeMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMax)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("RotationMin", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMin)))
if (GUI::DragFloat3("RotationMin", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("RotationMax", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMax)))
if (GUI::DragFloat3("RotationMax", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMax)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength)))
if (GUI::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(& m_InstanceDesc.vAzimuthAngle)))
if (GUI::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(& m_InstanceDesc.vAzimuthAngle)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle)))
if (GUI::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("WolrdOffsetMin", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMin)))
if (GUI::DragFloat3("WolrdOffsetMin", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("WolrdOffsetMax", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMax)))
if (GUI::DragFloat3("WolrdOffsetMax", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMax)))
{
Instane_Buffer_ReStruct();
}
@@ -989,34 +989,34 @@ void CInstance_Model::Describe_Entity()
{
_int iMoveLerpOption = (_int)m_InstanceDesc.fMoveLerpOption;
if (ImGui::Combo("Move Lerp Option", &iMoveLerpOption, pLerp, 9))
if (GUI::Combo("Move Lerp Option", &iMoveLerpOption, pLerp, 9))
{
Instane_Buffer_ReStruct();
m_InstanceDesc.fMoveLerpOption = (_float)iMoveLerpOption;
}
if (ImGui::DragFloat2("Speed", reinterpret_cast<_float*>(&m_InstanceDesc.vSpeed)))
if (GUI::DragFloat2("Speed", reinterpret_cast<_float*>(&m_InstanceDesc.vSpeed)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vDrag)))
if (GUI::DragFloat2("Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vDrag)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("Acceleration", reinterpret_cast<_float*>(&m_InstanceDesc.vAcceleration)))
if (GUI::DragFloat2("Acceleration", reinterpret_cast<_float*>(&m_InstanceDesc.vAcceleration)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("VelocityMin", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMin)))
if (GUI::DragFloat3("VelocityMin", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("VelocityMax", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMax)))
if (GUI::DragFloat3("VelocityMax", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMax)))
{
Instane_Buffer_ReStruct();
}
@@ -1057,12 +1057,12 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("PivotMin", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMin)))
if (GUI::DragFloat3("PivotMin", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("PivotMax", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMax)))
if (GUI::DragFloat3("PivotMax", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMax)))
{
Instane_Buffer_ReStruct();
}
@@ -1078,12 +1078,12 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("Gravity", reinterpret_cast<_float*>(&m_InstanceDesc.vGravity)))
if (GUI::DragFloat2("Gravity", reinterpret_cast<_float*>(&m_InstanceDesc.vGravity)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("DropAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vDropAttenuation)))
if (GUI::DragFloat2("DropAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vDropAttenuation)))
{
Instane_Buffer_ReStruct();
}
@@ -1097,17 +1097,17 @@ void CInstance_Model::Describe_Entity()
if (GUI::TreeNode("Rotate"))
{
if (ImGui::DragFloat2("RotationSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationSpeed)))
if (GUI::DragFloat2("RotationSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationSpeed)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("RotateAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttenuation)))
if (GUI::DragFloat2("RotateAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttenuation)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("RotateAttDelay", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttDelay)))
if (GUI::DragFloat2("RotateAttDelay", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttDelay)))
{
Instane_Buffer_ReStruct();
}
@@ -1121,12 +1121,12 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("DeltaAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMin)))
if (GUI::DragFloat3("DeltaAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("DeltaAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMax)))
if (GUI::DragFloat3("DeltaAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMax)))
{
Instane_Buffer_ReStruct();
}
@@ -1146,12 +1146,12 @@ void CInstance_Model::Describe_Entity()
if (ImGui::DragFloat3("DeltaAxisAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMin)))
if (GUI::DragFloat3("DeltaAxisAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMin)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("DeltaAxisAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMax)))
if (GUI::DragFloat3("DeltaAxisAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMax)))
{
Instane_Buffer_ReStruct();
}
@@ -1169,12 +1169,12 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("SinWaveMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMinAmount)))
if (GUI::DragFloat3("SinWaveMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMinAmount)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("SinWaveMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMaxAmount)))
if (GUI::DragFloat3("SinWaveMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMaxAmount)))
{
Instane_Buffer_ReStruct();
}
@@ -1197,19 +1197,19 @@ void CInstance_Model::Describe_Entity()
_int iSizeLerpOption = (_int)m_InstanceDesc.fSizeLerpOption;
if (ImGui::Combo("Size Lerp Option", &iSizeLerpOption, pLerp, 9))
if (GUI::Combo("Size Lerp Option", &iSizeLerpOption, pLerp, 9))
{
Instane_Buffer_ReStruct();
m_InstanceDesc.fSizeLerpOption = (_float)iSizeLerpOption;
}
if (ImGui::DragFloat3("LerpSizeAmount", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaSize)))
if (GUI::DragFloat3("LerpSizeAmount", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaSize)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("Size Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeDrag)))
if (GUI::DragFloat2("Size Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeDrag)))
{
Instane_Buffer_ReStruct();
}
@@ -1227,53 +1227,53 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat("TimeMult", reinterpret_cast<_float*>(&m_InstanceDesc.fTimeMult)))
if (GUI::DragFloat("TimeMult", reinterpret_cast<_float*>(&m_InstanceDesc.fTimeMult)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("LifeTime", reinterpret_cast<_float*>(&m_InstanceDesc.vLifeTime)))
if (GUI::DragFloat2("LifeTime", reinterpret_cast<_float*>(&m_InstanceDesc.vLifeTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("Delay", reinterpret_cast<_float*>(&m_InstanceDesc.vDelay)))
if (GUI::DragFloat2("Delay", reinterpret_cast<_float*>(&m_InstanceDesc.vDelay)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime)))
if (GUI::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime)))
if (GUI::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("DistortionUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDistortionUVMoveTime)))
if (GUI::DragFloat2("DistortionUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDistortionUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("NoiseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vNoiseUVMoveTime)))
if (GUI::DragFloat2("NoiseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vNoiseUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("DissolveUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDissolveUVMoveTime)))
if (GUI::DragFloat2("DissolveUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDissolveUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime)))
if (GUI::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex)))
if (GUI::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex)))
{
Instane_Buffer_ReStruct();
}
@@ -1302,11 +1302,11 @@ void CInstance_Model::Describe_Entity()
ImGui::PopItemWidth();
ImGui::TreePop();
GUI::PopItemWidth();
GUI::TreePop();
}
ImGui::Separator();
GUI::Separator();
}
#endif // _DEBUG
@@ -205,13 +205,13 @@ void CMouse_Manager::Free()
void CMouse_Manager::Describe_Entity()
{
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("Mouse_Manager")) {
GUI::Text("AccumulateMomentum %.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();
ImGuiIO& io = ImGui::GetIO();
ImGuiIO& io = GUI::GetIO();
GUI::Text("IMGUI MousePos: %.1f, %.1f", io.MousePos.x, io.MousePos.y);
//io.MousePos = ImVec2((float)pt.x, (float)pt.y);
GUI::Text("VPPOS: %d, %d", pt.x, pt.y);
@@ -177,7 +177,7 @@ PSX::PxJoint* CPhysX_Manager::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActo
return pOut;
}
PSX::PxD6Joint* CPhysX_Manager::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos)
PSX::PxD6Joint* CPhysX_Manager::Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos)
{
const PSX::PxTransform pxWorldParentPos = pActor0->getGlobalPose();
const PSX::PxTransform pxWorldChildPos = pActor1->getGlobalPose();
@@ -206,12 +206,11 @@ PSX::PxD6Joint* CPhysX_Manager::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, P
pJoint->setMotion(PSX::PxD6Axis::eSWING2, PSX::PxD6Motion::eLIMITED);
pJoint->setTwistLimit(PSX::PxJointAngularLimitPair(-0.35f, 0.35f)); // 20도
pJoint->setSwingLimit(PSX::PxJointLimitCone(0.10f, 0.10f)); // 40도
pJoint->setTwistLimit(PSX::PxJointAngularLimitPair(-XMConvertToRadians(1.f), XMConvertToRadians(1.f))); // 20도
pJoint->setSwingLimit(PSX::PxJointLimitCone(XMConvertToRadians(1.f), XMConvertToRadians(1.f)));
pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(50.0f, 10.0f, FLT_MAX, true));
pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(50.0f, 100.0f, FLT_MAX, true));
pJoint->setDrivePosition(PSX::PxTransform(PSX::PxIdentity)); //생성 시 프레임 기준
//pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(0.0f, 0.0f, 0.0f, false));
pJoint->setConstraintFlag(PSX::PxConstraintFlag::eVISUALIZATION, true);
pJoint->setConstraintFlag(PSX::PxConstraintFlag::eIMPROVED_SLERP, true);
@@ -584,7 +584,7 @@ void CRenderTarget_Manager::RenderTarget_Debuger()
GUI::Spacing();
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::Button("ToggleAll")) {
Toggle_RT_Debugger();
}
+11 -10
View File
@@ -248,11 +248,11 @@ void CRenderer::Render_Shadow()
m_pContext->RSSetViewports(1, &ViewPortDesc);
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_NEAR)]) {
if (nullptr != pRenderObject) {
if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR))) {
assert(false);
}
}
//if (nullptr != pRenderObject) {
// if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR))) {
// assert(false);
// }
//}
SAFE_RELEASE(pRenderObject);
}
@@ -282,11 +282,11 @@ void CRenderer::Render_Shadow()
m_pContext->RSSetViewports(1, &ViewPortDesc);
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_MIDDLE)]) {
if (nullptr != pRenderObject) {
if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE))) {
assert(false);
}
}
//if (nullptr != pRenderObject) {
// if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE))) {
// assert(false);
// }
//}
SAFE_RELEASE(pRenderObject);
}
@@ -372,6 +372,7 @@ void CRenderer::Render_LightAcc()
m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV));
m_pShader->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4));
m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float));
m_pShader->Bind_RawValue("g_fLightSpecularMaximum", &m_fLightSpecularMaximum, sizeof(_float));
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Diffuse"), m_pShader, "g_DiffuseTexture"))) {
return;
@@ -633,6 +633,9 @@ void CRenderer::Describe_Entitiy()
{
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
if (GUI::CollapsingHeader("RENDERER")) {
if (GUI::CollapsingHeader("Variable")) {
GUI::DragFloat("SpecularMaximum", &m_fLightSpecularMaximum, 0.01f, 0.0f, 2.f, "%.3f");
}
if (GUI::CollapsingHeader("PostProcessing_Bloom"))
{
GUI::BeginChild("PostProcessing_Bloom");
@@ -192,7 +192,7 @@ void CResource_Manager::Free()
void CResource_Manager::Describe_Entity()
{
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::PushItemWidth(80);
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
if (GUI::CollapsingHeader("ResourceManager")) {
static vector<pair<_wstring, _uint>> vecHit = {};
static vector<pair<_wstring, _uint>> vecMiss = {};
@@ -127,7 +127,7 @@ void CRigidBody_Dynamic::Move_LocalPos(_fvector vNewRotQ, _gvector vNewTranslati
XMStoreFloat3(&m_vLocalTranslation, vNewTranslation);
PSX::PxShape* pShape = { nullptr };
m_pRigidBody->getShapes(&pShape, m_pRigidBody->getNbShapes());
pShape->setLocalPose(PSX::PxTransform(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z, PSX::PxQuat(m_vLocalRotQ.x, m_vLocalRotQ.y, m_vLocalRotQ.z, m_vLocalRotQ.w)));
pShape->setLocalPose(PSX::PxTransform(PSX::PxVec3(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z), PSX::PxQuat(m_vLocalRotQ.x, m_vLocalRotQ.y, m_vLocalRotQ.z, m_vLocalRotQ.w)));
#ifdef _DEBUG
Add_DebugShape();
#endif // _DEBUG
@@ -359,7 +359,7 @@ HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DES
m_eLockFlag = Desc.eLockFlag;
m_PxMassCenter = Desc.pxMassCenter;
m_vDamping = Desc.vAutoDamping;
m_vLocalRotQ = Desc.vLocalRotQ;
m_vLocalRotQ = Desc.vLocalRotQ;
m_vLocalTranslation = Desc.vLocalTranslation;
return S_OK;
@@ -482,30 +482,27 @@ void CRigidBody_Dynamic::Describe_Entity()
Set_HalfGeometryInfo(m_vhalfGeometryInfo);
}
GUI::Text("Translation"); GUI::SameLine();
if (GUI::DragFloat3("##LocalPos", (_float*)&m_vLocalTranslation, 0.125f, -10.f, 10.f, "%.4f")) {
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
_float3 vLocalTranslation = m_vLocalTranslation;
if (GUI::DragFloat3("##LocalPos", (_float*)&vLocalTranslation, 0.125f, -10.f, 10.f, "%.4f")) {
Move_LocalPos(m_vLocalRotQ, vLocalTranslation);
}
_vector q = XMLoadFloat4(&m_vLocalRotQ);
// 기본 방향벡터 (엔진 기준)
_vector forward = XMVector3Rotate(XMVectorSet(0, 0, 1, 0), q);
_vector right = XMVector3Rotate(XMVectorSet(1, 0, 0, 0), q);
_vector up = XMVector3Rotate(XMVectorSet(0, 1, 0, 0), q);
// --- RPY 계산 ---
_float fYaw = atan2f(XMVectorGetX(forward), XMVectorGetZ(forward));
_float fPitch = asinf(-XMVectorGetY(forward));
_float fRoll = atan2f(XMVectorGetY(right), XMVectorGetY(up)); // 수정된 Roll 계산
_float fRoll = atan2f(XMVectorGetY(right), XMVectorGetY(up));
_float3 vRPY = { fRoll, fPitch, fYaw }; // Roll-Pitch-Yaw 순서 정렬
_float3 vRPY = { fRoll, fPitch, fYaw };
// --- GUI 편집 ---
GUI::Text("Rotation (Roll Pitch Yaw)");
GUI::SameLine();
if (GUI::DragFloat3("##LocalRotq", (_float*)&vRPY,
XMConvertToRadians(0.5f), -XM_2PI, XM_2PI, "%.5f"))
{
// XMQuaternionRotationRollPitchYaw는 (Yaw→Pitch→Roll) 순서
_vector vRotq = XMQuaternionRotationRollPitchYaw(vRPY.z, vRPY.y, vRPY.x);
XMStoreFloat4(&m_vLocalRotQ, vRotq);
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
@@ -21,6 +21,7 @@
#define ASSERT_JINHO(expression)
#define ASSERT_HYUNBIN(expression)
#define ASSERT_INHYUK(expression)
#define IMGUI_GLOBAL_ITEM_WIDTH 160
#define OPTIONAL_TRUE_KEYINPUTGUICHECK
@@ -12,6 +12,9 @@ typedef unsigned short _ushort;
typedef signed int _int;
typedef unsigned int _uint;
typedef XMUINT2 _uint2;
typedef XMUINT3 _uint3;
typedef XMUINT4 _uint4;
typedef signed long _long;
typedef unsigned long _ulong;
+1 -1
View File
@@ -219,7 +219,7 @@ class ENGINE_DLL CGameInstance final : public CBase
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody, _uint iLevel);
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody, _uint iLevel);
PSX::PxJoint* Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1);
PSX::PxD6Joint* Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos);
PSX::PxD6Joint* Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos);
_bool SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer);
_bool SphereCast(_float fRadius, _fvector vStartPos, _gvector vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer);
+184 -11
View File
@@ -326,7 +326,7 @@ class CMyTools {
return hitLeft.distance < hitRight.distance;
});
}
inline static _uint AlphabetToInt(_tchar Alphabet)
{
@@ -337,24 +337,197 @@ class CMyTools {
return (Alphabet - 'A');
}
#ifdef _DEBUG
inline static PSX::PxTransform MakeJointWorldPoseFromRouteEnd(PSX::PxRigidActor* routeRigidActor, _float3 vCapsuleHalfLengths, bool isHeadEnd)
inline static _bool DescribePxTransform(PSX::PxTransform& pxTransform, size_t iID)
{
PSX::PxVec3 vAxis = {};
_float fAngle = {};
pxTransform.q.toRadiansAndUnitAxis(fAngle, vAxis);
GUI::Text((to_string((_int)iID) + "Pos : %.2f %.2f %.2f").c_str(), pxTransform.p.x, pxTransform.p.y, pxTransform.p.z);
GUI::Text((to_string((_int)iID) + "fAngle vAxis : %.2f %.2f %.2f %.2f").c_str(), fAngle, vAxis.x, vAxis.y, vAxis.z);
if (GUI::DragFloat3((to_string((_int)iID) + " Pos").c_str(), (_float*)&pxTransform.p, 0.01f, -2.f, 2.f, "%.2f")) {
return true;
}
if (GUI::DragFloat((to_string((_int)iID) + " fAngle").c_str(), &fAngle, XMConvertToRadians(1.f), XMConvertToRadians(0.1f), 2.f * XM_2PI, "%.2f")) {
pxTransform.q = PSX::PxQuat(fAngle, vAxis);
return true;
}
return false;
}
#endif // _DEBUG
// 루트의 끝에 있는 조인트 위치를 구함
inline static PSX::PxTransform Calc_JointPosFromRoute(PSX::PxRigidActor* pRouteActor, _float3 vCapsuleHalfLengths, bool bIsHead)
{
PSX::PxShape* shapeArray[1] = {};
routeRigidActor->getShapes(shapeArray, 1);
pRouteActor->getShapes(shapeArray, 1);
PSX::PxShape* routeShape = shapeArray[0];
PSX::PxTransform pxRouteWorld = PSX::PxShapeExt::getGlobalPose(*routeShape, *pRouteActor);
PSX::PxVec3 capsuleAxisWorld = pxRouteWorld.q.rotate(PSX::PxVec3(1.f, 0.f, 0.f));
const PSX::PxTransform pxRouteWorldTransfom = PSX::PxShapeExt::getGlobalPose(*routeShape, *routeRigidActor);
PSX::PxTransform pxResult;
pxResult.q = pxRouteWorld.q;
pxResult.p = pxRouteWorld.p + (bIsHead ? 1.f : -1.f) * capsuleAxisWorld * (vCapsuleHalfLengths.y + vCapsuleHalfLengths.x);
const PSX::PxVec3 capsuleAxisWorld = pxRouteWorldTransfom.q.rotate(PSX::PxVec3(1.f, 0.f, 0.f));
PSX::PxTransform jointWorldPose;
jointWorldPose.q = pxRouteWorldTransfom.q;
jointWorldPose.p = pxRouteWorldTransfom.p + (isHeadEnd ? 1.f : -1.f) * capsuleAxisWorld * (vCapsuleHalfLengths.y + vCapsuleHalfLengths.x);
return jointWorldPose;
return pxResult;
}
static _bool Modify_D6Joint(PSX::PxD6Joint& joint, _uint iID)
{
_bool bIsModified = false;
const char* motionItems[] = { "Locked", "Limited", "Free" };
struct AxisRow { PSX::PxD6Axis::Enum axis; const char* label; };
const AxisRow axisRows[] =
{
{ PSX::PxD6Axis::eX, "X Motion" },
{ PSX::PxD6Axis::eY, "Y Motion" },
{ PSX::PxD6Axis::eZ, "Z Motion" },
{ PSX::PxD6Axis::eTWIST, "Twist Motion" },
{ PSX::PxD6Axis::eSWING1, "Swing1 Motion" },
{ PSX::PxD6Axis::eSWING2, "Swing2 Motion" },
};
for (const AxisRow& row : axisRows)
{
const PSX::PxD6Motion::Enum pxCurMotion = joint.getMotion(row.axis);
int iCurIndex = 0;
if (pxCurMotion == PSX::PxD6Motion::eLOCKED) iCurIndex = 0;
else if (pxCurMotion == PSX::PxD6Motion::eLIMITED) iCurIndex = 1;
else iCurIndex = 2; // eFREE
int iNewIndex = iCurIndex;
std::string uiId = std::string(row.label) + " ##" + std::to_string(iID);
if (GUI::Combo(uiId.c_str(), &iNewIndex, motionItems, IM_ARRAYSIZE(motionItems)) && iNewIndex != iCurIndex)
{
PSX::PxD6Motion::Enum pxNewMotion =
(iNewIndex == 0) ? PSX::PxD6Motion::eLOCKED :
(iNewIndex == 1) ? PSX::PxD6Motion::eLIMITED :
PSX::PxD6Motion::eFREE;
joint.setMotion(row.axis, pxNewMotion);
bIsModified = true;
}
}
const _bool bIsLinearLimited =
(joint.getMotion(PSX::PxD6Axis::eX) == PSX::PxD6Motion::eLIMITED) ||
(joint.getMotion(PSX::PxD6Axis::eY) == PSX::PxD6Motion::eLIMITED) ||
(joint.getMotion(PSX::PxD6Axis::eZ) == PSX::PxD6Motion::eLIMITED);
const _bool bIsSwingLimited =
(joint.getMotion(PSX::PxD6Axis::eSWING1) == PSX::PxD6Motion::eLIMITED) ||
(joint.getMotion(PSX::PxD6Axis::eSWING2) == PSX::PxD6Motion::eLIMITED);
const _bool bIsTwistLimited =
(joint.getMotion(PSX::PxD6Axis::eTWIST) == PSX::PxD6Motion::eLIMITED);
PSX::PxJointLinearLimit pxLinearLimit = joint.getLinearLimit();
_float fLinearLimit = pxLinearLimit.value;
if (GUI::DragFloat((std::string("LinearLimit ##") + std::to_string(iID)).c_str(), &fLinearLimit, 0.01f, 0.f, 10.f, "%.3f"))
bIsModified = true;
PSX::PxJointLimitCone pxSwingLimit = joint.getSwingLimit();
PSX::PxJointAngularLimitPair pxTwistLimit = joint.getTwistLimit();
_float fSwingDeg = XMConvertToDegrees(pxSwingLimit.yAngle);
_float fTwistAbsDeg = XMConvertToDegrees(PSX::PxMax(PSX::PxAbs(pxTwistLimit.lower), PSX::PxAbs(pxTwistLimit.upper)));
if (GUI::DragFloat((std::string("SwingDeg ##") + std::to_string(iID)).c_str(), &fSwingDeg, 1.f, 0.f, 180.f, "%.2f"))
bIsModified = true;
if (GUI::DragFloat((std::string("TwistAbsDeg ##") + std::to_string(iID)).c_str(), &fTwistAbsDeg, 1.f, 0.f, 180.f, "%.2f"))
bIsModified = true;
PSX::PxD6JointDrive pxSlerpDrive = joint.getDrive(PSX::PxD6Drive::eSLERP);
_bool bIsSlerpDriveEnabled = (pxSlerpDrive.stiffness > 0.f) || (pxSlerpDrive.damping > 0.f) || (pxSlerpDrive.forceLimit > 0.f);
if (GUI::Checkbox((std::string("Enable SLERP Drive ##") + std::to_string(iID)).c_str(), &bIsSlerpDriveEnabled))
bIsModified = true;
if (GUI::SliderFloat((std::string("SLERP stiffness ##") + std::to_string(iID)).c_str(), &pxSlerpDrive.stiffness, 0.f, 100.f, "%.2f"))
bIsModified = true;
GUI::SameLine();
if (GUI::SliderFloat((std::string("SLERP damping ##") + std::to_string(iID)).c_str(), &pxSlerpDrive.damping, 0.f, 100.f, "%.2f"))
bIsModified = true;
PSX::PxD6JointDrive pxLinearDriveX = joint.getDrive(PSX::PxD6Drive::eX);
_bool bIsLinearDriveEnabled = (pxLinearDriveX.stiffness > 0.f) || (pxLinearDriveX.damping > 0.f) || (pxLinearDriveX.forceLimit > 0.f);
if (GUI::Checkbox((std::string("Enable Linear Drive(XYZ) ##") + std::to_string(iID)).c_str(), &bIsLinearDriveEnabled))
bIsModified = true;
if (GUI::SliderFloat((std::string("Linear stiffness ##") + std::to_string(iID)).c_str(), &pxLinearDriveX.stiffness, 0.f, 100.f, "%.2f"))
bIsModified = true;
GUI::SameLine();
if (GUI::SliderFloat((std::string("Linear damping ##") + std::to_string(iID)).c_str(), &pxLinearDriveX.damping, 0.f, 100.f, "%.2f"))
bIsModified = true;
if (bIsModified)
{
pxLinearLimit.value = PSX::PxMax(0.f, fLinearLimit);
joint.setLinearLimit(pxLinearLimit);
const _float fSwingRad = XMConvertToRadians(fSwingDeg);
pxSwingLimit.yAngle = fSwingRad;
pxSwingLimit.zAngle = fSwingRad;
joint.setSwingLimit(pxSwingLimit);
const _float fTwistAbsRad = XMConvertToRadians(fTwistAbsDeg);
pxTwistLimit.lower = -fTwistAbsRad;
pxTwistLimit.upper = +fTwistAbsRad;
joint.setTwistLimit(pxTwistLimit);
if (!bIsSlerpDriveEnabled)
joint.setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(0.f, 0.f, 0.f, pxSlerpDrive.flags & PSX::PxD6JointDriveFlag::eACCELERATION));
else
joint.setDrive(PSX::PxD6Drive::eSLERP, pxSlerpDrive);
if (!bIsLinearDriveEnabled)
{
const PSX::PxD6JointDrive pxOff(0.f, 0.f, 0.f, pxLinearDriveX.flags & PSX::PxD6JointDriveFlag::eACCELERATION);
joint.setDrive(PSX::PxD6Drive::eX, pxOff);
joint.setDrive(PSX::PxD6Drive::eY, pxOff);
joint.setDrive(PSX::PxD6Drive::eZ, pxOff);
}
else
{
joint.setDrive(PSX::PxD6Drive::eX, pxLinearDriveX);
joint.setDrive(PSX::PxD6Drive::eY, pxLinearDriveX);
joint.setDrive(PSX::PxD6Drive::eZ, pxLinearDriveX);
}
}
return bIsModified;
}
// 힌지 월드축을 가져와서 레볼루트 조인트의 회전 쿼터니언을 구함
inline static PSX::PxQuat Calc_RevJointPosFromWorldHingeAxis(const PSX::PxVec3& pxHingeWorldAxis)
{
PSX::PxVec3 pxBasicAxis = PSX::PxVec3(0.f, 1.f, 0.f);
if (PSX::PxAbs(pxHingeWorldAxis.dot(pxBasicAxis)) > 0.99f)
{
pxBasicAxis = PSX::PxVec3(0.f, 0.f, 1.f);
}
PSX::PxVec3 zAxis = pxHingeWorldAxis.cross(pxBasicAxis).getNormalized();
PSX::PxVec3 yAxis = zAxis.cross(pxHingeWorldAxis).getNormalized();
PSX::PxMat33 pxResultMatrix(pxHingeWorldAxis, yAxis, zAxis);
return PSX::PxQuat(pxResultMatrix);
}
#pragma endregion
#pragma region FileSystem
//static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive,
@@ -1,4 +1,4 @@
// Redistribution and use in source and binary forms, with or without
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
@@ -36,7 +36,7 @@ class CPhysX_Manager final : public CBase
// https://documentation.help/nvidia-physx-sdk-guide/Joints.html
PSX::PxJoint* Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1);
PSX::PxD6Joint* Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos);
PSX::PxD6Joint* Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos);
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh, _uint iLevel);
void RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc, _uint iLevel);
@@ -134,13 +134,13 @@ class CPrototype_Manager final : public CBase
return strName;
}
if (ImGui::IsItemHovered()) {
if (GUI::IsItemHovered()) {
ImGui::BeginTooltip(); // 툴팁 창 시작
GUI::BeginTooltip(); // 툴팁 창 시작
ImGui::TextUnformatted(CMyTools::ToString(wstrComponentName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천)
GUI::TextUnformatted(CMyTools::ToString(wstrComponentName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천)
ImGui::EndTooltip(); // 툴팁 창 종료
GUI::EndTooltip(); // 툴팁 창 종료
};
if ((iIndex++ + 1) % 4 != 0)
@@ -159,9 +159,9 @@ class CPrototype_Manager final : public CBase
if(GUI::BeginCombo(pComponentName, (s_iCurrentItem >= 0 && s_iCurrentItem < pComponentNames.size())
? pComponentNames[s_iCurrentItem] : "NONE"))
{
if (ImGui::IsWindowAppearing())
if (GUI::IsWindowAppearing())
{
ImGui::SetKeyboardFocusHere();
GUI::SetKeyboardFocusHere();
filter.Clear();
}
@@ -184,7 +184,7 @@ class CPrototype_Manager final : public CBase
if (is_selected)
{
ImGui::SetItemDefaultFocus();
GUI::SetItemDefaultFocus();
}
}
+2
View File
@@ -73,6 +73,8 @@ class CRenderer final : public CBase
#pragma region TunningParameters
/* TunningParam */
// Variable
_float m_fLightSpecularMaximum = { 1.f };
// MotionBlur
_float m_fMBBlurRadius = { 28.f };