@@ -525,7 +525,6 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv);
|
||||
Color = tex1;
|
||||
|
||||
float2 reversuv = In.vTexcoord;
|
||||
|
||||
reversuv.x = 1.0f - Finaluv;
|
||||
@@ -537,7 +536,9 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
tex2.rgb *= float3(112.f, 241.f, 31.f) / 255.f;
|
||||
float3 Green = float3(112.f, 241.f, 31.f) / 255.f;
|
||||
Green *= 1.2f;
|
||||
tex2.rgb *= Green;
|
||||
|
||||
if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f)))
|
||||
Color = tex2;
|
||||
|
||||
@@ -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>
|
||||
@@ -233,6 +233,7 @@
|
||||
<ClCompile Include="..\Private\EffectObject.cpp" />
|
||||
<ClCompile Include="..\Private\Effect_Container.cpp" />
|
||||
<ClCompile Include="..\Private\NomalJap.cpp" />
|
||||
<ClCompile Include="..\Private\Player_States.cpp" />
|
||||
<ClCompile Include="..\Private\SkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\InfoInstance.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Field.cpp" />
|
||||
|
||||
@@ -73,9 +73,6 @@
|
||||
<ClInclude Include="..\Public\CamPosition.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Cameras</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\SkyBox.h">
|
||||
<Filter>02.GameObjects\SkyBox</Filter>
|
||||
</ClInclude>
|
||||
@@ -157,6 +154,9 @@
|
||||
<ClInclude Include="..\Public\CamPosition_Shoulder.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -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>
|
||||
@@ -386,6 +374,21 @@
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition\Socket">
|
||||
<UniqueIdentifier>{2e4f0394-e25c-4508-937a-7e73d005ae5f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\Camera_Gaze">
|
||||
<UniqueIdentifier>{470c4db5-b306-4fb8-8338-0a99ac77ac89}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effects\Decendo">
|
||||
<UniqueIdentifier>{3572e19c-c7cc-4c7a-add0-2012b81b3935}</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">
|
||||
@@ -445,9 +448,6 @@
|
||||
<ClCompile Include="..\Private\CamPosition.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Cameras</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\SkyBox.cpp">
|
||||
<Filter>02.GameObjects\SkyBox</Filter>
|
||||
</ClCompile>
|
||||
@@ -529,6 +529,12 @@
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player_States.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -60,9 +60,13 @@ HRESULT CCamPosition_Shoulder::Initialize(void* pArg)
|
||||
|
||||
void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
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));
|
||||
@@ -84,6 +88,12 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_O)) {
|
||||
m_pBinded_Camera->Toggle_Priority();
|
||||
}
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
Describe_Entity();
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
@@ -101,6 +111,9 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Shoulder::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bLerp) {
|
||||
m_vLerpTimer.x += fTimeDelta;
|
||||
XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTimer.x / m_vLerpTimer.y));
|
||||
@@ -152,7 +165,7 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
CameraDesc.pFollowTarget = m_pTarget_FollowPart;
|
||||
CameraDesc.pLookTarget = m_pTarget_LookPart;
|
||||
CameraDesc.iPriority = 51;
|
||||
CameraDesc.pCameraKey = TEXT("CAM_SHOULDER");
|
||||
CameraDesc.pCameraKey = CAMERA_SHOULDER;
|
||||
CameraDesc.bEnableTransitionLerp = true;
|
||||
CameraDesc.bEnableFollowLerp = true;
|
||||
CameraDesc.bEnableLookLerp = true;
|
||||
@@ -164,7 +177,7 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, m_pBinded_Camera, TEXT("CAM_SHOULDER"));
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, m_pBinded_Camera, CAMERA_SHOULDER);
|
||||
|
||||
|
||||
return S_OK;
|
||||
@@ -204,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();
|
||||
}
|
||||
|
||||
@@ -14,19 +14,22 @@ CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs)
|
||||
|
||||
void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false);
|
||||
}
|
||||
|
||||
void CCamera_Debug::Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
_float3 vCamPos = {};
|
||||
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) {
|
||||
m_pGameInstance->Toggle_MouseCenter();
|
||||
}
|
||||
if (m_bMovable) {
|
||||
@@ -69,6 +72,9 @@ void CCamera_Debug::Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Debug::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Render()
|
||||
@@ -98,8 +104,6 @@ HRESULT CCamera_Debug::Initialize(void* pArg)
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -134,7 +138,7 @@ CCamera_Debug* CCamera_Debug::Create(ID3D11Device* pDevice, ID3D11DeviceContext*
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CCamera_Debug* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
CGameObject* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
|
||||
@@ -13,6 +13,9 @@ CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs)
|
||||
|
||||
void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (false == m_bIsCurrentTransition) {
|
||||
if (m_bEnable_FollowLerp) {
|
||||
_vector vNewPos = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vFollowPos_Src), XMLoadFloat3(&m_vFollowPos_Dest), m_vFollowLerpTime.x / m_vFollowLerpTime.y), 1.f);
|
||||
@@ -28,6 +31,9 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
else {
|
||||
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
m_bActive = true;
|
||||
__super::Bind_Matrices();
|
||||
@@ -35,6 +41,11 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
Update_LerpTimer(fTimeDelta);
|
||||
|
||||
Describe_Entity();
|
||||
@@ -42,6 +53,9 @@ void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
m_vLookLerpTime.x += fTimeDelta;
|
||||
if (m_vLookLerpTime.y <= m_vLookLerpTime.x) {
|
||||
@@ -77,8 +91,22 @@ void CCamera_Gaze::Enable_LookLerp()
|
||||
XMStoreFloat3(&m_vLookPos_Src, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Toggle_Priority()
|
||||
{
|
||||
if (m_iPriority == 99) {
|
||||
m_iPriority = 51;
|
||||
}
|
||||
else {
|
||||
m_iPriority = 99;
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, false);
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
HRESULT CCamera_Gaze::Render()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ HRESULT CEffectParts::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ HRESULT CLevel_Field::Initialize()
|
||||
|
||||
void CLevel_Field::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -31,22 +31,13 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Layer_UI(LAYER_UI))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_Effect(LAYER_EFFECT))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Camera())) {
|
||||
if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -58,7 +49,7 @@ HRESULT CLevel_GamePlay::Initialize()
|
||||
|
||||
void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_ADD))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
@@ -108,7 +99,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 99;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
@@ -116,10 +107,13 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) {
|
||||
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -134,11 +128,6 @@ HRESULT CLevel_GamePlay::Ready_Markers()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Effect(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
@@ -152,8 +141,9 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CSkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CSkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_SKYBOX))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 0.f, 0.f };
|
||||
|
||||
@@ -23,7 +23,7 @@ HRESULT CLevel_Logo::Initialize()
|
||||
|
||||
void CLevel_Logo::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ HRESULT CLevel_Restart::Initialize()
|
||||
|
||||
void CLevel_Restart::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_0))
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "Bombard.h"
|
||||
#include "TrailObject.h"
|
||||
#include "Instance_Model.h"
|
||||
#include "Trail.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -217,6 +218,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_POSTEX,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl"),
|
||||
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
@@ -268,7 +275,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"),
|
||||
@@ -287,6 +294,9 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTrail>(g_iStaticLevel, CTrail::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CEffectParts>(g_iStaticLevel, CEffectParts::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
@@ -40,15 +39,17 @@ HRESULT CPlayer::Initialize_Prototype()
|
||||
|
||||
HRESULT CPlayer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
if (FAILED(Ready_Components())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(Ready_Parts()))
|
||||
if (FAILED(Ready_Parts())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Load_KeyFrame();
|
||||
|
||||
@@ -56,6 +57,8 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Set_Anim();
|
||||
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
@@ -67,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;
|
||||
}
|
||||
|
||||
@@ -79,24 +92,24 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
IsSprint();
|
||||
IsWalk();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void CPlayer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
@@ -106,6 +119,9 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CPlayer::Render()
|
||||
{
|
||||
if (!m_bVisible){
|
||||
return S_OK;
|
||||
}
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -133,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 = {};
|
||||
@@ -154,13 +211,15 @@ HRESULT CPlayer::Ready_Components()
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
@@ -206,48 +265,6 @@ HRESULT CPlayer::Ready_Parts()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//{
|
||||
// CCamPosition_Socket::CAMERAPOSITION_PLAYER_DESC Desc{};
|
||||
|
||||
// Desc.pParentTransform = m_pTransformCom;
|
||||
|
||||
// if (FAILED(Add_PartObject<CCamPosition_Socket>("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc)))
|
||||
// {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// CCamPosition_Arm::CameraArm_DESC CameraArmDesc{};
|
||||
// XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
// CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
// CameraArmDesc.fEye = { 0.f, 10.f, 10.f };
|
||||
// CameraArmDesc.fMouseSensor = 0.4f;
|
||||
// CameraArmDesc.fDistance = 4.f;
|
||||
// CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
// if (FAILED(Add_PartObject<CCamPosition_Arm>("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{};
|
||||
// CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
// CameraDesc.fNear = 0.1f;
|
||||
// CameraDesc.fFar = 300.f;
|
||||
// CameraDesc.fSpeedPerSec = 5.f;
|
||||
// CameraDesc.fRotationPerSec = XMConvertToRadians(90.f);
|
||||
// CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart;
|
||||
// CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart;
|
||||
// CameraDesc.iPriority = 51;
|
||||
|
||||
// CCamera_Gaze* pCamera = { nullptr };
|
||||
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera)))
|
||||
// {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW"));
|
||||
//}
|
||||
|
||||
{
|
||||
CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc;
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
@@ -276,430 +293,18 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
HRESULT CPlayer::InputSystem()
|
||||
void CPlayer::Update_CameraCoordinateSystem()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
|| m_pGameInstance->Key_Down(DIK_5)
|
||||
|| m_pGameInstance->Key_Down(DIK_6))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
_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);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSkill()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_1)
|
||||
//|| m_pGameInstance->Key_Down(DIK_C)
|
||||
//|| m_pGameInstance->Key_Down(DIK_V)
|
||||
//|| m_pGameInstance->Key_Down(DIK_T)
|
||||
//|| m_pGameInstance->Key_Down(DIK_G)
|
||||
//|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::spr]
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Move
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else {
|
||||
// ?
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) {
|
||||
// OtherMove -> AnotherMove
|
||||
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) {
|
||||
// Combat -> Move
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
//else if (true == bLeft){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
//}
|
||||
//else if (true == bRight){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)){
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Jump
|
||||
// pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
m_Animation[STATEANIM::CAST] = { 696,false };
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
}
|
||||
#pragma endregion STATE
|
||||
|
||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPlayer* pInstance = new CPlayer(pDevice, pContext);
|
||||
@@ -764,30 +369,18 @@ void CPlayer::Describe_Entity()
|
||||
GUI::DragFloat3("Pos", Pos3);
|
||||
|
||||
|
||||
_float RotR,RotU,RotL;
|
||||
_float RotR, RotU, RotL;
|
||||
RotR = XMVectorGetX(m_pTransformCom->Get_State(STATE::RIGHT));
|
||||
RotU = XMVectorGetY(m_pTransformCom->Get_State(STATE::UP));
|
||||
RotL = XMVectorGetZ(m_pTransformCom->Get_State(STATE::LOOK));
|
||||
|
||||
float Rot3[3] = { RotR, RotU,RotL };
|
||||
GUI::DragFloat3("Rot", Rot3);
|
||||
|
||||
}
|
||||
|
||||
_bool CPlayer::IsSprint()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LSHIFT))
|
||||
{
|
||||
return m_bSprintToggle = !m_bSprintToggle;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
_bool CPlayer::IsWalk()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_C))
|
||||
{
|
||||
return m_bWalkToggle = !m_bWalkToggle;
|
||||
}
|
||||
return false;
|
||||
string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex());
|
||||
GUI::Text(AnimList.c_str());
|
||||
|
||||
GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,648 @@
|
||||
#include "pch.h"
|
||||
#include "Player.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Bombard.h"
|
||||
|
||||
#pragma region States
|
||||
void CPlayer::TestKeyInput(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F1))
|
||||
{
|
||||
m_eSpell = STATEANIM::ACCIO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F2))
|
||||
{
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3))
|
||||
{
|
||||
m_eSpell = STATEANIM::DEPULSO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F4))
|
||||
{
|
||||
m_eSpell = STATEANIM::DIFFINDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F5))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_ENTER;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F6))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_EXIT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputAction()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSpell()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)) {
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
}
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) {
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
if (m_bSprintToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_C)) {
|
||||
m_bWalkToggle = !m_bWalkToggle;
|
||||
m_bSprintToggle = false;
|
||||
if (m_bWalkToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::WALK | FSMSTATE::JOG | FSMSTATE::SPRINT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
m_pFSM->Enable_State(FSMSTATE::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::DEPULSO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DEPULSO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DIFFINDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DIFFINDO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_ENTER:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_EXIT:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_EXIT];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
default:
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_R))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.1f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell()))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::SPELL].first <= iIndex && m_Animation[STATEANIM::SPELL].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.15f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat"))
|
||||
{
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::ACCIO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
|
||||
break;
|
||||
case STATEANIM::DESCENDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_eSpell = STATEANIM::END;
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::SPELL] = { 696,false };
|
||||
m_Animation[STATEANIM::MAPHELP] = { 122,false };
|
||||
m_Animation[STATEANIM::ACCIO] = { 417,false };
|
||||
m_Animation[STATEANIM::DESCENDO] = { 418,false };
|
||||
m_Animation[STATEANIM::DEPULSO] = { 782,false };
|
||||
m_Animation[STATEANIM::DIFFINDO] = { 786,false };
|
||||
m_Animation[STATEANIM::LUMOS] = { 782,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
@@ -39,7 +39,7 @@ void CSkyBox::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CSkyBox::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object<CCamera_Gaze>()->Get_WorldPostion());
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_CamXMPosition());
|
||||
}
|
||||
|
||||
void CSkyBox::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -38,26 +38,82 @@ void CTrailObject::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTrailObject::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
|
||||
m_CombinedMat = m_pParentTransformCom->Get_XMWorldMatrix();
|
||||
|
||||
m_CombinedMat.r[3] += m_vOffset;
|
||||
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_CombinedMat);
|
||||
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.y == 0)
|
||||
return;
|
||||
|
||||
m_TrailInfo.vDistortionTime.x += fTimeDelta;
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.x > m_TrailInfo.vDistortionTime.y)
|
||||
{
|
||||
m_TrailInfo.vDistortionTime.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CTrailObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_TrailInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isOnlyBlur == true)
|
||||
return;
|
||||
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTrail::TRAIL_DESC pTrailDesc;
|
||||
|
||||
pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f);
|
||||
pTrailDesc.vLow = _float3(0.f, -1.f, 0.f);
|
||||
|
||||
if (FAILED(Add_Component<CTrail>(g_iStaticLevel, &m_pTrailCom, &pTrailDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
{
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
@@ -78,11 +134,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -99,13 +150,9 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailDiffuseName = szName;
|
||||
|
||||
m_isDiffuse = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -122,8 +169,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailNoiseName = szName;
|
||||
|
||||
m_isNoise = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
@@ -141,47 +186,45 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
m_isMask = true;
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailDistortionName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDistortionName),
|
||||
reinterpret_cast<CComponent**>(&m_pDistortion_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_pTrailCom->Load_Trail(hFile);
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTrail::TRAIL_DESC pTrailDesc;
|
||||
|
||||
pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f);
|
||||
pTrailDesc.vLow = _float3(0.f, -1.f, 0.f);
|
||||
|
||||
if (FAILED(Add_Component<CTrail>(ENUM_CLASS(LEVEL::STATIC), &m_pTrailCom, &pTrailDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -199,6 +242,27 @@ HRESULT CTrailObject::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Render_Blur()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_TrailInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_TrailInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTrailCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -241,37 +305,132 @@ void CTrailObject::Free()
|
||||
|
||||
void CTrailObject::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("VALUE");
|
||||
|
||||
_float4 vValue = {};
|
||||
|
||||
XMStoreFloat4(&vValue, m_vOffset);
|
||||
|
||||
if(GUI::InputFloat4("OFFSET", (_float*)&vValue))
|
||||
{
|
||||
m_vOffset = XMLoadFloat4(&vValue);
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(m_pTrailCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_TrailInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_TrailInfo.fDiffuseAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_TrailInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_TrailInfo.isMask, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_TrailInfo.fSoftMask, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_TrailInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_TrailInfo.isNoiseColor, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_TrailInfo.isNoiseAlpha, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseStrength", &m_TrailInfo.fNoiseStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 디스토션 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_TrailInfo.isDistortion, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDistortionTime", &m_TrailInfo.vDistortionTime, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_TrailInfo.vDiffuseDistortioUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDistortionIntensity", &m_TrailInfo.fDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_TrailInfo.vMaskDistortionUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_TrailInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_TrailInfo.fEmissiveStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_TrailInfo.fSoftenExp, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_TrailInfo.fSoftStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_TrailInfo.fCoreBoost, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_TrailInfo.fRadius, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
@@ -293,5 +452,12 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Wand.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject(pDevice, pContext)
|
||||
@@ -30,6 +31,21 @@ HRESULT CWand::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTrailObject>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this , &pTrail))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(pTrail->Load_Trail("../Bin/Resources/Data/Effect/Decendo/Proj_Trail" , static_cast<LEVEL>(NEXT_LEVEL))))
|
||||
return E_FAIL;
|
||||
|
||||
pTrail->Set_Target(m_pModelCom->Get_BoneMatrixPtr("root" ), XMVectorSet(0.f, 1.f, 0.f , 0.f));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ class CCamera_Debug final : public CCamera
|
||||
_float3 vEye{}, vAt{};
|
||||
_float fMouseSensor{};
|
||||
}CAMERA_DEBUG_DESC;
|
||||
|
||||
private:
|
||||
CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamera_Debug(const CCamera_Debug& rhs);
|
||||
@@ -39,7 +38,7 @@ class CCamera_Debug final : public CCamera
|
||||
|
||||
public:
|
||||
static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamera_Debug* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ class CCamera_Gaze final : public CCamera
|
||||
void Update_LerpTimer(Engine::_float fTimeDelta);
|
||||
void Enable_FollowLerp();
|
||||
void Enable_LookLerp();
|
||||
void Toggle_Priority();
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Client
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END };
|
||||
enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END };
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Client {
|
||||
#pragma region OBJECT
|
||||
|
||||
#define CAMERA_DEBUG TEXT("CAMERA_DEBUG")
|
||||
#define CAMERA_SHOULDER TEXT("CAMERA_SHOULDER")
|
||||
#pragma endregion
|
||||
#pragma region COMPONENT
|
||||
|
||||
@@ -38,6 +39,7 @@ namespace Client {
|
||||
#define LAYER_FLOOR TEXT("Layer_Floor")
|
||||
#define LAYER_WALL TEXT("Layer_Wall")
|
||||
#define LAYER_CUBE TEXT("Layer_Cube")
|
||||
#define LAYER_SKYBOX TEXT("Layer_SkyBox")
|
||||
#define LAYER_EDITOR_CAMERA TEXT("Layer_Editor_Camera")
|
||||
#define LAYER_BACKGROUND TEXT("Layer_BackGround")
|
||||
#define LAYER_MARKER TEXT("Layer_Marker")
|
||||
|
||||
@@ -73,14 +73,16 @@ class CEffectObject abstract : public CPartObject
|
||||
_bool isNoiseAlpha = { false };
|
||||
_bool isNomalDissolve = {};
|
||||
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
_bool isEmissiveDissolveReverse = { false };
|
||||
_bool isOnlyBlur = { false };
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ class CLevel_GamePlay final : public CLevel
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Camera();
|
||||
HRESULT Ready_Layer_Sound();
|
||||
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Player(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag);
|
||||
|
||||
|
||||
@@ -7,36 +7,29 @@ NS_BEGIN(Client)
|
||||
|
||||
class CPlayer final : public CUnit
|
||||
{
|
||||
public:
|
||||
struct InputCondition
|
||||
{
|
||||
FSMSTATE::ESTATE state;
|
||||
function<_bool()> checker;
|
||||
};
|
||||
|
||||
private:
|
||||
CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CPlayer(const CPlayer& Prototype);
|
||||
virtual ~CPlayer() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
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:
|
||||
unordered_map<size_t, CState*> m_States = { };
|
||||
size_t m_iStateMask = { 0 };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
vector<InputCondition> m_InputConditions;
|
||||
_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 };
|
||||
class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr };
|
||||
@@ -46,9 +39,18 @@ class CPlayer final : public CUnit
|
||||
class CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
class CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
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);
|
||||
@@ -57,15 +59,19 @@ class CPlayer final : public CUnit
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
private:
|
||||
void TestKeyInput(_float fTimeDelta);
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
_bool IsSprint();
|
||||
_bool IsWalk();
|
||||
|
||||
HRESULT InputSystem();
|
||||
HRESULT InputSkill();
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
HRESULT InputSpell();
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
@@ -87,17 +93,11 @@ class CPlayer final : public CUnit
|
||||
HRESULT Behavior_DodgeExitCheck();
|
||||
void Behavior_DodgeExit();
|
||||
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
void Behavior_CombatEnter();
|
||||
HRESULT Behavior_CombatExitCheck();
|
||||
void Behavior_CombatExit();
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -13,6 +13,50 @@ NS_BEGIN(Client)
|
||||
|
||||
class CTrailObject final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagTrailInfo
|
||||
{
|
||||
EFFECT_TYPE eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
/* 디퓨즈 */
|
||||
_bool isDiffuse = {};
|
||||
_float fDiffuseAlpha = { 1.f };
|
||||
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
/* 마스크 */
|
||||
_bool isMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
/* 노이즈 */
|
||||
_bool isNoise = {};
|
||||
_bool isNoiseColor = { false };
|
||||
_bool isNoiseAlpha = { false };
|
||||
_float fNoiseStrength = {};
|
||||
|
||||
/* 디스 토션 */
|
||||
_bool isDistortion = {};
|
||||
_float2 vDistortionTime = {};
|
||||
_float2 vDiffuseDistortioUVAmount = {};
|
||||
_float2 vMaskDistortionUVAmount = {};
|
||||
_float fDistortionIntensity = {};
|
||||
|
||||
/* 이미시브 */
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
|
||||
_float fEmissiveStrength = { 0.f };
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
|
||||
/* 블러 */
|
||||
_bool isBlur = {};
|
||||
_bool isOnlyBlur = { false };
|
||||
_float fBlurIntensity = {};
|
||||
_int iBlurWeight = {};
|
||||
|
||||
}TRAIL_INFO;
|
||||
private:
|
||||
CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTrailObject(const CTrailObject& rhs);
|
||||
@@ -25,12 +69,23 @@ class CTrailObject final : public CPartObject
|
||||
|
||||
public:
|
||||
HRESULT Load_Trail(const _char* pPath, LEVEL eLevel);
|
||||
void Set_Target(const _float4x4* pMatrix , _fvector v0ffset) {
|
||||
|
||||
if (pMatrix != nullptr)
|
||||
{
|
||||
m_pParantsMatrix = pMatrix;
|
||||
m_vOffset = v0ffset;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Blur() override;
|
||||
|
||||
|
||||
public:
|
||||
static CTrailObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -42,6 +97,7 @@ class CTrailObject final : public CPartObject
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pNoise_TextureCom = { nullptr };
|
||||
CTexture* m_pMasking_TextureCom = { nullptr };
|
||||
CTexture* m_pDistortion_TextureCom = { nullptr };
|
||||
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CTrail* m_pTrailCom = { nullptr };
|
||||
@@ -49,15 +105,16 @@ class CTrailObject final : public CPartObject
|
||||
_string m_strTrailDiffuseName = {};
|
||||
_string m_strTrailNoiseName = {};
|
||||
_string m_strTrailMaskingName = {};
|
||||
_string m_strTrailDistortionName = {};
|
||||
|
||||
_string m_strPath = {};
|
||||
_string m_strName = {};
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isNoise = {};
|
||||
_bool m_isMask = {};
|
||||
TRAIL_INFO m_TrailInfo = {};
|
||||
|
||||
EFFECT_TYPE m_eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
const _float4x4* m_pParantsMatrix = {};
|
||||
_vector m_vOffset = {};
|
||||
_matrix m_CombinedMat = {};
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -26,11 +26,11 @@ class CWand final : public CPartObject
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
class CTrailObject* pTrail = { nullptr };
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
@@ -264,5 +264,45 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle)
|
||||
|
||||
}
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0, 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -556,4 +556,14 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
|
||||
pass RefitPass // 6
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
@@ -66,6 +67,7 @@ int g_iNoiseMoveLerpOption;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
|
||||
|
||||
int g_iMaskDistortionMoveLerpOption;
|
||||
int g_iDiffuseDistortionMoveLerpOption;
|
||||
//
|
||||
@@ -116,46 +118,7 @@ bool g_isNomalDissolve;
|
||||
|
||||
float g_fFar;
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0 , 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -358,7 +321,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
vMtrlDiffuse = saturate(g_vColor + vMtrlDiffuse);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -382,7 +345,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb;
|
||||
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
@@ -403,7 +367,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
if (g_isMaskUVMove)
|
||||
@@ -415,7 +378,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -431,13 +394,12 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlMask.r = 1.f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
if (g_isNomalDissolve)
|
||||
@@ -484,8 +446,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
@@ -506,15 +466,18 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0.05f)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
@@ -684,7 +647,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -693,9 +656,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -703,6 +664,9 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
@@ -764,6 +728,16 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -790,7 +764,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_NON_NORMALMAP();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
Texture2D g_DepthTexture;
|
||||
@@ -11,14 +12,46 @@ uint g_iIndexU;
|
||||
uint g_iIndexV;
|
||||
|
||||
Texture2D g_Texture;
|
||||
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
Texture2D g_NoiseTexture;
|
||||
Texture2D g_DistortionTexture;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isNoise;
|
||||
/* 디퓨즈 */
|
||||
bool g_isDiffuse;
|
||||
float g_fDiffuseAlpha;
|
||||
float4 g_vColor;
|
||||
|
||||
/* 마스크 */
|
||||
bool g_isMask;
|
||||
float g_fSoftMaskEdge;
|
||||
float g_fSoftMask;
|
||||
|
||||
/* 노이즈 */
|
||||
bool g_isNoise;
|
||||
bool g_isNoiseColor;
|
||||
bool g_isNoiseAlpha;
|
||||
float g_fNoiseStrength;
|
||||
|
||||
/* 디스토션 */
|
||||
|
||||
bool g_isDistortion;
|
||||
float2 g_vDistortionTime;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
float g_fDistortionIntensity; // 디스토션 왜곡 세기
|
||||
|
||||
/* 이미시브 */
|
||||
float4 g_vEmissive;
|
||||
float g_fEmissiveStrength;
|
||||
float g_fSoftenExp;
|
||||
float g_fSoftStrength;
|
||||
float g_fCoreBoost;
|
||||
float g_fRadius;
|
||||
|
||||
/* 블러 */
|
||||
float g_fBlurIntensity;
|
||||
float g_iBlurWeight;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -121,37 +154,263 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
{
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
/* 디퓨즈 디스토션 */
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = vector(0.f, 0.f, 0.f, 1.f);
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
if (g_isMask == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, In.vTexcoord);
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
//vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
}
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (g_isMask == true)
|
||||
{
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
float fSoftMask;
|
||||
|
||||
if (g_fSoftMask > FLT_EPSILON5)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
else
|
||||
fSoftMask = vMtrlMask.r;
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
}
|
||||
else
|
||||
vMtrlMask.r = 1.f;
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* 웨이트 블랜드 */
|
||||
|
||||
float fWeight = clamp(pow(In.vProjPos.w, -2.5f), 1.0f, 1000.0f);
|
||||
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * vMtrlDiffuse.a, vMtrlDiffuse.a) * fWeight;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb, vMtrlDiffuse.a) * fWeight;
|
||||
Out.vRevealage.r = vMtrlDiffuse.a;
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
|
||||
float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
float2 CenteredUV = In.vTexcoord - 0.5f;
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
|
||||
float fEmissive = fSoftEdge + fCore;
|
||||
|
||||
vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * g_fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_Position;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vBlurWeight : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
{
|
||||
/* 디퓨즈 디스토션 */
|
||||
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (g_isMask == true)
|
||||
{
|
||||
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
float fSoftMask;
|
||||
|
||||
if (g_fSoftMask > FLT_EPSILON5)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
}
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
///* 이미시브 */
|
||||
|
||||
//float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
//float2 CenteredUV = In.vTexcoord - 0.5f;
|
||||
|
||||
//float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
//float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
//float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
//float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
|
||||
//float fEmissive = fSoftEdge + fCore;
|
||||
|
||||
//vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * g_fBlurIntensity, vMtrlDiffuse.a); // 이미시브 스트랭스
|
||||
Out.vBlurWeight = g_iBlurWeight / 128.f;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -203,10 +462,20 @@ technique11 PosTexTechnique11
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Trail();
|
||||
}
|
||||
|
||||
pass TrailBlur
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_TRAIL_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
@@ -167,6 +167,7 @@
|
||||
<ClInclude Include="..\public\AlphaMap.h" />
|
||||
<ClInclude Include="..\Public\Body.h" />
|
||||
<ClInclude Include="..\public\Active_Icon.h" />
|
||||
<ClInclude Include="..\Public\Decendo.h" />
|
||||
<ClInclude Include="..\Public\Broom.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h" />
|
||||
@@ -177,7 +178,9 @@
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h" />
|
||||
<ClInclude Include="..\Public\CamPosition.h" />
|
||||
<ClInclude Include="..\Public\CamPosition_Arm.h" />
|
||||
<ClInclude Include="..\Public\CamPosition_Player.h" />
|
||||
<ClInclude Include="..\Public\CamPosition_Shoulder.h" />
|
||||
<ClInclude Include="..\Public\CamPosition_Socket.h" />
|
||||
<ClInclude Include="..\Public\CamPosition_Target.h" />
|
||||
<ClInclude Include="..\Public\DummyObject.h" />
|
||||
<ClInclude Include="..\public\DummySkyBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Globe.h" />
|
||||
@@ -213,7 +216,7 @@
|
||||
<ClInclude Include="..\Public\Effect_Container.h" />
|
||||
<ClInclude Include="..\public\GamePlay_Canvas.h" />
|
||||
<ClInclude Include="..\public\BuildingContainer.h" />
|
||||
<ClInclude Include="..\Public\DebugCamera.h" />
|
||||
<ClInclude Include="..\Public\Camera_Debug.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXMesh.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
@@ -300,6 +303,7 @@
|
||||
<ClCompile Include="..\private\AlphaMap.cpp" />
|
||||
<ClCompile Include="..\Private\Body.cpp" />
|
||||
<ClCompile Include="..\private\Active_Icon.cpp" />
|
||||
<ClCompile Include="..\Private\Decendo.cpp" />
|
||||
<ClCompile Include="..\Private\Broom.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp" />
|
||||
@@ -310,7 +314,9 @@
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Player.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Socket.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Target.cpp" />
|
||||
<ClCompile Include="..\Private\DummyObject.cpp" />
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Globe.cpp" />
|
||||
@@ -346,7 +352,7 @@
|
||||
<ClCompile Include="..\Private\Effect_Container.cpp" />
|
||||
<ClCompile Include="..\private\GamePlay_Canvas.cpp" />
|
||||
<ClCompile Include="..\private\BuildingContainer.cpp" />
|
||||
<ClCompile Include="..\Private\DebugCamera.cpp" />
|
||||
<ClCompile Include="..\Private\Camera_Debug.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXMesh.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
@@ -374,6 +380,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\NoMountIcon.cpp" />
|
||||
<ClCompile Include="..\Private\Player.cpp" />
|
||||
<ClCompile Include="..\Private\Player_States.cpp" />
|
||||
<ClCompile Include="..\private\Potion.cpp" />
|
||||
<ClCompile Include="..\private\Slot_Number.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Slot_Preview.cpp" />
|
||||
@@ -425,6 +432,7 @@
|
||||
<ClCompile Include="..\Private\RootModelPart.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="Editor.cpp" />
|
||||
<ClCompile Include="Goblin_States.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc" />
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
<Filter Include="02.GameObjects\Dummys">
|
||||
<UniqueIdentifier>{fb090860-8f24-4f71-9daf-7fd971a8f5c2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DebugCamera">
|
||||
<UniqueIdentifier>{0eeb6d5c-db23-4147-b981-8346c879a1eb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyObject">
|
||||
<UniqueIdentifier>{085e6bcb-1fe4-4857-bfc6-ed6fc0218358}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -310,9 +307,6 @@
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition">
|
||||
<UniqueIdentifier>{1c11a2a1-ad0a-4f0b-8a86-5ab9fc68a69f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Player">
|
||||
<UniqueIdentifier>{b899b53a-c8cf-451a-ab5d-6945cac88276}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Wand">
|
||||
<UniqueIdentifier>{92110a48-81d0-4e98-be06-05dd078d0488}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -349,6 +343,9 @@
|
||||
<Filter Include="02.GameObjects\Env\05.AlphaMap">
|
||||
<UniqueIdentifier>{54eef1b7-a5ee-444f-9577-44ffc8c3d8bc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\07.Decendo">
|
||||
<UniqueIdentifier>{a94e6a94-cc46-4c16-8518-5032bfdbd235}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot_Preview">
|
||||
<UniqueIdentifier>{b4e1da25-c952-4ff4-92fd-7f1501d8c005}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -358,6 +355,24 @@
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel\Magic_Meter">
|
||||
<UniqueIdentifier>{b6ec3441-6b18-45d1-80ba-03aa6df7f9e2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\Debug">
|
||||
<UniqueIdentifier>{ee7ebf3c-8798-41cb-a261-31ca5041909c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Arm">
|
||||
<UniqueIdentifier>{94ad00fa-52a1-4d53-b44e-5bb849a25201}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Socket">
|
||||
<UniqueIdentifier>{0d5c1798-4922-498e-afed-d1778c8e77b9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Player">
|
||||
<UniqueIdentifier>{b899b53a-c8cf-451a-ab5d-6945cac88276}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Player\Shoulder">
|
||||
<UniqueIdentifier>{1962eafc-d147-494f-8d09-d96b78014958}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Camera\CameraPosition\Player\Target">
|
||||
<UniqueIdentifier>{1c4860c7-bc8a-4bed-b545-ed3ef0b02748}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel\Magic_Icon">
|
||||
<UniqueIdentifier>{4967d007-a0d8-4d57-b259-7bb47b5cf9ea}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -402,9 +417,6 @@
|
||||
<ClInclude Include="..\Public\Level_Logo.h">
|
||||
<Filter>01.Level\01.Logo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\DebugCamera.h">
|
||||
<Filter>02.GameObjects\Dummys\DebugCamera</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\DummyRect.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyRect</Filter>
|
||||
</ClInclude>
|
||||
@@ -681,12 +693,6 @@
|
||||
<ClInclude Include="..\Public\CamPosition.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Player.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Arm.h">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Wand.h">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClInclude>
|
||||
@@ -699,8 +705,26 @@
|
||||
<ClInclude Include="..\Public\Wand.h">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\AlphaMap.h">
|
||||
<Filter>02.GameObjects\Env\05.AlphaMap</Filter>
|
||||
<ClInclude Include="..\public\AlphaMap.h">
|
||||
<Filter>02.GameObjects\Env\05.AlphaMap</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Decendo.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\07.Decendo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Debug.h">
|
||||
<Filter>02.GameObjects\Camera\Debug</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Arm.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Arm</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Socket.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Socket</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Shoulder.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Target.h">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player\Target</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Spell_Slot_Preview.h">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot_Preview</Filter>
|
||||
@@ -742,9 +766,6 @@
|
||||
<ClCompile Include="..\Private\Level_Logo.cpp">
|
||||
<Filter>01.Level\01.Logo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\DebugCamera.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DebugCamera</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\pch.cpp">
|
||||
<Filter>99.Define\DEFAULT</Filter>
|
||||
</ClCompile>
|
||||
@@ -1027,12 +1048,6 @@
|
||||
<ClCompile Include="..\Private\CamPosition.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Player.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Wand.cpp">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClCompile>
|
||||
@@ -1048,6 +1063,9 @@
|
||||
<ClCompile Include="..\private\AlphaMap.cpp">
|
||||
<Filter>02.GameObjects\Env\05.AlphaMap</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Decendo.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\07.Decendo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Spell_Slot_Preview.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot_Preview</Filter>
|
||||
</ClCompile>
|
||||
@@ -1057,6 +1075,27 @@
|
||||
<ClCompile Include="..\private\Magic_Meter.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Magic_Meter</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Debug.cpp">
|
||||
<Filter>02.GameObjects\Camera\Debug</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Arm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Socket.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Socket</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player\Shoulder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Target.cpp">
|
||||
<Filter>02.GameObjects\Camera\CameraPosition\Player\Target</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player_States.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Goblin_States.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Magic_Icon.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Magic_Icon</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
|
||||
void CGoblin::Behavior_IdleEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_IdleExitCheck()
|
||||
{
|
||||
if (m_fTargetDistance <= 15.f)
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (m_fTargetDistance <= 3.f)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_CombatExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2);
|
||||
}
|
||||
|
||||
|
||||
void CGoblin::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CGoblin::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 22,true };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 50,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 58,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 46,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙
|
||||
m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void CAlphaMap::Load_ToFile(const _char* pFilePath)
|
||||
if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource)))
|
||||
return;
|
||||
|
||||
MSG_BOX("Success to Load Binanry File");
|
||||
//MSG_BOX("Success to Load Binanry File");
|
||||
|
||||
memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels);
|
||||
|
||||
|
||||
@@ -36,12 +36,15 @@ void CBuildingContainer::Update(_float fTimeDelta)
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (m_bSelected)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
@@ -147,10 +150,8 @@ void CBuildingContainer::Describe_Entity()
|
||||
|
||||
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
|
||||
{
|
||||
CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
|
||||
if (nullptr != pTerrain)
|
||||
if (m_pGameInstance->isPicking(&m_vPosition))
|
||||
{
|
||||
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>()->Get_XMWorldMatrix(), &m_vPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,10 @@ CCamPosition_Arm::CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* p
|
||||
: CCamPosition(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CCamPosition_Arm::CCamPosition_Arm(const CCamPosition_Arm& rhs)
|
||||
: CCamPosition(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Arm::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
@@ -44,6 +42,7 @@ void CCamPosition_Arm::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamPosition_Arm::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CCamPosition_Arm::Late_Update(_float fTimeDelta)
|
||||
@@ -96,12 +95,10 @@ CCamPosition_Arm* CCamPosition_Arm::Clone(void* pArg, class CGameObject* pOWner)
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CCamPosition_Arm::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CCamPosition_Arm::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
#include "pch.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CamPosition_Target.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Camera_Gaze.h"
|
||||
|
||||
CCamPosition_Shoulder::CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CCamPosition(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
CCamPosition_Shoulder::CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs)
|
||||
: CCamPosition(rhs)
|
||||
{
|
||||
}
|
||||
HRESULT CCamPosition_Shoulder::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CCamPosition_Shoulder::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_SubParts())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CAMERA_SHOULDER_DESC* pDesc = static_cast<CAMERA_SHOULDER_DESC*>(pArg);
|
||||
{
|
||||
m_fMouseSensor = pDesc->fMouseSensor;
|
||||
m_vShoulderPosRatio = pDesc->vInitialLook;
|
||||
m_fShoulderDistance = pDesc->fShoulderDistance;
|
||||
m_vAccDegreeXY = { 0.f, 0.f };
|
||||
m_fCameraFocalLength = pDesc->fCameraFocalLength;
|
||||
m_fBackFrontRatio = pDesc->fBackFrontRatio;
|
||||
|
||||
m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio = pDesc->vInitialLook;
|
||||
m_vShoulderStartRatio.x *= -1.f;
|
||||
m_pTransformCom->Set_State(STATE::POSITION,
|
||||
m_pParentTransformCom->Get_State(STATE::POSITION)
|
||||
+ XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)) * m_fShoulderDistance);
|
||||
|
||||
_vector vShoulderPos = Get_WorldPostion();
|
||||
_vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f);
|
||||
_vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f);
|
||||
vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq));
|
||||
|
||||
CTransform* pLookTransform = m_pTarget_LookPart->Get_Component<CTransform>();
|
||||
CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component<CTransform>();
|
||||
|
||||
pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio));
|
||||
pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio)));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
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));
|
||||
_vector vRotq = XMQuaternionRotationRollPitchYaw(0.f, XMConvertToRadians(m_vAccDegreeXY.y), 0.f);
|
||||
vLook = XMVector3Normalize(XMVector3Rotate(vLook, vRotq));
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(vLook) * m_fShoulderDistance);
|
||||
_vector vShoulderPos = Get_WorldPostion();
|
||||
_vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f);
|
||||
_vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f);
|
||||
vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq));
|
||||
|
||||
CTransform* pLookTransform = m_pTarget_LookPart->Get_Component<CTransform>();
|
||||
CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component<CTransform>();
|
||||
|
||||
pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio));
|
||||
pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio)));
|
||||
}
|
||||
|
||||
void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_O)) {
|
||||
m_pBinded_Camera->Toggle_Priority();
|
||||
}
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
Describe_Entity();
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
}
|
||||
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) {
|
||||
m_pGameInstance->Toggle_MouseCenter();
|
||||
}
|
||||
if (m_pGameInstance->Key_Up(DIK_P)) {
|
||||
m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio;
|
||||
m_vShoulderStartRatio.x *= -1.f;
|
||||
m_bLerp = true;
|
||||
m_vLerpTimer.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CCamPosition_Shoulder::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bLerp) {
|
||||
m_vLerpTimer.x += fTimeDelta;
|
||||
XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTimer.x / m_vLerpTimer.y));
|
||||
if (m_vLerpTimer.x > m_vLerpTimer.y) {
|
||||
m_bLerp = false;
|
||||
m_vLerpTimer.x = 0.f;
|
||||
|
||||
m_vShoulderPosRatio = m_vShoulderOtherRatio;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Shoulder::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_vector CCamPosition_Shoulder::Get_WorldPostion()
|
||||
{
|
||||
return m_pTransformCom->Get_State(STATE::POSITION);
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Shoulder::Ready_Components(void* pArg)
|
||||
{
|
||||
CTransform::TRANSFORM_DESC DescTransfrom = {};
|
||||
DescTransfrom.fRadius = 30.f;
|
||||
DescTransfrom.fRotationPerSec = 0.f;
|
||||
DescTransfrom.fSpeedPerSec = 0.f;
|
||||
if (FAILED(__super::Ready_Components(&DescTransfrom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
{
|
||||
{
|
||||
CCamPosition_Target::CAMERAPOSITION_TARGET_DESC Desc{};
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
m_pTarget_LookPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc);
|
||||
m_pTarget_FollowPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc);
|
||||
}
|
||||
|
||||
CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 300.f;
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.f);
|
||||
CameraDesc.pFollowTarget = m_pTarget_FollowPart;
|
||||
CameraDesc.pLookTarget = m_pTarget_LookPart;
|
||||
CameraDesc.iPriority = 51;
|
||||
CameraDesc.pCameraKey = CAMERA_SHOULDER;
|
||||
CameraDesc.bEnableTransitionLerp = true;
|
||||
CameraDesc.bEnableFollowLerp = true;
|
||||
CameraDesc.bEnableLookLerp = true;
|
||||
CameraDesc.vTransitionTime = { 0.f, 1.f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vLookLerpTime = { 0.f, 0.16f };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &m_pBinded_Camera)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, m_pBinded_Camera, CAMERA_SHOULDER);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
CCamPosition_Shoulder* CCamPosition_Shoulder::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CCamPosition_Shoulder");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
CCamPosition_Shoulder* CCamPosition_Shoulder::Clone(void* pArg, class CGameObject* pOWner)
|
||||
{
|
||||
CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(*this);
|
||||
pInstance->m_pOwner = pOWner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CCamPosition_Shoulder");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
void CCamPosition_Shoulder::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pTarget_LookPart);
|
||||
SAFE_RELEASE(m_pTarget_FollowPart);
|
||||
}
|
||||
void CCamPosition_Shoulder::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Cam_Shoulder");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
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::SliderFloat3("ShoulderPosRatio", (_float*)&m_vShoulderPosRatio, -2.f, 2.f, "%.1f");
|
||||
GUI::End();
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "CamPosition_Player.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
|
||||
CCamPosition_Player::CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
CCamPosition_Socket::CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CCamPosition(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CCamPosition_Player::CCamPosition_Player(const CCamPosition_Player& rhs)
|
||||
CCamPosition_Socket::CCamPosition_Socket(const CCamPosition_Socket& rhs)
|
||||
:CCamPosition(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamPosition_Player::Priority_Update(_float fTimeDelta)
|
||||
void CCamPosition_Socket::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
/*_matrix socketMatrix = {};
|
||||
|
||||
@@ -24,29 +24,29 @@ void CCamPosition_Player::Priority_Update(_float fTimeDelta)
|
||||
m_pTransformCom->Set_WorldMatrix(/*socketMatrix * */XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
}
|
||||
|
||||
void CCamPosition_Player::Update(_float fTimeDelta)
|
||||
void CCamPosition_Socket::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamPosition_Player::Late_Update(_float fTimeDelta)
|
||||
void CCamPosition_Socket::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Player::Initialize_Prototype()
|
||||
HRESULT CCamPosition_Socket::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Player::Initialize(void* pArg)
|
||||
HRESULT CCamPosition_Socket::Initialize(void* pArg)
|
||||
{
|
||||
CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast<CAMERAPOSITION_PLAYER_DESC*> (pArg);
|
||||
//m_pSocketMatrices = pDesc->pSocketMatrices;
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -54,9 +54,9 @@ HRESULT CCamPosition_Player::Initialize(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Player::Ready_Components(void* pArg)
|
||||
HRESULT CCamPosition_Socket::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -64,14 +64,14 @@ HRESULT CCamPosition_Player::Ready_Components(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Player::Bind_ShaderResources()
|
||||
HRESULT CCamPosition_Socket::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
CCamPosition_Socket* CCamPosition_Socket::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamPosition_Player* pInstance = new CCamPosition_Player(pDevice, pContext);
|
||||
CCamPosition_Socket* pInstance = new CCamPosition_Socket(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
@@ -82,9 +82,9 @@ CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11De
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* pOWner)
|
||||
CCamPosition_Socket* CCamPosition_Socket::Clone(void* pArg, class CGameObject* pOWner)
|
||||
{
|
||||
CCamPosition_Player* pInstance = new CCamPosition_Player(*this);
|
||||
CCamPosition_Socket* pInstance = new CCamPosition_Socket(*this);
|
||||
pInstance->m_pOwner = pOWner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
@@ -95,11 +95,11 @@ CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* p
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CCamPosition_Player::Free()
|
||||
void CCamPosition_Socket::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CCamPosition_Player::Describe_Entity()
|
||||
void CCamPosition_Socket::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "CamPosition_Target.h"
|
||||
|
||||
CCamPosition_Target::CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CCamPosition(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
CCamPosition_Target::CCamPosition_Target(const CCamPosition_Target& rhs)
|
||||
:CCamPosition(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamPosition_Target::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamPosition_Target::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamPosition_Target::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
_vector CCamPosition_Target::Get_WorldPostion()
|
||||
{
|
||||
return m_pTransformCom->Get_State(STATE::POSITION);
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Target::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CCamPosition_Target::Initialize(void* pArg)
|
||||
{
|
||||
CAMERAPOSITION_TARGET_DESC* pDesc = static_cast<CAMERAPOSITION_TARGET_DESC*> (pArg);
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Target::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Target::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCamPosition_Target* CCamPosition_Target::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamPosition_Target* pInstance = new CCamPosition_Target(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CCamPosition_Target");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
CCamPosition_Target* CCamPosition_Target::Clone(void* pArg, class CGameObject* pOWner)
|
||||
{
|
||||
CCamPosition_Target* pInstance = new CCamPosition_Target(*this);
|
||||
pInstance->m_pOwner = pOWner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CCamPosition_Target");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
void CCamPosition_Target::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
void CCamPosition_Target::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,23 +1,27 @@
|
||||
#include "pch.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Shader.h"
|
||||
|
||||
CDebugCamera::CDebugCamera(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
CCamera_Debug::CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CCamera(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CDebugCamera::CDebugCamera(const CDebugCamera& rhs)
|
||||
CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs)
|
||||
: CCamera(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CDebugCamera::Priority_Update(_float fTimeDelta)
|
||||
void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false);
|
||||
}
|
||||
|
||||
void CDebugCamera::Update(_float fTimeDelta)
|
||||
void CCamera_Debug::Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
_float3 vCamPos = {};
|
||||
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
@@ -66,21 +70,24 @@ void CDebugCamera::Update(_float fTimeDelta)
|
||||
__super::Bind_Matrices();
|
||||
}
|
||||
|
||||
void CDebugCamera::Late_Update(_float fTimeDelta)
|
||||
void CCamera_Debug::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDebugCamera::Render()
|
||||
HRESULT CCamera_Debug::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDebugCamera::Initialize_Prototype()
|
||||
HRESULT CCamera_Debug::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDebugCamera::Initialize(void* pArg)
|
||||
HRESULT CCamera_Debug::Initialize(void* pArg)
|
||||
{
|
||||
CAMERA_DEBUG_DESC* pDesc = static_cast<CAMERA_DEBUG_DESC*>(pArg);
|
||||
m_fMouseSensor = pDesc->fMouseSensor;
|
||||
@@ -97,12 +104,10 @@ HRESULT CDebugCamera::Initialize(void* pArg)
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDebugCamera::Ready_Components(void* pArg)
|
||||
HRESULT CCamera_Debug::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
@@ -111,46 +116,46 @@ HRESULT CDebugCamera::Ready_Components(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDebugCamera::Bind_ShaderResources()
|
||||
HRESULT CCamera_Debug::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDebugCamera::Set_InitialPos()
|
||||
void CCamera_Debug::Set_InitialPos()
|
||||
{
|
||||
m_pTransformCom->Set_WorldMatrix(m_matInitial);
|
||||
}
|
||||
|
||||
CDebugCamera* CDebugCamera::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
CCamera_Debug* CCamera_Debug::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDebugCamera* pInstance = new CDebugCamera(pDevice, pContext);
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(pDevice, pContext);
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDebugCamera");
|
||||
MSG_BOX("Failed to Created : CCamera_Debug");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDebugCamera::Clone(void* pArg, CGameObject* pOwner)
|
||||
CGameObject* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDebugCamera* pInstance = new CDebugCamera(*this);
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDebugCamera");
|
||||
MSG_BOX("Failed to Cloned : CCamera_Debug");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDebugCamera::Free()
|
||||
void CCamera_Debug::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CDebugCamera::Describe_Entity()
|
||||
void CCamera_Debug::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -13,9 +13,27 @@ CCamera_Gaze::CCamera_Gaze(const CCamera_Gaze& rhs)
|
||||
|
||||
void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (false == m_bIsCurrentTransition) {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
if (m_bEnable_FollowLerp) {
|
||||
_vector vNewPos = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vFollowPos_Src), XMLoadFloat3(&m_vFollowPos_Dest), m_vFollowLerpTime.x / m_vFollowLerpTime.y), 1.f);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, vNewPos);
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pFollowTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
}
|
||||
if (m_bEnable_LookLerp) {
|
||||
_vector vNewLook = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&m_vLookPos_Src), XMLoadFloat3(&m_vLookPos_Dest), m_vLookLerpTime.x / m_vLookLerpTime.y), 1.f);
|
||||
m_pTransformCom->LookAt(vNewLook);
|
||||
}
|
||||
else {
|
||||
m_pTransformCom->LookAt(m_pLookTarget->Get_Component<CTransform>()->Get_State(STATE::POSITION));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
m_bActive = true;
|
||||
__super::Bind_Matrices();
|
||||
@@ -23,22 +41,81 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
Update_LerpTimer(fTimeDelta);
|
||||
|
||||
Describe_Entity();
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
m_vLookLerpTime.x += fTimeDelta;
|
||||
if (m_vLookLerpTime.y <= m_vLookLerpTime.x) {
|
||||
m_vLookLerpTime.x = 0.f;
|
||||
m_bEnable_LookLerp = false;
|
||||
XMStoreFloat3(&m_vLookPos_Src, XMLoadFloat3(&m_vLookPos_Dest));
|
||||
XMStoreFloat3(&m_vLookPos_Dest, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
}
|
||||
|
||||
if (true == m_bEnable_FollowLerp) {
|
||||
m_vFollowLerpTime.x += fTimeDelta;
|
||||
if (m_vFollowLerpTime.y <= m_vFollowLerpTime.x) {
|
||||
m_vFollowLerpTime.x = 0.f;
|
||||
m_bEnable_FollowLerp = false;
|
||||
XMStoreFloat3(&m_vFollowPos_Src, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
XMStoreFloat3(&m_vFollowPos_Dest, m_pFollowTarget->Get_WorldPostion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Enable_FollowLerp()
|
||||
{
|
||||
m_bEnable_FollowLerp = true;
|
||||
m_vFollowLerpTime.x = 0.f;
|
||||
XMStoreFloat3(&m_vFollowPos_Src, m_pFollowTarget->Get_WorldPostion());
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Enable_LookLerp()
|
||||
{
|
||||
m_bEnable_LookLerp = true;
|
||||
m_vLookLerpTime.x = 0.f;
|
||||
XMStoreFloat3(&m_vLookPos_Src, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Toggle_Priority()
|
||||
{
|
||||
if (m_iPriority == 99) {
|
||||
m_iPriority = 51;
|
||||
}
|
||||
else {
|
||||
m_iPriority = 99;
|
||||
m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, false);
|
||||
}
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Initialize(void* pArg)
|
||||
{
|
||||
|
||||
@@ -52,7 +129,6 @@ HRESULT CCamera_Gaze::Initialize(void* pArg)
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
@@ -61,12 +137,10 @@ HRESULT CCamera_Gaze::Ready_Components(void* pArg)
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Gaze::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamera_Gaze* pInstance = new CCamera_Gaze(pDevice, pContext);
|
||||
@@ -78,7 +152,6 @@ CCamera_Gaze* CCamera_Gaze::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CCamera_Gaze* pInstance = new CCamera_Gaze(*this);
|
||||
@@ -91,13 +164,35 @@ CGameObject* CCamera_Gaze::Clone(void* pArg, CGameObject* pOwner)
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Camera_Gaze_Describe");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z);
|
||||
GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z);
|
||||
GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z);
|
||||
GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z);
|
||||
GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp);
|
||||
if (true == m_bEnable_TransitionLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y);
|
||||
GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::Checkbox("LookLerp", &m_bEnable_LookLerp);
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y);
|
||||
GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp);
|
||||
if (true == m_bEnable_FollowLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y);
|
||||
GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
#include "pch.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "EditEffect.h"
|
||||
#include "Dummy_PhysXEffectHitBox.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
|
||||
CDecendo::CDecendo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CEffect_Container{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDecendo::CDecendo(const CDecendo& rhs)
|
||||
: CEffect_Container(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Initialize_Prototype()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Decendo/")))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_wstrEffectName = L"Bombard";
|
||||
|
||||
m_pProjectile_Blur = Get_PartObject<CEditEffect>("Decendo_Proj_Blur");
|
||||
m_pProjectile = Get_PartObject<CEditEffect>("Decendo_Proj");
|
||||
|
||||
CPartObject* pCircle0 = Get_PartObject<CEditEffect>("Decendo_Cricle_S");
|
||||
|
||||
pCircle0->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
m_pProjectile->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
m_pProjectile_Blur->Get_Component<CTransform>()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
Get_PartObject<CTrailObject>()->Set_Target(m_pProjectile->Get_Component<CTransform>());
|
||||
|
||||
pCircle0->Set_Visible(true);
|
||||
m_pProjectile->Set_Visible(true);
|
||||
m_pProjectile_Blur->Set_Visible(true);
|
||||
|
||||
SAFE_ADDREF(m_pProjectile_Blur);
|
||||
SAFE_ADDREF(m_pProjectile);
|
||||
|
||||
//나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬
|
||||
_vector vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK));
|
||||
_vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f);
|
||||
|
||||
|
||||
_vector vQuaternion = XMQuaternionRotationAxis(vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2));
|
||||
|
||||
m_vRotateUp = XMVector3Rotate(vUp, vQuaternion);
|
||||
|
||||
m_vRotateUp = XMVector3Normalize(m_vRotateUp);
|
||||
|
||||
m_fDuration = 2.5f;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDecendo::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CDecendo::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
Update_Event(fTimeDelta);
|
||||
|
||||
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
|
||||
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
|
||||
m_pProjectile->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
|
||||
|
||||
|
||||
if (m_fAccTime > XM_PI)
|
||||
return;
|
||||
|
||||
m_fAccTime += fTimeDelta * 3.f;
|
||||
|
||||
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
|
||||
m_pProjectile->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
|
||||
|
||||
}
|
||||
|
||||
void CDecendo::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Ready_Child()
|
||||
{
|
||||
CDummy_PhysXEffectHitBox::PHYSXDUMMY_DESC Desc{};
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion());
|
||||
|
||||
XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f));
|
||||
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
Desc.iSubKind = 70;
|
||||
Desc.vDeltaPos = { 0.f, 0.f, 1.f };
|
||||
Desc.vLifeTime = { 0.f, 1.f };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXEffectHitBox>(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDecendo* CDecendo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDecendo* pInstance = new CDecendo(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDecendo");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
||||
CGameObject* CDecendo::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDecendo* pInstance = new CDecendo(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDecendo");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDecendo::OnCollision(CGameObject* pOther , void* pDesc)
|
||||
{
|
||||
//CTransform* pOtherTransform = p
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
|
||||
for (auto& pPair : m_PartObjects)
|
||||
{
|
||||
pPair.second->Set_Visible(true);
|
||||
pPair.second->Get_Component<CTransform>()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos);
|
||||
}
|
||||
|
||||
m_pProjectile_Blur->Set_Visible(false);
|
||||
m_pProjectile->Set_Visible(false);
|
||||
|
||||
|
||||
Get_PartObject<CEditEffect>("Decendo_Cricle_S")->Set_Visible(false);
|
||||
Get_PartObject<CTrailObject>()->Set_Visible(false);
|
||||
|
||||
m_pPhysHitBox->Set_Dead();
|
||||
}
|
||||
|
||||
void CDecendo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
//if(m_pPhysHitBox != nullptr)
|
||||
// if (m_pPhysHitBox->Get_Depth() == false)
|
||||
// SAFE_RELEASE(m_pPhysHitBox);
|
||||
|
||||
SAFE_RELEASE(m_pProjectile_Blur);
|
||||
SAFE_RELEASE(m_pProjectile);
|
||||
|
||||
}
|
||||
|
||||
void CDecendo::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "DummyObject.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
|
||||
CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "DummySkyBox.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "Camera_Gaze.h"
|
||||
|
||||
@@ -40,9 +40,7 @@ void CDummySkyBox::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CDummySkyBox::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef gimch
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object<CDebugCamera>()->Get_WorldPostion());
|
||||
#endif // !기무리
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_CamXMPosition());
|
||||
}
|
||||
|
||||
void CDummySkyBox::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Bombard.h"
|
||||
|
||||
#include "TrailObject.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
CGameObject(pDevice, pContext)
|
||||
@@ -62,6 +63,15 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_P)) {
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -457,6 +457,7 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive);
|
||||
GUI::Checkbox("EmissiveDissolve", &m_EffectInfo.isEmissiveDissolve);
|
||||
GUI::Checkbox("EmissiveDissolveReverse", &m_EffectInfo.isEmissiveDissolveReverse);
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
|
||||
@@ -57,188 +57,6 @@ void CEffect_Container::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CEffect_Container::Save_Package(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(),
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL
|
||||
);
|
||||
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"패키징 저장 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
_int iObjectCount = (_int)m_PartObjects.size();
|
||||
|
||||
if (!WriteFile(hFile, &iObjectCount, sizeof(_int), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// 자식 개수 저장
|
||||
|
||||
for (auto& pPartObejct : m_PartObjects)
|
||||
{
|
||||
CEditEffect* pEffectObject = dynamic_cast<CEditEffect*>(pPartObejct.second);
|
||||
CTrailObject* pTrailObject = {};
|
||||
|
||||
if (pEffectObject == nullptr) // 이펙트 오브젝트가 아닐 경우
|
||||
{
|
||||
pTrailObject = dynamic_cast<CTrailObject*>(pPartObejct.second);
|
||||
|
||||
pTrailObject->Save_Path(hFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEffectObject->Save_Path(hFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"패키징 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
HRESULT CEffect_Container::Load_Package(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
HANDLE hFile = CreateFileW(
|
||||
CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름
|
||||
GENERIC_READ, // 읽기 모드
|
||||
FILE_SHARE_READ, // 다른 프로세스도 읽기 가능
|
||||
NULL,
|
||||
OPEN_EXISTING, // 기존 파일 열기
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"패키징 읽기 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_int iObjectCount = {};
|
||||
|
||||
if (!ReadFile(hFile, &iObjectCount, sizeof(_int), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < iObjectCount; i++)
|
||||
{
|
||||
EFFECT_TYPE eEffectType = {};
|
||||
|
||||
if (!ReadFile(hFile, &eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iFilePathLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iFilePathLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
if (iFilePathLength != 0)
|
||||
{
|
||||
if (!ReadFile(hFile, szFilePath, sizeof(_char) * ((DWORD)iFilePathLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
_string strPath = szFilePath;
|
||||
size_t iPos;
|
||||
|
||||
while ((iPos = strPath.find(".bin")) != std::string::npos) {
|
||||
strPath.erase(iPos, 4);
|
||||
};
|
||||
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
CEditEffect* pEditEffect = {};
|
||||
CTrailObject* pTrailEffect = {};
|
||||
switch (eEffectType)
|
||||
{
|
||||
case EFFECT_TYPE::EFFECT:
|
||||
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
if (FAILED(Add_PartObject<CEditEffect>("EffectObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pEditEffect, &PartsDesc)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(pEditEffect->Load(strPath.c_str(), LEVEL::EFFECT)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pEditEffect);
|
||||
|
||||
break;
|
||||
|
||||
case EFFECT_TYPE::TRAIL:
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>("TrailObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pTrailEffect, &PartsDesc)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
pTrailEffect->Load_Trail(strPath.c_str(), LEVEL::EFFECT);
|
||||
|
||||
SAFE_RELEASE(pTrailEffect);
|
||||
|
||||
break;
|
||||
case EFFECT_TYPE::END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Load_Directory(const _char* pPath)
|
||||
{
|
||||
|
||||
@@ -249,13 +67,52 @@ HRESULT CEffect_Container::Load_Directory(const _char* pPath)
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (strcmp(ext.c_str(), ".bin"))
|
||||
if (!(strcmp(ext.c_str(), ".bin") ^ strcmp(ext.c_str(), ".trail")))
|
||||
continue;
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
/* Trail */
|
||||
|
||||
if (!strcmp(ext.c_str(), ".trail"))
|
||||
{
|
||||
CTrailObject* pTrail = nullptr;
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
_wstring wstrFileName = file.path().stem().wstring(); //이름 넣기
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>(CMyTools::ToString(wstrFileName), NEXT_LEVEL, &pTrail, &PartsDesc))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/*이펙트 로드 로드*/
|
||||
size_t iPos = {};
|
||||
_string strFilePath = szFilePath;
|
||||
|
||||
while ((iPos = strFilePath.find(".trail")) != std::string::npos) {
|
||||
strFilePath.erase(iPos, 6);
|
||||
};
|
||||
|
||||
|
||||
if (FAILED(pTrail->Load_Trail(strFilePath.c_str(), LEVEL::EFFECT)))
|
||||
{
|
||||
Safe_Release(pTrail);
|
||||
continue;
|
||||
}
|
||||
|
||||
Safe_Release(pTrail);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
@@ -619,22 +619,12 @@ void CEffect_Editor::Describe_Entity()
|
||||
ReSaveFile(m_strSavePath.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
GUI::InputTextMultiline("PACKAGE FILE PATH", m_szPackageBuffer, sizeof(m_szPackageBuffer), ImVec2(250, 25));
|
||||
GUI::InputTextMultiline("DIRECTORY PATH", m_szPackageBuffer, sizeof(m_szPackageBuffer), ImVec2(250, 25));
|
||||
|
||||
m_strPackageSavePath = m_szPackageBuffer;
|
||||
|
||||
if (GUI::Button("PACKAING"))
|
||||
{
|
||||
Save_Package(m_strPackageSavePath.c_str());
|
||||
}
|
||||
|
||||
GUI::SameLine();
|
||||
|
||||
if (GUI::Button("LOAD DIRECTORY"))
|
||||
{
|
||||
|
||||
if (SUCCEEDED(Load_Directory(m_strPackageSavePath.c_str())))
|
||||
{
|
||||
MessageBox(NULL, L"파일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CMonster(pDevice, pContext)
|
||||
@@ -27,23 +35,49 @@ HRESULT CGoblin::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(1);
|
||||
Add_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(-10.f, 0.f, -10.f, 1.f));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pTransformCom->RewindMomentum();
|
||||
}
|
||||
|
||||
void CGoblin::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CGoblin::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
|
||||
@@ -74,6 +108,11 @@ HRESULT CGoblin::Render()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -94,6 +133,35 @@ HRESULT CGoblin::Ready_Components()
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER);
|
||||
Desc.pTransform = m_pTransformCom;
|
||||
Desc.eBodyType = ACTOR::CAPSULE;
|
||||
Desc.fContactOffset = 0.1f;
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create();
|
||||
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create();
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER);
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -143,6 +211,17 @@ void CGoblin::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
if (nullptr != m_pCallBack_Behavior) {
|
||||
m_pCallBack_Behavior->Finalize();
|
||||
}
|
||||
if (nullptr != m_pCallBack_HitReport) {
|
||||
m_pCallBack_HitReport->Finalize();
|
||||
}
|
||||
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
}
|
||||
|
||||
void CGoblin::Describe_Entity()
|
||||
|
||||
@@ -176,7 +176,7 @@ void CHair::Describe_Entity()
|
||||
if (!m_pModelCom )
|
||||
return;
|
||||
|
||||
/*for (_uint i = 0; i < dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size(); i++)
|
||||
/*for (_uint i = 0; i < dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc(); i++)
|
||||
{
|
||||
_char label[128];
|
||||
|
||||
@@ -187,7 +187,7 @@ void CHair::Describe_Entity()
|
||||
iTextureIndex = i;
|
||||
}
|
||||
|
||||
if (i % dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size() != dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size()-1)
|
||||
if (i % dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc() != dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc()-1)
|
||||
GUI::SameLine();
|
||||
}*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "Level_BloomViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Dummy_Cube.h"
|
||||
#include "Dummy_Globe.h"
|
||||
#include "MainLight.h"
|
||||
@@ -91,21 +91,28 @@ HRESULT CLevel_BloomViewer::Render()
|
||||
|
||||
HRESULT CLevel_BloomViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) {
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Level_EffectViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "TestEffect.h"
|
||||
#include "Effect_Editor.h"
|
||||
#include "Dummy_Cube.h"
|
||||
@@ -72,21 +72,28 @@ HRESULT CLevel_EffectViewer::Render()
|
||||
|
||||
HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) {
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
#include "Level_Loading.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Terrain.h"
|
||||
#include "MapObject_Manager.h"
|
||||
#include "BuildingContainer.h"
|
||||
@@ -68,22 +68,28 @@ HRESULT CLevel_MapViewer::Ready_Layer_Light()
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) {
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Head.h"
|
||||
#include "Hair.h"
|
||||
#include "Dummy_Cube.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "GameObject.h"
|
||||
#include "DummyObject.h"
|
||||
@@ -30,10 +30,10 @@ HRESULT CLevel_ObjectViewer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
//{
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy"))))
|
||||
{
|
||||
@@ -57,12 +57,6 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
||||
Parts_Object_Setting();
|
||||
|
||||
Find_Anim();
|
||||
|
||||
if (m_Test)
|
||||
{
|
||||
m_Test->Describe_Entity();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Render()
|
||||
@@ -662,20 +656,28 @@ void CLevel_ObjectViewer::Find_Anim()
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 5.f, -5.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -706,8 +708,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
|
||||
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
// return E_FAIL;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_Test)))
|
||||
return E_FAIL;
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
#include "Level_Loading.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Terrain.h"
|
||||
#include "Dummy_PhysXBox.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
@@ -62,21 +62,28 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Light()
|
||||
|
||||
HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 100.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 2.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 70;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) {
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG);
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma region DEFAULT_HEADER
|
||||
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "DummyRect.h"
|
||||
#include "MainApp.h"
|
||||
#include "Dummy_Cube.h"
|
||||
@@ -25,7 +25,9 @@
|
||||
#include "Broom.h"
|
||||
#include <filesystem>
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Player.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "CamPosition_Target.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
|
||||
@@ -91,6 +93,7 @@
|
||||
#include "TrailObject.h"
|
||||
#include "NomalJap.h"
|
||||
#include "Bombard.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -260,7 +263,7 @@ HRESULT CLoader::Loading_For_Logo()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDebugCamera>(g_iStaticLevel, CDebugCamera::Create(m_pDevice, m_pContext)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamera_Debug>(g_iStaticLevel, CCamera_Debug::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -811,9 +814,6 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXWall>(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDebugCamera>(ENUM_CLASS(LEVEL::EFFECT), CDebugCamera::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CEditEffect>(ENUM_CLASS(LEVEL::EFFECT), CEditEffect::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -846,7 +846,10 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBombard>(ENUM_CLASS(LEVEL::EFFECT), CBombard::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CDecendo::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
|
||||
@@ -1322,6 +1325,32 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
// Heavy Wall
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
Desc.eType = ACTOR::BOX;
|
||||
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.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 2.5f, 4.5f, 3.5f };
|
||||
Desc.fDensity = 10.f;
|
||||
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
|
||||
Desc.eLockFlag = {};
|
||||
Desc.vAutoDamping = { 100.f, 100.f };
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
vector<future<pair<_wstring, CModel*>*>> futures = {};
|
||||
|
||||
#pragma region BODY
|
||||
@@ -1398,7 +1427,7 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
#pragma region MONSTER
|
||||
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Goblin_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
@@ -1417,11 +1446,11 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
#pragma endregion
|
||||
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity(),
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixRotationY(XMConvertToRadians(180.f))* XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Npc_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Wand_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
@@ -1505,7 +1534,15 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CamPosition_Player */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Player>(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext))))
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Socket>(g_iStaticLevel, CCamPosition_Socket::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CamPosition_Shoulder */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Shoulder>(g_iStaticLevel, CCamPosition_Shoulder::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CamPosition_Target */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamPosition_Target>(g_iStaticLevel, CCamPosition_Target::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CamPosition_Arm */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "MainLight.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
|
||||
CMainLight::CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "MapObject.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "Terrain.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "MapObject_Collision.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "Terrain.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "MapObject_LOD.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "Terrain.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
@@ -57,9 +57,18 @@ HRESULT CMapObject_LOD::Initialize(void* pArg)
|
||||
m_vRotation = pDesc->vRotation;
|
||||
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
|
||||
|
||||
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
|
||||
|
||||
@@ -78,18 +87,12 @@ void CMapObject_LOD::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CMapObject_LOD::Update(_float fTimeDelta)
|
||||
{
|
||||
//if (0 == m_iLodIndex)
|
||||
// m_bSelected = true;
|
||||
/*if (0 == m_iLodIndex)
|
||||
m_bSelected = true;*/
|
||||
|
||||
//m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
|
||||
//m_pTransformCom->Set_Scale(m_vScale);
|
||||
//m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
}
|
||||
|
||||
void CMapObject_LOD::Late_Update(_float fTimeDelta)
|
||||
@@ -102,6 +105,12 @@ void CMapObject_LOD::Late_Update(_float fTimeDelta)
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
}
|
||||
#endif
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
_float fRaius = m_pModelComs[0]->Get_Radius();
|
||||
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), fRaius)) {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "MapObject_Manager.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "MapObject.h"
|
||||
#include "MapObject_LOD.h"
|
||||
@@ -1348,7 +1348,7 @@ void CMapObject_Manager::Update_ContainerObject()
|
||||
|
||||
for (auto& pObject : (*pList))
|
||||
{
|
||||
if (GUI::Button((dynamic_cast<CMapContainer*>(pObject)->Get_Name().c_str())))
|
||||
if (GUI::Button((dynamic_cast<CMapContainer*>(pObject)->Get_Name() + to_string(iIndex)).c_str()))
|
||||
{
|
||||
m_iContainerObjectIndex = iIndex;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Monster.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
@@ -23,6 +24,9 @@ HRESULT CMonster::Initialize(void* pArg)
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pPlayerTransform = static_cast<CPlayer*>(pArg)->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pPlayerTransform);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -33,10 +37,12 @@ void CMonster::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CMonster::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render()
|
||||
@@ -65,6 +71,7 @@ void CMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pPlayerTransform);
|
||||
}
|
||||
|
||||
void CMonster::Describe_Entity()
|
||||
|
||||
@@ -35,8 +35,6 @@ HRESULT CNomalJap::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
Load_Package("../Bin/Resources/Data/Effect/Package/Jap3");
|
||||
|
||||
m_wstrEffectName = L"Nomal_Jap";
|
||||
|
||||
m_PartObjects.begin()->second->Set_Visible(true);
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
#include "Player.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "CamPosition_Player.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
@@ -17,6 +20,8 @@
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Bombard.h"
|
||||
|
||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
{
|
||||
@@ -34,15 +39,17 @@ HRESULT CPlayer::Initialize_Prototype()
|
||||
|
||||
HRESULT CPlayer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
if (FAILED(Ready_Components())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(Ready_Parts()))
|
||||
if (FAILED(Ready_Parts())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Load_KeyFrame();
|
||||
|
||||
@@ -50,6 +57,8 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Set_Anim();
|
||||
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
@@ -59,11 +68,15 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -74,10 +87,17 @@ void CPlayer::Update(_float fTimeDelta)
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
Describe_Entity();
|
||||
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
TestKeyInput(fTimeDelta);
|
||||
}
|
||||
|
||||
void CPlayer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
@@ -104,12 +124,16 @@ HRESULT CPlayer::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -124,19 +148,49 @@ HRESULT CPlayer::Ready_Components()
|
||||
if (FAILED(__super::Ready_Components(&Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model");
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER);
|
||||
Desc.pTransform = m_pTransformCom;
|
||||
Desc.eBodyType = ACTOR::CAPSULE;
|
||||
Desc.fContactOffset = 0.1f;
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Playable_HitReport::Create();
|
||||
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Playable_Behavior::Create();
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER);
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -153,47 +207,20 @@ HRESULT CPlayer::Ready_Parts()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{};
|
||||
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
//Desc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_HeadCamera");
|
||||
|
||||
if (FAILED(Add_PartObject<CCamPosition_Player>("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc;
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
Desc.fMouseSensor = 0.5f;
|
||||
Desc.fShoulderDistance = 2.f;
|
||||
Desc.fBackFrontRatio = 0.9f;
|
||||
Desc.fCameraFocalLength = 10.f;
|
||||
Desc.vInitialLook = { 1.f, 2.f, -1.f };
|
||||
|
||||
if (FAILED(Add_PartObject<CCamPosition_Shoulder>("Cam_Shoulder_Part", g_iStaticLevel, &m_pCamPosition_ShoulderPart, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
CCamPosition_Arm::CameraArm_DESC CameraArmDesc{};
|
||||
XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
CameraArmDesc.fEye = { 0.f, 10.f, 10.f };
|
||||
CameraArmDesc.fMouseSensor = 0.4f;
|
||||
CameraArmDesc.fDistance = 4.f;
|
||||
CameraArmDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(Add_PartObject<CCamPosition_Arm>("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 300.f;
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.f);
|
||||
CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart;
|
||||
CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart;
|
||||
CameraDesc.iPriority = 51;
|
||||
|
||||
CCamera_Gaze* pCamera = { nullptr };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW"));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -213,532 +240,6 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputAction()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG|FSMSTATE::WALK)) {
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
}
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputAction())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) {
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward){
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
if (m_bSprintToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_C)) {
|
||||
m_bWalkToggle = !m_bWalkToggle;
|
||||
m_bSprintToggle= false;
|
||||
if (m_bWalkToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
return S_OK;
|
||||
}
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE|FSMSTATE::WALK|FSMSTATE::JOG|FSMSTATE::SPRINT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()){
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
m_pFSM->Enable_State(FSMSTATE::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()){
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
if (IsCurrentKeyFrame("Dodge")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::CAST);
|
||||
pairAnimInfo = m_Animation[STATEANIM::CAST];
|
||||
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_R))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.1f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::CAST);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::CAST].first <= iIndex && m_Animation[STATEANIM::CAST].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.15f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::CAST];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::CAST | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) {m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);};
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
m_Animation[STATEANIM::CAST] = { 696,false };
|
||||
m_Animation[STATEANIM::MAPHELP] = { 122,false };
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
}
|
||||
|
||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPlayer* pInstance = new CPlayer(pDevice, pContext);
|
||||
@@ -767,12 +268,27 @@ void CPlayer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
if (nullptr != m_pCallBack_Behavior) {
|
||||
m_pCallBack_Behavior->Finalize();
|
||||
}
|
||||
if (nullptr != m_pCallBack_HitReport) {
|
||||
m_pCallBack_HitReport->Finalize();
|
||||
}
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart);
|
||||
SAFE_RELEASE(m_pCamPosition_TopDown_LookPart);
|
||||
SAFE_RELEASE(m_pCamPosition_ShoulderPart);
|
||||
}
|
||||
|
||||
void CPlayer::Describe_Entity()
|
||||
{
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
GUI::Text("%.1f %.1f %.1f %.1f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
_char label[256];
|
||||
for (auto& iter : m_KeyFrames)
|
||||
{
|
||||
@@ -788,7 +304,7 @@ void CPlayer::Describe_Entity()
|
||||
GUI::DragFloat3("Pos", Pos3);
|
||||
|
||||
|
||||
_float RotR,RotU,RotL;
|
||||
_float RotR, RotU, RotL;
|
||||
RotR = XMVectorGetX(m_pTransformCom->Get_State(STATE::RIGHT));
|
||||
RotU = XMVectorGetY(m_pTransformCom->Get_State(STATE::UP));
|
||||
RotL = XMVectorGetZ(m_pTransformCom->Get_State(STATE::LOOK));
|
||||
@@ -799,5 +315,7 @@ void CPlayer::Describe_Entity()
|
||||
|
||||
string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex());
|
||||
GUI::Text(AnimList.c_str());
|
||||
|
||||
//GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,676 @@
|
||||
#include "pch.h"
|
||||
#include "Player.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
#include "Bombard.h"
|
||||
|
||||
#pragma region States
|
||||
void CPlayer::TestKeyInput(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F1))
|
||||
{
|
||||
m_eSpell = STATEANIM::ACCIO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F2))
|
||||
{
|
||||
m_eSpell = STATEANIM::DESCENDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3))
|
||||
{
|
||||
m_eSpell = STATEANIM::DEPULSO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F4))
|
||||
{
|
||||
m_eSpell = STATEANIM::DIFFINDO;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F5))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_ENTER;
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F6))
|
||||
{
|
||||
m_eSpell = STATEANIM::DISILLUSION_EXIT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputAction()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSpell()
|
||||
{
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::SPRINT)) {
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
}
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) {
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
else if (bBackward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
m_fAmount = 0.2f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_bSprintToggle = false;
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount);
|
||||
m_fAmount = 1.f;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
if (m_bSprintToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
m_pFSM->Disable_State(FSMSTATE::JOG);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_C)) {
|
||||
m_bWalkToggle = !m_bWalkToggle;
|
||||
m_bSprintToggle = false;
|
||||
if (m_bWalkToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_pFSM->Disable_State(FSMSTATE::JOG);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_pFSM->Disable_State(FSMSTATE::WALK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
if (m_pModelCom->IsFinishedAnim() && m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::WALK | FSMSTATE::JOG | FSMSTATE::SPRINT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
m_pFSM->Enable_State(FSMSTATE::DODGE);
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())&&IsCurrentKeyFrame("Dodge")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::DEPULSO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DEPULSO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DIFFINDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DIFFINDO];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_ENTER:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
case STATEANIM::DISILLUSION_EXIT:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_EXIT];
|
||||
m_eSpell = STATEANIM::END;
|
||||
break;
|
||||
default:
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_R))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL2);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL2];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.1f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SUCCEEDED(InputSpell()))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPELL);
|
||||
_uint iIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (m_Animation[STATEANIM::SPELL].first <= iIndex && m_Animation[STATEANIM::SPELL].first + 3 > iIndex) {
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (fRatio >= 0.15f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL];
|
||||
pairAnimInfo.first = iIndex + 1;
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_V))
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat"))
|
||||
{
|
||||
if (m_eSpell != STATEANIM::END)
|
||||
{
|
||||
switch (m_eSpell)
|
||||
{
|
||||
case STATEANIM::ACCIO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
|
||||
break;
|
||||
case STATEANIM::DESCENDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_eSpell = STATEANIM::END;
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 625,true };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 166,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false};
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
m_Animation[STATEANIM::JUMP_JOG] = { 203,false };
|
||||
m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false };
|
||||
|
||||
m_Animation[STATEANIM::SPRINT] = { 599,true };
|
||||
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
m_Animation[STATEANIM::DODGE_BLINK] = { 799,true };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false };
|
||||
m_Animation[STATEANIM::SPELL] = { 696,false };
|
||||
m_Animation[STATEANIM::MAPHELP] = { 122,false };
|
||||
m_Animation[STATEANIM::ACCIO] = { 417,false };
|
||||
m_Animation[STATEANIM::DESCENDO] = { 418,false };
|
||||
m_Animation[STATEANIM::DEPULSO] = { 782,false };
|
||||
m_Animation[STATEANIM::DIFFINDO] = { 786,false };
|
||||
m_Animation[STATEANIM::LUMOS] = { 782,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "RootModelPart.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "ModelParts.h"
|
||||
#include "Body.h"
|
||||
#include "Head.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Terrain.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "AlphaMap.h"
|
||||
|
||||
@@ -40,6 +40,9 @@ HRESULT CTerrain::Initialize(void* pArg)
|
||||
|
||||
m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin");
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Load_HeightMap("Hogsmeade_HeightMap.bin")))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -63,7 +66,7 @@ void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
//}
|
||||
|
||||
|
||||
GUI::DragFloat("Up", &m_fUpValue, 0.01f, -1.0f, 1.f);
|
||||
//GUI::DragFloat("Up", &m_fUpValue, 0.01f, -1.0f, 1.f);
|
||||
if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON))
|
||||
{
|
||||
if (m_pGameInstance->isPicking(&m_vPickingPosition))
|
||||
@@ -82,23 +85,24 @@ void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region HEIGHT MAP
|
||||
//HRESULT hr = {};
|
||||
//if(GUI::Button("Save HeightMap"))
|
||||
// hr = m_pVIBufferCom->Save_HeightMap("Hogsmeade_HeightMap.bin");
|
||||
//if(GUI::Button("Load HeightMap"))
|
||||
// hr = m_pVIBufferCom->Load_HeightMap("Hogsmeade_HeightMap.bin");
|
||||
#pragma endregion
|
||||
|
||||
|
||||
/*GUI::InputFloat("Height Ratio", &m_fHeightRatio);
|
||||
max(0.01f, m_fHeightRatio);
|
||||
*/
|
||||
//m_pVIBufferCom->Change_HeigthRatio(m_fHeightRatio);
|
||||
//GUI::DragFloat3("Picking", (_float*)(&m_vPickingPosition));
|
||||
_float4 vPos = {};
|
||||
_float3 vRotation = {};
|
||||
XMStoreFloat4(&vPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
GUI::DragFloat3("Pos", (_float*)(&vPos));
|
||||
GUI::DragFloat3("Rota", (_float*)(&m_vRotation));
|
||||
//_float4 vPos = {};
|
||||
//_float3 vRotation = {};
|
||||
//XMStoreFloat4(&vPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
//GUI::DragFloat3("Pos", (_float*)(&vPos));
|
||||
//GUI::DragFloat3("Rota", (_float*)(&m_vRotation));
|
||||
|
||||
//m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat4(&vPos));
|
||||
//m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat4(&vPos));
|
||||
|
||||
GUI::DragFloat("Culling Radius", &m_fCullingRadius, 0.01f, 0.01f, 2.f);
|
||||
//GUI::DragFloat("Culling Radius", &m_fCullingRadius, 0.01f, 0.01f, 2.f);
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
@@ -107,7 +111,10 @@ void CTerrain::Update(_float fTimeDelta)
|
||||
{
|
||||
//m_pVIBufferCom->Culling(XMMatrixIdentity());
|
||||
|
||||
|
||||
if(m_pGameInstance->Key_Down(DIK_LSHIFT) && m_pGameInstance->Key_Down(DIK_W))
|
||||
{
|
||||
m_bWasWireFrame = !m_bWasWireFrame;
|
||||
}
|
||||
}
|
||||
|
||||
void CTerrain::Late_Update(_float fTimeDelta)
|
||||
@@ -122,9 +129,18 @@ HRESULT CTerrain::Render()
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
|
||||
if(m_bWasWireFrame)
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::TERRAIN)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
|
||||
|
||||
@@ -28,8 +28,6 @@ HRESULT CTrailObject::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
//Load_Trail("")
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -41,48 +39,61 @@ void CTrailObject::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTrailObject::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.y == 0)
|
||||
return;
|
||||
|
||||
m_TrailInfo.vDistortionTime.x += fTimeDelta;
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.x > m_TrailInfo.vDistortionTime.y)
|
||||
{
|
||||
m_TrailInfo.vDistortionTime.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CTrailObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_TrailInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isOnlyBlur == true)
|
||||
return;
|
||||
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CTrailObject::Save_Path(HANDLE hFile)
|
||||
void CTrailObject::Set_Target(CTransform* pTargetTransform)
|
||||
{
|
||||
DWORD dwByte;
|
||||
|
||||
size_t iObjectLength = m_strPath.length();
|
||||
const _char* pFilePath = m_strPath.c_str();
|
||||
SAFE_RELEASE(m_pParentTransformCom);
|
||||
|
||||
if (!WriteFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!WriteFile(hFile, &iObjectLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (pFilePath != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFilePath, sizeof(_char) * ((DWORD)iObjectLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
if(pTargetTransform != nullptr)
|
||||
m_pParentTransformCom = pTargetTransform;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
m_strPath = pPath;
|
||||
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(),
|
||||
GENERIC_WRITE,
|
||||
@@ -97,15 +108,7 @@ HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strPath = strPerfectFilePath;
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
if (!WriteFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
DWORD dwByte;
|
||||
|
||||
size_t iComponentLength = m_strTrailDiffuseName.length();
|
||||
const _char* pFileComponentPath = m_strTrailDiffuseName.c_str();
|
||||
@@ -150,8 +153,27 @@ HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
}
|
||||
}
|
||||
|
||||
iComponentLength = m_strTrailDistortionName.length();
|
||||
pFileComponentPath = m_strTrailDistortionName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
m_pTrailCom->Save_Trail(hFile);
|
||||
|
||||
|
||||
if (!WriteFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
MessageBox(NULL, L"트레일 저장 성공", L"System Message", MB_OK);
|
||||
@@ -165,10 +187,11 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
@@ -189,11 +212,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -210,13 +228,9 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailDiffuseName = szName;
|
||||
|
||||
m_isDiffuse = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -233,8 +247,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailNoiseName = szName;
|
||||
|
||||
m_isNoise = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
@@ -255,20 +267,42 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
m_isMask = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailDistortionName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDistortionName),
|
||||
reinterpret_cast<CComponent**>(&m_pDistortion_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_pTrailCom->Load_Trail(hFile);
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -310,6 +344,28 @@ HRESULT CTrailObject::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Render_Blur()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_TrailInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_TrailInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTrailCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -346,6 +402,7 @@ void CTrailObject::Free()
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pTrailCom);
|
||||
}
|
||||
@@ -357,15 +414,63 @@ void CTrailObject::Describe_Entity()
|
||||
{
|
||||
m_pTrailCom->Describe_Entity();
|
||||
|
||||
GUI::Checkbox("Diffuse", &m_isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_isMask);
|
||||
GUI::Checkbox("Noise", &m_isNoise);
|
||||
m_pShaderCom->Describe_Entity();
|
||||
|
||||
if (m_isDiffuse == true)
|
||||
GUI::Checkbox("Diffuse", &m_TrailInfo.isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_TrailInfo.isMask);
|
||||
GUI::Checkbox("Noise", &m_TrailInfo.isNoise);
|
||||
GUI::Checkbox("Distortion", &m_TrailInfo.isDistortion);
|
||||
|
||||
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vColor);
|
||||
|
||||
if (GUI::TreeNode("TRAIL BLUR"))
|
||||
{
|
||||
GUI::Checkbox("Blur", &m_TrailInfo.isBlur);
|
||||
GUI::Checkbox("OnlyBlur", &m_TrailInfo.isOnlyBlur);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
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::TreePop();
|
||||
}
|
||||
|
||||
/* 이미시브 */
|
||||
if (GUI::TreeNode("TRAIL EMISSIVE"))
|
||||
{
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vEmissive);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
|
||||
GUI::DragFloat("EmissiveStrength", &m_TrailInfo.fEmissiveStrength, 0.01f, 0.f);
|
||||
GUI::DragFloat("SoftenExp", &m_TrailInfo.fSoftenExp, 0.01f, 0.f);
|
||||
GUI::DragFloat("SoftStrength", &m_TrailInfo.fSoftStrength, 0.01f, 0.f);
|
||||
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::TreePop();
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isDiffuse == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL DIFFUSE"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("Diffuse Alpha", &m_TrailInfo.fDiffuseAlpha, 0.01f, 0.f, 1.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("DIFFUSE TEX"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailDiffuseName = strName;
|
||||
@@ -375,34 +480,98 @@ void CTrailObject::Describe_Entity()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isMask == true)
|
||||
if (m_TrailInfo.isMask == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL MASK"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASK_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailMaskingName = strName;
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("SoftMask", &m_TrailInfo.fSoftMask, 0.01f, 0.f);
|
||||
GUI::DragFloat("fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, 0.01f, 0.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("MASK TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASK_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailMaskingName = strName;
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isNoise == true)
|
||||
if (m_TrailInfo.isNoise == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL NOISE"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailNoiseName = strName;
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::Checkbox("NoiseColor", &m_TrailInfo.isNoiseColor);
|
||||
GUI::Checkbox("NoiseAlpha", &m_TrailInfo.isNoiseAlpha);
|
||||
GUI::DragFloat("NoiseStrength", &m_TrailInfo.fNoiseStrength, 0.01f, 0.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("NOISE TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailNoiseName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isDistortion == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL DISTORTION"))
|
||||
{
|
||||
_string strName = {};
|
||||
|
||||
_float2 vDiffuseDistortioUVAmount = {};
|
||||
_float2 vMaskDistortionUVAmount = {};
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
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();
|
||||
|
||||
if (GUI::TreeNode("NOISE TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISTORTION_TEXTURE", (CComponent**)&m_pDistortion_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailDistortionName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
@@ -424,22 +593,103 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_TrailInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_TrailInfo.fDiffuseAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_TrailInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_TrailInfo.isMask, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_TrailInfo.fSoftMask, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_TrailInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_TrailInfo.isNoiseColor, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_TrailInfo.isNoiseAlpha, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseStrength", &m_TrailInfo.fNoiseStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 디스토션 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_TrailInfo.isDistortion, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDistortionTime", &m_TrailInfo.vDistortionTime, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_TrailInfo.vDiffuseDistortioUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDistortionIntensity", &m_TrailInfo.fDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_TrailInfo.vMaskDistortionUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_TrailInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_TrailInfo.fEmissiveStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_TrailInfo.fSoftenExp, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_TrailInfo.fSoftStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_TrailInfo.fCoreBoost, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_TrailInfo.fRadius, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
@@ -461,5 +711,12 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -43,10 +43,6 @@ void CWand::Priority_Update(_float fTimeDelta)
|
||||
socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]);
|
||||
}
|
||||
m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
|
||||
|
||||
//_float3 Scale = _float3(10.f, 10.f, 10.f);
|
||||
//m_pTransformCom->Set_Scale(Scale);
|
||||
}
|
||||
|
||||
void CWand::Update(_float fTimeDelta)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "CamPosition.h"
|
||||
#include "CamPosition_Target.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCamPosition_Shoulder final : public CCamPosition
|
||||
{
|
||||
public:
|
||||
typedef struct tagCameraShoulder_Desc : public CCamPosition::CAMERAPOSITION_DESC
|
||||
{
|
||||
_float fMouseSensor = { 0.5f };
|
||||
_float fShoulderDistance = { 2.f };
|
||||
_float fBackFrontRatio = { 0.9f };
|
||||
_float fCameraFocalLength = { 10.f };
|
||||
_float3 vInitialLook = { 1.f, 2.f, -1.f };
|
||||
}CAMERA_SHOULDER_DESC;
|
||||
private:
|
||||
CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs);
|
||||
virtual ~CCamPosition_Shoulder() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components(void* pArg);
|
||||
HRESULT Ready_SubParts();
|
||||
|
||||
_bool m_bMovable = { true };
|
||||
_float m_fMouseSensor = { 0.5f };
|
||||
_float m_fShoulderDistance = { 2.f };
|
||||
_float m_fCameraFocalLength = { 10.f };
|
||||
_float m_fBackFrontRatio = { 0.9f };
|
||||
_float2 m_vAccDegreeXY = {};
|
||||
_float3 m_vShoulderPosRatio = { 1.f, 2.f, -1.f };
|
||||
|
||||
_float3 m_vShoulderStartRatio = { 1.f, 2.f, -1.f };
|
||||
_float3 m_vShoulderOtherRatio = { 1.f, 2.f, -1.f };
|
||||
|
||||
_bool m_bLerp = { false };
|
||||
_float2 m_vLerpTimer = { 0.f, 1.f };
|
||||
|
||||
|
||||
CCamPosition_Target* m_pTarget_LookPart = { nullptr };
|
||||
CCamPosition_Target* m_pTarget_FollowPart = { nullptr };
|
||||
class CCamera_Gaze* m_pBinded_Camera = { nullptr };
|
||||
|
||||
public:
|
||||
static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Shoulder* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCamPosition_Player final : public CCamPosition
|
||||
class CCamPosition_Socket final : public CCamPosition
|
||||
{
|
||||
public:
|
||||
typedef struct tagCamPosition_Player : public CCamPosition::CAMERAPOSITION_DESC
|
||||
@@ -12,9 +12,9 @@ class CCamPosition_Player final : public CCamPosition
|
||||
const _float4x4* pSocketMatrices = { };
|
||||
}CAMERAPOSITION_PLAYER_DESC;
|
||||
private:
|
||||
CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamPosition_Player(const CCamPosition_Player& rhs);
|
||||
virtual ~CCamPosition_Player() = default;
|
||||
CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamPosition_Socket(const CCamPosition_Socket& rhs);
|
||||
virtual ~CCamPosition_Socket() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
@@ -30,8 +30,8 @@ class CCamPosition_Player final : public CCamPosition
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
|
||||
public:
|
||||
static CCamPosition_Player* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Player* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
static CCamPosition_Socket* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Socket* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "CamPosition.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCamPosition_Target final : public CCamPosition
|
||||
{
|
||||
public:
|
||||
typedef struct tagCamPosition_Target : public CCamPosition::CAMERAPOSITION_DESC
|
||||
{
|
||||
}CAMERAPOSITION_TARGET_DESC;
|
||||
private:
|
||||
CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamPosition_Target(const CCamPosition_Target& rhs);
|
||||
virtual ~CCamPosition_Target() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components(void* pArg);
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CCamPosition_Target* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Target* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||