[add] LockOn Throwing
This commit is contained in:
@@ -71,7 +71,7 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h
|
||||
PSX::PxVec3 vCompressedDir = vDir;
|
||||
vCompressedDir.y += -vDir.y * 2.f + 1.f;
|
||||
vCompressedDir.normalize();
|
||||
pDynamic->addForce(vCompressedDir * fLength* 100.f, PSX::PxForceMode::eFORCE);
|
||||
pDynamic->addForce(vCompressedDir * fLength* 1000.f, PSX::PxForceMode::eFORCE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -66,6 +66,7 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_PGDN))
|
||||
{
|
||||
Start_LerpShoulderPos();
|
||||
m_bLerp = !m_bLerp;
|
||||
}
|
||||
if (true == m_bMovable) {
|
||||
@@ -210,8 +211,8 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
CameraDesc.bEnableFollowLerp = false;
|
||||
CameraDesc.bEnableLookLerp = false;
|
||||
CameraDesc.vTransitionTime = { 0.f, 1.f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vLookLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
CameraDesc.vLookLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &m_pBinded_Camera)))
|
||||
{
|
||||
@@ -232,6 +233,13 @@ void CCamPosition_Shoulder::Start_LerpShoulderPos()
|
||||
|
||||
XMStoreFloat4(&m_DestPos, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(vLook) * m_fShoulderDistance);
|
||||
}
|
||||
_vector CCamPosition_Shoulder::Get_ShoulderLocalPos()
|
||||
{
|
||||
_vector vLook = XMVector3Normalize(3.f * (XMVectorSetZ(XMLoadFloat3(&m_vShoulderPosRatio), 0.f)));
|
||||
_vector vRotq = XMQuaternionRotationRollPitchYaw(0.f, XMConvertToRadians(m_vAccDegreeXY.y), 0.f);
|
||||
vLook = XMVector3Normalize(XMVector3Rotate(vLook, vRotq));
|
||||
return vLook * m_fShoulderDistance;
|
||||
}
|
||||
CCamPosition_Shoulder* CCamPosition_Shoulder::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(pDevice, pContext);
|
||||
|
||||
@@ -115,6 +115,12 @@ HRESULT CMapElement_Interactable::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapElement_Interactable::GrapToPlayer(_fvector vPos, _float fRatio)
|
||||
{
|
||||
_vector vCurrentPosition = m_pTransformCom->Get_State(STATE::POSITION);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorLerp(vCurrentPosition, vPos, fRatio));
|
||||
}
|
||||
|
||||
HRESULT CMapElement_Interactable::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
@@ -227,6 +233,11 @@ HRESULT CMapElement_Interactable::Render_OutLine()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapElement_Interactable::Set_KinematicFlag(_bool bFlag)
|
||||
{
|
||||
m_pRigidBody->Set_Kinematic(bFlag);
|
||||
}
|
||||
|
||||
CMapElement_Interactable* CMapElement_Interactable::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CMapElement_Interactable* pInstance = new CMapElement_Interactable(pDevice, pContext);
|
||||
|
||||
@@ -121,6 +121,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
Update_CameraCoordinateSystem();
|
||||
UpdateGrapInteractive(fTimeDelta);
|
||||
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
@@ -138,15 +139,25 @@ __super::Update(fTimeDelta);
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_pCallBack_HitReport->Set_CurrentSlop();
|
||||
}
|
||||
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON))
|
||||
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)){
|
||||
m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN));
|
||||
}
|
||||
if (m_pGameInstance->Mouse_Up(DIM_RBUTTON))
|
||||
{
|
||||
m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_UP));
|
||||
m_bAim = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::UpdateGrapInteractive(Engine::_float fTimeDelta)
|
||||
{
|
||||
if (nullptr != m_pGrapInteractive) {
|
||||
m_vGrapInteratableLerp.x += fTimeDelta;
|
||||
m_pGrapInteractive->GrapToPlayer(m_pTransformCom->Get_State(STATE::POSITION) + m_pCamPosition_ShoulderPart->Get_ShoulderLocalPos(), m_vGrapInteratableLerp.x);
|
||||
if (m_vGrapInteratableLerp.x > m_vGrapInteratableLerp.y) {
|
||||
m_vGrapInteratableLerp.x -= m_vGrapInteratableLerp.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayer::Late_Update(_float fTimeDelta)
|
||||
@@ -512,6 +523,7 @@ void CPlayer::Free()
|
||||
__super::Free();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pGrapInteractive);
|
||||
if (nullptr != m_pInfoInstance) {
|
||||
CInfoInstance* pInfo = m_pInfoInstance;
|
||||
m_pInfoInstance = nullptr;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "CamPosition_Arm.h"
|
||||
#include "Wand.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "MapElement_Interactable.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CamPosition_Shoulder.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
@@ -205,6 +206,9 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta)
|
||||
else if (m_pGameInstance->Key_Down(DIK_T)) {
|
||||
m_pInfoInstance->Change_Canvas();
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -796,8 +800,17 @@ void CPlayer::Behavior_CombatEnter()
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW);
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
if (nullptr != m_pGrapInteractive) {
|
||||
m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW);
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
}
|
||||
else if (nullptr != m_LockOnInfo.pInteractive) {
|
||||
m_pGrapInteractive = m_LockOnInfo.pInteractive;
|
||||
SAFE_ADDREF(m_pGrapInteractive);
|
||||
m_pGrapInteractive->Set_KinematicFlag(true);
|
||||
m_vGrapInteratableLerp.x = 0.f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_G)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::POTION);
|
||||
@@ -880,6 +893,18 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
_vector vDir = {};
|
||||
_float vDistance = 45.f;
|
||||
CRigidBody_Dynamic* pBody = m_pGrapInteractive->Get_Component<CRigidBody_Dynamic>();
|
||||
if (nullptr != m_LockOnInfo.pUnit) {
|
||||
vDir = XMVector3Normalize(m_LockOnInfo.pUnit->Get_LockOnPos() - m_pGrapInteractive->Get_LockOnPos());
|
||||
}
|
||||
else {
|
||||
vDir = m_pTransformCom->Get_State(STATE::LOOK);
|
||||
}
|
||||
m_pGrapInteractive->Set_KinematicFlag(false);
|
||||
pBody->Add_Force(vDir * vDistance, PSX::PxForceMode::eIMPULSE);
|
||||
SAFE_RELEASE(m_pGrapInteractive);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -959,6 +984,9 @@ HRESULT CPlayer::Behavior_LightAttackExitCheck()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && fRatio >= 0.3f) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
@@ -1158,6 +1186,9 @@ HRESULT CPlayer::Behavior_SpellExitCheck()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && fRatio >= 0.3f)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
_vector Get_ShoulderLocalPos();
|
||||
|
||||
|
||||
private:
|
||||
@@ -50,7 +51,7 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
_bool m_bShoulderLerp = { false };
|
||||
_float2 m_vShoulderLerpTimer = { 0.f, 1.f };
|
||||
|
||||
_float2 m_vPosLerpTimer = { 0.f, 0.16f };
|
||||
_float2 m_vPosLerpTimer = { 0.f, BASIC_LERP_TIMER };
|
||||
_float4 m_StartPos = { };
|
||||
_float4 m_DestPos = { };
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@ class CMapElement_Interactable final : public CMapElement
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual void GrapToPlayer(_fvector vPos, _float fRatio);
|
||||
_vector Get_LockOnPos();
|
||||
virtual void Set_DrawOutLine();
|
||||
virtual HRESULT Render_OutLine() override;
|
||||
void Set_KinematicFlag(_bool bFlag);
|
||||
|
||||
private:
|
||||
ELEMENT_INTERACTABLE_ID m_eInteractableID = { ELEMENT_INTERACTABLE_ID::END };
|
||||
|
||||
@@ -26,9 +26,11 @@ class CPlayer final : public CUnit
|
||||
#endif // _DEBUG
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
_matrix Get_WandPos();
|
||||
void UpdateGrapInteractive(Engine::_float fTimeDelta);
|
||||
private:
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
LOCKON_INFO m_LockOnInfo = {};
|
||||
class CMapElement_Interactable* m_pGrapInteractive = { nullptr };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
_bool m_bSprintToggle = { false };
|
||||
@@ -37,6 +39,7 @@ class CPlayer final : public CUnit
|
||||
|
||||
_float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, };
|
||||
_float3 m_vCameraRightDir = { 1.f, 0.f, 0.f };
|
||||
_float2 m_vGrapInteratableLerp = { 0.f, BASIC_LERP_TIMER };
|
||||
|
||||
class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
|
||||
@@ -170,8 +170,8 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
CameraDesc.bEnableFollowLerp = true;
|
||||
CameraDesc.bEnableLookLerp = true;
|
||||
CameraDesc.vTransitionTime = { 0.f, 1.f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vLookLerpTime = { 0.f, 0.16f };
|
||||
CameraDesc.vFollowLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
CameraDesc.vLookLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Gaze>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &m_pBinded_Camera)))
|
||||
{
|
||||
|
||||
@@ -773,7 +773,7 @@ void CGameInstance::RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& De
|
||||
PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody_Dynamic& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
|
||||
}
|
||||
}
|
||||
PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody_Static& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_StaticActor(RigidBody);
|
||||
|
||||
@@ -56,13 +56,8 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB
|
||||
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
|
||||
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
|
||||
|
||||
if (pxRigidFlags.isSet(PSX::PxRigidBodyFlag::eKINEMATIC)) {
|
||||
|
||||
}
|
||||
else {
|
||||
PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density());
|
||||
}
|
||||
|
||||
PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density());
|
||||
m_pRestBodies.insert(pActorDynamic);
|
||||
Attach_Actor(*pActorDynamic);
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ CRigidBody_Dynamic::CRigidBody_Dynamic(const CRigidBody_Dynamic& rhs) :
|
||||
m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo),
|
||||
m_PxMassCenter(rhs.m_PxMassCenter),
|
||||
m_eLockFlag(rhs.m_eLockFlag),
|
||||
m_vDamping(rhs.m_vDamping)
|
||||
m_vDamping(rhs.m_vDamping),
|
||||
m_fDensity(rhs.m_fDensity)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -225,7 +226,6 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg)
|
||||
m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag);
|
||||
m_pRigidBody->setLinearDamping(m_vDamping.x);
|
||||
m_pRigidBody->setAngularDamping(m_vDamping.y);
|
||||
|
||||
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
|
||||
//m_pRigidBody->joint;
|
||||
//PSX::PxRevol
|
||||
|
||||
@@ -21,10 +21,10 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
_float2 vTransitionTime = { 0.f, 1.f };
|
||||
|
||||
_bool bEnableLookLerp = { false };
|
||||
_float2 vLookLerpTime = { 0.f, 0.16f };
|
||||
_float2 vLookLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
|
||||
_bool bEnableFollowLerp = { false };
|
||||
_float2 vFollowLerpTime = { 0.f, 0.16f };
|
||||
_float2 vFollowLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
}CAMERA_DESC;
|
||||
|
||||
protected:
|
||||
@@ -55,10 +55,10 @@ class ENGINE_DLL CCamera abstract : public CGameObject
|
||||
_float m_fFar = {};
|
||||
|
||||
_float2 m_vTransitionTime = { 0.f, 1.f };
|
||||
_float2 m_vLookLerpTime = { 0.f, 0.16f };
|
||||
_float2 m_vLookLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
_float3 m_vLookPos_Src = { 0.f, 0.f, 1.f };
|
||||
_float3 m_vLookPos_Dest = { 0.f, 0.f, 1.f };
|
||||
_float2 m_vFollowLerpTime = { 0.f, 0.16f };
|
||||
_float2 m_vFollowLerpTime = { 0.f, BASIC_LERP_TIMER };
|
||||
_float3 m_vFollowPos_Src = { 0.f, 0.f, 0.f };
|
||||
_float3 m_vFollowPos_Dest = { 0.f, 0.f, 0.f };
|
||||
_uint m_iPriority = { UINT_MAX };
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
|
||||
#define SSAO_SAMPLE_NUMBER 64
|
||||
#define BASIC_LERP_TIMER 0.16f
|
||||
|
||||
constexpr unsigned int g_iMaxShadowWidth = 16384;
|
||||
constexpr unsigned int g_iMaxShadowHeight = 9216;
|
||||
|
||||
Reference in New Issue
Block a user