[add] CameraCoordinates
This commit is contained in:
@@ -123,7 +123,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;DirectXTKd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
|
||||
@@ -245,9 +245,6 @@
|
||||
<Filter Include="02.GameObjects\Environment\Plane">
|
||||
<UniqueIdentifier>{603938cc-e4fe-44d8-890b-784174a86161}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Player">
|
||||
<UniqueIdentifier>{11250d84-e19c-4999-a5d6-d9f89123e7ae}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
|
||||
<UniqueIdentifier>{b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -305,15 +302,6 @@
|
||||
<Filter Include="02.GameObjects\SkyBox">
|
||||
<UniqueIdentifier>{e83f88ec-c414-43b4-b437-52288cee431a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item">
|
||||
<UniqueIdentifier>{9cc88058-bda3-4ed0-9ec9-1968963fdda4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Broom">
|
||||
<UniqueIdentifier>{aac01a47-304a-4319-8bd8-fdd9020ddf18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Wand">
|
||||
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX">
|
||||
<UniqueIdentifier>{ddf8c8e6-ca51-42e0-b08f-13ae0fd9d842}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -389,6 +377,15 @@
|
||||
<Filter Include="02.GameObjects\Cameras\Camera_Gaze">
|
||||
<UniqueIdentifier>{470c4db5-b306-4fb8-8338-0a99ac77ac89}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item">
|
||||
<UniqueIdentifier>{9cc88058-bda3-4ed0-9ec9-1968963fdda4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Broom">
|
||||
<UniqueIdentifier>{aac01a47-304a-4319-8bd8-fdd9020ddf18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Wand">
|
||||
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
|
||||
@@ -66,6 +66,7 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
if (true == m_bMovable) {
|
||||
m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor;
|
||||
m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor;
|
||||
CMyTools::AdjustAccumulateDegreePitchYawDegree(m_vAccDegreeXY);
|
||||
}
|
||||
|
||||
_vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio));
|
||||
@@ -216,10 +217,11 @@ void CCamPosition_Shoulder::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Cam_Shoulder");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("fMouseSensor : %.1f", &m_fMouseSensor);
|
||||
|
||||
GUI::Text("fMouseSensor : %.1f", m_fMouseSensor);
|
||||
GUI::SliderFloat("ShoulderDistance", &m_fShoulderDistance, 0.f, 10.f, "%.1f");
|
||||
GUI::SliderFloat("BackFrontRatio", &m_fBackFrontRatio, 0.01f, 0.99f, "%.2f");
|
||||
GUI::Text("Pitch Yaw : %f %f", &m_vAccDegreeXY.x, &m_vAccDegreeXY.y);
|
||||
GUI::Text("Pitch Yaw : %f %f", m_vAccDegreeXY.x, m_vAccDegreeXY.y);
|
||||
GUI::SliderFloat3("ShoulderPosRatio", (_float*)&m_vShoulderPosRatio, -2.f, 2.f, "%.1f");
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("%d", m_iPriority);
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor());
|
||||
}
|
||||
}
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
|
||||
|
||||
@@ -70,6 +70,16 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_BasicEffect = make_unique<BasicEffect>(m_pDevice);
|
||||
m_BasicEffect->SetVertexColorEnabled(true);
|
||||
m_BasicEffect->SetView(m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW));
|
||||
m_BasicEffect->SetProjection(m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ));
|
||||
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -82,17 +92,18 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
Update_CameraCoordinateSystem();
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
Describe_Entity();
|
||||
|
||||
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
TestKeyInput(fTimeDelta);
|
||||
}
|
||||
@@ -108,8 +119,9 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CPlayer::Render()
|
||||
{
|
||||
if (!m_bVisible)
|
||||
if (!m_bVisible){
|
||||
return S_OK;
|
||||
}
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -137,11 +149,52 @@ HRESULT CPlayer::Render()
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
Render_CameraCoordinateSystem();
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Render_CameraCoordinateSystem()
|
||||
{
|
||||
m_Batch->Begin();
|
||||
|
||||
const _float fArrowLength = 2.0f;
|
||||
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vLook = { XMVectorGetX(xmvLook), XMVectorGetZ(xmvLook) };
|
||||
|
||||
|
||||
GUI::Text("W : %.2f, %.2f, %.2f", m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z);
|
||||
GUI::Text("A : %.2f, %.2f, %.2f", -m_vCameraRightDir.x, 0.f, -m_vCameraRightDir.z);
|
||||
GUI::Text("S : %.2f, %.2f, %.2f", -m_vCameraLookDir.x, 0.f, -m_vCameraLookDir.z);
|
||||
GUI::Text("D : %.2f, %.2f, %.2f", m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z);
|
||||
|
||||
GUI::Button("##0", { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), {100.f, 100.f}); GUI::SameLine();
|
||||
GUI::Button("##2", {100.f, 100.f});
|
||||
GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button("##4", { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f });
|
||||
GUI::Button("##6", {100.f, 100.f}); GUI::SameLine();
|
||||
GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button("##8", {100.f, 100.f});
|
||||
|
||||
m_Batch->DrawLine( // W
|
||||
VertexPositionColor(fArrowLength * -XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::Blue)
|
||||
);
|
||||
m_Batch->DrawLine( // D
|
||||
VertexPositionColor(fArrowLength * -XMLoadFloat3(&m_vCameraRightDir), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * XMLoadFloat3(&m_vCameraRightDir), DirectX::Colors::Red)
|
||||
);
|
||||
m_Batch->DrawLine( // PlayerLook
|
||||
VertexPositionColor(XMVectorZero(), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * xmvLook, DirectX::Colors::HotPink)
|
||||
);
|
||||
|
||||
m_Batch->End();
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Ready_Components()
|
||||
{
|
||||
CTransform::TRANSFORM_DESC Desc = {};
|
||||
@@ -245,6 +298,13 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
void CPlayer::Update_CameraCoordinateSystem()
|
||||
{
|
||||
_vector xmvCameraLook = XMVector3Normalize(XMVectorSetY(m_pGameInstance->Get_CameraLook(), 0.f));
|
||||
_vector xmvUp = XMVectorSet(0.f, 1.f, 0.f, 0.f);
|
||||
XMStoreFloat3(&m_vCameraRightDir, XMVector3Normalize(XMVector3Cross(xmvUp, xmvCameraLook)));
|
||||
XMStoreFloat3(&m_vCameraLookDir, xmvCameraLook);
|
||||
}
|
||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPlayer* pInstance = new CPlayer(pDevice, pContext);
|
||||
|
||||
@@ -17,6 +17,7 @@ class CPlayer final : public CUnit
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
void Render_CameraCoordinateSystem();
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
@@ -27,6 +28,9 @@ class CPlayer final : public CUnit
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
_float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, };
|
||||
_float3 m_vCameraRightDir = { 1.f, 0.f, 0.f };
|
||||
|
||||
|
||||
class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
@@ -42,6 +46,13 @@ class CPlayer final : public CUnit
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Ready_Parts();
|
||||
HRESULT Bind_ShaderResources();
|
||||
void Update_CameraCoordinateSystem();
|
||||
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<BasicEffect> m_BasicEffect;
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch;
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
public:
|
||||
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -66,6 +66,7 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
if (true == m_bMovable) {
|
||||
m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor;
|
||||
m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor;
|
||||
CMyTools::AdjustAccumulateDegreePitchYawDegree(m_vAccDegreeXY);
|
||||
}
|
||||
|
||||
_vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio));
|
||||
|
||||
@@ -41,7 +41,7 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("%d", m_iPriority);
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ void CDummy_PhysXMonster::Update(_float fTimeDelta)
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,11 @@ HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_vector CCamera_Manager::Get_CameraLook()
|
||||
{
|
||||
return m_pCurrentMainCamera->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
}
|
||||
|
||||
void CCamera_Manager::Force_CamPosition(_fvector vPos)
|
||||
{
|
||||
if (nullptr == m_pCurrentMainCamera)
|
||||
|
||||
@@ -173,7 +173,7 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, const LO
|
||||
_float3 vCurRootPos;
|
||||
XMStoreFloat3(&vCurRootPos, vTranslation);
|
||||
|
||||
XMMATRIX pre = XMLoadFloat4x4(&m_PreTransformMatrix);
|
||||
_matrix pre = XMLoadFloat4x4(&m_PreTransformMatrix);
|
||||
/*
|
||||
if (!m_bInitialRootPos)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, const LO
|
||||
_float dy = XMVectorGetY(vDeltaAdjusted);
|
||||
_float dz = XMVectorGetZ(vDeltaAdjusted);
|
||||
|
||||
_vector vDeltaWorld = vRight * dx + (-vUp * dz) + vLook * dy;
|
||||
_vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy);
|
||||
|
||||
vDeltaWorld *= 0.01f;
|
||||
|
||||
@@ -240,7 +240,7 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, const LO
|
||||
|
||||
|
||||
if (angle > 0 )
|
||||
pTransform->TurnAngle(XMLoadFloat4(&axis), -angle);
|
||||
pTransform->TurnAngle(XMLoadFloat4(&axis), angle);
|
||||
}
|
||||
|
||||
XMStoreFloat4(&m_vPrevRootRot, qCur);
|
||||
|
||||
@@ -23,7 +23,7 @@ HRESULT CCharacter_Controller::Render()
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
_vector vColor = DirectX::Colors::GhostWhite;
|
||||
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
@@ -160,14 +160,13 @@ void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
|
||||
if (true == m_bGravity) {
|
||||
m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
}
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum());
|
||||
|
||||
m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles);
|
||||
|
||||
//PSX::PxUserControllerHitReport* pHitCallBack = { nullptr };
|
||||
//PSX::PxControllerShapeHit ShapeHit = {};
|
||||
//ShapeHit.
|
||||
//pHitCallBack->onShapeHit();
|
||||
}
|
||||
|
||||
void CCharacter_Controller::Set_Position(_fvector vNewPos)
|
||||
|
||||
@@ -572,6 +572,10 @@ HRESULT CGameInstance::IsBinded_Camera(const _wstring& strCameraKey)
|
||||
{
|
||||
return m_pCamera_Manager->IsBinded_Camera(strCameraKey);
|
||||
}
|
||||
_vector CGameInstance::Get_CameraLook()
|
||||
{
|
||||
return m_pCamera_Manager->Get_CameraLook();
|
||||
}
|
||||
const _float* CGameInstance::Get_CurrentCameraFar()
|
||||
{
|
||||
return m_pCamera_Manager->Get_CurrentCameraFar();
|
||||
|
||||
@@ -16,6 +16,7 @@ class CCamera_Manager final : public CBase
|
||||
HRESULT Add_Camera(_uint iLevel, CCamera* pCamera, const _wstring& wstrCameraKey);
|
||||
HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority);
|
||||
HRESULT IsBinded_Camera(const _wstring& wstrCameraKey);
|
||||
_vector Get_CameraLook();
|
||||
|
||||
|
||||
void Force_CamPosition(_fvector vPos);
|
||||
|
||||
@@ -61,6 +61,8 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
_float3 Get_Volume();
|
||||
|
||||
HRESULT ConvertToDO(class CRigidBody_Dynamic& BodyOriginal);
|
||||
_bool IsGravity() { return m_bGravity; }
|
||||
void SetGravity(_bool bCondition) { m_bGravity = bCondition; };
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
@@ -74,6 +76,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
|
||||
PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};
|
||||
_bool m_bActive = { true };
|
||||
_bool m_bGravity = { true };
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
|
||||
@@ -168,6 +168,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
HRESULT Add_Camera(_uint iLevel, class CCamera* pCamera, const _wstring& strCameraKey);
|
||||
HRESULT Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority);
|
||||
HRESULT IsBinded_Camera(const _wstring& strCameraKey);
|
||||
_vector Get_CameraLook();
|
||||
const _float* Get_CurrentCameraFar();
|
||||
void Force_CamPosition(_fvector vPos);
|
||||
#pragma endregion
|
||||
|
||||
@@ -191,16 +191,65 @@ class CMyTools {
|
||||
fSrcRadian += (fRotateSpeed * XM_PI) / 180.f;
|
||||
}
|
||||
}
|
||||
|
||||
inline static _float Get_Direction2D(_float2 fOrigianlDir, _float2 fInputDir) {
|
||||
_vector vOriginal = XMVector2Normalize(XMLoadFloat2(&fOrigianlDir));
|
||||
_vector vInput = XMVector2Normalize(XMLoadFloat2(&fInputDir));
|
||||
|
||||
// 2D 평면에 사상된 방향을 교정해서 리턴
|
||||
// float -> Radian값
|
||||
// -, +
|
||||
inline static _float Get_Direction2D(_float2 vOrigianlDir, _float2 vInputDir) {
|
||||
_vector vOriginal = XMVector2Normalize(XMLoadFloat2(&vOrigianlDir));
|
||||
_vector vInput = XMVector2Normalize(XMLoadFloat2(&vInputDir));
|
||||
|
||||
_float fDiffAngle = XMVectorGetX(XMVector2AngleBetweenNormals(vOriginal, vInput));
|
||||
_float fCross = XMVectorGetZ(XMVector2Cross(vOriginal, vInput));
|
||||
|
||||
return fDiffAngle * (fCross < 0 ? -1.f : 1.f);
|
||||
}
|
||||
// yaw 360도 자동 커트
|
||||
// pitch 80도 클램프
|
||||
inline static void AdjustAccumulateDegreePitchYawDegree(_float2& vAccumulateDegreePitchYaw, float fPitchLimitDegree = 80.f)
|
||||
{
|
||||
if (vAccumulateDegreePitchYaw.y > 360.f)
|
||||
{
|
||||
vAccumulateDegreePitchYaw.y -= 360.f;
|
||||
}
|
||||
else if (vAccumulateDegreePitchYaw.y < -360.f)
|
||||
{
|
||||
vAccumulateDegreePitchYaw.y += 360.f;
|
||||
}
|
||||
|
||||
if (vAccumulateDegreePitchYaw.x > fPitchLimitDegree)
|
||||
{
|
||||
vAccumulateDegreePitchYaw.x = fPitchLimitDegree;
|
||||
}
|
||||
else if (vAccumulateDegreePitchYaw.x < -fPitchLimitDegree)
|
||||
{
|
||||
vAccumulateDegreePitchYaw.x = -fPitchLimitDegree;
|
||||
}
|
||||
}
|
||||
|
||||
// yaw 360도 자동 커트
|
||||
// pitch 80도 클램프
|
||||
inline void AdjustAccumulateDegreePitchYawRadian(_float2& vAccumulateRadianPitchYaw, float fPitchLimitRadian = XMConvertToRadians(80.f))
|
||||
{
|
||||
if (vAccumulateRadianPitchYaw.y > XM_PI)
|
||||
{
|
||||
vAccumulateRadianPitchYaw.y -= XM_PI;
|
||||
}
|
||||
else if (vAccumulateRadianPitchYaw.y < -XM_PI)
|
||||
{
|
||||
vAccumulateRadianPitchYaw.y += XM_PI;
|
||||
}
|
||||
|
||||
if (vAccumulateRadianPitchYaw.x > fPitchLimitRadian)
|
||||
{
|
||||
vAccumulateRadianPitchYaw.x = fPitchLimitRadian;
|
||||
}
|
||||
else if (vAccumulateRadianPitchYaw.x < -fPitchLimitRadian)
|
||||
{
|
||||
vAccumulateRadianPitchYaw.x = -fPitchLimitRadian;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma region FileSystem
|
||||
//static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive,
|
||||
|
||||
@@ -53,3 +53,5 @@ xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mt.lib .\EngineSDK\Lib
|
||||
|
||||
xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Debug\
|
||||
xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Release\
|
||||
|
||||
xcopy /y .\Engine\ThirdPartyLib\DirectXTK\DirectXTKd.lib .\EngineSDK\Lib\Debug\
|
||||
|
||||
Reference in New Issue
Block a user