Merge remote-tracking branch 'origin/PhysicsLAB' into Develope
This commit is contained in:
@@ -24,7 +24,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
//_CrtSetBreakAlloc(1157440);
|
||||
//_CrtSetBreakAlloc(1181);
|
||||
//_CrtSetBreakAlloc(1182);
|
||||
//_CrtSetBreakAlloc(1183);
|
||||
//_CrtSetBreakAlloc(1184);
|
||||
//_CrtSetBreakAlloc(1185);
|
||||
//_CrtSetBreakAlloc(1186);
|
||||
//_CrtSetBreakAlloc(1187);
|
||||
#endif
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
@@ -166,10 +166,25 @@
|
||||
<ClInclude Include="..\Public\Action_Panel.h" />
|
||||
<ClInclude Include="..\Public\Body.h" />
|
||||
<ClInclude Include="..\public\Active_Icon.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitRepot.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h" />
|
||||
<ClInclude Include="..\Public\DummyObject.h" />
|
||||
<ClInclude Include="..\public\DummySkyBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorFrame.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorSet.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXFixedDoor.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXMonster.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlatform.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
@@ -200,7 +215,7 @@
|
||||
<ClInclude Include="..\public\MapObject_Manager.h" />
|
||||
<ClInclude Include="..\Public\MainLight.h" />
|
||||
<ClInclude Include="..\public\MapObject_Collision.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoor.h">
|
||||
<ClInclude Include="..\Public\Dummy_PhysXFreeDoor.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
@@ -256,10 +271,25 @@
|
||||
<ClCompile Include="..\Private\Action_Panel.cpp" />
|
||||
<ClCompile Include="..\Private\Body.cpp" />
|
||||
<ClCompile Include="..\private\Active_Icon.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitRepot.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp" />
|
||||
<ClCompile Include="..\Private\DummyObject.cpp" />
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorFrame.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorSet.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXFixedDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXMonster.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXPlatform.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
@@ -290,7 +320,7 @@
|
||||
<ClCompile Include="..\private\MapObject_Manager.cpp" />
|
||||
<ClCompile Include="..\Private\MainLight.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Collision.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoor.cpp">
|
||||
<ClCompile Include="..\Private\Dummy_PhysXFreeDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
||||
@@ -202,30 +202,27 @@
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Dummy_Plane">
|
||||
<UniqueIdentifier>{6872c5bc-5eac-46a1-b6d8-3ec0f4fb2cd5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback">
|
||||
<UniqueIdentifier>{b6d1496a-c8ef-4b7a-9ed4-f00b0a244313}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable">
|
||||
<UniqueIdentifier>{a225d78f-7eec-4407-bdfd-9e14452f3338}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable">
|
||||
<UniqueIdentifier>{a32d5869-5562-4099-925a-f8c022e9aac7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior">
|
||||
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\Callback">
|
||||
<UniqueIdentifier>{b6d1496a-c8ef-4b7a-9ed4-f00b0a244313}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXDoor">
|
||||
<UniqueIdentifier>{3131278b-18f5-4b84-ba85-73104998e9c9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXPlatform">
|
||||
<UniqueIdentifier>{efffeaa6-b7a5-49fe-bd2e-9dfa9e4a67d8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXWall">
|
||||
<UniqueIdentifier>{813d68fb-0603-44e9-8fda-5c5dd84d0eb1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback">
|
||||
<UniqueIdentifier>{b6d1496a-c8ef-4b7a-9ed4-f00b0a244313}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet">
|
||||
<UniqueIdentifier>{6a026ae9-e454-45cd-9baa-ed093de3e60c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame">
|
||||
<UniqueIdentifier>{070a2e44-cce8-4f75-8192-9fcdec4b17f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXFixedDoor">
|
||||
<UniqueIdentifier>{2f4d3a35-b6fa-475e-86ce-e7fae954da58}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXFreeDoor">
|
||||
<UniqueIdentifier>{3131278b-18f5-4b84-ba85-73104998e9c9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State">
|
||||
<UniqueIdentifier>{9c21aba5-00c1-4b4c-8a82-dac7a156fd9b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -249,7 +246,7 @@
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Env\04.Land">
|
||||
<UniqueIdentifier>{66df0152-4b1e-461c-a88e-750770c73d62}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel">
|
||||
<UniqueIdentifier>{69af6531-b479-4496-9e9b-245423844204}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -262,6 +259,27 @@
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel\Spell_Image">
|
||||
<UniqueIdentifier>{a5069e0b-5f20-44e5-bb86-56d4febc0996}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\PhysXMonster">
|
||||
<UniqueIdentifier>{1bc9f833-8d1b-4576-9ae5-51a039f4d2ff}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior">
|
||||
<UniqueIdentifier>{d0e9e4de-c3f2-45fa-ba22-f8882d7a2a7e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster">
|
||||
<UniqueIdentifier>{dabfa8ad-dc37-4dd6-8ea0-9fd46cfeadec}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable">
|
||||
<UniqueIdentifier>{a225d78f-7eec-4407-bdfd-9e14452f3338}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport">
|
||||
<UniqueIdentifier>{e8c89ebe-2db4-47c1-b2cc-8b6d49bef902}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Monster">
|
||||
<UniqueIdentifier>{af42cf4c-c875-43b8-9a5a-981d78e6aaf9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable">
|
||||
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -465,14 +483,8 @@
|
||||
<ClInclude Include="..\Public\Dummy_Plane.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitRepot.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoor.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoor</Filter>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXFreeDoor.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXFreeDoor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlatform.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXPlatform</Filter>
|
||||
@@ -500,7 +512,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Land.h">
|
||||
<Filter>02.GameObjects\Env\04.Land</Filter>
|
||||
</ClInclude>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Action_Panel.h">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel</Filter>
|
||||
</ClInclude>
|
||||
@@ -513,6 +525,30 @@
|
||||
<ClInclude Include="..\public\Spell_Overlay.h">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Spell_Overlay</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorSet.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXFixedDoor.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXFixedDoor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorFrame.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXMonster.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXMonster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -712,14 +748,8 @@
|
||||
<ClCompile Include="..\Private\Dummy_Plane.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitRepot.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Playable</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\Callback\Playable\Behavior</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoor.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoor</Filter>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXFreeDoor.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXFreeDoor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXPlatform.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXPlatform</Filter>
|
||||
@@ -727,6 +757,15 @@
|
||||
<ClCompile Include="..\Private\Dummy_PhysXWall.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXWall</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorSet.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXFixedDoor.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXFixedDoor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorFrame.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||
<Filter>80.State\State_Dodge</Filter>
|
||||
</ClCompile>
|
||||
@@ -747,7 +786,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Land.cpp">
|
||||
<Filter>02.GameObjects\Env\04.Land</Filter>
|
||||
</ClCompile>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Action_Panel.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel</Filter>
|
||||
</ClCompile>
|
||||
@@ -760,6 +799,21 @@
|
||||
<ClCompile Include="..\private\Spell_Overlay.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Spell_Overlay</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_PhysXMonster.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXMonster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_HitReport.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Monster_Behavior.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CCallBack_Monster_Behavior::CCallBack_Monster_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
CCallBack_Monster_Behavior::~CCallBack_Monster_Behavior()
|
||||
{
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
{
|
||||
if (nullptr == actor.userData) {
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0);
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(actor.userData);
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
switch (pActorData->iSubKind)
|
||||
{
|
||||
case 20:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
break;
|
||||
case 21:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case 22:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case 23:
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case 24:
|
||||
eResults = PSX::PxControllerBehaviorFlags(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return eResults;
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxController& controller)
|
||||
{
|
||||
// CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle)
|
||||
{
|
||||
// Obstacle이 움직이는 발판이다?
|
||||
// 여기서 ride/slide 세팅
|
||||
//return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Monster_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject)
|
||||
{
|
||||
m_pController = pController;
|
||||
m_pPartDynamicBody = pPartDynamicObject;
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pController);
|
||||
SAFE_ADDREF(m_pPartDynamicBody);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Monster_Behavior::Finalize()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pPartDynamicBody);
|
||||
SAFE_RELEASE(m_pController);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCallBack_Monster_Behavior* CCallBack_Monster_Behavior::Create()
|
||||
{
|
||||
return new CCallBack_Monster_Behavior();;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Monster_HitReport.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "RigidBody_Dynamic.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
CCallBack_Monster_HitReport::CCallBack_Monster_HitReport()
|
||||
{
|
||||
}
|
||||
|
||||
CCallBack_Monster_HitReport::~CCallBack_Monster_HitReport()
|
||||
{
|
||||
}
|
||||
|
||||
void CCallBack_Monster_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pTargetActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
PhsXUserData* pOwnerActorData = static_cast<PhsXUserData*>(pController->getActor()->userData);
|
||||
if (nullptr == pTargetActorData) { // missing user data
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pTargetActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
{
|
||||
switch (pTargetActorData->iSubKind)
|
||||
{
|
||||
case 0:
|
||||
m_pController->ConvertToDO(*m_pPartDynamicBody);
|
||||
m_pPartDynamicBody->Add_Force(XMVectorSet(vDir.x, vDir.y, vDir.z, 0.f) * fLength * 100.f, PSX::PxForceMode::eIMPULSE);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Monster_HitReport::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pOtherController->getActor()->userData);
|
||||
assert(nullptr != pActorData); // missing user data
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Monster_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
const void* pOtherController = hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Monster_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject)
|
||||
{
|
||||
m_pController = pController;
|
||||
m_pPartDynamicBody = pPartDynamicObject;
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pController);
|
||||
SAFE_ADDREF(m_pPartDynamicBody);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Monster_HitReport::Finalize()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pPartDynamicBody);
|
||||
SAFE_RELEASE(m_pController);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCallBack_Monster_HitReport* CCallBack_Monster_HitReport::Create()
|
||||
{
|
||||
return new CCallBack_Monster_HitReport();
|
||||
}
|
||||
@@ -3,15 +3,12 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CCallBack_Playable_Behavior::CCallBack_Playable_Behavior():
|
||||
m_pGameInstance(CGameInstance::GetInstance())
|
||||
CCallBack_Playable_Behavior::CCallBack_Playable_Behavior()
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
CCallBack_Playable_Behavior::~CCallBack_Playable_Behavior()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
@@ -42,7 +39,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con
|
||||
eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
break;
|
||||
case 24:
|
||||
eResults = PSX::PxControllerBehaviorFlags(0);;
|
||||
eResults = PSX::PxControllerBehaviorFlags(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -74,3 +71,27 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con
|
||||
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Playable_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject)
|
||||
{
|
||||
m_pController = pController;
|
||||
m_pPartDynamicBody = pPartDynamicObject;
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pController);
|
||||
SAFE_ADDREF(m_pPartDynamicBody);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Playable_Behavior::Finalize()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pPartDynamicBody);
|
||||
SAFE_RELEASE(m_pController);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCallBack_Playable_Behavior* CCallBack_Playable_Behavior::Create()
|
||||
{
|
||||
return new CCallBack_Playable_Behavior();
|
||||
}
|
||||
|
||||
+41
-10
@@ -1,20 +1,17 @@
|
||||
#include "pch.h"
|
||||
#include "CallBack_Playable_HitRepot.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
#include "GameInstance.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
CCallBack_Playable_HitRepot::CCallBack_Playable_HitRepot():
|
||||
m_pGameInstance(CGameInstance::GetInstance())
|
||||
CCallBack_Playable_HitReport::CCallBack_Playable_HitReport()
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
CCallBack_Playable_HitRepot::~CCallBack_Playable_HitRepot()
|
||||
CCallBack_Playable_HitReport::~CCallBack_Playable_HitReport()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
@@ -53,7 +50,6 @@ void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hi
|
||||
case 24: // 문짝
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
pDynamic->addTorque(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
_float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f));
|
||||
if (fDot > 0) {
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
@@ -62,6 +58,17 @@ void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hi
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eIMPULSE);
|
||||
}
|
||||
} break;
|
||||
case 25: // 문짝
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
_float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f));
|
||||
if (fDot > 0) {
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eFORCE);
|
||||
}
|
||||
else {
|
||||
pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100000.f, PSX::PxForceMode::eFORCE);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
{
|
||||
PSX::PxRigidDynamic* pDynamic = static_cast<PSX::PxRigidDynamic*>(pActor);
|
||||
@@ -81,7 +88,7 @@ void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hi
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
void CCallBack_Playable_HitReport::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
@@ -114,7 +121,7 @@ void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& h
|
||||
}
|
||||
}
|
||||
|
||||
void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
void CCallBack_Playable_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
@@ -130,3 +137,27 @@ void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleH
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Playable_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject)
|
||||
{
|
||||
m_pController = pController;
|
||||
m_pPartDynamicBody = pPartDynamicObject;
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pController);
|
||||
SAFE_ADDREF(m_pPartDynamicBody);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCallBack_Playable_HitReport::Finalize()
|
||||
{
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pPartDynamicBody);
|
||||
SAFE_RELEASE(m_pController);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CCallBack_Playable_HitReport* CCallBack_Playable_HitReport::Create()
|
||||
{
|
||||
return new CCallBack_Playable_HitReport();
|
||||
}
|
||||
+34
-31
@@ -1,25 +1,25 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXDoor.h"
|
||||
#include "Dummy_PhysXDoorFrame.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_PhysXDoor::CDummy_PhysXDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
CDummy_PhysXDoorFrame::CDummy_PhysXDoorFrame(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_PhysXDoor::CDummy_PhysXDoor(const CDummy_PhysXDoor& rhs)
|
||||
: CGameObject(rhs)
|
||||
CDummy_PhysXDoorFrame::CDummy_PhysXDoorFrame(const CDummy_PhysXDoorFrame& rhs)
|
||||
: CPartObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoor::Initialize_Prototype()
|
||||
HRESULT CDummy_PhysXDoorFrame::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoor::Initialize(void* pArg)
|
||||
HRESULT CDummy_PhysXDoorFrame::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
@@ -32,29 +32,25 @@ HRESULT CDummy_PhysXDoor::Initialize(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Priority_Update(_float fTimeDelta)
|
||||
void CDummy_PhysXDoorFrame::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Update(_float fTimeDelta)
|
||||
void CDummy_PhysXDoorFrame::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef 기무리
|
||||
//if (m_pActor->is wakeup)
|
||||
// _vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
|
||||
//_float fRadian = XMConvertToRadians(XMVectorGetZ(vRPY));
|
||||
//if (tanf(fRadian)
|
||||
#endif // 기무리
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix,
|
||||
XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()) * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Late_Update(_float fTimeDelta)
|
||||
void CDummy_PhysXDoorFrame::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoor::Render()
|
||||
HRESULT CDummy_PhysXDoorFrame::Render()
|
||||
{
|
||||
//if (FAILED(Bind_ShaderResources())) {
|
||||
// return E_FAIL;
|
||||
@@ -80,7 +76,12 @@ HRESULT CDummy_PhysXDoor::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoor::Ready_Components(void* pArg)
|
||||
PSX::PxRigidDynamic* CDummy_PhysXDoorFrame::Get_Actor()
|
||||
{
|
||||
return m_pRigidBody->Get_Actor();
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorFrame::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
@@ -90,14 +91,11 @@ HRESULT CDummy_PhysXDoor::Ready_Components(void* pArg)
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z);
|
||||
|
||||
m_vRadianYAngle.y = pPhysXDummyDesc->vRotRPY.y;
|
||||
m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-70.f);
|
||||
m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(70.f);
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pPhysXDummyDesc->iSubKind;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -112,10 +110,11 @@ HRESULT CDummy_PhysXDoor::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoor::Bind_ShaderResources()
|
||||
HRESULT CDummy_PhysXDoorFrame::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
@@ -133,34 +132,38 @@ HRESULT CDummy_PhysXDoor::Bind_ShaderResources()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_PhysXDoor* CDummy_PhysXDoor::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
CDummy_PhysXDoorFrame* CDummy_PhysXDoorFrame::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_PhysXDoor* pInstance = new CDummy_PhysXDoor(pDevice, pContext);
|
||||
CDummy_PhysXDoorFrame* pInstance = new CDummy_PhysXDoorFrame(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXDoor");
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXDoorFrame");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_PhysXDoor::Clone(void* pArg, CGameObject* pOwner)
|
||||
CGameObject* CDummy_PhysXDoorFrame::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_PhysXDoor* pInstance = new CDummy_PhysXDoor(*this);
|
||||
CDummy_PhysXDoorFrame* pInstance = new CDummy_PhysXDoorFrame(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXDoor");
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXDoorFrame");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Free()
|
||||
void CDummy_PhysXDoorFrame::Free()
|
||||
{
|
||||
if (nullptr != m_pRigidBody) {
|
||||
m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
@@ -168,6 +171,6 @@ void CDummy_PhysXDoor::Free()
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoor::Describe_Entity()
|
||||
void CDummy_PhysXDoorFrame::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXDoorSet.h"
|
||||
#include "Dummy_PhysXFixedDoor.h"
|
||||
#include "Dummy_PhysXDoorFrame.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_PhysXDoorSet::CDummy_PhysXDoorSet(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CContainerObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_PhysXDoorSet::CDummy_PhysXDoorSet(const CDummy_PhysXDoorSet& rhs)
|
||||
: CContainerObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_PartObject(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
PSX::PxTransform pxFrameTransform = {};
|
||||
PSX::PxTransform pxDoorTransform = {};
|
||||
PSX::PxRigidDynamic* pFrameBody = m_pFramePart->Get_Actor();
|
||||
PSX::PxRigidDynamic* pDoorBody = m_pDoorPart->Get_Actor();
|
||||
|
||||
_vector vPos = m_pTransformCom->Get_State(STATE::POSITION) + XMVectorSet(0.f, 1.f, 0.f, 0.f);
|
||||
PSX::PxVec3 vHingeLocalPos = {};
|
||||
XMStoreFloat3((_float3*)&vHingeLocalPos, vPos);
|
||||
pxFrameTransform.p = pFrameBody->getGlobalPose().transformInv(vHingeLocalPos);
|
||||
pxDoorTransform.p = pDoorBody->getGlobalPose().transformInv(vHingeLocalPos);
|
||||
|
||||
pxDoorTransform.q = pxFrameTransform.q = PSX::PxQuat(XM_PIDIV2, PSX::PxVec3(0.f, 0.f, 1.f));
|
||||
|
||||
m_pPSXJoint = m_pGameInstance->Create_PxRevoluteJoint(pFrameBody, pxFrameTransform, pDoorBody ,pxDoorTransform);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Ready_PartObject(void* pArg)
|
||||
{
|
||||
{
|
||||
CDummy_PhysXDoorFrame::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
Desc.vPos = { -10.f, 3.f, -10.f };
|
||||
Desc.iSubKind = 23;
|
||||
if (FAILED(Add_PartObject<CDummy_PhysXDoorFrame>("DoorFrame", g_iStaticLevel, &m_pFramePart, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXFixedDoor::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.pParentTransform = m_pTransformCom;
|
||||
Desc.vPos = { 0.f, 3.f, 0.f };
|
||||
Desc.iSubKind = 25;
|
||||
if (FAILED(Add_PartObject<CDummy_PhysXFixedDoor>("DoorFixed", g_iStaticLevel, &m_pDoorPart, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXDoorSet::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_PhysXDoorSet* CDummy_PhysXDoorSet::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_PhysXDoorSet* pInstance = new CDummy_PhysXDoorSet(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXDoorSet");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_PhysXDoorSet::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_PhysXDoorSet* pInstance = new CDummy_PhysXDoorSet(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXDoorSet");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pDoorPart);
|
||||
SAFE_RELEASE(m_pFramePart);
|
||||
}
|
||||
|
||||
void CDummy_PhysXDoorSet::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXFixedDoor.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_PhysXFixedDoor::CDummy_PhysXFixedDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_PhysXFixedDoor::CDummy_PhysXFixedDoor(const CDummy_PhysXFixedDoor& rhs)
|
||||
: CPartObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_PhysXFixedDoor::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_PhysXFixedDoor::Update(_float fTimeDelta)
|
||||
{
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix,
|
||||
XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()) * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
}
|
||||
|
||||
void CDummy_PhysXFixedDoor::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Render()
|
||||
{
|
||||
_vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
|
||||
|
||||
//GUI::Begin("FixedDoor");
|
||||
//m_pTransformCom->Describe_Entity();
|
||||
//GUI::Text("Current Roll : %f", XMConvertToDegrees(XMVectorGetX(vRPY)));
|
||||
//GUI::Text("Current Pitch : %f", XMConvertToDegrees(XMVectorGetY(vRPY)));
|
||||
//GUI::Text("Current Yaw : %f", XMConvertToDegrees(XMVectorGetZ(vRPY)));
|
||||
//GUI::End();
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
PSX::PxRigidDynamic* CDummy_PhysXFixedDoor::Get_Actor()
|
||||
{
|
||||
return m_pRigidBody->Get_Actor();
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z);
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pPhysXDummyDesc->iSubKind;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFixedDoor::Bind_ShaderResources()
|
||||
{
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_PhysXFixedDoor* CDummy_PhysXFixedDoor::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_PhysXFixedDoor* pInstance = new CDummy_PhysXFixedDoor(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXFixedDoor");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_PhysXFixedDoor::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_PhysXFixedDoor* pInstance = new CDummy_PhysXFixedDoor(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXFixedDoor");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_PhysXFixedDoor::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXFixedDoor::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXFreeDoor.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_PhysXFreeDoor::CDummy_PhysXFreeDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_PhysXFreeDoor::CDummy_PhysXFreeDoor(const CDummy_PhysXFreeDoor& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFreeDoor::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFreeDoor::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
//GUI::Text("%f %f %f", m_vKinematicTimer.x, m_vKinematicTimer.y, m_vKinematicTimer.z);
|
||||
//GUI::Text("%f", ((m_vKinematicTimer.x - m_vKinematicTimer.y) / (m_vKinematicTimer.z - m_vKinematicTimer.y)));
|
||||
|
||||
if (m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) {
|
||||
m_vKinematicTimer.x += fTimeDelta;
|
||||
if (m_vKinematicTimer.x < m_vKinematicTimer.z) {
|
||||
// 행렬없이 럴프 버전
|
||||
_float fTime = max(0.f, ((m_vKinematicTimer.x - m_vKinematicTimer.y) / (m_vKinematicTimer.z - m_vKinematicTimer.y)));
|
||||
Lerp_Matrix(fTime);
|
||||
//Lerp_NonMatrix(fTime);
|
||||
GUI::Text("2");
|
||||
}
|
||||
else {
|
||||
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
|
||||
GUI::Text("3");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Lerp_Matrix(Engine::_float fTime)
|
||||
{
|
||||
{
|
||||
_float4x4 OutMatrix = {};
|
||||
_float4x4 CurrentMatrix = {};
|
||||
XMStoreFloat4x4(&CurrentMatrix, m_pTransformCom->Get_XMWorldMatrix());
|
||||
CMyTools::MatrixLerp(&CurrentMatrix, &m_InitialMatrix, OutMatrix, fTime);
|
||||
m_pTransformCom->Set_WorldMatrix(OutMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Lerp_NonMatrix(Engine::_float fTime)
|
||||
{
|
||||
{
|
||||
_vector vCurrQ = m_pTransformCom->Get_QuarternionVector();
|
||||
_vector vInitialQ = XMLoadFloat4((_float4*)&m_pxStartQuat);
|
||||
_vector vLerpQuat = XMVector4Normalize(XMVectorLerp(vCurrQ, vInitialQ, fTime));
|
||||
|
||||
PSX::PxTransform actorPose = m_pActor->getGlobalPose();
|
||||
PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose();
|
||||
|
||||
PSX::PxVec3 vpxMassLocal = massLocalPose.p;
|
||||
PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal);
|
||||
|
||||
_vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f);
|
||||
_vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f);
|
||||
|
||||
|
||||
_float3 vScale = m_pTransformCom->Get_Scale();
|
||||
_matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale));
|
||||
_matrix RotationMatrix = XMMatrixRotationQuaternion(vLerpQuat);
|
||||
|
||||
_matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal);
|
||||
_matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld);
|
||||
|
||||
// 최종 월드 행렬
|
||||
_matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴
|
||||
* (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(world);
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFreeDoor::Render()
|
||||
{
|
||||
_vector vRPY = m_pTransformCom->Get_RollPitchYawVector();
|
||||
if (!(m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)) {
|
||||
_float fPitch = XMVectorGetX(vRPY);
|
||||
_float fYaw = XMVectorGetY(vRPY);
|
||||
_float fRoll = XMVectorGetZ(vRPY);
|
||||
|
||||
_float fClampedYaw = ClampRadian(fYaw);
|
||||
if (fClampedYaw != fYaw) {
|
||||
_vector vNewQuat = XMQuaternionRotationRollPitchYaw(fPitch, fClampedYaw, fRoll);
|
||||
|
||||
PSX::PxTransform actorPose = m_pActor->getGlobalPose();
|
||||
PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose();
|
||||
|
||||
PSX::PxVec3 vpxMassLocal = massLocalPose.p;
|
||||
PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal);
|
||||
|
||||
_vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f);
|
||||
_vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f);
|
||||
|
||||
_float3 vScale = m_pTransformCom->Get_Scale();
|
||||
_matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale));
|
||||
_matrix RotationMatrix = XMMatrixRotationQuaternion(vNewQuat);
|
||||
|
||||
_matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal);
|
||||
_matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld);
|
||||
|
||||
// 최종 월드 행렬
|
||||
_matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴
|
||||
* (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(world);
|
||||
m_pActor->setGlobalPose(XMWorldToPx_NoScale(world));
|
||||
|
||||
m_pActor->setAngularVelocity(PSX::PxVec3(0));
|
||||
m_pActor->setLinearVelocity(PSX::PxVec3(0));
|
||||
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true);
|
||||
m_vKinematicTimer.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
vRPY = m_pTransformCom->Get_RollPitchYawVector(); // 갱신된 값으로 다시 읽기
|
||||
GUI::Begin("Door");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("Current Roll : %f", XMConvertToDegrees(XMVectorGetZ(vRPY)));
|
||||
GUI::Text("Current Pitch : %f", XMConvertToDegrees(XMVectorGetX(vRPY)));
|
||||
GUI::Text("Current Yaw : %f", XMConvertToDegrees(XMVectorGetY(vRPY)));
|
||||
GUI::Text("Current Limit Left : %f", XMConvertToDegrees(m_vRadianYAngle.x));
|
||||
GUI::Text("Current Limit Right : %f", XMConvertToDegrees(m_vRadianYAngle.z));
|
||||
GUI::End();
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFreeDoor::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z);
|
||||
|
||||
XMStoreFloat4((_float4*)&m_pxStartQuat, m_pTransformCom->Get_QuarternionVector());
|
||||
XMStoreFloat4x4(&m_InitialMatrix, m_pTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
m_vRadianYAngle.y = pPhysXDummyDesc->vRotRPY.z;
|
||||
m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-pPhysXDummyDesc->fAngleLimit);
|
||||
m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(pPhysXDummyDesc->fAngleLimit);
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pPhysXDummyDesc->iSubKind;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pActor = m_pRigidBody->Get_Actor();
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXFreeDoor::Bind_ShaderResources()
|
||||
{
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_float CDummy_PhysXFreeDoor::ClampRadian(_float fNewRadian)
|
||||
{
|
||||
// [x, z] 사이로 잘라주는 단순한 클램프
|
||||
_float minYaw = m_vRadianYAngle.x;
|
||||
_float maxYaw = m_vRadianYAngle.z;
|
||||
|
||||
// 라디안 노멀라이즈 ([-pi, pi] 같은 범위로)
|
||||
fNewRadian = CMyTools::NormalizeRadian(fNewRadian);
|
||||
|
||||
if (fNewRadian < minYaw) {
|
||||
fNewRadian = minYaw;
|
||||
}
|
||||
else if (fNewRadian > maxYaw) {
|
||||
fNewRadian = maxYaw;
|
||||
}
|
||||
return fNewRadian;
|
||||
}
|
||||
|
||||
CDummy_PhysXFreeDoor* CDummy_PhysXFreeDoor::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_PhysXFreeDoor* pInstance = new CDummy_PhysXFreeDoor(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXFreeDoor");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_PhysXFreeDoor::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_PhysXFreeDoor* pInstance = new CDummy_PhysXFreeDoor(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXFreeDoor");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXFreeDoor::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXMonster.h"
|
||||
#include "CallBack_Monster_Behavior.h"
|
||||
#include "CallBack_Monster_HitReport.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CDummy_PhysXMonster::CDummy_PhysXMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :
|
||||
CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_PhysXMonster::CDummy_PhysXMonster(const CDummy_PhysXMonster& rhs) :
|
||||
CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CDummy_PhysXMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
}
|
||||
|
||||
void CDummy_PhysXMonster::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("%d", m_pCharacter_Controller->IsActive());
|
||||
GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y);
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * 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;
|
||||
}
|
||||
else {
|
||||
if (0.f == m_vStunTimer.x) {
|
||||
PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition();
|
||||
PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z);
|
||||
m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
//m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
m_vStunTimer.x += fTimeDelta;
|
||||
m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose());
|
||||
if (m_vStunTimer.y < m_vStunTimer.x) {
|
||||
m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMonster::Render()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
if (FAILED(m_pCharacter_Controller->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMonster::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMonster::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMonster::Ready_Components(void* pArg)
|
||||
{
|
||||
CTransform::TRANSFORM_DESC TransformDesc{};
|
||||
TransformDesc.fRadius = 100.f;
|
||||
TransformDesc.fRotationPerSec = XMConvertToRadians(60.f);
|
||||
TransformDesc.fSpeedPerSec = 30.f;
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PHYSXDUMMY_DESC* pDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z);
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = pDesc->iSubKind;
|
||||
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 = pDesc->iSubKind;
|
||||
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());
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXMonster::Bind_ShaderResources()
|
||||
{
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_PhysXMonster* CDummy_PhysXMonster::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_PhysXMonster* pInstance = new CDummy_PhysXMonster(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_PhysXMonster");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_PhysXMonster::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_PhysXMonster* pInstance = new CDummy_PhysXMonster(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_PhysXMonster");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_PhysXMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
if (nullptr != m_pCallBack_Behavior) {
|
||||
m_pCallBack_Behavior->Finalize();
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
}
|
||||
if (nullptr != m_pCallBack_HitReport) {
|
||||
m_pCallBack_HitReport->Finalize();
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
}
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXMonster::Describe_Entity()
|
||||
{
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
}
|
||||
@@ -100,6 +100,9 @@ HRESULT CDummy_PhysXPlayable::Initialize(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -115,7 +118,7 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
PHYSXDUMMY_DESC* pDesc = static_cast<PHYSXDUMMY_DESC*>(pArg);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z);
|
||||
{
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = pDesc->iSubKind;
|
||||
@@ -127,19 +130,27 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = &m_pCallBack_HitReport;
|
||||
Desc.pCallback_Behavior = &m_pCallBack_Behavior;
|
||||
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;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = pDesc->iSubKind;
|
||||
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());
|
||||
}
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
@@ -160,7 +171,6 @@ HRESULT CDummy_PhysXPlayable::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;
|
||||
}
|
||||
@@ -196,8 +206,16 @@ CGameObject* CDummy_PhysXPlayable::Clone(void* pArg, CGameObject* pOwner)
|
||||
void CDummy_PhysXPlayable::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_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
#include "Terrain.h"
|
||||
#include "Dummy_PhysXBox.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "Dummy_PhysXMonster.h"
|
||||
#include "Dummy_PhysXMesh.h"
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXPlatform.h"
|
||||
#include "Dummy_PhysXDoor.h"
|
||||
#include "Dummy_PhysXFreeDoor.h"
|
||||
#include "Dummy_PhysXDoorSet.h"
|
||||
#include "MapObject_Manager.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MainLight.h"
|
||||
@@ -67,7 +69,7 @@ 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 = 500.f;
|
||||
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;
|
||||
@@ -85,10 +87,12 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag)
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){
|
||||
return E_FAIL;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject_Manager>(g_iStaticLevel, NEXT_LEVEL, LAYER_MAPOBJECTMANAGER)))
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject_Manager>(g_iStaticLevel, NEXT_LEVEL, LAYER_MAPOBJECTMANAGER))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -115,6 +119,14 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
//{
|
||||
// CDummy_PhysXDoorSet::PHYSXDUMMY_DESC Desc{};
|
||||
// Desc.vPos = { -15.f, 3.f, -15.f };
|
||||
// Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXDoorSet>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
{
|
||||
CDummy_PhysXPlatform::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { -3.f, 2.f, 10.f };
|
||||
@@ -134,14 +146,24 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXDoor::PHYSXDUMMY_DESC Desc{};
|
||||
CDummy_PhysXFreeDoor::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 10.f, 2.f, 10.f };
|
||||
Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f };
|
||||
Desc.vRotRPY = { 0.f, XMConvertToRadians(-XM_1DIV2PI), 0.f};
|
||||
Desc.iSubKind = 24;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXDoor>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
Desc.fAngleLimit = 70.f;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXFreeDoor>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
//{
|
||||
// CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{};
|
||||
// Desc.vPos = { 14.f, 2.f, 15.f };
|
||||
// Desc.vRotRPY = { 0.f, XMConvertToRadians(-XM_1DIV2PI), 0.f };
|
||||
// Desc.iSubKind = 23;
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXWall>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
{
|
||||
CDummy_PhysXPlayable::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 100.f, 0.f };
|
||||
@@ -151,6 +173,15 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{
|
||||
CDummy_PhysXMonster::PHYSXDUMMY_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 100.f, 0.f };
|
||||
Desc.vRotRPY = { 12.f, 0.f, 0.f };
|
||||
Desc.iSubKind = 10;
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXMonster>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
//{
|
||||
// CDummy_PhysXMesh::PHYSXDUMMY_DESC Desc{};
|
||||
|
||||
@@ -80,10 +80,14 @@
|
||||
|
||||
#include "Dummy_PhysXBox.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "Dummy_PhysXMonster.h"
|
||||
#include "Dummy_PhysXMesh.h"
|
||||
#include "Dummy_PhysXPlatform.h"
|
||||
#include "Dummy_PhysXDoor.h"
|
||||
#include "Dummy_PhysXFreeDoor.h"
|
||||
#include "Dummy_PhysXWall.h"
|
||||
//#include "Dummy_PhysXDoorFrame.h"
|
||||
//#include "Dummy_PhysXFixedDoor.h"
|
||||
//#include "Dummy_PhysXDoorSet.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -646,8 +650,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 4.5f, 4.5f, 4.5f };
|
||||
Desc.fDensity = 1000.f;
|
||||
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 };
|
||||
@@ -684,9 +688,9 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.5f, 1.5f, 0.0625f };
|
||||
Desc.fDensity = 100.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 1.5f, 0.f));
|
||||
Desc.vhalfGeometryInfo = { 3.5f, 1.5f, 0.25f };
|
||||
Desc.fDensity = 10.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(3.5f, 1.5f, 0.f));
|
||||
|
||||
Desc.pxMassCenter = pxPivotTransform;
|
||||
Desc.eLockFlag = {
|
||||
@@ -703,6 +707,27 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
{ // FixedDoor
|
||||
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 = { 1.5f, 1.5f, 0.25f };
|
||||
Desc.fDensity = 10.f;
|
||||
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 1.5f, 0.f));
|
||||
|
||||
Desc.pxMassCenter = pxPivotTransform;
|
||||
Desc.eLockFlag = { };
|
||||
Desc.vAutoDamping = { 10.f, 10.f };
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), 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)))) {
|
||||
@@ -802,13 +827,25 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXBox>(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoor>(g_iStaticLevel, CDummy_PhysXDoor::Create(m_pDevice, m_pContext)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXFreeDoor>(g_iStaticLevel, CDummy_PhysXFreeDoor::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoorSet>(g_iStaticLevel, CDummy_PhysXDoorSet::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXDoorFrame>(g_iStaticLevel, CDummy_PhysXDoorFrame::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXFixedDoor>(g_iStaticLevel, CDummy_PhysXFixedDoor::Create(m_pDevice, m_pContext)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXPlayable>(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXMesh>(g_iStaticLevel, CDummy_PhysXMesh::Create(m_pDevice, m_pContext)))) {
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXMonster>(g_iStaticLevel, CDummy_PhysXMonster::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXMesh>(g_iStaticLevel, CDummy_PhysXMesh::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXWall>(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCallBack_Monster_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
private:
|
||||
CCallBack_Monster_Behavior();
|
||||
public:
|
||||
~CCallBack_Monster_Behavior();
|
||||
|
||||
|
||||
public:
|
||||
// PxControllerBehaviorCallback을(를) 통해 상속됨
|
||||
// 충돌알림이 아닌, 행동정책 정해주기. CCT vs CCT는 지원안함
|
||||
// slopeLimit로 미끄러져 갈 수 있는지 없는지 이분법적인 계산 대신, 원하는 물체에 대해서만 미끄러운 표면으로 정의해줌
|
||||
// 주인이 되는 CCT가 이 물체에 대해 이 물체를 어떻게 해야 할까? -> (타고 올라갈까? Ride?) (미끄러져갈까? Slide?) ( 직접 내가 구현할까? user defined ride? )
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) override;
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override;
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override;
|
||||
|
||||
public:
|
||||
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject);
|
||||
HRESULT Finalize();
|
||||
|
||||
private:
|
||||
CCharacter_Controller* m_pController = { nullptr };
|
||||
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
public:
|
||||
static CCallBack_Monster_Behavior* Create();
|
||||
};
|
||||
NS_END
|
||||
+14
-5
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
@@ -8,7 +9,7 @@ NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport
|
||||
class CCallBack_Monster_HitReport final : public PSX::PxUserControllerHitReport
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
@@ -16,10 +17,10 @@ class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
private:
|
||||
CCallBack_Monster_HitReport();
|
||||
public:
|
||||
CCallBack_Playable_HitRepot();
|
||||
~CCallBack_Playable_HitRepot();
|
||||
~CCallBack_Monster_HitReport();
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
@@ -31,7 +32,15 @@ class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
|
||||
public:
|
||||
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject);
|
||||
HRESULT Finalize();
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
CCharacter_Controller* m_pController = { nullptr };
|
||||
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
public:
|
||||
static CCallBack_Monster_HitReport* Create();
|
||||
};
|
||||
NS_END
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
@@ -16,9 +17,9 @@ class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallba
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
|
||||
public:
|
||||
private:
|
||||
CCallBack_Playable_Behavior();
|
||||
public:
|
||||
~CCallBack_Playable_Behavior();
|
||||
|
||||
public:
|
||||
@@ -31,7 +32,16 @@ class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallba
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override;
|
||||
|
||||
virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override;
|
||||
|
||||
public:
|
||||
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject);
|
||||
HRESULT Finalize();
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
CCharacter_Controller* m_pController = { nullptr };
|
||||
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
public:
|
||||
static CCallBack_Playable_Behavior* Create();
|
||||
};
|
||||
NS_END
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CCallBack_Playable_HitReport final : public PSX::PxUserControllerHitReport
|
||||
{
|
||||
// 구현 예시
|
||||
// CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임
|
||||
//
|
||||
// PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)"
|
||||
// PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)"
|
||||
// PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)"
|
||||
private:
|
||||
CCallBack_Playable_HitReport();
|
||||
public:
|
||||
~CCallBack_Playable_HitReport();
|
||||
|
||||
public:
|
||||
// PxUserControllerHitReport을(를) 통해 상속됨
|
||||
// 충돌알림!!
|
||||
// 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까?
|
||||
virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우
|
||||
|
||||
virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우
|
||||
|
||||
virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우
|
||||
|
||||
public:
|
||||
HRESULT Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject);
|
||||
HRESULT Finalize();
|
||||
private:
|
||||
CCharacter_Controller* m_pController = { nullptr };
|
||||
CRigidBody_Dynamic* m_pPartDynamicBody = { nullptr };
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
public:
|
||||
static CCallBack_Playable_HitReport* Create();
|
||||
};
|
||||
NS_END
|
||||
+12
-11
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
@@ -11,19 +11,19 @@ NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_PhysXDoor final : public CGameObject
|
||||
class CDummy_PhysXDoorFrame final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc
|
||||
typedef struct tagPhysXDummyDesc : public CPartObject::PARTOBJECT_DESC
|
||||
{
|
||||
_float3 vPos = { };
|
||||
_float3 vRotRPY = { };
|
||||
_uint iSubKind = { };
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CDummy_PhysXDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXDoor(const CDummy_PhysXDoor& rhs);
|
||||
virtual ~CDummy_PhysXDoor() = default;
|
||||
CDummy_PhysXDoorFrame(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXDoorFrame(const CDummy_PhysXDoorFrame& rhs);
|
||||
virtual ~CDummy_PhysXDoorFrame() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
@@ -31,12 +31,13 @@ class CDummy_PhysXDoor final : public CGameObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
PSX::PxRigidDynamic* Get_Actor();
|
||||
|
||||
private:
|
||||
CRigidBody* m_pRigidBody = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
const PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
_float3 m_vRadianYAngle = {};
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
@@ -46,7 +47,7 @@ class CDummy_PhysXDoor final : public CGameObject
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CDummy_PhysXDoor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
static CDummy_PhysXDoorFrame* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "ContainerObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_PhysXDoorSet final : public CContainerObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc
|
||||
{
|
||||
_float3 vPos = { };
|
||||
_float3 vRotRPY = { };
|
||||
_float fAngleLimit = {};
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CDummy_PhysXDoorSet(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXDoorSet(const CDummy_PhysXDoorSet& rhs);
|
||||
virtual ~CDummy_PhysXDoorSet() = 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;
|
||||
|
||||
private:
|
||||
class CDummy_PhysXFixedDoor* m_pDoorPart = { nullptr };
|
||||
class CDummy_PhysXDoorFrame* m_pFramePart = { nullptr };
|
||||
PSX::PxRevoluteJoint* m_pPSXJoint = { nullptr };
|
||||
_float3 m_vRadianYAngle = {};
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Ready_PartObject(void* pArg);
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
|
||||
public:
|
||||
static CDummy_PhysXDoorSet* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_PhysXFixedDoor final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc : public CPartObject::PARTOBJECT_DESC
|
||||
{
|
||||
_float3 vPos = { };
|
||||
_float3 vRotRPY = { };
|
||||
_uint iSubKind = { };
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CDummy_PhysXFixedDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXFixedDoor(const CDummy_PhysXFixedDoor& rhs);
|
||||
virtual ~CDummy_PhysXFixedDoor() = 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;
|
||||
|
||||
PSX::PxRigidDynamic* Get_Actor();
|
||||
|
||||
private:
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
const PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
|
||||
public:
|
||||
static CDummy_PhysXFixedDoor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_PhysXFreeDoor final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc
|
||||
{
|
||||
_float3 vPos = { };
|
||||
_float3 vRotRPY = { };
|
||||
_uint iSubKind = { };
|
||||
_float fAngleLimit = {};
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CDummy_PhysXFreeDoor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXFreeDoor(const CDummy_PhysXFreeDoor& rhs);
|
||||
virtual ~CDummy_PhysXFreeDoor() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
void Lerp_Matrix(Engine::_float fTime);
|
||||
void Lerp_NonMatrix(Engine::_float fTime);
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
_float3 m_vRadianYAngle = {};
|
||||
_float3 m_vKinematicTimer = { 0.f, 2.f, 2.3f };
|
||||
PSX::PxQuat m_pxStartQuat = {};
|
||||
_float4x4 m_InitialMatrix = {};
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
_float ClampRadian(_float fNewRadian);
|
||||
|
||||
|
||||
public:
|
||||
static CDummy_PhysXFreeDoor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "CallBack_Monster_Behavior.h"
|
||||
#include "CallBack_Monster_HitReport.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_PhysXMonster final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagPhysXDummyDesc
|
||||
{
|
||||
_float3 vPos = { };
|
||||
_float3 vRotRPY = { };
|
||||
_uint iSubKind = { };
|
||||
}PHYSXDUMMY_DESC;
|
||||
private:
|
||||
CDummy_PhysXMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXMonster(const CDummy_PhysXMonster& rhs);
|
||||
virtual ~CDummy_PhysXMonster() = 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;
|
||||
|
||||
private:
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
_float2 m_vStunTimer = { 0.f, 4.f };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CDummy_PhysXMonster* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CallBack_Playable_HitRepot.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
@@ -34,12 +34,13 @@ class CDummy_PhysXPlayable final : public CGameObject
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
CCallBack_Playable_Behavior m_pCallBack_Behavior = {};
|
||||
CCallBack_Playable_HitRepot m_pCallBack_HitReport = {};
|
||||
CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -207,6 +207,10 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp" />
|
||||
<ClCompile Include="..\Private\ContainerObject.cpp" />
|
||||
<ClCompile Include="..\Private\DebugDraw.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic_Joint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\ElementObject.cpp" />
|
||||
<ClCompile Include="..\Private\FSM.cpp" />
|
||||
<ClCompile Include="..\Private\GameInstance.cpp">
|
||||
@@ -413,6 +417,10 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\Bounding_OBB.h" />
|
||||
<ClInclude Include="..\Public\Bounding_Sphere.h" />
|
||||
<ClInclude Include="..\public\FSM.h" />
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic_Joint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\NCallBack_Playable_Behavior.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -271,6 +271,9 @@
|
||||
<Filter Include="02.Element\02.Component\02.VIBuffer\Instance\UI_nstance">
|
||||
<UniqueIdentifier>{3266e85d-44bb-4144-bf85-fadc48d85a38}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\20.Joint">
|
||||
<UniqueIdentifier>{869c0ee8-a853-40d4-90ea-3e1501fa8529}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -513,6 +516,9 @@
|
||||
<ClCompile Include="..\private\VIBuffer_Instance.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic_Joint.cpp">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\20.Joint</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -1121,6 +1127,9 @@
|
||||
<ClInclude Include="..\public\VIBuffer_Instance.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic_Joint.h">
|
||||
<Filter>02.Element\02.Component\07.RigidBody\20.Joint</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -20,7 +20,7 @@ HRESULT CCharacter_Controller::Render()
|
||||
_vector vPos = Get_Position();
|
||||
_float3 vVolume = Get_Volume();
|
||||
_matrix WorldMatrix = XMMatrixTranslationFromVector(vPos);
|
||||
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
@@ -40,10 +40,9 @@ HRESULT CCharacter_Controller::Render()
|
||||
{
|
||||
_float fHalf = vVolume.y;
|
||||
|
||||
_matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
fHalf / (2.f * 0.5f),
|
||||
vVolume.x / 0.5f);
|
||||
_matrix ScaleMatrix = XMMatrixScaling(vVolume.x / 0.5f,
|
||||
fHalf / (2.f * 0.5f),
|
||||
vVolume.x / 0.5f);
|
||||
m_pMainShape->Draw(ScaleMatrix * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
|
||||
_matrix ScaleSphereMatrix = XMMatrixScaling(vVolume.x / 0.5f, vVolume.x / 0.5f, vVolume.x / 0.5f);
|
||||
@@ -65,6 +64,11 @@ PSX::PxRigidDynamic* CCharacter_Controller::Get_Actor()
|
||||
return m_pController->getActor();
|
||||
}
|
||||
|
||||
PSX::PxController* CCharacter_Controller::Get_Controller()
|
||||
{
|
||||
return m_pController;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
void CCharacter_Controller::Resize_Volume(_float fHeight)
|
||||
@@ -88,8 +92,7 @@ void CCharacter_Controller::Modify_Volume(_float3 fVolume)
|
||||
if (0 != fVolume.z) {
|
||||
pBox->setHalfForwardExtent(fVolume.z);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
PSX::PxCapsuleController* pCapsule = static_cast<PSX::PxCapsuleController*>(m_pController);
|
||||
@@ -99,8 +102,7 @@ void CCharacter_Controller::Modify_Volume(_float3 fVolume)
|
||||
if (0 != fVolume.y) {
|
||||
pCapsule->setHeight(fVolume.y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -119,8 +121,7 @@ _float3 CCharacter_Controller::Get_Volume()
|
||||
pBox->getHalfHeight(),
|
||||
pBox->getHalfForwardExtent()
|
||||
};
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
PSX::PxCapsuleController* pCapsule = static_cast<PSX::PxCapsuleController*>(m_pController);
|
||||
@@ -129,14 +130,29 @@ _float3 CCharacter_Controller::Get_Volume()
|
||||
pCapsule->getHeight(),
|
||||
0.f
|
||||
};
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
default:
|
||||
return { -1.f, -1.f, -1.f };
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CCharacter_Controller::ConvertToDO(CRigidBody_Dynamic& BodyOriginal)
|
||||
{
|
||||
PSX::PxRigidDynamic* pDOActor = BodyOriginal.Get_Actor();
|
||||
PSX::PxRigidDynamic* pCCTActor = m_pController->getActor();
|
||||
|
||||
m_bActive = false;
|
||||
BodyOriginal.SetActive(true);
|
||||
|
||||
m_pGameInstance->Attach_Actor(*pDOActor); // DO 액터 활성화
|
||||
|
||||
PSX::PxTransform pxTransform = pCCTActor->getGlobalPose();
|
||||
pDOActor->setGlobalPose(pxTransform);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
{
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
@@ -148,7 +164,6 @@ void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
|
||||
m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles);
|
||||
|
||||
|
||||
//PSX::PxUserControllerHitReport* pHitCallBack = { nullptr };
|
||||
//PSX::PxControllerShapeHit ShapeHit = {};
|
||||
//ShapeHit.
|
||||
@@ -200,7 +215,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
PSX::PxBoxControllerDesc Desc{};
|
||||
Desc.halfHeight = pDesc->vBoxSize.y;
|
||||
@@ -214,7 +229,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
m_pController->setUserData(&m_tagData);
|
||||
m_pController->getActor()->userData = &m_tagData;
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
PSX::PxCapsuleControllerDesc Desc{};
|
||||
Desc.radius = pDesc->fRadius;
|
||||
|
||||
@@ -608,6 +608,10 @@ PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody_Static& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_StaticActor(RigidBody);
|
||||
}
|
||||
PSX::PxRevoluteJoint* CGameInstance::Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame)
|
||||
{
|
||||
return m_pPhysX_Manager->Create_PxRevoluteJoint(pActorFrame, pxLocalWallFrame, pActorObject, pxLocalActorFrame);
|
||||
}
|
||||
PSX::PxController* CGameInstance::Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_CapsuleController(Desc);
|
||||
|
||||
@@ -124,6 +124,15 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
|
||||
return pActor;
|
||||
}
|
||||
|
||||
PSX::PxRevoluteJoint* CPhysX_Manager::Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame)
|
||||
{
|
||||
PSX::PxRevoluteJoint* pJoint = PSX::PxRevoluteJointCreate(*m_pPhysics, pActorFrame, pxLocalWallFrame, pActorObject, pxLocalActorFrame);
|
||||
|
||||
assert(nullptr != pJoint);
|
||||
|
||||
return pJoint;
|
||||
}
|
||||
|
||||
PSX::PxMaterial* CPhysX_Manager::Create_Material(const _float3* vMatInfo)
|
||||
{
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z);
|
||||
@@ -347,6 +356,7 @@ PSX::PxController* CPhysX_Manager::Add_CapsuleController(PSX::PxCapsuleControlle
|
||||
PSX::PxController* pController = { nullptr };
|
||||
|
||||
pController = m_pCCTManager->createController(Desc);
|
||||
|
||||
return pController;
|
||||
}
|
||||
|
||||
@@ -551,7 +561,11 @@ void CPhysX_Manager::Free()
|
||||
m_pCCTManager->release();
|
||||
m_pCCTManager = nullptr;
|
||||
}
|
||||
|
||||
for (PSX::PxMaterial* pMat : m_pMaterials) {
|
||||
if (pMat) {
|
||||
pMat->release();
|
||||
}
|
||||
} m_pMaterials.clear();
|
||||
if (nullptr != m_pScene) {
|
||||
m_pScene->release(); m_pScene = nullptr;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,21 @@ void CRigidBody_Dynamic::Set_Kinematic(_bool bKinematic)
|
||||
m_pRigidBody->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic);
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal)
|
||||
{
|
||||
m_pTransform->Set_WorldMatrix(m_pRigidBody->getGlobalPose());
|
||||
CCTOriginal.Set_Position(m_pTransform->Get_State(STATE::POSITION));
|
||||
|
||||
m_pRigidBody->setAngularVelocity(PSX::PxZERO()); // DO 객체 이동 제거
|
||||
m_pRigidBody->setLinearVelocity(PSX::PxZERO());
|
||||
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody); // 현재 액터 비활성화
|
||||
m_bActive = false;
|
||||
CCTOriginal.SetActive(true);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "pch.h"
|
||||
@@ -86,6 +86,14 @@ void CTransform::Mult_Scale(_float3& vScale)
|
||||
Set_State(STATE::LOOK, vLook * vScale.z);
|
||||
}
|
||||
|
||||
void CTransform::Set_WorldMatrix(PSX::PxTransform dstMatrix)
|
||||
{
|
||||
_float3 vScale = Get_Scale();
|
||||
|
||||
XMStoreFloat4x4(&m_WorldMatrix,
|
||||
XMMatrixAffineTransformation(XMLoadFloat3(&vScale), XMVectorZero(), XMLoadFloat4((_float4*)&dstMatrix.q), XMLoadFloat3((_float3*)&dstMatrix.p)));
|
||||
}
|
||||
|
||||
HRESULT CTransform::Initialize_Prototype()
|
||||
{
|
||||
XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity());
|
||||
@@ -237,6 +245,7 @@ void CTransform::Rotation(_fvector vAxis, _float fRadian)
|
||||
|
||||
void CTransform::Rotation(_float fRadianX, _float fRadianY, _float fRadianZ)
|
||||
{
|
||||
// _fvector 버전이랑 FromVector만 다른거임
|
||||
_float3 vScale = Get_Scale();
|
||||
_vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f) * vScale.x;
|
||||
_vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f) * vScale.y;
|
||||
@@ -259,6 +268,26 @@ void CTransform::Rotation(_float3& vRadian)
|
||||
Rotation(vRadian.x, vRadian.y, vRadian.z);
|
||||
}
|
||||
|
||||
void CTransform::Rotation(_fvector vRPY)
|
||||
{
|
||||
// _float3 버전이랑 FromVector만 다른거임
|
||||
_float3 vScale = Get_Scale();
|
||||
_vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f) * vScale.x;
|
||||
_vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f) * vScale.y;
|
||||
_vector vLook = XMVectorSet(0.f, 0.f, 1.f, 0.f) * vScale.z;
|
||||
|
||||
_vector vQuternion = XMQuaternionRotationRollPitchYawFromVector(vRPY);
|
||||
_matrix RotationMatrix = XMMatrixRotationQuaternion(vQuternion);
|
||||
|
||||
vRight = XMVector3TransformNormal(vRight, RotationMatrix);
|
||||
vUp = XMVector3TransformNormal(vUp, RotationMatrix);
|
||||
vLook = XMVector3TransformNormal(vLook, RotationMatrix);
|
||||
|
||||
Set_State(STATE::RIGHT, vRight);
|
||||
Set_State(STATE::UP, vUp);
|
||||
Set_State(STATE::LOOK, vLook);
|
||||
}
|
||||
|
||||
void CTransform::LookAt(_fvector vAt)
|
||||
{
|
||||
_float3 vScale = Get_Scale();
|
||||
|
||||
@@ -27,14 +27,12 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
// 타고 올라갈 수 없는 경사면의 각도를 정의함. 0.f 면 비활성화 됨
|
||||
// _float fSlopeLimit = { 코사인각도 };
|
||||
|
||||
|
||||
|
||||
// Box인 경우 채워넣기
|
||||
_float3 vBoxSize = { 0.5f, 0.5f, 0.5f }; // CCT박스는 회전없는 AABB임
|
||||
|
||||
// Capsule인 경우 채워넣기
|
||||
_float fRadius;
|
||||
_float fHeight;
|
||||
_float fRadius = { 0.5f };
|
||||
_float fHeight = { 1.f };
|
||||
PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset 값이 무제한), (eCONSTRAINED, stepOffset 값이 제대로 먹음)
|
||||
}Character_Controller_DESC;
|
||||
#pragma endregion
|
||||
@@ -48,6 +46,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
virtual HRESULT Render() override;
|
||||
#endif
|
||||
PSX::PxRigidDynamic* Get_Actor();
|
||||
PSX::PxController* Get_Controller();
|
||||
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
@@ -61,6 +60,10 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
|
||||
HRESULT ConvertToDO(class CRigidBody_Dynamic& BodyOriginal);
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
private:
|
||||
ACTOR m_eBodyType = { ACTOR::END };
|
||||
PSX::PxController* m_pController = { nullptr };
|
||||
@@ -70,6 +73,7 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
PhsXUserData m_tagData = {};
|
||||
|
||||
PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};
|
||||
_bool m_bActive = { true };
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
|
||||
@@ -189,7 +189,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody);
|
||||
|
||||
PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame);
|
||||
|
||||
PSX::PxController* Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc);
|
||||
PSX::PxController* Add_BoxController(PSX::PxBoxControllerDesc& Desc);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Engine_Define.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
@@ -38,7 +38,7 @@ class CMyTools {
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
// wstring --> string 변환
|
||||
// wstring --> string 변환
|
||||
static _string ToString(const _wstring& var)
|
||||
{
|
||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, var.c_str(),
|
||||
@@ -51,7 +51,7 @@ class CMyTools {
|
||||
return strTo;
|
||||
}
|
||||
|
||||
// string --> wstring 변환
|
||||
// string --> wstring 변환
|
||||
static _wstring ToWstring(const _string& var)
|
||||
{
|
||||
int size_needed = MultiByteToWideChar(CP_UTF8, 0, var.c_str(),
|
||||
@@ -64,13 +64,13 @@ class CMyTools {
|
||||
return wstrTo;
|
||||
}
|
||||
|
||||
// ratio로 현재 value 가져오기
|
||||
// ratio로 현재 value 가져오기
|
||||
static _float Lerp_f1D(_float fA, _float fB, _float fRatio)
|
||||
{
|
||||
return fA + (fB - fA) * fRatio;
|
||||
}
|
||||
|
||||
// value로 현재 ratio 가져오기
|
||||
// value로 현재 ratio 가져오기
|
||||
static _float InverseLerp_f1D(_float fA, _float fB, _float fValue)
|
||||
{
|
||||
if (fA == fB) return 0.0f;
|
||||
@@ -78,7 +78,7 @@ class CMyTools {
|
||||
}
|
||||
|
||||
|
||||
// A -> B, A- >C의 외적이 업벡터 방향으로 외적되도록 B C를 교정
|
||||
// A -> B, A- >C의 외적이 업벡터 방향으로 외적되도록 B C를 교정
|
||||
static void CorrectTriangleToUpHead(_float3& dotA, _float3& dotB, _float3& dotC) {
|
||||
_vector vDotA = XMLoadFloat3(&dotA);
|
||||
_vector vDotB = XMLoadFloat3(&dotB);
|
||||
@@ -89,7 +89,7 @@ class CMyTools {
|
||||
}
|
||||
}
|
||||
|
||||
// dx9에 있던 그거
|
||||
// dx9에 있던 그거
|
||||
static _bool IntersectTri(
|
||||
const _fvector& vPos, const _fvector& vDir,
|
||||
const _fvector& vertexA, const _gvector& vertexB, const _hvector& vertexC,
|
||||
@@ -116,7 +116,7 @@ class CMyTools {
|
||||
return t >= 0.f;
|
||||
}
|
||||
|
||||
// source에 keyword가 있는지 검사
|
||||
// source에 keyword가 있는지 검사
|
||||
static _bool ContainsString(const char* source, const char* keyword) {
|
||||
if (!source || !keyword || *keyword == '\0') {
|
||||
return false;
|
||||
@@ -124,7 +124,7 @@ class CMyTools {
|
||||
return (strstr(source, keyword) != nullptr);
|
||||
}
|
||||
|
||||
// 매트릭스 럴프
|
||||
// 매트릭스 럴프
|
||||
static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0
|
||||
_In_ _float4x4* pMatTarget, // Target -> 1
|
||||
_Out_ _float4x4& matOut, _float fRatio) {
|
||||
@@ -146,7 +146,7 @@ class CMyTools {
|
||||
XMStoreFloat4x4(&matOut, (XMMatrixAffineTransformation(vTargetScale, XMVectorZero(), vTargetRotq, vTargetTrans)));
|
||||
}
|
||||
|
||||
// 비슷하면 1 직교하면 0 완전 반대방향일수록 -1
|
||||
// 비슷하면 1 직교하면 0 완전 반대방향일수록 -1
|
||||
static _float DirectionCompare(_vector a, _vector b)
|
||||
{
|
||||
_vector vNormalA = XMVector3Normalize(a);
|
||||
@@ -154,7 +154,7 @@ class CMyTools {
|
||||
return XMVectorGetX(XMVector3Dot(vNormalA, vNormalB));
|
||||
}
|
||||
|
||||
// hlsl에 있는 Saturate 그거임
|
||||
// hlsl에 있는 Saturate 그거임
|
||||
static _float Saturate(_float fValue) {
|
||||
if (fValue > 1.f) {
|
||||
fValue = 1.f;
|
||||
@@ -165,14 +165,43 @@ class CMyTools {
|
||||
return fValue;
|
||||
}
|
||||
|
||||
// 입력 라디안이 들어오면 -PI ~ +PI로 정규화된 라디안으로 변경
|
||||
static _float NormalizeRadian(_float fRadian)
|
||||
{
|
||||
fRadian = fmodf(fRadian, XM_2PI);
|
||||
if (fRadian <= -XM_PI) {
|
||||
fRadian += XM_2PI;
|
||||
}
|
||||
else if (fRadian > XM_PI) {
|
||||
fRadian -= XM_2PI;
|
||||
}
|
||||
return fRadian;
|
||||
}
|
||||
|
||||
inline static void RotateRadianTowards(_float& fSrcRadian, const _float& fDstRadian, _float fRotateSpeed) {
|
||||
_float fDiffRadian = fmodf(fSrcRadian - fDstRadian, 2 * XM_PI);
|
||||
if (fDiffRadian < 0) fDiffRadian += 2 * XM_PI;
|
||||
|
||||
if (fDiffRadian < (fRotateSpeed * XM_PI) / 180.f) {
|
||||
fSrcRadian = fDstRadian;
|
||||
return;
|
||||
}
|
||||
if (fDiffRadian < XM_PI) {
|
||||
fSrcRadian -= (fRotateSpeed * XM_PI) / 180.f;
|
||||
}
|
||||
else if (fDiffRadian > XM_PI) {
|
||||
fSrcRadian += (fRotateSpeed * XM_PI) / 180.f;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma region FileSystem
|
||||
//static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive,
|
||||
// /* 탐색할 폴더 경로 */ _In_ const _wstring& TargetPath,
|
||||
// /* 탐색할 때마다 실행할 로직*/ _In_ function<void(filesystem::directory_entry)> funcLogic,
|
||||
// /* 탐색할 확장자들 */ _In_ const vector<_wstring>& targetExtentions,
|
||||
// /* 결과 경로들 */ _Out_ vector<_wstring>& Paths )
|
||||
//static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive,
|
||||
// /* 탐색할 폴더 경로 */ _In_ const _wstring& TargetPath,
|
||||
// /* 탐색할 때마다 실행할 로직*/ _In_ function<void(filesystem::directory_entry)> funcLogic,
|
||||
// /* 탐색할 확장자들 */ _In_ const vector<_wstring>& targetExtentions,
|
||||
// /* 결과 경로들 */ _Out_ vector<_wstring>& Paths )
|
||||
//{
|
||||
// // 경로 예시 -> "../Bin/Resources/Models/Environment/Hogwarts/SUB_ClockTowerCourtyard/Static_Mesh_EXT"
|
||||
// // 경로 예시 -> "../Bin/Resources/Models/Environment/Hogwarts/SUB_ClockTowerCourtyard/Static_Mesh_EXT"
|
||||
// filesystem::path path = TargetPath;
|
||||
// for (const filesystem::directory_entry& file : filesystem::directory_iterator(path, filesystem::directory_options::skip_permission_denied))
|
||||
// {
|
||||
@@ -182,24 +211,24 @@ class CMyTools {
|
||||
// }
|
||||
// continue;
|
||||
// }
|
||||
// if (true == targetExtentions.empty()) { // 확장자 제한 없음
|
||||
// if (true == targetExtentions.empty()) { // 확장자 제한 없음
|
||||
// Paths.emplace_back(file.path().wstring());
|
||||
// funcLogic(file);
|
||||
// continue;
|
||||
// }
|
||||
// for (const _wstring& ext : targetExtentions) { // 확장자 제한 있음
|
||||
// for (const _wstring& ext : targetExtentions) { // 확장자 제한 있음
|
||||
// if (file.path().extension() == ext) {
|
||||
// Paths.emplace_back(file.path().wstring());
|
||||
// funcLogic(file);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// // file.path().extension(); // 확장자
|
||||
// // file.path().filename(); // 파일명(확장자포함)
|
||||
// // file.path().stem(); // 파일명(확장자제외)
|
||||
// // file.path().parent_path(); // 상위 폴더 경로
|
||||
// // file.path().wstring(); // 전체 경로
|
||||
// // file.path().string(); // 전체 경로 (string)
|
||||
// // file.path().extension(); // 확장자
|
||||
// // file.path().filename(); // 파일명(확장자포함)
|
||||
// // file.path().stem(); // 파일명(확장자제외)
|
||||
// // file.path().parent_path(); // 상위 폴더 경로
|
||||
// // file.path().wstring(); // 전체 경로
|
||||
// // file.path().string(); // 전체 경로 (string)
|
||||
// }
|
||||
//}
|
||||
#pragma endregion
|
||||
@@ -221,4 +250,4 @@ class CMyTools {
|
||||
}
|
||||
}
|
||||
};
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
|
||||
@@ -24,6 +24,7 @@ class CPhysX_Manager final : public CBase
|
||||
|
||||
PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody);
|
||||
PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody);
|
||||
PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame);
|
||||
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxMaterial* Create_Material(const _float3* vMatInfo);
|
||||
|
||||
@@ -40,6 +40,10 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
virtual void Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 방향 ( 회전축은 MassCenter )
|
||||
void Set_Kinematic(_bool bKinematic);
|
||||
|
||||
HRESULT ConvertToCCT(class CCharacter_Controller& CCTOriginal);
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
private:
|
||||
PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체
|
||||
PSX::PxRigidDynamicLockFlags m_eLockFlag = { };
|
||||
@@ -48,6 +52,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
_float3 m_vhalfGeometryInfo = {};
|
||||
_float2 m_vDamping = { 0.f, 0.f };
|
||||
_float m_fDensity = { 1000.f };
|
||||
_bool m_bActive = { true };
|
||||
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
class CDynamic_Joint
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ class ENGINE_DLL CTransform final :
|
||||
void Set_State(STATE eState, _fvector vState) { XMStoreFloat4(reinterpret_cast<_float4*>(&m_WorldMatrix.m[ENUM_CLASS(eState)]), vState); }
|
||||
void Set_WorldMatrix(_float4x4& dstMatrix) { memcpy_s(&m_WorldMatrix, sizeof(_float4x4), &dstMatrix, sizeof(_float4x4)); }
|
||||
void Set_WorldMatrix(_fmatrix& dstMatrix) { XMStoreFloat4x4(&m_WorldMatrix, dstMatrix); }
|
||||
void Set_WorldMatrix(PSX::PxTransform dstMatrix);
|
||||
_float Get_Speed() const { return m_fSpeedPerSec; }
|
||||
_float Get_RotationSpeed() const { return m_fRotationPerSec; }
|
||||
_float Get_Radius() const { return m_fRadius; }
|
||||
@@ -59,6 +60,7 @@ class ENGINE_DLL CTransform final :
|
||||
void Rotation(_fvector vAxis, _float fRadian);
|
||||
void Rotation(_float fRadianX, _float fRadianY, _float fRadianZ);
|
||||
void Rotation(_float3& vRadian);
|
||||
void Rotation(_fvector vRPY);
|
||||
|
||||
// Up, Down 벡터를 바라보게 하면 터짐
|
||||
void LookAt(_fvector vAt);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <d3d11.h>
|
||||
|
||||
@@ -76,7 +76,6 @@ using namespace FMOD;
|
||||
|
||||
#include "PhysX/PxPhysics.h"
|
||||
#include "PhysX/PxPhysicsAPI.h"
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user