From fa0363bd1d68232b8094452de38bace2839fdc7c Mon Sep 17 00:00:00 2001 From: "adnan.mujkic" Date: Fri, 17 Jul 2026 23:49:40 +0200 Subject: [PATCH] More refactors, remove universal camera, tweak build script --- BuildGame.bat | 167 +- Content/Camera/BP_UniversalCamera.uasset | 3 - Content/Input/IMC_MovementContext.uasset | 4 +- .../AlchemySystem/BP_AlchemyManager.uasset | 4 +- .../Blueprints/BP_ThirdPersonCharacter.uasset | 4 +- .../0/KY/1TIS1JTSP6OJZYAWI50IXS.uasset | 4 +- .../0/Q5/9FZQ54683KH54N3CTAC56E.uasset | 4 +- .../0/QO/V42ZUGC93YVPG6JZQSYNFV.uasset | 4 +- .../0/UK/RJR7O3ZBUNVYT45GYLP4LT.uasset | 4 +- .../1/G4/WCIOOKCLLLGGYKV3QTB3PC.uasset | 4 +- .../2/3O/ZX7H6U52U8CDRI888H7ZQ6.uasset | 4 +- .../2/CI/70BS2JIPOBOLSLK41VZTOX.uasset | 4 +- .../2/MZ/S102JILH4NPA69Y23WGEFN.uasset | 4 +- .../2/O6/GR4F3AMJY6BFXAU9SYTOEN.uasset | 4 +- .../3/C8/X511L70OJGDRVNDY6M3RFM.uasset | 4 +- .../4/67/O326MPI9QNSZEEB74A4R10.uasset | 4 +- .../4/71/L52OPE2KS89OUZ84N0MNSZ.uasset | 4 +- .../4/9N/NK4HCA2HAC35F26D0Q56HD.uasset | 4 +- .../4/IV/AZTI3ISN21AO0OX04BYRR4.uasset | 4 +- .../4/KT/AKQTEEYD69AC748FOENK58.uasset | 4 +- .../4/LE/S051R10K50ZELROG2Q4AS8.uasset | 4 +- .../5/3N/V2S8IJJZC6RFPD86AP93EN.uasset | 4 +- .../5/QX/9L27I0L6BGYROGLZCSSIEJ.uasset | 4 +- .../6/BL/5HUHLPTPP1KKKRQ8B1GAKE.uasset | 4 +- .../6/FJ/XSLZCCYW6P0XOLD701W2BA.uasset | 4 +- .../6/SY/DSB9H4SNLTFFQD7IWQVP6M.uasset | 4 +- .../6/T1/UEW826WYCSQR77Q2FL71LI.uasset | 4 +- .../6/UQ/JH3TNU0CLQHW0OHIZRQCSL.uasset | 4 +- .../6/W9/YIOMING37LJUL2TVWHDD1Z.uasset | 4 +- .../7/67/UH9JH7WQKMK2NU4EO2WWI2.uasset | 4 +- .../7/EK/U12XBX5FQST76VPVQECOSY.uasset | 4 +- .../7/F9/5WBW8D0MTX68M7O0SCV0GB.uasset | 4 +- .../7/I7/ZVU35CD39HBU6ZZ4WVP558.uasset | 4 +- .../8/50/U0CQU503ZU9MBP387LGXKM.uasset | 4 +- .../8/5B/B8PNJO8JVDIQWPAZ8IPMII.uasset | 4 +- .../8/5B/E1LRRODRTA551TUSC53CL2.uasset | 4 +- .../8/E7/XENB7SCXDXT2TSNL6ZB0UM.uasset | 4 +- .../8/M9/TH4OWAVQDJ7UMRSL6OR83A.uasset | 4 +- .../9/12/UV1ZX9E5BCZSLWGU2SF72M.uasset | 4 +- .../9/HA/3WLVCMQZ1ZXE21LYH0T6ZP.uasset | 4 +- .../9/IA/AT2Q2MNNVCBMBU518YY131.uasset | 4 +- .../9/NY/U4TWAWMRJJPUQOQ2GZOO5M.uasset | 4 +- .../9/TH/4ENMZ6FTGE3G9PD2D7HQIB.uasset | 4 +- .../A/13/K0RYP5DMVM9Y7XVJ52SZ41.uasset | 4 +- .../A/HK/UMH73RJNO4BE9I5Y8KPE87.uasset | 4 +- .../A/NY/9XW3ZK2DJBFHJQUQ13WFON.uasset | 4 +- .../A/UX/S19GZC6XMTXZ7SKXNDQRHT.uasset | 4 +- .../B/1R/4VQHD1PWEMSRJVS6277FUB.uasset | 4 +- .../B/IF/3K7W26ICNW2G4SBJQPRNQ7.uasset | 4 +- .../B/LI/TC5V3M7J9K5B4T4E0EM15R.uasset | 4 +- .../C/0Q/XUAC92W1RIWSFOSOM3CM5R.uasset | 4 +- .../C/AJ/36MY46OHJR6J516LC95D5X.uasset | 4 +- .../C/I5/LQ3CMLU5ZJWRL3SBRP91YC.uasset | 4 +- .../C/I6/O6H03PUIGOJRV3C5NK23LB.uasset | 4 +- .../C/SA/6ZEK9SCPXHWMH3K25G1XKG.uasset | 4 +- .../C/U8/HTJQPX65AQH8TE4FPXW0ST.uasset | 4 +- .../D/17/XYII6JEU1NWS5TUWNTWNX9.uasset | 4 +- .../D/5D/VDJOPBBOA83U9UDKE7IPCU.uasset | 4 +- .../D/69/VJHHRR1MYM25BDHS6BR2TF.uasset | 4 +- .../D/FR/P3GK359CLJH40T3VDWEQ1D.uasset | 4 +- .../D/LE/4MWFDEFLUV2HW5UJYTULIV.uasset | 4 +- .../D/RG/37E73V7FQ6QMBJ9N3XJ514.uasset | 4 +- .../D/TH/3ZZ09AKE46EOWGGPLJSY4O.uasset | 4 +- .../D/V6/JB95XD8IMTZJQBL7SRWG5P.uasset | 4 +- .../D/YS/9L5GI7YOBQ7ZBJW9TC7EHJ.uasset | 3 - .../E/1E/9T1M2QOCYCVSTJMC1F92HT.uasset | 4 +- .../E/6H/DJ51NDA2JUETNXB3SZWG9J.uasset | 4 +- .../E/79/DQ03R297MHOCI1C2EOL47X.uasset | 4 +- .../E/JG/N3AQY3WLDMKNREZL3X7HI8.uasset | 4 +- .../E/NR/BZV1ME84L9SHRDI0VFRDJ1.uasset | 4 +- .../E/TJ/HQ6SA0JSGQ60VNL8HFU61J.uasset | 4 +- .../E/XL/8TFST9SDPVUOPYL8S6XXN6.uasset | 4 +- .../Source/LTween/Private/LTweenManager.cpp | 1 + .../Resources/Icon128.png | 3 - .../RTSCameraPlugin/Private/AsyncNode.cpp | 386 ---- .../Private/PlaceholderCamera.cpp | 36 - .../RTSCameraPlugin/Private/SharedStructs.cpp | 56 - .../Private/UniversalCamera.cpp | 1951 ----------------- .../Private/UniversalCameraPlugin.cpp | 20 - .../Private/UniversalCameraSaveGame.cpp | 5 - .../Source/RTSCameraPlugin/Public/AsyncNode.h | 307 --- .../Public/PlaceholderCamera.h | 54 - .../RTSCameraPlugin/Public/SharedStructs.h | 77 - .../RTSCameraPlugin/Public/UniversalCamera.h | 1086 --------- .../Public/UniversalCameraPlugin.h | 15 - .../Public/UniversalCameraSaveGame.h | 31 - .../UniversalCameraPlugin.Build.cs | 60 - .../UniversalCameraPlugin.uplugin | 28 - ProjectEleri.uproject | 8 +- ProjectEleri.uproject.DotSettings.user | 3 +- .../Private/EleriPlayerController.cpp | 9 +- Source/ProjectEleri/Private/MyCharacter.cpp | 67 +- Source/ProjectEleri/ProjectEleri.Build.cs | 1 - Source/ProjectEleri/Public/EleriSaveGame.h | 2 - Source/ProjectEleri/Public/MyCharacter.h | 26 +- 95 files changed, 287 insertions(+), 4394 deletions(-) delete mode 100644 Content/Camera/BP_UniversalCamera.uasset delete mode 100644 Content/__ExternalActors__/Maps/Persistent_GameWorld/D/YS/9L5GI7YOBQ7ZBJW9TC7EHJ.uasset delete mode 100644 Plugins/UniversalCameraPlugin/Resources/Icon128.png delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/AsyncNode.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/PlaceholderCamera.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/SharedStructs.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCamera.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraPlugin.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraSaveGame.cpp delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/AsyncNode.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/PlaceholderCamera.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/SharedStructs.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCamera.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraPlugin.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraSaveGame.h delete mode 100644 Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/UniversalCameraPlugin.Build.cs delete mode 100644 Plugins/UniversalCameraPlugin/UniversalCameraPlugin.uplugin diff --git a/BuildGame.bat b/BuildGame.bat index 74be3850..7d097327 100644 --- a/BuildGame.bat +++ b/BuildGame.bat @@ -1,18 +1,26 @@ @echo off setlocal enabledelayedexpansion - echo =================================== echo Eleri - Build, Upload and Notify echo =================================== -:: ---- CONFIG — edit these ---- +:: ---- CONFIG - edit these ---- set UE_VERSION=5.8 set PROJECT_PATH=C:\Projects\ProjectEleri\ProjectEleri.uproject set PROJECT_NAME=Eleri -set OUTPUT_DIR=C:\Projects\ProjectEleri\BUILD\Debug +set OUTPUT_DIR=C:\Projects\ProjectEleri\BUILD set MAX_BUILDS=10 set UAT_PATH=C:\Program Files\Epic Games\UE_%UE_VERSION%\Engine\Build\BatchFiles\RunUAT.bat +:: ---- STEAM CONFIG - edit these ---- +set STEAMCMD_PATH=C:\Users\adnan\Downloads\steamworks_sdk_161\sdk\tools\ContentBuilder\builder\steamcmd.exe +set STEAM_USERNAME=adodev +set STEAM_APP_ID=3528720 +:: Only Shipping gets uploaded to Steam - DebugGame builds are local-only +set STEAM_DEPOT_SHIPPING=3528721 +:: Folder where generated Steam VDF scripts will be written (temp working files, safe to keep in OUTPUT_DIR) +set STEAM_VDF_DIR=%OUTPUT_DIR%\steam_vdf + :: ---- ARGUMENTS ---- set BUILD_VERSION=%1 set CHANGELOG=%~2 @@ -25,33 +33,68 @@ if "%CHANGELOG%"=="" set /p CHANGELOG="Changelog / notes (optional, press Enter echo. echo Which steps would you like to run? echo 1 - Build only -echo 2 - Build + Zip +echo 2 - Build + Upload to Steam echo. set /p RUN_STEPS="Enter choice (1-2): " +if "%RUN_STEPS%"=="" set RUN_STEPS=1 +if "%RUN_STEPS%" LSS "1" set RUN_STEPS=1 +if "%RUN_STEPS%" GTR "2" set RUN_STEPS=1 -if "%RUN_STEPS%"=="" set RUN_STEPS=2 -if "%RUN_STEPS%" LSS "1" set RUN_STEPS=2 -if "%RUN_STEPS%" GTR "4" set RUN_STEPS=2 +:: ---- CONFIG SELECTION ---- +echo. +echo Which configuration(s) would you like to build? +echo 1 - DebugGame +echo 2 - Shipping +echo 3 - Both +echo. +set /p CFG_CHOICE="Enter choice (1-3): " +if "%CFG_CHOICE%"=="" set CFG_CHOICE=1 +if "%CFG_CHOICE%"=="1" set CONFIGS=DebugGame +if "%CFG_CHOICE%"=="2" set CONFIGS=Shipping +if "%CFG_CHOICE%"=="3" set CONFIGS=DebugGame Shipping +if not defined CONFIGS set CONFIGS=DebugGame echo. -echo Running steps 1 through %RUN_STEPS%... - -set BUILD_TYPE=debug -set DEST_FILENAME=%PROJECT_NAME%_%BUILD_VERSION%.zip -set BUILD_OUTPUT=%OUTPUT_DIR%\%BUILD_VERSION%% +echo Running steps 1 through %RUN_STEPS% for configuration(s): %CONFIGS% +echo. :: ==================================== -:: STEP 1 — BUILD +:: MAIN LOOP - one pass per selected config :: ==================================== -echo. -echo [1/2] Building %PROJECT_NAME% in DebugGame mode... -echo. +for %%C in (%CONFIGS%) do ( + call :build_one_config %%C + if !errorlevel! neq 0 ( + echo ERROR: Pipeline failed for config %%C. + pause + exit /b 1 + ) +) +echo. +echo =================================== +echo All done! (ran steps 1-%RUN_STEPS% for: %CONFIGS%) +echo =================================== +pause +exit /b 0 + + +:: ==================================== +:: SUBROUTINE - build/upload a single config +:: %1 = config name (DebugGame or Shipping) +:: ==================================== +:build_one_config +set THIS_CONFIG=%~1 +set BUILD_OUTPUT=%OUTPUT_DIR%\%BUILD_VERSION%\%THIS_CONFIG% + +:: ---- STEP 1: BUILD ---- +echo. +echo [1/2] Building %PROJECT_NAME% in %THIS_CONFIG% mode... +echo. call "%UAT_PATH%" BuildCookRun ^ -project="%PROJECT_PATH%" ^ -noP4 ^ -platform=Win64 ^ - -clientconfig=DebugGame ^ + -clientconfig=%THIS_CONFIG% ^ -cook ^ -build ^ -stage ^ @@ -60,45 +103,75 @@ call "%UAT_PATH%" BuildCookRun ^ -archivedirectory="%BUILD_OUTPUT%" ^ -prereqs ^ -nodebuginfo - set BUILD_EXIT=%errorlevel% echo. echo UAT exited with code: %BUILD_EXIT% - if %BUILD_EXIT% neq 0 ( - echo ERROR: Build failed! - pause + echo ERROR: Build failed for %THIS_CONFIG%! + exit /b 1 +) +echo Build succeeded for %THIS_CONFIG%! +echo Build folder: %BUILD_OUTPUT% + +if %RUN_STEPS% EQU 1 exit /b 0 + +:: ---- STEP 2: UPLOAD TO STEAM ---- +if /I "%THIS_CONFIG%"=="DebugGame" ( + echo. + echo DebugGame is local-only - skipping Steam upload for this config. + exit /b 0 +) + +echo. +echo [2/2] Uploading %THIS_CONFIG% build to Steam... + +set STEAM_DEPOT=%STEAM_DEPOT_SHIPPING% + +if "%STEAM_DEPOT%"=="" ( + echo ERROR: No Steam depot ID configured for Shipping. Skipping upload. exit /b 1 ) -echo Build succeeded! -if %RUN_STEPS% EQU 1 goto :done +if not exist "%STEAM_VDF_DIR%" mkdir "%STEAM_VDF_DIR%" +set APP_VDF=%STEAM_VDF_DIR%\app_build_%THIS_CONFIG%.vdf +set DEPOT_VDF=%STEAM_VDF_DIR%\depot_build_%THIS_CONFIG%.vdf -:: ==================================== -:: STEP 2 — ZIP -:: ==================================== -echo. -echo [2/2] Zipping build... +:: Generate depot script - points at the build output directly +( + echo "DepotBuildConfig" + echo { + echo "DepotID" "%STEAM_DEPOT%" + echo "ContentRoot" "%BUILD_OUTPUT%" + echo "FileMapping" + echo { + echo "LocalPath" "*" + echo "DepotPath" "." + echo "recursive" "1" + echo } + echo } +) > "%DEPOT_VDF%" -set ZIP_PATH=%OUTPUT_DIR%\%DEST_FILENAME% +:: Generate app build script +( + echo "AppBuild" + echo { + echo "AppID" "%STEAM_APP_ID%" + echo "Desc" "%PROJECT_NAME% %BUILD_VERSION% [%THIS_CONFIG%] - %CHANGELOG%" + echo "ContentRoot" "%BUILD_OUTPUT%" + echo "BuildOutput" "%STEAM_VDF_DIR%\output_%THIS_CONFIG%" + echo "Depots" + echo { + echo "%STEAM_DEPOT%" "%DEPOT_VDF%" + echo } + echo } +) > "%APP_VDF%" -powershell -Command "Compress-Archive -Path '%BUILD_OUTPUT%\*' -DestinationPath '%ZIP_PATH%' -Force" - -if %errorlevel% neq 0 ( - echo ERROR: Zipping failed. - pause & exit /b 1 +"%STEAMCMD_PATH%" +login %STEAM_USERNAME% +run_app_build "%APP_VDF%" +quit +set STEAM_EXIT=%errorlevel% +if %STEAM_EXIT% neq 0 ( + echo ERROR: Steam upload failed for %THIS_CONFIG% ^(exit code %STEAM_EXIT%^). + exit /b 1 ) +echo Steam upload succeeded for %THIS_CONFIG%! -echo Zip created: %ZIP_PATH% -echo Build folder kept at: %BUILD_OUTPUT% -if %RUN_STEPS% EQU 2 goto :done - -:: ==================================== -:done -:: ==================================== -echo. -echo =================================== -echo All done! (ran steps 1-%RUN_STEPS%) -echo Build: %DEST_FILENAME% -echo =================================== -pause \ No newline at end of file +exit /b 0 \ No newline at end of file diff --git a/Content/Camera/BP_UniversalCamera.uasset b/Content/Camera/BP_UniversalCamera.uasset deleted file mode 100644 index 730f2ac3..00000000 --- a/Content/Camera/BP_UniversalCamera.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f77f60df392c8b2e37351c0c84550c81b8e7c39491b8f140d4e27db5e79ca040 -size 25951 diff --git a/Content/Input/IMC_MovementContext.uasset b/Content/Input/IMC_MovementContext.uasset index 4b97a5b6..0b0d8f5d 100644 --- a/Content/Input/IMC_MovementContext.uasset +++ b/Content/Input/IMC_MovementContext.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44919300a74efa6387fba2206f800d24f92fb65bd7b9aec2612c956480edd313 -size 8331 +oid sha256:7d00d4de3e20d4bb68be507b83ba67816f34e43b9d8be1dedb0b26e42d9d2551 +size 8383 diff --git a/Content/Scripts/AlchemySystem/BP_AlchemyManager.uasset b/Content/Scripts/AlchemySystem/BP_AlchemyManager.uasset index 578a8266..659df49f 100644 --- a/Content/Scripts/AlchemySystem/BP_AlchemyManager.uasset +++ b/Content/Scripts/AlchemySystem/BP_AlchemyManager.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0aeb6b6df4525d2d7ecafd21ea48d038f6c8b2d07b2bb797d59052cf45d8097a -size 2916864 +oid sha256:3def34f729bf26b6d4da2087d1ca79ecba501e6831f5fbec89e39ebdd93cf0e3 +size 2860719 diff --git a/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset b/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset index 8aaa79f9..1125ac1c 100644 --- a/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset +++ b/Content/ThirdPersonBP/Blueprints/BP_ThirdPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:92dc48e2b30426ced8b7f6893bc8e36560dc0d3676fa3bd2ad7cef50bcb04327 -size 1405082 +oid sha256:69189e82a38180676c16ae954e069d8755eabe262a6a244f220eba6f754fa203 +size 1409108 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/KY/1TIS1JTSP6OJZYAWI50IXS.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/KY/1TIS1JTSP6OJZYAWI50IXS.uasset index 48c76454..36cf6226 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/KY/1TIS1JTSP6OJZYAWI50IXS.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/KY/1TIS1JTSP6OJZYAWI50IXS.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c249cb1f6ea9404f26feef71e656a97a3c27e7357cca44b7ff95b96aa2c5e27d -size 378294 +oid sha256:e5009a0d5b012b3689f45242eb397400ca272014d628657817b6fe6183270af8 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/Q5/9FZQ54683KH54N3CTAC56E.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/Q5/9FZQ54683KH54N3CTAC56E.uasset index 78a17fcd..e26916a7 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/Q5/9FZQ54683KH54N3CTAC56E.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/Q5/9FZQ54683KH54N3CTAC56E.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90933eb5e2938e13ffbee75f646b7552976419d012f1748e0be130936029e4a6 -size 378178 +oid sha256:837ab52079b868d36315409041959e8e28a069ff2a5c2c34feadcc7cf09717c2 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/QO/V42ZUGC93YVPG6JZQSYNFV.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/QO/V42ZUGC93YVPG6JZQSYNFV.uasset index 069aaa3e..9e3aeed6 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/QO/V42ZUGC93YVPG6JZQSYNFV.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/QO/V42ZUGC93YVPG6JZQSYNFV.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a3fde54b55bf1c4743d4e45b7000ba15644e0077e58b276d525b734284ce861 -size 378294 +oid sha256:af9c5a7526fa2b96f3f1cb58187c167d9b6015311a360713d9b1cd5859b3015d +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/UK/RJR7O3ZBUNVYT45GYLP4LT.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/UK/RJR7O3ZBUNVYT45GYLP4LT.uasset index b452a9d3..1258f8fe 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/UK/RJR7O3ZBUNVYT45GYLP4LT.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/0/UK/RJR7O3ZBUNVYT45GYLP4LT.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bfe7e52c541c8342b28d9f6697050e36917ad7c1d64f4f6c094ea0246b7fa8fa -size 378294 +oid sha256:7500ef30b349f280f039b8451a441297e86f0d837506e8202d29191c9e643bb5 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/1/G4/WCIOOKCLLLGGYKV3QTB3PC.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/1/G4/WCIOOKCLLLGGYKV3QTB3PC.uasset index c24f8c13..99fb09c3 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/1/G4/WCIOOKCLLLGGYKV3QTB3PC.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/1/G4/WCIOOKCLLLGGYKV3QTB3PC.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a245dd098d073d1ad7c8b015bab159e03f208771edeb97f3df9b38e8b77affed -size 378294 +oid sha256:bf189ab60cc03b7c4636534a7e2037091a8e9e4bf5a44072fccdc5e49253217f +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/3O/ZX7H6U52U8CDRI888H7ZQ6.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/3O/ZX7H6U52U8CDRI888H7ZQ6.uasset index 4aa60431..532afc50 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/3O/ZX7H6U52U8CDRI888H7ZQ6.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/3O/ZX7H6U52U8CDRI888H7ZQ6.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6969046b3d20798514b7aa4e5e7b48ac78843573f82ecd13a99c86e16eb5c49 -size 378294 +oid sha256:67952a24fe40932ea6afa43188e7a8591ab0712d2586c1296e6df4206d4b22c9 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/CI/70BS2JIPOBOLSLK41VZTOX.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/CI/70BS2JIPOBOLSLK41VZTOX.uasset index 29bc7e54..0299156e 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/CI/70BS2JIPOBOLSLK41VZTOX.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/CI/70BS2JIPOBOLSLK41VZTOX.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66811c4db2346feb4e840ff088fcd6d3f19dfbf5304af7e07f76e06ed493a3b2 -size 378178 +oid sha256:da3090d5b18dfd6509dc79ed606b36ce9ed6ca7f64d98bdda8e251cd29e90141 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/MZ/S102JILH4NPA69Y23WGEFN.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/MZ/S102JILH4NPA69Y23WGEFN.uasset index 1d4db7ab..82577601 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/MZ/S102JILH4NPA69Y23WGEFN.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/MZ/S102JILH4NPA69Y23WGEFN.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4a652a3ca2018baf1a9886daf583d15a38b0d1ff369c4edfe7603c45b0630a7 -size 378178 +oid sha256:a815767bef0e7e364c1cd7e88e11830e689c699adf020eff1268891124ca8622 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/O6/GR4F3AMJY6BFXAU9SYTOEN.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/O6/GR4F3AMJY6BFXAU9SYTOEN.uasset index 4e015e62..9dd8854a 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/O6/GR4F3AMJY6BFXAU9SYTOEN.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/2/O6/GR4F3AMJY6BFXAU9SYTOEN.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d6f96426e4949cb0549e64dd5ec1165bb642d0b2d204d39baaae693b72042b9 -size 378178 +oid sha256:e1f7479ceeb4f9643f9a7cfb5604d1e37f6db2b89a27ec92b70b81630068e5ef +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/3/C8/X511L70OJGDRVNDY6M3RFM.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/3/C8/X511L70OJGDRVNDY6M3RFM.uasset index 6ec64b49..876e49e7 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/3/C8/X511L70OJGDRVNDY6M3RFM.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/3/C8/X511L70OJGDRVNDY6M3RFM.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:84764df2917c0ffb0f8d8f2867d647009dff9422b71a288868cbafe66ec3f97d -size 378294 +oid sha256:bdae1b1e93a44176a2a037fa4905ec8307d215b37f39c2382e6a68da31a27998 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/67/O326MPI9QNSZEEB74A4R10.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/67/O326MPI9QNSZEEB74A4R10.uasset index edc84f69..4a2807a6 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/67/O326MPI9QNSZEEB74A4R10.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/67/O326MPI9QNSZEEB74A4R10.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afa35faea0f3cbdeac5079753257c5882d8e96dfb2daadd88ff78b7adf1b39c1 -size 378294 +oid sha256:e7c5b84fb9b500851f2ad1f02a57e3c2f95ae7c90da92a231434af3bfb0a564d +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/71/L52OPE2KS89OUZ84N0MNSZ.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/71/L52OPE2KS89OUZ84N0MNSZ.uasset index 7c9f9167..9c476e28 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/71/L52OPE2KS89OUZ84N0MNSZ.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/71/L52OPE2KS89OUZ84N0MNSZ.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e3588357c7252a91f3dfa55fef1e48d2eec4f05ddd2922779e2bf75d574d4ab1 -size 378178 +oid sha256:b747066ce27838302e3708bdab35e81134f136823ef4a0ab465136ce2569f80e +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/9N/NK4HCA2HAC35F26D0Q56HD.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/9N/NK4HCA2HAC35F26D0Q56HD.uasset index bc210372..13bb7df5 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/9N/NK4HCA2HAC35F26D0Q56HD.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/9N/NK4HCA2HAC35F26D0Q56HD.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b720dbd9f285ce96b2acac242d075d1b8c2718e59eea1407a19aa7bd2aaad9a -size 378294 +oid sha256:de85d5575b01183353d6cee0712da828ce71bb7486e810b4ca28d1f12cd35cbc +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/IV/AZTI3ISN21AO0OX04BYRR4.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/IV/AZTI3ISN21AO0OX04BYRR4.uasset index de43fba6..7d6d5095 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/IV/AZTI3ISN21AO0OX04BYRR4.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/IV/AZTI3ISN21AO0OX04BYRR4.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1099c068fafb3eb2d1d974b50f437d532097c2410a4253cb7955a1dff073253 -size 379656 +oid sha256:c49e386336aee3a607b69ed6fef44eb0d6e36fe04c3b34f6fe1d907d2a717acc +size 396456 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/KT/AKQTEEYD69AC748FOENK58.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/KT/AKQTEEYD69AC748FOENK58.uasset index 509603af..1ba44bed 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/KT/AKQTEEYD69AC748FOENK58.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/KT/AKQTEEYD69AC748FOENK58.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81276f3a55a5eac7afef336c1f405612b9bb284c119954f26de92a87300bee2d -size 378178 +oid sha256:a37b8c4de9cd036fe6345e53ca3386f1bd9aacd210ea18d5366ebb383064a595 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/LE/S051R10K50ZELROG2Q4AS8.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/LE/S051R10K50ZELROG2Q4AS8.uasset index f30039e7..d3d4072f 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/LE/S051R10K50ZELROG2Q4AS8.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/4/LE/S051R10K50ZELROG2Q4AS8.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec23eca99b7f615a464b420e40e628ccc4e9aef2cef52c34f9ab1c56b473b177 -size 378294 +oid sha256:08107df2f55efb9e5e2aef8c65e02abcdbe61c0f9b35850adef97f98a89d5d3d +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/3N/V2S8IJJZC6RFPD86AP93EN.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/3N/V2S8IJJZC6RFPD86AP93EN.uasset index 0418b200..92d2f9f9 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/3N/V2S8IJJZC6RFPD86AP93EN.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/3N/V2S8IJJZC6RFPD86AP93EN.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:96350615a21e1182a34ea550f347dd538c83dfbc757e822246c322acad7c71a4 -size 378294 +oid sha256:8fa7cbb01d3398c89ec8e51bdd477cc376714dcc73cb47e67766b433284fcbf0 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/QX/9L27I0L6BGYROGLZCSSIEJ.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/QX/9L27I0L6BGYROGLZCSSIEJ.uasset index b0adf307..80718b45 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/QX/9L27I0L6BGYROGLZCSSIEJ.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/5/QX/9L27I0L6BGYROGLZCSSIEJ.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4895a421930347f7c6cd233d86fc0716ef4a7466aa0fdcfb7cc43d292c655dd3 -size 378294 +oid sha256:124dd6f5f254695d5c22e12474dad57d125adc7e065d266394d621acd9ddb8cf +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/BL/5HUHLPTPP1KKKRQ8B1GAKE.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/BL/5HUHLPTPP1KKKRQ8B1GAKE.uasset index a9f45a5b..ad50ce52 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/BL/5HUHLPTPP1KKKRQ8B1GAKE.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/BL/5HUHLPTPP1KKKRQ8B1GAKE.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a79562ea57ead5d1fa20a9a84bd6abb8003bdff54ae31b3482373ee9da4b546 -size 378294 +oid sha256:eae261dec8305dd4d48cafb9898494563743364fc738898be2f095d966e40bce +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/FJ/XSLZCCYW6P0XOLD701W2BA.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/FJ/XSLZCCYW6P0XOLD701W2BA.uasset index 59bdb8e3..d0131f3b 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/FJ/XSLZCCYW6P0XOLD701W2BA.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/FJ/XSLZCCYW6P0XOLD701W2BA.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a09274037ad3251619eb134ef2779966b9386925e86e71fa712e18b821c85fb5 -size 20969 +oid sha256:d310c878274df4cd12f029247d6772a510f4dbb462a747cf0a8f2b5265fb62e5 +size 21069 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/SY/DSB9H4SNLTFFQD7IWQVP6M.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/SY/DSB9H4SNLTFFQD7IWQVP6M.uasset index a8d448a4..3eabdd9b 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/SY/DSB9H4SNLTFFQD7IWQVP6M.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/SY/DSB9H4SNLTFFQD7IWQVP6M.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d5d567e2b5ebbf8f4cef143f2d7f2f5828e8392eb7260bca1269d6a85d6638a -size 378294 +oid sha256:06c7ae789cdee846d01247946989d1c1f811f2f281bf1dab5dec501888676fb8 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/T1/UEW826WYCSQR77Q2FL71LI.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/T1/UEW826WYCSQR77Q2FL71LI.uasset index e1f1635e..a8f4f57e 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/T1/UEW826WYCSQR77Q2FL71LI.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/T1/UEW826WYCSQR77Q2FL71LI.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b07d6e60274ebc725c3be43b349128024a226c8a465308743849b86e6db58c25 -size 378294 +oid sha256:a3a910e2335ba55d1659bdf3ee2865efeb1c76d77c8aeda0e9772ef8139fadae +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/UQ/JH3TNU0CLQHW0OHIZRQCSL.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/UQ/JH3TNU0CLQHW0OHIZRQCSL.uasset index 2fa570d9..47b392a2 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/UQ/JH3TNU0CLQHW0OHIZRQCSL.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/UQ/JH3TNU0CLQHW0OHIZRQCSL.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ef8bd15a43633ca37fa6518ee2288fa3690c5d26e65865eb93a9cdb06e419c4 -size 378294 +oid sha256:af25752a9f255cd027d1a3481d456acf89aa5e89a8cc612652d42942f6bc4f6a +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/W9/YIOMING37LJUL2TVWHDD1Z.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/W9/YIOMING37LJUL2TVWHDD1Z.uasset index cc3f7a0e..e961ac29 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/W9/YIOMING37LJUL2TVWHDD1Z.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/6/W9/YIOMING37LJUL2TVWHDD1Z.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cf476b6504790a48603b4c8f9a05af0119c86fbac679c10ddfc04d67fa2eed0 -size 378294 +oid sha256:ca112fd73ec571a5ab10d5969a4ca5421df3d8029c016488aa5fb8d5633c3f03 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/67/UH9JH7WQKMK2NU4EO2WWI2.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/67/UH9JH7WQKMK2NU4EO2WWI2.uasset index 50bfc354..4bdf553c 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/67/UH9JH7WQKMK2NU4EO2WWI2.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/67/UH9JH7WQKMK2NU4EO2WWI2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b96d089bcd78836007929d44d72f66c45a8877d0a689b4122c2f052bf1bf9b93 -size 396349 +oid sha256:7eb1aff3a0e69a2248cc22fddac2b86b85c276fab66b9a90a3c4932bbee0161e +size 423303 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/EK/U12XBX5FQST76VPVQECOSY.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/EK/U12XBX5FQST76VPVQECOSY.uasset index 728bcebd..149b450d 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/EK/U12XBX5FQST76VPVQECOSY.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/EK/U12XBX5FQST76VPVQECOSY.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61dc07910d309866370944746486fb253cde64981467a0452f83d8eefe9486ee -size 407610 +oid sha256:759d72699b57d7e048c86b5c97079b30475c9dfe747af21c487328a9705ad4c8 +size 443153 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/F9/5WBW8D0MTX68M7O0SCV0GB.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/F9/5WBW8D0MTX68M7O0SCV0GB.uasset index 88f1d683..f455cb19 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/F9/5WBW8D0MTX68M7O0SCV0GB.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/F9/5WBW8D0MTX68M7O0SCV0GB.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dfef12d9ee850af74e5617e847486dfbab6432955d18e5f788eb4fa6e0601501 -size 378294 +oid sha256:9ea53cbb14d5c84397a80c0a5c1cbd03a84245b35397764145bf14389406df94 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/I7/ZVU35CD39HBU6ZZ4WVP558.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/I7/ZVU35CD39HBU6ZZ4WVP558.uasset index 2ae4b7bd..b4b27a90 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/I7/ZVU35CD39HBU6ZZ4WVP558.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/7/I7/ZVU35CD39HBU6ZZ4WVP558.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ec4c185e71c7aed758523e5cf63e134c80b665fa35d1c4d7666660811f3789d -size 378178 +oid sha256:f720b86c576e3d64f37eb4163d4b1cd788eec84e6798220a83d233bc287d37c7 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/50/U0CQU503ZU9MBP387LGXKM.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/50/U0CQU503ZU9MBP387LGXKM.uasset index 6f3a31d0..38a1e06c 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/50/U0CQU503ZU9MBP387LGXKM.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/50/U0CQU503ZU9MBP387LGXKM.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93201e46d51f6db2f89c0e53956e0cdc6f686978f51ad3ae58883846d1c3dc84 -size 378294 +oid sha256:060d2e9596ab4ad6be03988fc8b5cf270d646ee27a85d078fa47af546651627c +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/B8PNJO8JVDIQWPAZ8IPMII.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/B8PNJO8JVDIQWPAZ8IPMII.uasset index d2719491..68c4856a 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/B8PNJO8JVDIQWPAZ8IPMII.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/B8PNJO8JVDIQWPAZ8IPMII.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b352013c5ead03bdc7169fc65decc2315eec2372137cd79c1a86e10b6b8f0059 -size 378294 +oid sha256:c989b9e4d1b86d50bbc7b45fd2565102e54ff7f19703c82b6f058fd1e25b1152 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/E1LRRODRTA551TUSC53CL2.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/E1LRRODRTA551TUSC53CL2.uasset index f6f4b9df..0f5fc18d 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/E1LRRODRTA551TUSC53CL2.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/5B/E1LRRODRTA551TUSC53CL2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c7bdc978f45c1ac4a3ade011f0185007ce86592f3c988ebef9afcef7ad6cb9c -size 378294 +oid sha256:76563469bf4dcd75e6fd2b0a245f945910e226f586ec24d52985ac8671f41ed7 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/E7/XENB7SCXDXT2TSNL6ZB0UM.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/E7/XENB7SCXDXT2TSNL6ZB0UM.uasset index 4728d593..cebbaf24 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/E7/XENB7SCXDXT2TSNL6ZB0UM.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/E7/XENB7SCXDXT2TSNL6ZB0UM.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:db598f060f310588a33091a4f813816e58eb2101d2c21470ebff99c5f25937fa -size 378294 +oid sha256:3cf7b3a161d6a8ca758ceb491c5e5a20abaa71f921bb49bfb040eb45fc9a3a58 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/M9/TH4OWAVQDJ7UMRSL6OR83A.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/M9/TH4OWAVQDJ7UMRSL6OR83A.uasset index a6646893..9c159dd9 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/M9/TH4OWAVQDJ7UMRSL6OR83A.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/8/M9/TH4OWAVQDJ7UMRSL6OR83A.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4408091709a182d761de3a899c486900e8850303328afe55cb86a4a360f740b6 -size 378294 +oid sha256:320726da6ac8474e0bb3c0e89cc45e67bfd305c603ecaab55b1265a626a488e1 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/12/UV1ZX9E5BCZSLWGU2SF72M.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/12/UV1ZX9E5BCZSLWGU2SF72M.uasset index 83b1ed29..4414a908 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/12/UV1ZX9E5BCZSLWGU2SF72M.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/12/UV1ZX9E5BCZSLWGU2SF72M.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b78f8353c0dc8c78b3710008ea0286f422a4a9c21b1490fd9c63844388b6872 -size 378178 +oid sha256:ba406663eb306c2a1eafc58f350ecd97d2ccb16ef47ead0a7964c791c2f08841 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/HA/3WLVCMQZ1ZXE21LYH0T6ZP.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/HA/3WLVCMQZ1ZXE21LYH0T6ZP.uasset index d9fd7eb0..f75fed99 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/HA/3WLVCMQZ1ZXE21LYH0T6ZP.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/HA/3WLVCMQZ1ZXE21LYH0T6ZP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9efdea67158a2cd03b3ca672d5dbf524176f328c1d4de0079d1f876ed252f515 -size 378294 +oid sha256:274c0eb083c76426e395a761f42d0707ebd2e46e862038bd0171b4bb067843c6 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/IA/AT2Q2MNNVCBMBU518YY131.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/IA/AT2Q2MNNVCBMBU518YY131.uasset index 44c22a13..14172d14 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/IA/AT2Q2MNNVCBMBU518YY131.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/IA/AT2Q2MNNVCBMBU518YY131.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cdd9368f32444b2f2719172aa6893b056028f9c96adfb3b7d71c006fa189a2a1 -size 378178 +oid sha256:ad11b524686b252e6e54134d1518e925ec3958bbb4f4af5dbc9933c21b904660 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/NY/U4TWAWMRJJPUQOQ2GZOO5M.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/NY/U4TWAWMRJJPUQOQ2GZOO5M.uasset index aeb37529..07c5fcb9 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/NY/U4TWAWMRJJPUQOQ2GZOO5M.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/NY/U4TWAWMRJJPUQOQ2GZOO5M.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:146e71eb59271d752a43570a75e2d695085dd4953dc8a4007e526ac3a4cd3b03 -size 378294 +oid sha256:25aa19cbb903fc381b53f7f4464cef0745d25d36aa20df2b4f5e46d93b80bf2f +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/TH/4ENMZ6FTGE3G9PD2D7HQIB.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/TH/4ENMZ6FTGE3G9PD2D7HQIB.uasset index 943f4bb1..e2b87fb9 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/TH/4ENMZ6FTGE3G9PD2D7HQIB.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/9/TH/4ENMZ6FTGE3G9PD2D7HQIB.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b920d2c25d1b967dcb8636613d03545165ceacf5bd4f51fa63d6b85891e209fb -size 378294 +oid sha256:dde36a462f4fd708ca5f7ba79735473ba1945a63dd7b2f7681cbbcbce5aa7074 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/13/K0RYP5DMVM9Y7XVJ52SZ41.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/13/K0RYP5DMVM9Y7XVJ52SZ41.uasset index 434c3964..b54f6e48 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/13/K0RYP5DMVM9Y7XVJ52SZ41.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/13/K0RYP5DMVM9Y7XVJ52SZ41.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57642e930ea6da45abfa4890ebc6ed37051696bd8aef04bc2a1bf21462b483a4 -size 378294 +oid sha256:b965465cc00d29589a4b385b9906752ad5ae1ec251b5eeed4cc8efe038e7a0e3 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/HK/UMH73RJNO4BE9I5Y8KPE87.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/HK/UMH73RJNO4BE9I5Y8KPE87.uasset index 9563ddc0..141c0eb2 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/HK/UMH73RJNO4BE9I5Y8KPE87.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/HK/UMH73RJNO4BE9I5Y8KPE87.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb7be5248ffdbac598ceb022c560f5ea7be420b2296a7c7c8639e889cc4117e8 -size 378294 +oid sha256:2ca9b84605c0c477dff82d0d48054e9170c5ddb63ad8cc17462018de4075bac2 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/NY/9XW3ZK2DJBFHJQUQ13WFON.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/NY/9XW3ZK2DJBFHJQUQ13WFON.uasset index b38ee753..aa258cc6 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/NY/9XW3ZK2DJBFHJQUQ13WFON.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/NY/9XW3ZK2DJBFHJQUQ13WFON.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90bba960fb7b45835360735c27d9c82347d305ddb397d3f8a62288061fe12829 -size 378294 +oid sha256:132158582339b86344c810ae3bc16021834dd1b01a1b14cda0f612cdc3f91108 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/UX/S19GZC6XMTXZ7SKXNDQRHT.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/UX/S19GZC6XMTXZ7SKXNDQRHT.uasset index 39e11da2..ac37a91f 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/UX/S19GZC6XMTXZ7SKXNDQRHT.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/A/UX/S19GZC6XMTXZ7SKXNDQRHT.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:83087bb9c76df4293608b0339ce8d2043c6afea8ad0e9214a21fc3da562231d3 -size 378294 +oid sha256:5be36bac0ed83af47d25d4995866ff313b2790ca7a91f59ba2a632fbf8ba9cc0 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/1R/4VQHD1PWEMSRJVS6277FUB.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/1R/4VQHD1PWEMSRJVS6277FUB.uasset index 703f2558..104f271a 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/1R/4VQHD1PWEMSRJVS6277FUB.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/1R/4VQHD1PWEMSRJVS6277FUB.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd8e46fa59dc98222dcb58303b4dd1568635852afffbadad7f2436c8d166f9b4 -size 378294 +oid sha256:eb78c821e82eb608d5c7fb7638a9f835914cd4848887ba75646ca1ea5b7d510a +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/IF/3K7W26ICNW2G4SBJQPRNQ7.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/IF/3K7W26ICNW2G4SBJQPRNQ7.uasset index c167c506..e4cccacb 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/IF/3K7W26ICNW2G4SBJQPRNQ7.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/IF/3K7W26ICNW2G4SBJQPRNQ7.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4ba1c209aa96afd3dbc3c13328a8e4f7a2e714de78f4f274e3b5c55d4d02cbec -size 378294 +oid sha256:e60902cda3df6f40d5fa2b4c608ca5eb4ebd9f760694a0216f6475b9672bf10b +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/LI/TC5V3M7J9K5B4T4E0EM15R.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/LI/TC5V3M7J9K5B4T4E0EM15R.uasset index c8bc59f2..2d56c89e 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/LI/TC5V3M7J9K5B4T4E0EM15R.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/B/LI/TC5V3M7J9K5B4T4E0EM15R.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04200e24e4dac2aea501f64f628c51ca48682d2c1e07223dae65408a69fa8c6a -size 378294 +oid sha256:efa3ca8fe8bc70189c31ff578884a87ac6ade348a0ae23fbbc3a41ebb9d3d2d9 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/0Q/XUAC92W1RIWSFOSOM3CM5R.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/0Q/XUAC92W1RIWSFOSOM3CM5R.uasset index 72c383a0..e38a4cd8 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/0Q/XUAC92W1RIWSFOSOM3CM5R.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/0Q/XUAC92W1RIWSFOSOM3CM5R.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e4007559d373eab104234fb71ba944dfaabed024e547783c311bdfb3c963be1 -size 378294 +oid sha256:929dd594b96e9220d62a031125860d388519fe20fa1544d53662f1f9582f8dbb +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/AJ/36MY46OHJR6J516LC95D5X.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/AJ/36MY46OHJR6J516LC95D5X.uasset index 4dc6ba9c..ad20c166 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/AJ/36MY46OHJR6J516LC95D5X.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/AJ/36MY46OHJR6J516LC95D5X.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a784c605a867792d4c761e77a53c617e6e09a18a759eed6b8f2c97889080e01c -size 378178 +oid sha256:028f685c4de1966fbb4885ec9e9f1bc59d6f527156d8f5420ea08ddc455ee08a +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I5/LQ3CMLU5ZJWRL3SBRP91YC.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I5/LQ3CMLU5ZJWRL3SBRP91YC.uasset index 2469601a..78162778 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I5/LQ3CMLU5ZJWRL3SBRP91YC.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I5/LQ3CMLU5ZJWRL3SBRP91YC.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e0de4fa7f3ff929ee49f4206a60645b5a338960974af6a62859817f0a091c2c -size 381687 +oid sha256:ac616130120bf7d4e96746cfb19380a50ecd71f44df2c1464d9195e75e150d30 +size 399675 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I6/O6H03PUIGOJRV3C5NK23LB.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I6/O6H03PUIGOJRV3C5NK23LB.uasset index 2e8b94b7..6c1b17c8 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I6/O6H03PUIGOJRV3C5NK23LB.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/I6/O6H03PUIGOJRV3C5NK23LB.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c80bb6326498471d92297999648523373fd275cf3db8a30360e6227d892b2070 -size 378178 +oid sha256:fc8f36bf50c3f0802dbfd9771466208d17ca9a0f91a456986101bc26f1aa9ca9 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/SA/6ZEK9SCPXHWMH3K25G1XKG.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/SA/6ZEK9SCPXHWMH3K25G1XKG.uasset index b367bff7..2fb9e968 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/SA/6ZEK9SCPXHWMH3K25G1XKG.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/SA/6ZEK9SCPXHWMH3K25G1XKG.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4aebd2871f2b1cd2d2974351b855e911fd9d06cda4f90f045c23384327387ae -size 378294 +oid sha256:b21b19061dee944e31ff61bcef3d0fb21769f5df50157e93a67aaf7e659d9f65 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/U8/HTJQPX65AQH8TE4FPXW0ST.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/U8/HTJQPX65AQH8TE4FPXW0ST.uasset index 03dee16d..38d34348 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/U8/HTJQPX65AQH8TE4FPXW0ST.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/C/U8/HTJQPX65AQH8TE4FPXW0ST.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d270ca109eefd8fd2bc9551adf4c273e323748ba9a99b2475a36c6643db52d11 -size 378294 +oid sha256:8a501d9d38638ae677236d16dcf4275e2bb729b14eedf5db2dd2e39e8c0d788f +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/17/XYII6JEU1NWS5TUWNTWNX9.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/17/XYII6JEU1NWS5TUWNTWNX9.uasset index 5b88de8d..338b47a7 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/17/XYII6JEU1NWS5TUWNTWNX9.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/17/XYII6JEU1NWS5TUWNTWNX9.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c82dc770565fa7101fad6e68c732a422cc86de726ca9788a79429567417eebf4 -size 378294 +oid sha256:3b61c66f7b98a81f94d024fce638a539c1dd03f14abc74a51798aab39ffc242b +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/5D/VDJOPBBOA83U9UDKE7IPCU.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/5D/VDJOPBBOA83U9UDKE7IPCU.uasset index 48e24364..e62fcdb1 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/5D/VDJOPBBOA83U9UDKE7IPCU.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/5D/VDJOPBBOA83U9UDKE7IPCU.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8bd9293590f0472d6b9b7c3b51b63bc2dca6ebb5224c2cb2db3cebe8caf8b6c9 -size 378178 +oid sha256:27da2ee9fb6d2c4bc21dfd737346bf1ec92cf044341659a1f88c697678d898f1 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/69/VJHHRR1MYM25BDHS6BR2TF.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/69/VJHHRR1MYM25BDHS6BR2TF.uasset index ac707198..7e6d9313 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/69/VJHHRR1MYM25BDHS6BR2TF.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/69/VJHHRR1MYM25BDHS6BR2TF.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f578d6c1319e99f03fef777a13d2a700b375ddac7ae2bc2280372b259573a804 -size 378294 +oid sha256:435277fcd253857bfa28964f7e7a576628c4ce480e5e6d180c071780210c16de +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/FR/P3GK359CLJH40T3VDWEQ1D.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/FR/P3GK359CLJH40T3VDWEQ1D.uasset index 605de727..521cc902 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/FR/P3GK359CLJH40T3VDWEQ1D.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/FR/P3GK359CLJH40T3VDWEQ1D.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82dae53e0636689cabbf70c899c7c4ffb5d62cc1061ec547d5da5dea143a689c -size 31123 +oid sha256:e763757fef28d5332af24a9890e9bc048834e55bdff2efd50ab2cd4cbf203656 +size 31077 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/LE/4MWFDEFLUV2HW5UJYTULIV.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/LE/4MWFDEFLUV2HW5UJYTULIV.uasset index 1eeda4de..0a3e7aac 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/LE/4MWFDEFLUV2HW5UJYTULIV.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/LE/4MWFDEFLUV2HW5UJYTULIV.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6162fb06741b02c4b7dc8e0121b3fd84fe47555c67a97b096120540ff9fa23f9 -size 378178 +oid sha256:4887141f086df7af6598fed909fce8dc5b2f7ea92c3683f9c1959f3eee1f74f8 +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/RG/37E73V7FQ6QMBJ9N3XJ514.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/RG/37E73V7FQ6QMBJ9N3XJ514.uasset index 72ae4911..d7b0c5f7 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/RG/37E73V7FQ6QMBJ9N3XJ514.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/RG/37E73V7FQ6QMBJ9N3XJ514.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb104e6e9884dcc1967c9fb80dfd465a6b08241770fb46f587ddd42332547c93 -size 378294 +oid sha256:b5bf5a84c3171e06724370178bdb35847ac9e3ac7c18363c49c6308a23076e98 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/TH/3ZZ09AKE46EOWGGPLJSY4O.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/TH/3ZZ09AKE46EOWGGPLJSY4O.uasset index 92ccb206..f3750898 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/TH/3ZZ09AKE46EOWGGPLJSY4O.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/TH/3ZZ09AKE46EOWGGPLJSY4O.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f23b4a8554c49a8c5b3b007bffa3c12e81bbb223d6290e186869ba555549bd9 -size 378178 +oid sha256:32e2d8ee1e2beec4bfd48eda507f2380573a4b9eb813c952e5b91fab6289d2ca +size 394060 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/V6/JB95XD8IMTZJQBL7SRWG5P.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/V6/JB95XD8IMTZJQBL7SRWG5P.uasset index ca9f19e8..dc98a14c 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/V6/JB95XD8IMTZJQBL7SRWG5P.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/V6/JB95XD8IMTZJQBL7SRWG5P.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:008d6165c1c76b4b816c6a80bad0b46f927428970d4af908f970100796e03155 -size 404943 +oid sha256:089dfc97ae75cccc1cd872dadb93a1e4b7e19be5def868aae89daf62c2978bb8 +size 438249 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/YS/9L5GI7YOBQ7ZBJW9TC7EHJ.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/YS/9L5GI7YOBQ7ZBJW9TC7EHJ.uasset deleted file mode 100644 index 178bf998..00000000 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/D/YS/9L5GI7YOBQ7ZBJW9TC7EHJ.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52b3418555e1c19419b580dfd78bec83c3cdcc9e76d9c67cf72ebcfad941881b -size 4648 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/1E/9T1M2QOCYCVSTJMC1F92HT.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/1E/9T1M2QOCYCVSTJMC1F92HT.uasset index 2dee1056..b07b64cf 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/1E/9T1M2QOCYCVSTJMC1F92HT.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/1E/9T1M2QOCYCVSTJMC1F92HT.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d49d723ade038381dbd6fb75ec5b7b26b71155d01e0b1a7d1c89202fec614b -size 378294 +oid sha256:f5b89ed0c9cf100bffc804f86e7921b3f342672d09f3d6719a7f1634ab299042 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/6H/DJ51NDA2JUETNXB3SZWG9J.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/6H/DJ51NDA2JUETNXB3SZWG9J.uasset index 61b56cbc..69ce5f17 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/6H/DJ51NDA2JUETNXB3SZWG9J.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/6H/DJ51NDA2JUETNXB3SZWG9J.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4fc468b8e2fa6fc3e2a54cce616b55048e415c69160b97f96e228dd95038068d -size 377974 +oid sha256:c637635767c180f32f54c10befae08a89eb3f526e969791ad8858849b61aea1e +size 393867 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/79/DQ03R297MHOCI1C2EOL47X.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/79/DQ03R297MHOCI1C2EOL47X.uasset index 63674535..db14bceb 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/79/DQ03R297MHOCI1C2EOL47X.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/79/DQ03R297MHOCI1C2EOL47X.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21f676f80dc988eefc6b3f29a1c2052e769c7adbc39502477fa9291e7f7ec1a4 -size 407986 +oid sha256:487d24691d3a352dfe5ba281a662ad9d01dd1906adc231343aee21f5126b9492 +size 441214 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/JG/N3AQY3WLDMKNREZL3X7HI8.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/JG/N3AQY3WLDMKNREZL3X7HI8.uasset index 20181c94..87f53623 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/JG/N3AQY3WLDMKNREZL3X7HI8.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/JG/N3AQY3WLDMKNREZL3X7HI8.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2225f4992f3a4a7f748f99d88b573acfb90a39dff9c1a870bc316fd7d238130e -size 378294 +oid sha256:a41c8f3ea0ac4f916a8478e54bdce11890186f7407b6adb11f1a511a25bbd35b +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/NR/BZV1ME84L9SHRDI0VFRDJ1.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/NR/BZV1ME84L9SHRDI0VFRDJ1.uasset index c7c1f8c2..f6ee32b3 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/NR/BZV1ME84L9SHRDI0VFRDJ1.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/NR/BZV1ME84L9SHRDI0VFRDJ1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60c680aae6e254a7505a1fc9ff697b33509e5ec18faabb4cb558373b8730681a -size 378294 +oid sha256:282cd9754db6ab89d47eeadaaa09d00587f3bc3391d142f54f589450776fe441 +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/TJ/HQ6SA0JSGQ60VNL8HFU61J.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/TJ/HQ6SA0JSGQ60VNL8HFU61J.uasset index 1d3dddb7..827f1294 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/TJ/HQ6SA0JSGQ60VNL8HFU61J.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/TJ/HQ6SA0JSGQ60VNL8HFU61J.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b4b0d6a16951696ad3912633fe77335686f162cc7547fbd57860c56ef363ae5 -size 378294 +oid sha256:42ee7ed6577ace7db6d541f8535c967fdf813a04ab54293b2d719fa1818e7d1f +size 394176 diff --git a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/XL/8TFST9SDPVUOPYL8S6XXN6.uasset b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/XL/8TFST9SDPVUOPYL8S6XXN6.uasset index 33a90deb..be1efe1a 100644 --- a/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/XL/8TFST9SDPVUOPYL8S6XXN6.uasset +++ b/Content/__ExternalActors__/Maps/Persistent_GameWorld/E/XL/8TFST9SDPVUOPYL8S6XXN6.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5cb8216cdbc9b9ccc5c3ccdeecbc6950bda1b3f6d90a16d9bb42ad4dad5531f1 -size 378294 +oid sha256:ec02f1f55471fa9fadbf5f0dff335db0adf2c6f61df01dfbcaab1dab2a42980d +size 394176 diff --git a/Plugins/LTween/Source/LTween/Private/LTweenManager.cpp b/Plugins/LTween/Source/LTween/Private/LTweenManager.cpp index 1cc2e9dd..bab0ff00 100644 --- a/Plugins/LTween/Source/LTween/Private/LTweenManager.cpp +++ b/Plugins/LTween/Source/LTween/Private/LTweenManager.cpp @@ -122,6 +122,7 @@ bool ULTweenTickHelperWorldSubsystem::ShouldCreateSubsystem(UObject* Outer) cons } void ULTweenTickHelperWorldSubsystem::PostInitialize() { + Super::PostInitialize(); if (auto World = GetWorld()) { if (World->IsGameWorld()) diff --git a/Plugins/UniversalCameraPlugin/Resources/Icon128.png b/Plugins/UniversalCameraPlugin/Resources/Icon128.png deleted file mode 100644 index f1177c04..00000000 --- a/Plugins/UniversalCameraPlugin/Resources/Icon128.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c2ba422b297b77afe1d526eae0b1ec886ebce06b5435da2eb358520b2ae9632 -size 30224 diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/AsyncNode.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/AsyncNode.cpp deleted file mode 100644 index 30a67253..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/AsyncNode.cpp +++ /dev/null @@ -1,386 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - - -#include "AsyncNode.h" -#include "UniversalCamera.h" -#include "GameFramework/Actor.h" -#include "Components/SplineComponent.h" - -// ---------------------------- ASYNC NODE --------------------------------------- - -UAsyncNode* UAsyncNode::CameraTravel(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, FTargetVector LocationSettings, FOffsetSettings OffsetSettings, FTargetFloat YawSettings, FTargetFloat PitchSettings, FTargetFloat RollSettings, FTargetFloat ZoomSettings, UCurveFloat* Curve, FTravelSpeedSettings SpeedSettings, bool LockAllMovement, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (!UniversalCamera) return nullptr; - - if (LocationSettings.TargetMod == TargetMod_None && OffsetSettings.OffsetMod == 0 && YawSettings.TargetMod == TargetMod_None && PitchSettings.TargetMod == TargetMod_None && RollSettings.TargetMod == TargetMod_None && ZoomSettings.TargetMod == TargetMod_None) return nullptr; - - // Calculate Location Direction ------------------------------------------------- - - FVector StartingLocation, LocationDirection; - - bool IsValidLocation = false; - - if (LocationSettings.TargetMod == ETargetMod::TargetMod_Spline) - { - IsValidLocation = IsValid(LocationSettings.SplineComponent); - } - else - { - StartingLocation = UniversalCamera->DesiredLocation; - LocationDirection = LocationSettings.GetDirection(UniversalCamera, TargetSettings, StartingLocation, IgnoreRestrictions, IsValidLocation); - } - - // Offset ----------------------------------------------------------- - - bool IsValidOffset = false; - FVector StartingOffset = FVector(0.f, 0.f, 0.f); - switch (OffsetSettings.OffsetMod) - { - case 1: - StartingOffset = UniversalCamera->DesiredTargetOffset; - break; - case 2: - StartingOffset = UniversalCamera->DesiredSocketOffset; - break; - }; - FVector OffsetDirection = OffsetSettings.GetDirection(UniversalCamera, IgnoreRestrictions, IsValidOffset); - - // Yaw ----------------------------------------------------------- - - bool IsValidYaw = false; - float StartingYaw = UniversalCamera->DesiredRotation.Yaw; - float YawDirection = YawSettings.GetDirection(UniversalCamera, 0, TargetSettings, StartingYaw, IgnoreRestrictions, IsValidYaw); - - // Pitch --------------------------------------------------------- - - bool IsValidPitch = false; - float StartingPitch = UniversalCamera->DesiredRotation.Pitch; - float PitchDirection = PitchSettings.GetDirection(UniversalCamera, 1, TargetSettings, StartingPitch, IgnoreRestrictions, IsValidPitch); - - // Roll ----------------------------------------------------------- - - bool IsValidRoll = false; - float StartingRoll = UniversalCamera->DesiredRotation.Roll; - float RollDirection = RollSettings.GetDirection(UniversalCamera, 2, TargetSettings, StartingRoll, IgnoreRestrictions, IsValidRoll); - - // Zoom -------------------------------------------------------- - - bool IsValidZoom = false; - float StartingZoom = UniversalCamera->DesiredZoom; - float ZoomDirection = ZoomSettings.GetDirection(UniversalCamera, 3, TargetSettings, StartingZoom, IgnoreRestrictions, IsValidZoom);; - - // Return if all settings are invalid - if (!(IsValidLocation || IsValidOffset || IsValidYaw || IsValidPitch || IsValidRoll || IsValidZoom)) return nullptr; - - // Calculate the duration from the speed ------------------- - - float Duration = 0.f; - if (!SpeedSettings.UseSpeed) - { - Duration = SpeedSettings.Duration; - } - - float DurationTemp = 0.f; - - - if (IsValidLocation) - { - if (SpeedSettings.UseSpeed) - { - if (LocationSettings.TargetMod == ETargetMod::TargetMod_Spline) - { - if (LocationSettings.SplineComponent) - { - Duration = LocationSettings.SplineComponent->GetSplineLength() / SpeedSettings.Speed; - } - } - else - { - float LocationDistance = LocationDirection.Length(); - - Duration = FMath::Abs(LocationDistance / SpeedSettings.Speed); - } - - } - } - - // Calculate the farthest target (using the multiplier) and set it as the duration reference if using speed - float OffsetLength = OffsetDirection.Length(); - SpeedSettings.DurationInitializer(IsValidOffset, OffsetLength, &Duration, 1.f); - SpeedSettings.DurationInitializer(IsValidYaw, YawDirection, &Duration, 5.f); - SpeedSettings.DurationInitializer(IsValidPitch, PitchDirection, &Duration, 5.f); - SpeedSettings.DurationInitializer(IsValidRoll, RollDirection, &Duration, 5.f); - SpeedSettings.DurationInitializer(IsValidZoom, ZoomDirection, &Duration, 3.f); - - - // Instantiate and initialize the Task ---------- - - UAsyncNode* NewNode = NewObject(); - - if (!IsValid(NewNode)) return nullptr; - - // Camera - NewNode->m_UniversalCamera = UniversalCamera; - NewNode->m_IgnoreLag = IgnoreLag; - NewNode->m_IgnoreRestrictions = IgnoreRestrictions; - // Time - NewNode->MaxDuration = Duration; - // Duration - NewNode->TargetSettings = TargetSettings; - // Location - NewNode->LocationSettings = LocationSettings; - NewNode->StartingLocation = StartingLocation; - NewNode->LocationDirection = LocationDirection; - NewNode->IsValidLocation = IsValidLocation; - // Offset - NewNode->OffsetSettings = OffsetSettings; - NewNode->StartingOffset = StartingOffset; - NewNode->OffsetDirection = OffsetDirection; - NewNode->IsValidOffset = IsValidOffset; - // Yaw - NewNode->YawSettings = YawSettings; - NewNode->StartingYaw = StartingYaw; - NewNode->YawDirection = YawDirection; - NewNode->IsValidYaw = IsValidYaw; - // Pitch - NewNode->PitchSettings = PitchSettings; - NewNode->StartingPitch = StartingPitch; - NewNode->PitchDirection = PitchDirection; - NewNode->IsValidPitch = IsValidPitch; - // Roll - NewNode->RollSettings = RollSettings; - NewNode->StartingRoll = StartingRoll; - NewNode->RollDirection = RollDirection; - NewNode->IsValidRoll = IsValidRoll; - // Zoom - NewNode->ZoomSettings = ZoomSettings; - NewNode->StartingZoom = StartingZoom; - NewNode->ZoomDirection = ZoomDirection; - NewNode->IsValidZoom = IsValidZoom; - // Curve - NewNode->m_Curve = Curve; - // Lock Movement - NewNode->m_LockAllMovement = LockAllMovement; - - UniversalCamera->StartTraveling_Internal(NewNode); - - return NewNode; -} - -void UAsyncNode::TryUpdateLocationDirectionAndValidity() -{ - switch (LocationSettings.TargetMod) - { - case TargetMod_Actor: - case TargetMod_Socket: - case TargetMod_SceneComponent: - LocationDirection = GetLocationDirection(IsValidLocation); - break; - case TargetMod_Spline: - IsValidLocation = IsValid(LocationSettings.SplineComponent); - break; - } -} - -void UAsyncNode::TryUpdateFloatDirectionAndValidity(FTargetFloat* FloatSettings, float* FloatValue, DirectionFunction GetFloatDirection, bool* IsValidBool) -{ - switch (FloatSettings->TargetMod) - { - case TargetMod_Actor: - case TargetMod_Socket: - case TargetMod_SceneComponent: - *FloatValue = (*this.*GetFloatDirection)(*IsValidBool); - } -} - -// ---------------------------- TRAVEL SPEED SETTINGS --------------------------------------- - -void FTravelSpeedSettings::DurationInitializer(bool IsValidBool, float Direction, float* DurationRef, float Multiplier) -{ - if (IsValidBool) - { - if (UseSpeed) - { - float DurationTemp = FMath::Abs(Direction * Multiplier / Speed); - if (DurationTemp > *DurationRef) *DurationRef = DurationTemp; - } - else - { - *DurationRef = Duration; - } - } -} - -// ---------------------------- TARGET VECTOR --------------------------------------- - -FVector FTargetVector::GetLocation(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, bool& IsValid) -{ - IsValid = false; - - if (UniversalCamera->IsFollowingAnyActor()) return FVector(0.f, 0.f, 0.f); - - switch (TargetMod) - { - case TargetMod_None: - return FVector(0.f, 0.f, 0.f); - case TargetMod_CustomValue: - IsValid = true; - return VectorValue; - case TargetMod_Actor: - IsValid = TargetSettings.IsValidActor(); - if (IsValid) - { - return TargetSettings.GetActorLocation(); - } - else return FVector(0.f, 0.f, 0.f); - case TargetMod_Socket: - IsValid = TargetSettings.IsValidSocket(); - if (IsValid) - { - return TargetSettings.GetSocketLocation(); - } - else return FVector(0.f, 0.f, 0.f); - case TargetMod_SceneComponent: - IsValid = TargetSettings.IsValidSceneComponent(); - if (IsValid) - { - return TargetSettings.GetSceneComponentLocation(); - } - else return FVector(0.f, 0.f, 0.f); - } - - return FVector(0.f, 0.f, 0.f); -} - -FVector FTargetVector::GetDirection(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, FVector StartingLocation, bool IgnoreRestrictions, bool& IsValid) -{ - IsValid = false; - FVector Location = GetLocation(UniversalCamera, TargetSettings, IsValid); - if (!IgnoreRestrictions) Location = UniversalCamera->GetCorrectedDestinationFromRestrictions(Location); - return Location - StartingLocation; -} - -// ---------------------------- TARGET OFFSET --------------------------------------- - -FVector FOffsetSettings::GetDirection(AUniversalCamera* UniversalCamera, bool IgnoreRestrictions, bool& IsValidOffset) -{ - IsValidOffset = false; - FVector Offset = IgnoreRestrictions ? OffsetValue : UniversalCamera->GetClampedOffset(OffsetValue); - - switch (OffsetMod) - { - case 1: - IsValidOffset = true; - return Offset - UniversalCamera->DesiredTargetOffset; - case 2: - IsValidOffset = true; - return Offset - UniversalCamera->DesiredSocketOffset; - }; - - return FVector(0.f, 0.f, 0.f); -} - -// ---------------------------- TARGET FLOAT --------------------------------------- - -float FTargetFloat::GetRotationValue(AUniversalCamera* UniversalCamera, int32 Type, FTargetSettings TargetSettings, bool IgnoreRestrictions, bool& IsValid) -{ - IsValid = false; - FRotator RotatorValue(0.f, 0.f, 0.f); - - switch (TargetMod) - { - case TargetMod_None: - return 0.f; - case TargetMod_CustomValue: - IsValid = true; - return FloatValue; - case TargetMod_Actor: - IsValid = TargetSettings.IsValidActor(); - if (IsValid) - { - RotatorValue = TargetSettings.GetActorRotation(); - break; - } - else return 0.f; - case TargetMod_Socket: - IsValid = TargetSettings.IsValidSocket(); - if (IsValid) - { - RotatorValue = TargetSettings.GetSocketRotation(); - break; - } - else return 0.f; - case TargetMod_SceneComponent: - IsValid = TargetSettings.IsValidSceneComponent(); - if (IsValid) - { - RotatorValue = TargetSettings.GetSceneComponentRotation(); - break; - } - else return 0.f; - } - - if (Type == 0) - { - if (!IgnoreRestrictions) RotatorValue.Yaw = UniversalCamera->GetClampedYaw(RotatorValue.Yaw); - return RotatorValue.Yaw; - } - else if (Type == 1) - { - if (!IgnoreRestrictions) RotatorValue.Pitch = UniversalCamera->GetClampedYaw(RotatorValue.Pitch); - return RotatorValue.Pitch; - } - else if (Type == 2) - { - if (!IgnoreRestrictions) RotatorValue.Roll = UniversalCamera->GetClampedYaw(RotatorValue.Roll); - return RotatorValue.Roll; - } - - return 0.f; -} - -float FTargetFloat::GetZoomValue(FTargetSettings TargetSettings, bool& IsValid) -{ - IsValid = false; - - switch (TargetMod) - { - case TargetMod_CustomValue: - IsValid = true; - return FloatValue; - case TargetMod_Actor: - return TargetSettings.GetTargetActorZoom(IsValid); - - } - - return 0.f; -} - -float FTargetFloat::GetDirection(AUniversalCamera* UniversalCamera, int32 Type, FTargetSettings TargetSettings, float StartingValue, bool IgnoreRestrictions, bool& IsValid) -{ - IsValid = false; - - if (Type < 3) - { - float RotationValue = GetRotationValue(UniversalCamera, Type, TargetSettings, IgnoreRestrictions, IsValid); - float Delta = RotationValue - StartingValue; - - if (Delta > 180.0f) - { - Delta -= 360.0f; - } - else if (Delta < -180.0f) - { - Delta += 360.0f; - } - return Delta; - } - else if (Type == 3) - { - float ZoomValue = GetZoomValue(TargetSettings, IsValid); - if (!IgnoreRestrictions) ZoomValue = UniversalCamera->GetClampedZoom(ZoomValue); - return ZoomValue - StartingValue; - } - - return 0.f; -} \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/PlaceholderCamera.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/PlaceholderCamera.cpp deleted file mode 100644 index 77903482..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/PlaceholderCamera.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - - -#include "PlaceholderCamera.h" - -// Sets default values -APlaceholderCamera::APlaceholderCamera() -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = false; - - SpringArmComponent = CreateDefaultSubobject(TEXT("SpringArmComponent")); - SpringArmComponent->SetupAttachment(RootComponent); - SpringArmComponent->bDoCollisionTest = false; - SpringArmComponent->TargetArmLength = 400.0f; - - CameraComponent = CreateDefaultSubobject(TEXT("CameraComponent")); - CameraComponent->SetupAttachment(SpringArmComponent); -} - -// Called when the game starts or when spawned -void APlaceholderCamera::BeginPlay() -{ - Super::BeginPlay(); -} - -FPlaceholderCameraInfos APlaceholderCamera::GetInfos() -{ - FPlaceholderCameraInfos Infos; - Infos.Location = GetActorLocation(); - Infos.Yaw = GetActorRotation().Yaw; - Infos.Pitch = GetActorRotation().Pitch; - Infos.Zoom = GetZoom(); - - return Infos; -} \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/SharedStructs.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/SharedStructs.cpp deleted file mode 100644 index 1ef2220d..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/SharedStructs.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - - -#include "SharedStructs.h" -#include "GameFramework/SpringArmComponent.h" -#include "UniversalCamera.h" - -bool FTargetSettings::IsValidActor() const -{ - return IsValid(Actor); -} - -bool FTargetSettings::IsValidSocket() const -{ - return IsValid(Mesh) && Mesh->DoesSocketExist(Socket); -} - -bool FTargetSettings::IsValidSceneComponent() const -{ - return IsValid(SceneComponent); -} - -float FTargetSettings::GetTargetActorZoom(bool& IsValidTarget) -{ - IsValidTarget = false; - if (!IsValidActor()) - { - return 0.f; - } - - // Return the TargetArmLength if target has a SpringArmComponent - USpringArmComponent* SpringArmComponent = Cast(Actor->GetComponentByClass(USpringArmComponent::StaticClass())); - if (IsValid(SpringArmComponent)) - { - IsValidTarget = true; - return SpringArmComponent->TargetArmLength; - } - // Return the DesiredZoom is target is a UniversalCamera - AUniversalCamera* UniversalCameraRef = Cast(Actor); - if (IsValid(UniversalCameraRef)) - { - IsValidTarget = true; - return UniversalCameraRef->DesiredZoom; - } - - return 0.f; -} - -AActor* FTargetSettings::GetOwnerActor() const -{ - if (IsValidActor()) return Actor; - if (IsValidSocket()) return Mesh->GetOwner(); - if (IsValidSceneComponent()) return SceneComponent->GetOwner(); - - return nullptr; -} \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCamera.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCamera.cpp deleted file mode 100644 index 7cc8b228..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCamera.cpp +++ /dev/null @@ -1,1951 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - - -#include "UniversalCamera.h" -#include "Camera/CameraComponent.h" -#include "Kismet/GameplayStatics.h" -#include "Kismet/KismetMathLibrary.h" -#include "DrawDebugHelpers.h" -#include "AsyncNode.h" -#include "Curves/CurveFloat.h" -#include "Net/UnrealNetwork.h" -#include "TimerManager.h" -#include "Logging/MessageLog.h" -#include "Kismet/KismetSystemLibrary.h" -#include "Serialization/MemoryWriter.h" -#include "UniversalCameraSaveGame.h" -#include "Math/Box.h" -#include "Engine/Engine.h" -#include "Components/SplineComponent.h" -#include "Serialization/ObjectAndNameAsStringProxyArchive.h" - - -#define LOG_WARNING_MESSAGE(Message) \ -{ \ - FMessageLog MessageLog(FName("PIE")); \ - MessageLog.Warning(FText::FromString(Message)); \ -} - -FVector FTargetSettings_WithTemplates::GetTargetLocation(bool& IsValid, FRotator& Rotation) -{ - IsValid = false; - - switch (Type) - { - case 0: - if (TargetSettings.IsValidActor()) - { - IsValid = true; - Rotation = TargetSettings.GetActorRotation(); - return TargetSettings.GetActorLocation(); - } - else return FVector(0.f, 0.f, 0.f); - case 1: - if (TargetSettings.IsValidSceneComponent()) - { - IsValid = true; - Rotation = TargetSettings.GetSceneComponentRotation(); - return TargetSettings.GetSceneComponentLocation(); - } - else return FVector(0.f, 0.f, 0.f); - case 2: - if (TargetSettings.IsValidSocket()) - { - IsValid = true; - Rotation = TargetSettings.GetSocketRotation(); - return TargetSettings.GetSocketLocation(); - } - else return FVector(0.f, 0.f, 0.f); - } - - return FVector(0.f, 0.f, 0.f); -} - - -// Sets default values -AUniversalCamera::AUniversalCamera() -{ - PrimaryActorTick.bCanEverTick = true; - PrimaryActorTick.bTickEvenWhenPaused = true; - - RootComponent = CreateDefaultSubobject(TEXT("RootComponent")); - - SpringArmComponent = CreateDefaultSubobject(TEXT("CameraSpringArm")); - if (SpringArmComponent && RootComponent) - { - SpringArmComponent->SetupAttachment(RootComponent); - SpringArmComponent->TargetArmLength = 400.0f; - SpringArmComponent->bDoCollisionTest = false; - } -} - - -void AUniversalCamera::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const -{ - Super::GetLifetimeReplicatedProps(OutLifetimeProps); - - DOREPLIFETIME(AUniversalCamera, DesiredLocation); - DOREPLIFETIME(AUniversalCamera, DesiredSocketOffset); - DOREPLIFETIME(AUniversalCamera, DesiredTargetOffset); - DOREPLIFETIME(AUniversalCamera, DesiredRotation); - DOREPLIFETIME(AUniversalCamera, DesiredZoom); - DOREPLIFETIME(AUniversalCamera, DesiredRotationOffset); -} - -// Called when the game starts or when spawned -void AUniversalCamera::BeginPlay() -{ -#if WITH_EDITOR - LOG_VerifyStartingSettings(); -#endif - - if (GetWorld()) LastDeltaTime = GetWorld()->GetDeltaSeconds(); - - SetDesiredLocation(OverrideStartingLocation ? StartingLocation : GetActorLocation(), true, true); - SetDesiredYaw(OverrideStartingYaw ? StartingYaw : GetActorRotation().Yaw, true, true); - SetDesiredPitch(OverrideStartingPitch ? StartingPitch : GetActorRotation().Pitch, true, true); - - if (SpringArmComponent) - { - SetDesiredSocketOffset(OverrideStartingSocketOffset ? StartingSocketOffset : SpringArmComponent->SocketOffset, true, true); - SetDesiredTargetOffset(OverrideStartingTargetOffset ? StartingTargetOffset : SpringArmComponent->TargetOffset, true, true); - SetDesiredZoom(OverrideStartingZoom ? StartingZoom : SpringArmComponent->TargetArmLength, true, true); - } - - Super::BeginPlay(); -} - -#if WITH_EDITOR -void AUniversalCamera::LOG_VerifyStartingSettings() -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return; - } - - // Verify that a CameraComponent is attached to the SpringArmComponent - UCameraComponent* AttachedCamera = GetCameraComponent(); - if (!AttachedCamera) - { - LOG_WARNING_MESSAGE("Please attach a Camera or a CineCamera to the SpringArmComponent of your Universal Camera class!"); - } - - // Verify that DoCollisionTest is disabled - if (SpringArmComponent->bDoCollisionTest) - { - LOG_WARNING_MESSAGE("Please disable 'DoCollisionTest' in the SpringArmComponent of your Universal Camera and use the 'SpringArmCollisions' feature in your Universal Camera defaults instead."); - } - - // Verify that OriginArmCollisions probe size is greater that SpringArmCollisions probe size - if (EnabledFeatures & OriginCollisions && EnabledFeatures & SpringArmCollisions && (SpringArmCollisionsProbeSize > OriginCollisionsProbeSize)) - { - LOG_WARNING_MESSAGE("Spring Arm Collisions Probe Size is greater than Origin Collisions Probe Size, which could result in Spring Arm Collisions triggering when the Origin is near geometry."); - } -} -#endif - -// Called every frame -void AUniversalCamera::Tick(float DeltaTime) -{ - const float DeltaTimeCorrective = DeltaTime * GetTimeDilationCorrectiveValue(); - - LastLocation = GetActorLocation(); - - if (EnabledFeatures & EdgeScrolling) EdgeScrollingTick_Internal(); - - if (IsScreenSliding) ScreenSlidingTick(); - - if (IsTraveling) TravelTaskTick(DeltaTimeCorrective); - - if (bIsFollowingAnyActor) FollowTargetTick(); - - // Update Z Desired Location if using Terrain Height Adaptation - if ((EnabledFeatures & TerrainHeightAdaptation) && !IsPreciseMouseDragging && !IsFollowingAnyActor()) - { - ApplyTerrainHeightAdaptationTick(); - } - - if (IsPreciseMouseDragging) - { - PreciseMouseDragTick(); - } - - // LAG - - if (EnabledFeatures & LagMovement) - { - FVector LagLocation = Lag_GetTickDesiredLocation(DeltaTimeCorrective); - SetActorLocation(LagLocation); - } - if (EnabledFeatures & LagOffset) - { - if (SpringArmComponent) - { - SpringArmComponent->SocketOffset = Lag_GetTickDesiredSocketOffset(DeltaTimeCorrective); - SpringArmComponent->TargetOffset = Lag_GetTickDesiredTargetOffset(DeltaTimeCorrective); - } - else - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - } - } - if (EnabledFeatures & LagMovement) - { - FVector CurrentLocation = GetActorLocation(); - SetActorLocation(FVector(CurrentLocation.X, CurrentLocation.Y, Lag_GetTickDesiredHeight(DeltaTimeCorrective))); - } - if (EnabledFeatures & LagRotation) - { - SetActorRotation(Lag_GetTickDesiredRotation(DeltaTimeCorrective)); - } - - UpdateSpringArmLength(DeltaTimeCorrective); - - if (DebugPrintDesiredPosition) PrintDesiredPosition(); - - // Update Velocity - Velocity = (GetActorLocation() - LastLocation) / LastDeltaTime; - if (GetWorld()) LastDeltaTime = GetWorld()->GetDeltaSeconds(); - - LastTimeDilation = UGameplayStatics::GetGlobalTimeDilation(GetWorld()); - - Super::Tick(DeltaTime); - -#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) - if (DrawDebugSpheres) - { - FVector CurrentLocation = GetActorLocation(); - DrawDebugSphere(GetWorld(), GetActorLocation(), 5.f, 8, FColor::Green); - - if (EnabledFeatures & LagMovement) - { - DrawDebugSphere(GetWorld(), DesiredLocation, 5.f, 8, FColor::Yellow); - DrawDebugDirectionalArrow(GetWorld(), CurrentLocation, DesiredLocation, 7.5f, FColor::Yellow); - } - if (DesiredTargetOffset.Length() > KINDA_SMALL_NUMBER) - { - DrawDebugSphere(GetWorld(), GetDesiredTargetOffsetWorldLocation(), 5.f, 8, FColor::Orange); - DrawDebugDirectionalArrow(GetWorld(), DesiredLocation, GetDesiredTargetOffsetWorldLocation(), 7.5f, FColor::Orange); - } - if (DesiredSocketOffset.Length() > KINDA_SMALL_NUMBER) - { - DrawDebugSphere(GetWorld(), GetDesiredSocketOffsetWorldLocation(), 5.f, 8, FColor::Red); - DrawDebugDirectionalArrow(GetWorld(), GetDesiredTargetOffsetWorldLocation(), GetDesiredSocketOffsetWorldLocation(), 7.5f, FColor::Red); - } - } -#endif -} - -// Called to bind functionality to input -void AUniversalCamera::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) -{ - Super::SetupPlayerInputComponent(PlayerInputComponent); -} - -UCameraComponent* AUniversalCamera::GetCameraComponent() -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return nullptr; - } - - TArray> AttachedChildren = SpringArmComponent->GetAttachChildren(); - - for (TObjectPtr AttachedChild : AttachedChildren) - { - UCameraComponent* Camera = Cast(AttachedChild); - if (IsValid(Camera)) - { - return Camera; - } - } - - return nullptr; -} - -void AUniversalCamera::UpdateSpringArmLength(float DeltaTime) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return; - } - - float NewTargetArmLength = SpringArmComponent->TargetArmLength; - - if (EnabledFeatures & LagZoom) - { - NewTargetArmLength = Lag_GetTickDesiredZoom(DeltaTime); - } - - if (EnabledFeatures & SpringArmCollisions && (NewTargetArmLength != 0.0f)) - { - FVector OriginLoc = GetActorLocation(); - FVector CameraLoc = OriginLoc - GetActorRotation().Vector() * NewTargetArmLength; - - FHitResult HitResult; - - AActor* ActorToIgnore = IsFollowingAnyActor() ? FollowTargetSettings.TargetSettings.GetOwnerActor() : GetOwner(); - FCollisionQueryParams QueryParams(SCENE_QUERY_STAT(SpringArm), false, ActorToIgnore); - GetWorld()->SweepSingleByChannel(HitResult, OriginLoc, CameraLoc, FQuat::Identity, SpringArmCollisionsChannel, FCollisionShape::MakeSphere(SpringArmCollisionsProbeSize), QueryParams); - - if (HitResult.bBlockingHit) - { - NewTargetArmLength = (HitResult.Location - OriginLoc).Length(); - } - } - - SpringArmComponent->TargetArmLength = NewTargetArmLength; -} - - -void AUniversalCamera::EnableFeatures(int32 FeaturesToEnable) -{ - EnabledFeatures |= FeaturesToEnable; -} - -void AUniversalCamera::DisableFeatures(int32 FeaturesToDisable) -{ - // Disable ScreenSliding if active - if ((FeaturesToDisable & ScreenSliding) && (EnabledFeatures & ScreenSliding) && IsScreenSliding) - { - ToggleScreenSliding(false); - } - // Stop Following if active - if ((FeaturesToDisable & EEnabledFeatures::FollowTarget) && (EnabledFeatures & EEnabledFeatures::FollowTarget) && IsFollowingAnyActor()) - { - StopFollowing_Internal(bShouldResetOffsetIfFailed, StopFollowingReason_DisabledFeature); - } - // Disable PreciseMouseDrag if active - if ((FeaturesToDisable & PreciseMouseDrag) && (EnabledFeatures & PreciseMouseDrag) && IsPreciseMouseDragging) - { - TogglePreciseMouseDrag(false); - } - - if ((FeaturesToDisable & LagMovement) && (EnabledFeatures & LagMovement)) - { - SetDesiredLocation(GetActorLocation()); - } - if ((FeaturesToDisable & LagOffset) && (EnabledFeatures & LagOffset)) - { - if (SpringArmComponent) - { - SetDesiredSocketOffset(SpringArmComponent->SocketOffset); - SetDesiredTargetOffset(SpringArmComponent->TargetOffset); - } - else - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - } - - } - if ((FeaturesToDisable & LagRotation) && (EnabledFeatures & LagRotation)) - { - SetDesiredRotation(GetActorRotation()); - } - if ((FeaturesToDisable & LagZoom) && (EnabledFeatures & LagZoom)) - { - if (SpringArmComponent) - { - SetDesiredZoom(SpringArmComponent->TargetArmLength); - - } - else - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - } - } - - EnabledFeatures = ~(~EnabledFeatures | FeaturesToDisable); -} - -bool AUniversalCamera::AreFeaturesEnabled(int32 FeaturesToTest) -{ - return (EnabledFeatures & FeaturesToTest); -} - -void AUniversalCamera::StartTraveling_Internal(UAsyncNode* AsyncNode) -{ - if (!IsValid(AsyncNode)) return; - - CurrentTravelTask = AsyncNode; - IsTraveling = true; -} - -void AUniversalCamera::TravelTaskTick(float DeltaTime) -{ - if (!IsValid(CurrentTravelTask)) - { - EndTravelTask(true); - return; - } - - CurrentTravelTask->TryUpdateLocationDirectionAndValidity(); - CurrentTravelTask->TryUpdateYawDirectionAndValidity(); - CurrentTravelTask->TryUpdatePitchDirectionAndValidity(); - CurrentTravelTask->TryUpdateRollDirectionAndValidity(); - CurrentTravelTask->TryUpdateZoomDirectionAndValidity(); - - if (!CurrentTravelTask->AreValidSettings()) - { - EndTravelTask(true); - return; - } - - CurrentTravelTask->ElapsedTime += DeltaTime; - - float CurvePosition = CurrentTravelTask->ElapsedTime / CurrentTravelTask->MaxDuration; - float CurveValue = (CurrentTravelTask->m_Curve != nullptr) ? CurrentTravelTask->m_Curve->GetFloatValue(CurvePosition) : CurvePosition; - - UpdateCameraTransform(CurveValue); - - if (CurvePosition >= 1.f) - { - EndTravelTask(false); - } -} - -void AUniversalCamera::UpdateCameraTransform(float CurveValue) -{ - const bool UseSpline = CurrentTravelTask->LocationSettings.TargetMod == ETargetMod::TargetMod_Spline; - - if (UseSpline) - { - USplineComponent* SplineComponent = CurrentTravelTask->LocationSettings.SplineComponent; - if (SplineComponent) - { - const float SplineLength = SplineComponent->GetSplineLength(); - SetDesiredLocation_Internal(SplineComponent->GetLocationAtDistanceAlongSpline(CurveValue * SplineLength, ESplineCoordinateSpace::World)); - } - } - else - { - if (CurrentTravelTask->IsValidLocation) - { - SetDesiredLocation_Internal(CurrentTravelTask->StartingLocation + CurrentTravelTask->LocationDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - } - - if (CurrentTravelTask->IsValidOffset) - { - if (CurrentTravelTask->OffsetSettings.OffsetMod == 1) - { - SetDesiredTargetOffset_Internal(CurrentTravelTask->StartingOffset + CurrentTravelTask->OffsetDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - else - { - SetDesiredSocketOffset_Internal(CurrentTravelTask->StartingOffset + CurrentTravelTask->OffsetDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - } - if (CurrentTravelTask->IsValidYaw) - { - SetDesiredYaw_Internal(CurrentTravelTask->StartingYaw + CurrentTravelTask->YawDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - if (CurrentTravelTask->IsValidPitch) - { - SetDesiredPitch_Internal(CurrentTravelTask->StartingPitch + CurrentTravelTask->PitchDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - if (CurrentTravelTask->IsValidRoll) - { - SetDesiredRoll_Internal(CurrentTravelTask->StartingRoll + CurrentTravelTask->RollDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } - if (CurrentTravelTask->IsValidZoom) - { - SetDesiredZoom_Internal(CurrentTravelTask->StartingZoom + CurrentTravelTask->ZoomDirection * CurveValue, CurrentTravelTask->m_IgnoreLag, CurrentTravelTask->m_IgnoreRestrictions); - } -} - -void AUniversalCamera::EndTravelTask(const bool Abort) -{ - IsTraveling = false; - - if (Abort && IsValid(CurrentTravelTask)) - { - CurrentTravelTask->OnAborted.Broadcast(); - } - else if (IsValid(CurrentTravelTask)) - { - CurrentTravelTask->OnReachedDestination.Broadcast(); - } -} - -void AUniversalCamera::SetDesiredPosition(FVector NewLocation, FVector NewSocketOffset, FVector NewTargetOffset, float NewYaw, float NewPitch, float NewRoll, float NewZoom, bool IgnoreLag, bool IgnoreRestrictions) -{ - SetDesiredLocation(NewLocation, IgnoreLag, IgnoreRestrictions); - SetDesiredSocketOffset(NewSocketOffset, IgnoreLag, IgnoreRestrictions); - SetDesiredTargetOffset(NewTargetOffset, IgnoreLag, IgnoreRestrictions); - SetDesiredYaw(NewYaw, IgnoreLag, IgnoreRestrictions); - SetDesiredPitch(NewPitch, IgnoreLag, IgnoreRestrictions); - SetDesiredRoll(NewRoll, IgnoreLag, IgnoreRestrictions); - SetDesiredZoom(NewZoom, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredLocation_Internal(FVector NewLocation, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (!IgnoreRestrictions) NewLocation = GetCorrectedDestinationFromRestrictions(NewLocation); - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions) - { - bool DumBool; - NewLocation = GetCorrectedDestinationFromOriginCollisions(DesiredLocation, NewLocation, DumBool); - } - - DesiredLocation = NewLocation; - if (!(EnabledFeatures & EEnabledFeatures::LagMovement) || IgnoreLag) - { - LastLocation = GetActorLocation(); - LastDeltaTime = GetWorld()->GetDeltaSeconds(); - SetActorLocation(DesiredLocation, true); - } - OnDesiredLocationChanged.Broadcast(DesiredLocation); -} - -void AUniversalCamera::SetDesiredLocation(FVector NewLocation, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || CurrentTravelTask->IsValidLocation)) return; - - SetDesiredLocation_Internal(NewLocation, IgnoreLag, IgnoreRestrictions); -} - -FVector AUniversalCamera::GetClampedLocation(FVector Location) -{ - if (LocationConstrainType == ELocationConstrainType::Raw) - { - float X = Location.X; - float Y = Location.Y; - float Z = Location.Z; - - ClampCustomValue(ConstrainLocationMinimum.X, ConstrainLocationMaximum.X, &X, MinimumLocation.X, MaximumLocation.X); - ClampCustomValue(ConstrainLocationMinimum.Y, ConstrainLocationMaximum.Y, &Y, MinimumLocation.Y, MaximumLocation.Y); - ClampCustomValue(ConstrainLocationMinimum.Z, ConstrainLocationMaximum.Z, &Z, MinimumLocation.Z, MaximumLocation.Z); - - return FVector(X, Y, Z); - } - else if (LocationConstrainType == ELocationConstrainType::Sphere) - { - FVector ToLocation = Location - SphereOrigin; - float DistanceSquared = ToLocation.SizeSquared(); - - if (DistanceSquared > FMath::Square(SphereRadius)) - { - ToLocation.Normalize(); - Location = SphereOrigin + ToLocation * SphereRadius; - } - - return Location; - } - return Location; -} - -void AUniversalCamera::SetDesiredTargetOffset_Internal(FVector NewTargetOffset, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return; - } - if (!IgnoreRestrictions) NewTargetOffset = GetClampedOffset(NewTargetOffset); - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions) - { - bool DumBool; - NewTargetOffset = GetCorrectedDestinationFromOriginCollisions(GetDesiredTargetOffsetWorldLocation(), DesiredLocation + NewTargetOffset, DumBool) - DesiredLocation; - } - - DesiredTargetOffset = NewTargetOffset; - - if (!(EnabledFeatures & EEnabledFeatures::LagOffset) || IgnoreLag) - SpringArmComponent->TargetOffset = DesiredTargetOffset; - - OnDesiredTargetOffsetChanged.Broadcast(DesiredTargetOffset); -} - -void AUniversalCamera::SetDesiredTargetOffset(FVector NewTargetOffset, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || (CurrentTravelTask->IsValidOffset && CurrentTravelTask->OffsetSettings.OffsetMod == 1))) return; - - SetDesiredTargetOffset_Internal(NewTargetOffset, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredSocketOffset_Internal(FVector NewSocketOffset, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return; - } - - if (!IgnoreRestrictions) NewSocketOffset = GetClampedOffset(NewSocketOffset); - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions) - { - bool DumBool; - FVector NewWorldSocketOffset = GetCorrectedDestinationFromOriginCollisions(GetDesiredSocketOffsetWorldLocation(), GetDesiredTargetOffsetWorldLocation() + FRotationMatrix(DesiredRotation).TransformVector(NewSocketOffset), DumBool); - - FVector RelativeLoc = FTransform(DesiredRotation, GetDesiredTargetOffsetWorldLocation()).InverseTransformPosition(NewWorldSocketOffset); - NewSocketOffset = RelativeLoc; - } - - DesiredSocketOffset = NewSocketOffset; - if (!(EnabledFeatures & EEnabledFeatures::LagOffset) || IgnoreLag) - SpringArmComponent->SocketOffset = DesiredSocketOffset; - - OnDesiredSocketOffsetChanged.Broadcast(DesiredSocketOffset); -} - -void AUniversalCamera::SetDesiredSocketOffset(FVector NewSocketOffset, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || (CurrentTravelTask->IsValidOffset && CurrentTravelTask->OffsetSettings.OffsetMod == 2))) return; - - SetDesiredSocketOffset_Internal(NewSocketOffset, IgnoreLag, IgnoreRestrictions); -} - -FVector AUniversalCamera::GetClampedOffset(FVector Offset) -{ - if (OffsetConstrainType == EConstrainType::CustomConstrain) - { - // UE5.0 compatibility / Replaces FVector member references - - float X = Offset.X; - float Y = Offset.Y; - float Z = Offset.Z; - - ClampCustomValue(ConstrainOffsetMinimum.X, ConstrainOffsetMaximum.X, &X, MinimumOffset.X, MaximumOffset.X); - ClampCustomValue(ConstrainOffsetMinimum.Y, ConstrainOffsetMaximum.Y, &Y, MinimumOffset.Y, MaximumOffset.Y); - ClampCustomValue(ConstrainOffsetMinimum.Z, ConstrainOffsetMaximum.Z, &Z, MinimumOffset.Z, MaximumOffset.Z); - - Offset = FVector(X, Y, Z); - } - else if (OffsetConstrainType == EConstrainType::MaxDistance) - { - if (Offset.Length() > OffsetMaxDistance) - { - FVector Direction = Offset; - Direction.Normalize(); - Offset = Direction * OffsetMaxDistance; - } - } - return Offset; -} - -void AUniversalCamera::SetDesiredYaw_Internal(float NewYaw, bool IgnoreLag, bool IgnoreRestrictions) -{ - float NewYawOffset = DesiredRotationOffset.Yaw; - if (!IgnoreRestrictions) - { - NewYaw = GetClampedYaw(NewYaw); - NewYawOffset = GetClampedYaw(NewYaw + DesiredRotationOffset.Yaw) - NewYaw; - } - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions && DesiredSocketOffset.Length() > KINDA_SMALL_NUMBER) - { - bool DidHit; - FVector NewWorldSocketOffset = GetCorrectedDestinationFromOriginCollisions(GetDesiredSocketOffsetWorldLocation(), GetDesiredTargetOffsetWorldLocation() + FRotationMatrix(FRotator(DesiredRotation.Pitch, NewYaw, DesiredRotation.Roll)).TransformVector(DesiredSocketOffset), DidHit); - - if (DidHit) - { - return; - } - } - - DesiredRotation.Yaw = NewYaw; - DesiredRotationOffset.Yaw = NewYawOffset; - if (!(EnabledFeatures & EEnabledFeatures::LagRotation) || IgnoreLag) - SetActorRotation(GetDesiredRotationWithOffset()); - - OnDesiredRotationChanged.Broadcast(DesiredRotation); - OnDesiredRotationOffsetChanged.Broadcast(DesiredRotationOffset); -} - -void AUniversalCamera::SetDesiredYaw(float NewYaw, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || CurrentTravelTask->IsValidYaw)) return; - - SetDesiredYaw_Internal(NewYaw, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredYawOffset(float NewYawOffset) -{ - DesiredRotationOffset.Yaw = NewYawOffset; - SetDesiredYaw(DesiredRotation.Yaw); -} - -float AUniversalCamera::GetClampedYaw(float Yaw) -{ - Yaw = UKismetMathLibrary::NormalizeAxis(Yaw); - ClampCustomValue(ConstrainYaw, ConstrainYaw, &Yaw, MinimumYaw, MaximumYaw, ReverseYawRestriction); - return Yaw; -} - -void AUniversalCamera::SetDesiredPitch_Internal(float NewPitch, bool IgnoreLag, bool IgnoreRestrictions) -{ - float NewPitchOffset = DesiredRotationOffset.Pitch; - if (!IgnoreRestrictions) - { - NewPitch = GetClampedPitch(NewPitch); - NewPitchOffset = GetClampedPitch(NewPitch + DesiredRotationOffset.Pitch) - NewPitch; - } - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions && DesiredSocketOffset.Length() > KINDA_SMALL_NUMBER) - { - bool DidHit; - FVector NewWorldSocketOffset = GetCorrectedDestinationFromOriginCollisions(GetDesiredSocketOffsetWorldLocation(), GetDesiredTargetOffsetWorldLocation() + FRotationMatrix(FRotator(NewPitch, DesiredRotation.Yaw, DesiredRotation.Roll)).TransformVector(DesiredSocketOffset), DidHit); - - if (DidHit) - { - return; - } - } - - DesiredRotation.Pitch = NewPitch; - DesiredRotationOffset.Pitch = NewPitchOffset; - if (!(EnabledFeatures & EEnabledFeatures::LagRotation) || IgnoreLag) - SetActorRotation(GetDesiredRotationWithOffset()); - - OnDesiredRotationChanged.Broadcast(DesiredRotation); - OnDesiredRotationOffsetChanged.Broadcast(DesiredRotationOffset); -} - -void AUniversalCamera::SetDesiredPitch(float NewPitch, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || CurrentTravelTask->IsValidPitch)) return; - - SetDesiredPitch_Internal(NewPitch, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredPitchOffset(float NewPitchOffset) -{ - DesiredRotationOffset.Pitch = NewPitchOffset; - SetDesiredPitch(DesiredRotation.Pitch); -} - -float AUniversalCamera::GetClampedPitch(float Pitch) -{ - Pitch = UKismetMathLibrary::NormalizeAxis(Pitch); - ClampCustomValue(ConstrainPitch, ConstrainPitch, &Pitch, MinimumPitch, MaximumPitch, ReversePitchRestriction); - return Pitch; -} - -void AUniversalCamera::SetDesiredRoll_Internal(float NewRoll, bool IgnoreLag, bool IgnoreRestrictions) -{ - float NewRollOffset = DesiredRotationOffset.Roll; - if (!IgnoreRestrictions) - { - NewRoll = GetClampedRoll(NewRoll); - NewRollOffset = GetClampedRoll(NewRoll + DesiredRotationOffset.Roll) - NewRoll; - } - - if (!IgnoreRestrictions && EnabledFeatures & OriginCollisions && DesiredSocketOffset.Length() > KINDA_SMALL_NUMBER) - { - bool DidHit; - FVector NewWorldSocketOffset = GetCorrectedDestinationFromOriginCollisions(GetDesiredSocketOffsetWorldLocation(), GetDesiredTargetOffsetWorldLocation() + FRotationMatrix(FRotator(DesiredRotation.Pitch, DesiredRotation.Yaw, NewRoll)).TransformVector(DesiredSocketOffset), DidHit); - - if (DidHit) - { - return; - } - } - - DesiredRotation.Roll = NewRoll; - DesiredRotationOffset.Roll = NewRollOffset; - if (!(EnabledFeatures & EEnabledFeatures::LagRotation) || IgnoreLag) - SetActorRotation(GetDesiredRotationWithOffset()); - - OnDesiredRotationChanged.Broadcast(DesiredRotation); - OnDesiredRotationOffsetChanged.Broadcast(DesiredRotationOffset); -} - -void AUniversalCamera::SetDesiredRoll(float NewRoll, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || CurrentTravelTask->IsValidRoll)) return; - - SetDesiredRoll_Internal(NewRoll, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredRollOffset(float NewRollOffset) -{ - DesiredRotationOffset.Roll = NewRollOffset; - SetDesiredRoll(DesiredRotation.Roll); -} - -float AUniversalCamera::GetClampedRoll(float Roll) -{ - Roll = UKismetMathLibrary::NormalizeAxis(Roll); - ClampCustomValue(ConstrainRoll, ConstrainRoll, &Roll, MinimumRoll, MaximumRoll, ReverseRollRestriction); - return Roll; -} - -void AUniversalCamera::SetDesiredRotation(FRotator NewRotation, bool IgnoreLag, bool IgnoreRestrictions) -{ - SetDesiredYaw(NewRotation.Yaw, IgnoreLag, IgnoreRestrictions); - SetDesiredPitch(NewRotation.Pitch, IgnoreLag, IgnoreRestrictions); - SetDesiredRoll(NewRotation.Roll, IgnoreLag, IgnoreRestrictions); -} - -void AUniversalCamera::SetDesiredRotationOffset(FRotator NewRotationOffset) -{ - DesiredRotationOffset = NewRotationOffset; - SetDesiredRotation(DesiredRotation); -} - -void AUniversalCamera::SetDesiredZoom_Internal(float NewZoom, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return; - } - - if (!IgnoreRestrictions) NewZoom = GetClampedZoom(NewZoom); - - DesiredZoom = NewZoom; - if (!(EnabledFeatures & EEnabledFeatures::LagZoom) || IgnoreLag) - { - SpringArmComponent->TargetArmLength = DesiredZoom; - } - - - OnDesiredZoomChanged.Broadcast(DesiredZoom); -} - -void AUniversalCamera::SetDesiredZoom(float NewZoom, bool IgnoreLag, bool IgnoreRestrictions) -{ - if (IsTraveling && IsValid(CurrentTravelTask) && (CurrentTravelTask->m_LockAllMovement || CurrentTravelTask->IsValidZoom)) return; - - SetDesiredZoom_Internal(NewZoom, IgnoreLag, IgnoreRestrictions); -} - -FVector AUniversalCamera::GetOriginLocationFromCameraLocation(FVector CameraLocation) const -{ - return CameraLocation - DesiredTargetOffset - FRotationMatrix(DesiredRotation).TransformVector(DesiredSocketOffset) + DesiredRotation.Vector() * DesiredZoom; -} - -float AUniversalCamera::GetClampedZoom(float Zoom) -{ - ClampCustomValue(ConstrainZoomMinimum, ConstrainZoomMaximum, &Zoom, MinimumZoom, MaximumZoom); - return Zoom; -} - -void AUniversalCamera::EdgeScrollingTick_Internal() -{ - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - // Get Mouse Position - float MouseX, MouseY; - if (!PlayerController->GetMousePosition(MouseX, MouseY)) return; - - // Get Screen Size - int32 SizeX, SizeY; - PlayerController->GetViewportSize(SizeX, SizeY); - - float RightMultiplier = 0.f; - float ForwardMultiplier = 0.f; - - float XSensitivity = EdgeScrollingSensitivity * SizeX; - float YSensitivity = EdgeScrollingSensitivity * SizeY; - - float RightAxis = 0.f; - float ForwardAxis = 0.f; - - bool bTargetOffset = false; - bool bSocketOffset = false; - - bool bShouldEdgeScroll = false; - - switch (EdgeScrollMode) - { - case ScrollMovement: - bTargetOffset = false; - bSocketOffset = false; - break; - case ScrollSocketOffset: - bTargetOffset = true; - bSocketOffset = false; - break; - case ScrollTargetOffset: - bTargetOffset = false; - bSocketOffset = true; - break; - } - - if (MouseX < XSensitivity) - { - RightAxis = -1.f; - RightMultiplier = UseEdgeScrollingStrength ? 1.0f - MouseX / XSensitivity : 1.0f; - bShouldEdgeScroll = true; - } - else if (MouseX > SizeX - XSensitivity) - { - RightAxis = 1.f; - RightMultiplier = UseEdgeScrollingStrength ? 1.0f - (SizeX - MouseX) / XSensitivity : 1.0f; - bShouldEdgeScroll = true; - } - if (MouseY < YSensitivity) - { - ForwardAxis = 1.f; - ForwardMultiplier = UseEdgeScrollingStrength ? 1.0f - MouseY / YSensitivity : 1.0f; - bShouldEdgeScroll = true; - } - else if (MouseY > SizeY - YSensitivity) - { - ForwardAxis = -1.f; - ForwardMultiplier = UseEdgeScrollingStrength ? 1.0f - (SizeY - MouseY) / YSensitivity : 1.0f; - bShouldEdgeScroll = true; - } - - FVector2D DirectionalMultiplier(FMath::Abs(RightAxis), FMath::Abs(ForwardAxis)); - if (NormalizeEdgeScrollingDirection) DirectionalMultiplier.Normalize(); - DirectionalMultiplier.X *= RightMultiplier * EdgeScrollingSpeedMultiplier; - DirectionalMultiplier.Y *= ForwardMultiplier * EdgeScrollingSpeedMultiplier; - - if (bShouldEdgeScroll) - { - EdgeScrollingTick(RightAxis, ForwardAxis, DirectionalMultiplier.X, DirectionalMultiplier.Y, bTargetOffset, bSocketOffset); - } - - if (!IsEdgeScrolling && bShouldEdgeScroll) - { - IsEdgeScrolling = true; - OnBeginEdgeScrolling(); - } - - if (IsEdgeScrolling && !bShouldEdgeScroll) - { - IsEdgeScrolling = false; - OnEndEdgeScrolling(); - } - - ESimplifiedMovementDirection SimplifiedMovementDirection = MovementDirection_None; - - if (IsEdgeScrolling) - { - if (RightAxis > 0.f) - { - if (ForwardAxis > 0.f) - { - SimplifiedMovementDirection = Direction_RightForward; - } - else if (ForwardAxis < 0.f) - { - SimplifiedMovementDirection = Direction_RightBackward; - } - else - { - SimplifiedMovementDirection = Direction_Right; - } - } - else if (RightAxis < 0.f) - { - if (ForwardAxis > 0.f) - { - SimplifiedMovementDirection = Direction_LeftForward; - } - else if (ForwardAxis < 0.f) - { - SimplifiedMovementDirection = Direction_LeftBackward; - } - else - { - SimplifiedMovementDirection = Direction_Left; - } - } - else - { - if (ForwardAxis > 0.f) - { - SimplifiedMovementDirection = Direction_Forward; - } - else if (ForwardAxis < 0.f) - { - SimplifiedMovementDirection = Direction_Backward; - } - } - FVector2D Direction = FVector2D(ForwardAxis * ForwardMultiplier, RightAxis * RightMultiplier); - OnUpdateEdgeScrolling(SimplifiedMovementDirection, Direction); - } -} - -void AUniversalCamera::EdgeScrollingTick_Implementation(float RightAxis, float ForwardAxis, float RightMultiplier, float ForwardMultiplier, bool bTargetOffset, bool bSocketOffset) -{ - MoveRight(RightAxis, RightMultiplier, bTargetOffset, bSocketOffset); - MoveForward(ForwardAxis, ForwardMultiplier, bTargetOffset, bSocketOffset); -} - -FVector AUniversalCamera::Lag_GetTickDesiredLocation_Implementation(float DeltaTime) -{ - FVector CurrentLocation = GetActorLocation(); - FVector2D TickDesiredLocation = FMath::Vector2DInterpTo(FVector2D(CurrentLocation.X, CurrentLocation.Y), FVector2D(DesiredLocation.X, DesiredLocation.Y), DeltaTime, MovementLagSpeed); - return FVector(TickDesiredLocation.X, TickDesiredLocation.Y, CurrentLocation.Z); -} - -FVector AUniversalCamera::Lag_GetTickDesiredSocketOffset_Implementation(float DeltaTime) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return DesiredSocketOffset; - } - - FVector CurrentOffset = SpringArmComponent->SocketOffset; - FVector TickDesiredOffset = FMath::VInterpTo(CurrentOffset, DesiredSocketOffset, DeltaTime, OffsetLagSpeed); - return TickDesiredOffset; -} - -FVector AUniversalCamera::Lag_GetTickDesiredTargetOffset_Implementation(float DeltaTime) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return DesiredTargetOffset; - } - - FVector CurrentOffset = SpringArmComponent->TargetOffset; - FVector TickDesiredOffset = FMath::VInterpTo(CurrentOffset, DesiredTargetOffset, DeltaTime, OffsetLagSpeed); - return TickDesiredOffset; -} - -float AUniversalCamera::Lag_GetTickDesiredHeight_Implementation(float DeltaTime) -{ - float TickDesiredHeight = FMath::FInterpTo(GetActorLocation().Z, DesiredLocation.Z, DeltaTime, HeightLagSpeed); - return TickDesiredHeight; -} - -FRotator AUniversalCamera::Lag_GetTickDesiredRotation_Implementation(float DeltaTime) -{ - FRotator TickDesiredRotation = FRotator(FMath::QInterpTo(FQuat(GetActorRotation()), FQuat(GetDesiredRotationWithOffset()), DeltaTime, RotationLagSpeed)); - return TickDesiredRotation; -} - -float AUniversalCamera::Lag_GetTickDesiredZoom_Implementation(float DeltaTime) -{ - if (!SpringArmComponent) - { - LOG_WARNING_MESSAGE("Couldn't find the SpringArmComponent."); - return DesiredZoom; - } - - float TickDesiredZoom = FMath::FInterpTo(SpringArmComponent->TargetArmLength, DesiredZoom, DeltaTime, ZoomLagSpeed); - return TickDesiredZoom; -} - -float AUniversalCamera::GetScaledValue(float AxisValue, float Multiplier, float Speed, float ScalingValue, float Min, float Max) const -{ - return AxisValue * Multiplier * (Max > 0 ? FMath::Clamp(Speed * ScalingValue, Min, Max) : FMath::Max(Speed * ScalingValue, Min)); -} - -void AUniversalCamera::MoveForward(float AxisValue, float Multiplier, bool MoveTargetOffset, bool MoveSocketOffset) -{ - if (IsFollowingAnyActor() && !(MoveSocketOffset || MoveTargetOffset)) return; - if (!(EnabledFeatures & EEnabledFeatures::Movement)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - FVector ForwardVector = UseAlternativeForwardVector ? GetAlternativeForwardVector(DesiredRotation) : UKismetMathLibrary::GetForwardVector(DesiredRotation); - - if (MoveSocketOffset) - { - ForwardVector = DesiredRotation.UnrotateVector(ForwardVector); - - if (ApplyOffsetScaling) SetDesiredSocketOffset(DesiredSocketOffset + ForwardVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredSocketOffset(DesiredSocketOffset + ForwardVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else if (MoveTargetOffset) - { - if (ApplyOffsetScaling) SetDesiredTargetOffset(DesiredTargetOffset + ForwardVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredTargetOffset(DesiredTargetOffset + ForwardVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else - { - if (ApplyMovementScaling) SetDesiredLocation(DesiredLocation + ForwardVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, MovementSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredLocation(DesiredLocation + ForwardVector * GetTickMultiplier() * AxisValue * Multiplier * MovementSpeed); - } -} - -void AUniversalCamera::MoveRight(float AxisValue, float Multiplier, bool MoveTargetOffset, bool MoveSocketOffset) -{ - if (IsFollowingAnyActor() && !(MoveSocketOffset || MoveTargetOffset)) return; - if (!(EnabledFeatures & EEnabledFeatures::Movement)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - FVector RightVector = UseAlternativeRightVector ? GetAlternativeRightVector(DesiredRotation) : UKismetMathLibrary::GetRightVector(DesiredRotation); - - if (MoveSocketOffset) - { - RightVector = FVector(0.f, 1.f, 0.f); - if (ApplyOffsetScaling) SetDesiredSocketOffset(DesiredSocketOffset + RightVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredSocketOffset(DesiredSocketOffset + RightVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else if (MoveTargetOffset) - { - if (ApplyOffsetScaling) SetDesiredTargetOffset(DesiredTargetOffset + RightVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredTargetOffset(DesiredTargetOffset + RightVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else - { - if (ApplyMovementScaling) SetDesiredLocation(DesiredLocation + RightVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, MovementSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredLocation(DesiredLocation + RightVector * GetTickMultiplier() * AxisValue * Multiplier * MovementSpeed); - } -} - -void AUniversalCamera::MoveUp(float AxisValue, float Multiplier, bool MoveTargetOffset, bool MoveSocketOffset) -{ - if (IsFollowingAnyActor() && !(MoveSocketOffset || MoveTargetOffset)) return; - if (!(EnabledFeatures & EEnabledFeatures::Movement)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - FVector UpVector = UseAlternativeUpVector ? GetAlternativeUpVector(DesiredRotation) : UKismetMathLibrary::GetUpVector(DesiredRotation); - - if (MoveSocketOffset) - { - UpVector = DesiredRotation.UnrotateVector(UpVector); - - if (ApplyOffsetScaling) SetDesiredSocketOffset(DesiredSocketOffset + UpVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredSocketOffset(DesiredSocketOffset + UpVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else if (MoveTargetOffset) - { - if (ApplyOffsetScaling) SetDesiredTargetOffset(DesiredTargetOffset + UpVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, OffsetSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredTargetOffset(DesiredTargetOffset + UpVector * GetTickMultiplier() * AxisValue * Multiplier * OffsetSpeed); - } - else - { - if (ApplyMoveUpScaling) SetDesiredLocation(DesiredLocation + UpVector * GetTickMultiplier() * GetScaledValue(AxisValue, Multiplier, MovementSpeed, GetMovementScaling(), MinimumMovementSpeed, MaximumMovementSpeed)); - else SetDesiredLocation(DesiredLocation + UpVector * GetTickMultiplier() * AxisValue * Multiplier * MovementSpeed); - } -} - -void AUniversalCamera::Move(float ForwardAxis, float RightAxis, float UpAxis, float Multiplier, bool NormalizeDirection, bool MoveTargetOffset, bool MoveSocketOffset) -{ - FVector AxisDirection = FVector(ForwardAxis, RightAxis, UpAxis); - if (NormalizeDirection) AxisDirection.Normalize(); - MoveForward(AxisDirection.X, Multiplier, MoveTargetOffset, MoveSocketOffset); - MoveRight(AxisDirection.Y, Multiplier, MoveTargetOffset, MoveSocketOffset); - MoveUp(AxisDirection.Z, Multiplier, MoveTargetOffset, MoveSocketOffset); -} - -void AUniversalCamera::RotateYaw(float AxisValue, float Multiplier, bool RotateOffset) -{ - if (!(EnabledFeatures & EEnabledFeatures::Rotation)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - float NewYawOffset = DesiredRotationOffset.Yaw - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - float NewYaw = DesiredRotation.Yaw - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - if (RotateOffset) - { - SetDesiredYawOffset(NewYawOffset); - } - else - { - SetDesiredYaw(NewYaw); - } -} - -void AUniversalCamera::RotatePitch(float AxisValue, float Multiplier, bool RotateOffset) -{ - if (!(EnabledFeatures & EEnabledFeatures::Rotation)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - float NewPitchOffset = DesiredRotationOffset.Pitch - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - float NewPitch = DesiredRotation.Pitch - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - - if (RotateOffset) - { - SetDesiredPitchOffset(NewPitchOffset); - } - else - { - SetDesiredPitch(NewPitch); - } - -} - -void AUniversalCamera::RotateRoll(float AxisValue, float Multiplier, bool RotateOffset) -{ - if (!(EnabledFeatures & EEnabledFeatures::Rotation)) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - float NewRollOffset = DesiredRotationOffset.Roll - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - float NewRoll = DesiredRotation.Roll - GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier; - - if (RotateOffset) - { - SetDesiredRollOffset(NewRollOffset); - } - else - { - SetDesiredRoll(NewRoll); - } - -} - -void AUniversalCamera::Rotate(float YawAxis, float PitchAxis, float RollAxis, float Multiplier, bool RotateOffset) -{ - RotateYaw(YawAxis, Multiplier, RotateOffset); - RotatePitch(PitchAxis, Multiplier, RotateOffset); - RotateRoll(RollAxis, Multiplier, RotateOffset); -} - -void AUniversalCamera::ZoomIn(float AxisValue, float Multiplier) -{ - if (!(EnabledFeatures & EEnabledFeatures::Zoom)) return; - - - SetDesiredZoom(DesiredZoom - GetZoomInValue(AxisValue, Multiplier)); -} - -float AUniversalCamera::GetZoomInValue(float AxisValue, float Multiplier) -{ - return UseZoomScaling ? GetScaledValue(AxisValue, Multiplier, ZoomSpeed, GetZoomInScaling(), MinimumZoomSpeed, MaximumZoomSpeed) : - AxisValue * Multiplier * ZoomSpeed; -} - -float AUniversalCamera::GetZoomInValueFromDistance(float AxisValue, float Multiplier, float Distance) -{ - return UseZoomScaling ? GetScaledValue(AxisValue, Multiplier, ZoomSpeed, Distance / ZoomReference, MinimumZoomSpeed, MaximumZoomSpeed) * GetTickMultiplier() : - AxisValue * Multiplier * ZoomSpeed * GetTickMultiplier(); -} - -float AUniversalCamera::GetMovementScaling_Implementation() -{ - if (ScalingTraceToGround) - { - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return 0.f; - - FCollisionObjectQueryParams Params; - for (ECollisionChannel Channel : TerrainHeightAdaptationChannels) { Params.AddObjectTypesToQuery(Channel); } - - FHitResult HitResult; - FVector Start = DesiredLocation; - FVector End = DesiredLocation - FVector(0.0f, 0.0f, PlayerController->HitResultTraceDistance); - bool DidHit = GetWorld()->LineTraceSingleByObjectType(HitResult, Start, End, Params); - if (DidHit) - { - GroundLevel = HitResult.ImpactPoint.Z; - } - } - return UseZoomLevel ? DesiredZoom / ScalingDistanceReference : (DesiredLocation.Z - GroundLevel) / ScalingDistanceReference; -} - -float AUniversalCamera::GetZoomInScaling_Implementation() -{ - return DesiredZoom / ZoomReference; -} - -FVector AUniversalCamera::GetCorrectedDestinationFromOriginCollisions(FVector Location, FVector Destination, bool& DidHit) -{ - FHitResult HitResult; - FCollisionQueryParams QueryParams(SCENE_QUERY_STAT(Origin), false, GetOwner()); - GetWorld()->SweepSingleByChannel(HitResult, Location, Destination, FQuat::Identity, OriginCollisionsChannel, FCollisionShape::MakeSphere(OriginCollisionsProbeSize), QueryParams); - if (HitResult.bBlockingHit) - { - FVector BA = Destination - HitResult.Location; - FVector AH = HitResult.ImpactNormal; - - float BALength = BA.Length(); - BA.Normalize(); - - Destination += HitResult.ImpactNormal * (FMath::Abs(FVector::DotProduct(BA, AH) * BALength) + 1.f); - } - else return Destination; - - GetWorld()->SweepSingleByChannel(HitResult, Location, Destination, FQuat::Identity, OriginCollisionsChannel, FCollisionShape::MakeSphere(OriginCollisionsProbeSize), QueryParams); - if (HitResult.bBlockingHit) - { - return HitResult.Location + HitResult.ImpactNormal; - } - else return Destination; - -} - -float AUniversalCamera::GetTerrainHeightAdaptationValue_Implementation(bool& IsValidLoc) -{ - IsValidLoc = false; - float HeightValue = DesiredLocation.Z; - - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return HeightValue; - - if (TerrainHeightAdaptationChannels.Num() == 0) return HeightValue; - - FHitResult HitResult; - float ControllerTraceDistance = PlayerController->HitResultTraceDistance; - FVector Start = CanGoBelowSurfaces ? DesiredLocation + FVector(0.0f, 0.0f, GetDesiredCameraWorldLocation().Z) : DesiredLocation + FVector(0.0f, 0.0f, ControllerTraceDistance); - FVector End = DesiredLocation - FVector(0, 0, ControllerTraceDistance); - - FCollisionObjectQueryParams Params; - for (ECollisionChannel Channel : TerrainHeightAdaptationChannels) { Params.AddObjectTypesToQuery(Channel); } - - // Check under and above Origin - bool DidHit = GetWorld()->SweepSingleByObjectType(HitResult, Start, End, FQuat::Identity, Params, FCollisionShape::MakeSphere(ZProbeRadius)); - if (DidHit) - { - if (DistanceAdaptation && HitResult.ImpactPoint.Z <= GetDesiredCameraWorldLocation().Z) - { - if (DistanceBypassValue < DesiredZoom) return HeightValue; - } - - if (DesiredLocation.Z - HitResult.ImpactPoint.Z != KINDA_SMALL_NUMBER) - { - IsValidLoc = true; - HeightValue = HitResult.ImpactPoint.Z + OriginDistanceFromGround; - } - - // Check if camera has vision on origin if asked - if (AlwaysSeeOrigin) - { - DidHit = GetWorld()->SweepSingleByObjectType(HitResult, GetDesiredCameraWorldLocation(), DesiredLocation, FQuat::Identity, Params, FCollisionShape::MakeSphere(ZProbeRadius)); - if (DidHit) - { - IsValidLoc = true; - HeightValue = HitResult.ImpactPoint.Z + OriginDistanceFromGround; - } - } - } - return HeightValue; -} - -void AUniversalCamera::ApplyTerrainHeightAdaptationTick() -{ - bool IsValidLoc = false; - float NewZLoc = GetTerrainHeightAdaptationValue(IsValidLoc); - - if (IsValidLoc) - { - FVector NewLocation = DesiredLocation; - NewLocation.Z = NewZLoc; - SetDesiredLocation(NewLocation); - - // Update the MouseDragOrigin - PreciseMouseDragOrigin.Z = DesiredLocation.Z; - } -} - -FVector2D AUniversalCamera::GetMousePositionRatio(APlayerController* PlayerController, FVector2D& RawPosition) -{ - if (!IsValid(PlayerController)) return FVector2D(0.f, 0.f); - - float OriginX, OriginY; - PlayerController->GetMousePosition(OriginX, OriginY); - FVector2D Origin(OriginX, OriginY); - RawPosition = Origin; - - int32 SizeX, SizeY; - PlayerController->GetViewportSize(SizeX, SizeY); - FVector2D Size(SizeX, SizeY); - - return Origin / Size; -} - -FVector AUniversalCamera::GetImpactPointUnderCursor(APlayerController* PlayerController, ECollisionChannel TraceChannel, bool TraceComplex, bool& DidHit) -{ - DidHit = false; - if (!IsValid(PlayerController)) return FVector(0.f, 0.f, 0.f); - - FHitResult HitResult; - PlayerController->GetHitResultUnderCursor(TraceChannel, TraceComplex, HitResult); - DidHit = HitResult.IsValidBlockingHit(); - if (DidHit) return HitResult.ImpactPoint; - else return FVector(0.f, 0.f, 0.f); -} - -void AUniversalCamera::ToggleScreenSliding(bool Activate) -{ - if (Activate && EnabledFeatures & ScreenSliding) - { - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - FVector2D RawPosition(0.f, 0.f); - ScreenSlidingOriginRatio = GetMousePositionRatio(PlayerController, RawPosition); - IsScreenSliding = true; - - OnBeginScreenSliding(RawPosition); - } - else - { - IsScreenSliding = false; - - OnEndScreenSliding(); - } -} - -void AUniversalCamera::ScreenSlidingTick() -{ - if (ScreenSlidingType == ScreenSliding_None) return; - - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - FVector2D RawPosition; - FVector2D CurrentMousePositionRatio = GetMousePositionRatio(PlayerController, RawPosition); - FVector2D Delta = CurrentMousePositionRatio - ScreenSlidingOriginRatio; - - float StrengthX = FMath::Min(FMath::Abs(Delta.X), ScreenSlidingMaxRatio) * ScreenSlidingMaxSpeed / ScreenSlidingMaxRatio; - float StrengthY = FMath::Min(FMath::Abs(Delta.Y), ScreenSlidingMaxRatio) * ScreenSlidingMaxSpeed / ScreenSlidingMaxRatio; - - FVector2D Direction = CurrentMousePositionRatio - ScreenSlidingOriginRatio; - Direction.Normalize(); - OnUpdateScreenSliding(Direction); - - float AxisX = Delta.X > 0 ? 1.0f : -1.0f; - if (ScreenSlidingInvertXAxis) AxisX *= -1.0f; - float AxisY = Delta.Y > 0 ? -1.0f : 1.0f; - if (ScreenSlidingInvertYAxis) AxisY *= -1.0f; - - switch (ScreenSlidingType) - { - case SlideCamera: - MoveRight(AxisX, StrengthX); - MoveForward(AxisY, StrengthY); - return; - case SlideSocketOffset: - MoveRight(AxisX, StrengthX, true, false); - MoveForward(AxisY, StrengthY, true, false); - return; - case SlideTargetOffset: - MoveRight(AxisX, StrengthX, false, true); - MoveForward(AxisY, StrengthY, false, true); - return; - case SlideYaw: - RotateYaw(AxisX, StrengthX); - return; - case SlidePitch: - RotatePitch(AxisY, StrengthY); - return; - case SlideYawAndPitch: - RotateYaw(AxisX, StrengthX); - RotatePitch(AxisY, StrengthY); - return; - }; -} - -void AUniversalCamera::FollowTarget(FTargetSettings_WithTemplates TargetSettings, FConstrainVector2 FollowAxis, FBoolRotation FollowRotations, bool IgnoreRestrictions, bool ResetOffsetIfPrematurelyEnded) -{ - if (!(EnabledFeatures & EEnabledFeatures::FollowTarget)) return; - if (!FollowAxis.IsValid()) return; - - switch (TargetSettings.Type) - { - case 0: - if (!TargetSettings.TargetSettings.IsValidActor()) return; - break; - case 1: - if (!TargetSettings.TargetSettings.IsValidSceneComponent()) return; - break; - case 2: - if (!TargetSettings.TargetSettings.IsValidSocket()) return; - break; - } - - if (IsTraveling && IsValid(CurrentTravelTask)) EndTravelTask(false); - - FollowTargetSettings = TargetSettings; - FollowedAxis = FollowAxis; - FollowedRotations = FollowRotations; - bShouldResetOffsetIfFailed = ResetOffsetIfPrematurelyEnded; - bIsFollowingAnyActor = true; - bFollowTargetIgnoreRestrictions = IgnoreRestrictions; -} - -void AUniversalCamera::FollowTargetTick() -{ - bool IsValidTarget; - FRotator TargetRotation; - FVector TargetLocation = FollowTargetSettings.GetTargetLocation(IsValidTarget, TargetRotation); - - if (!IsValidTarget) - { - StopFollowing_Internal(bShouldResetOffsetIfFailed, StopFollowingReason_InvalidTarget); - return; - } - - FVector NewDesiredLocation = DesiredLocation; - - if (FollowedAxis.X) NewDesiredLocation.X = TargetLocation.X; - if (FollowedAxis.Y) NewDesiredLocation.Y = TargetLocation.Y; - if (FollowedAxis.Z) NewDesiredLocation.Z = TargetLocation.Z; - - SetDesiredLocation(NewDesiredLocation, false, bFollowTargetIgnoreRestrictions); - - FRotator NewDesiredRotation = DesiredRotation; - - if (FollowedRotations.Yaw) NewDesiredRotation.Yaw = TargetRotation.Yaw; - if (FollowedRotations.Pitch) NewDesiredRotation.Pitch = TargetRotation.Pitch; - if (FollowedRotations.Roll) NewDesiredRotation.Roll = TargetRotation.Roll; - - SetDesiredRotation(NewDesiredRotation, false, bFollowTargetIgnoreRestrictions); -} - -void AUniversalCamera::StopFollowing_Internal(bool bResetOffset, EStopFollowingReason Reason) -{ - bIsFollowingAnyActor = false; - FollowTargetSettings.Empty(); - - OnStoppedFollowing(Reason); - - if (bResetOffset) - { - ResetSocketOffset(); - ResetTargetOffset(); - ResetRotationOffset(); - } -} - -FVector AUniversalCamera::GetCorrectedDestinationFromDotsShape(const FVector& Destination, const TArray& PolygonPoints) -{ - // Convert the 3D destination point to a 2D point - FVector2D Destination2D(Destination.X, Destination.Y); - - // Check if the destination point is inside the polygon - if (IsPointInPolygon(Destination2D, PolygonPoints)) - { - // If the destination point is inside the polygon, return it as is - return Destination; - } - else - { - // If the destination point is outside the polygon, find the closest point on the polygon - FVector2D ClosestPoint = GetClosestPointOnPolygon(Destination2D, PolygonPoints); - - // Set the Z coordinate of the corrected destination to the original Z coordinate of the destination - FVector CorrectedDestination(ClosestPoint.X, ClosestPoint.Y, Destination.Z); - - return CorrectedDestination; - } -} - -bool AUniversalCamera::IsPointInPolygon(const FVector2D& Point, const TArray& PolygonPoints) -{ - int32 NumVertices = PolygonPoints.Num(); - bool Inside = false; - for (int32 i = 0, j = NumVertices - 1; i < NumVertices; j = i++) - { - if (((PolygonPoints[i].Y > Point.Y) != (PolygonPoints[j].Y > Point.Y)) && - (Point.X < (PolygonPoints[j].X - PolygonPoints[i].X) * (Point.Y - PolygonPoints[i].Y) / (PolygonPoints[j].Y - PolygonPoints[i].Y) + PolygonPoints[i].X)) - { - Inside = !Inside; - } - } - return Inside; -} - -FVector2D AUniversalCamera::GetClosestPointOnPolygon(const FVector2D& Point, const TArray& PolygonPoints) -{ - FVector2D ClosestPoint; - float ClosestDistanceSq = TNumericLimits::Max(); - - for (int32 i = 0; i < PolygonPoints.Num(); i++) - { - FVector2D EdgeStart = PolygonPoints[i]; - FVector2D EdgeEnd = PolygonPoints[(i + 1) % PolygonPoints.Num()]; - FVector2D EdgeDirection = (EdgeEnd - EdgeStart).GetSafeNormal(); - float DistanceAlongEdge = FVector2D::DotProduct(Point - EdgeStart, EdgeDirection); - FVector2D ClosestPointOnEdge = EdgeStart + EdgeDirection * FMath::Clamp(DistanceAlongEdge, 0.f, (EdgeEnd - EdgeStart).Size()); - float DistanceSq = (Point - ClosestPointOnEdge).SizeSquared(); - if (DistanceSq < ClosestDistanceSq) - { - ClosestPoint = ClosestPointOnEdge; - ClosestDistanceSq = DistanceSq; - } - } - - return ClosestPoint; -} - -FVector AUniversalCamera::GetCorrectedDestinationFromRestrictions(FVector Destination) -{ - Destination = GetClampedLocation(Destination); - - if (ConstrainLocationToShape) - { - Destination = GetCorrectedDestinationFromDotsShape(Destination, ConstrainDots); - } - - return Destination; -} - -TArray AUniversalCamera::GetActorsLocation2D(TArray Actors) -{ - TArray ReturnActors; - for (AActor*& Actor : Actors) - { - FVector Location = Actor->GetActorLocation(); - ReturnActors.Add(FVector2D(Location.X, Location.Y)); - } - return ReturnActors; -} - -TArray AUniversalCamera::GetSettingsSaveFormat() -{ - TArray ObjectData; - FMemoryWriter MemoryWriter(ObjectData, true); - FObjectAndNameAsStringProxyArchive Ar(MemoryWriter, false); - Ar.ArNoDelta = true; - this->Serialize(Ar); - return ObjectData; -} - -void AUniversalCamera::LoadSettingsSaveFormat(TArray SettingsSaveFormat) -{ - FMemoryReader MemoryReader(SettingsSaveFormat, true); - FObjectAndNameAsStringProxyArchive Ar(MemoryReader, false); - Ar.ArIsSaveGame = true; - Ar.ArNoDelta = true; - this->Serialize(Ar); -} - -FUniversalCameraPositionSaveFormat AUniversalCamera::GetPositionSaveFormat() -{ - FUniversalCameraPositionSaveFormat SaveFormat; - SaveFormat.DesiredLocation = DesiredLocation; - SaveFormat.DesiredSocketOffset = DesiredSocketOffset; - SaveFormat.DesiredTargetOffset = DesiredTargetOffset; - SaveFormat.DesiredRotation = DesiredRotation; - SaveFormat.DesiredRotationOffset = DesiredRotationOffset; - SaveFormat.DesiredZoom = DesiredZoom; - - return SaveFormat; -} - -void AUniversalCamera::LoadPositionSaveFormat(FUniversalCameraPositionSaveFormat PositionSaveFormat) -{ - SetDesiredPosition(PositionSaveFormat.DesiredLocation, PositionSaveFormat.DesiredSocketOffset, PositionSaveFormat.DesiredTargetOffset, PositionSaveFormat.DesiredRotation.Yaw, PositionSaveFormat.DesiredRotation.Pitch, PositionSaveFormat.DesiredRotation.Roll, PositionSaveFormat.DesiredZoom, true, true); - SetDesiredRotationOffset(PositionSaveFormat.DesiredRotationOffset); -} - -void AUniversalCamera::InitUCSaveGameInstance() -{ - if (!IsValid(UCSaveGameInstance)) - { - UCSaveGameInstance = Cast(UGameplayStatics::CreateSaveGameObject(UUniversalCameraSaveGame::StaticClass())); - } -} - -void AUniversalCamera::QuickSavePosition(FUniversalCameraPositionSaveFormat PositionSaveFormat, const FString SlotName, const int32 UserIndex) -{ - InitUCSaveGameInstance(); - - UCSaveGameInstance->SavedPosition = PositionSaveFormat; - UCSaveGameInstance->bIsValidSavePosition = true; - UGameplayStatics::SaveGameToSlot(UCSaveGameInstance, SlotName, UserIndex); -} - -void AUniversalCamera::QuickLoadPosition(const FString SlotName, const int32 UserIndex) -{ - UUniversalCameraSaveGame* UCSave = Cast(UGameplayStatics::LoadGameFromSlot(SlotName, UserIndex)); - - if (IsValid(UCSave) && UCSave->bIsValidSavePosition) - { - LoadPositionSaveFormat(UCSave->SavedPosition); - } -} - -void AUniversalCamera::QuickSaveSettings(TArray SettingsSaveFormat, const FString SlotName, const int32 UserIndex) -{ - InitUCSaveGameInstance(); - - UCSaveGameInstance->SavedSettings = SettingsSaveFormat; - UCSaveGameInstance->bIsValidSaveSettings = true; - UGameplayStatics::SaveGameToSlot(UCSaveGameInstance, SlotName, UserIndex); -} - -void AUniversalCamera::QuickLoadSettings(const FString SlotName, const int32 UserIndex) -{ - UUniversalCameraSaveGame* UCSave = Cast(UGameplayStatics::LoadGameFromSlot(SlotName, UserIndex)); - - if (IsValid(UCSave) && UCSave->bIsValidSaveSettings) - { - LoadSettingsSaveFormat(UCSave->SavedSettings); - } -} - -bool AUniversalCamera::GetActorFocusLocation_Implementation(AActor* Actor, FVector& Location, float& IdealZoom) -{ - if (!Actor) return false; - - FVector Origin, BoxExtent; - Actor->GetActorBounds(false, Origin, BoxExtent); - Location = Origin; - - float Radius = BoxExtent.Size(); - IdealZoom = Radius * 2.0f; - - return true; -} - -FVector AUniversalCamera::FindVectorAtZ(bool& Intersect, FVector Direction, float Z) -{ - Intersect = false; - if (Direction.Z == 0.f) return FVector(0.f, 0.f, 0.f); - - Intersect = true; - - Direction.Normalize(); - float Multiplier = Z / Direction.Z; - return Direction * Multiplier; -} - -void AUniversalCamera::ZoomAtLocation(float AxisValue, FVector Location, float Multiplier, bool LockZoomLevel) -{ - if (AxisValue == 0.f) return; - - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - - FVector Direction = Location - GetDesiredCameraWorldLocation(); - Direction.Normalize(); - float ScalingDistance = (Location - DesiredLocation).Length(); - - if (LockZoomLevel) - { - SetDesiredLocation(DesiredLocation + GetZoomInValueFromDistance(AxisValue, Multiplier, ScalingDistance) * Direction); - return; - } - else - { - ZoomIn(AxisValue, Multiplier); - } - - - if (Direction.Z > -0.1f) return; - - float ZDirection = GetDesiredCameraWorldLocation().Z - Location.Z; - - bool Intersect; - - FVector NewCameraLoc = Location + FindVectorAtZ(Intersect, Direction, ZDirection); - - if (Intersect) - { - FVector NewOriginDesiredLoc = GetOriginLocationFromCameraLocation(NewCameraLoc); - SetDesiredLocation(NewOriginDesiredLoc); - } -} - -void AUniversalCamera::ZoomAtCursor(float AxisValue, ECollisionChannel CollisionChannel, bool& DidHit, float Multiplier, bool LockZoomLevel) -{ - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - FVector ImpactPoint = GetImpactPointUnderCursor(PlayerController, CollisionChannel, false, DidHit); - - if (DidHit) - { - ZoomAtLocation(AxisValue, ImpactPoint, Multiplier, LockZoomLevel); - } - else - { - ZoomIn(AxisValue, Multiplier); - } -} - -void AUniversalCamera::TogglePreciseMouseDrag(bool Activate) -{ - if (Activate && (EnabledFeatures & EEnabledFeatures::PreciseMouseDrag)) - { - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - bool DidHit = false; - - if (PreciseMouseDragMode == EPreciseMouseDragMode::TraceToGround) - { - PreciseMouseDragOrigin = GetImpactPointUnderCursor(PlayerController, PreciseMouseDragCollisionChannel, PreciseMouseDragTraceComplex, DidHit); - } - else if (PreciseMouseDragMode == EPreciseMouseDragMode::Plane) - { - FVector WorldPosition, Direction; - FVector2D MousePosition; - PlayerController->GetMousePosition(MousePosition.X, MousePosition.Y); - UGameplayStatics::DeprojectScreenToWorld(PlayerController, MousePosition, WorldPosition, Direction); - - // Create the plane from the point and normal - FPlane DragPlane = FPlane(PreciseMouseDragPoint, PreciseMouseDragNormal); - - // Calculate the intersection of the ray with the plane - PreciseMouseDragOrigin = FMath::LinePlaneIntersection(WorldPosition, WorldPosition + Direction * 10000, DragPlane); - - DidHit = true; // Assuming the plane is always intersected - } - - IsPreciseMouseDragging = DidHit; - if (IsPreciseMouseDragging) - { - OnBeginMouseDrag(); - } - } - else - { - IsPreciseMouseDragging = false; - OnEndMouseDrag(); - } -} - -void AUniversalCamera::PreciseMouseDragTick() -{ - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - FVector2D MousePosition; - PlayerController->GetMousePosition(MousePosition.X, MousePosition.Y); - - FVector WorldPosition, Direction; - UGameplayStatics::DeprojectScreenToWorld(PlayerController, MousePosition, WorldPosition, Direction); - - FVector P = WorldPosition + (DesiredLocation - GetActorLocation()); - FVector M = FMath::LinePlaneIntersection(P, P + Direction * 10000, FPlane(PreciseMouseDragOrigin, FVector::UpVector)); - - if (!M.ContainsNaN()) // Check for valid intersection point - { - FVector Delta = M - PreciseMouseDragOrigin; - FVector NewLocation = DesiredLocation - Delta; - - SetDesiredLocation(NewLocation, PreciseMouseDragIgnoreMovementLag); - OnUpdateMouseDrag(Delta); - } -} - -/* -void AUniversalCamera::PreciseMouseDragTick() -{ - APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); - if (!IsValid(PlayerController)) return; - - FVector2D MousePosition; - PlayerController->GetMousePosition(MousePosition.X, MousePosition.Y); - FVector WorldPosition; - FVector Direction; - - if (PreciseMouseDragMode == EPreciseMouseDragMode::Plane) - { - // ??? - } - else if (PreciseMouseDragMode == EPreciseMouseDragMode::TraceToGround) - { - UGameplayStatics::DeprojectScreenToWorld(PlayerController, MousePosition, WorldPosition, Direction); - } - - FVector P = WorldPosition + (DesiredLocation - GetActorLocation()); - FVector D = Direction; - FVector M; - - M.Z = PreciseMouseDragOrigin.Z; - M.X = P.X + (PreciseMouseDragOrigin.Z - P.Z) * D.X / D.Z; - M.Y = P.Y + (PreciseMouseDragOrigin.Z - P.Z) * D.Y / D.Z; - - FVector Delta = M - PreciseMouseDragOrigin; - FVector NewLocation = DesiredLocation - Delta; - - SetDesiredLocation(NewLocation, PreciseMouseDragIgnoreMovementLag); - OnUpdateMouseDrag(Delta); -} -*/ - -void AUniversalCamera::RotateYawAroundPivot(FVector Pivot, float AxisValue, float Multiplier) -{ - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - FVector Direction = DesiredLocation - Pivot; - float OldYaw = DesiredRotation.Yaw; - SetDesiredYaw(DesiredRotation.Yaw + GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier); - float Delta = DesiredRotation.Yaw - OldYaw; - Direction = Direction.RotateAngleAxis(Delta, FVector(0.0f, 0.0f, 1.0f)); - SetDesiredLocation(Pivot + Direction); -} - -void AUniversalCamera::RotatePitchAroundPivot(FVector Pivot, float AxisValue, float Multiplier, bool LockZAxis) -{ - AxisValue = FMath::Clamp(AxisValue, -1.f, 1.f); - FVector Direction = DesiredLocation - Pivot; - float OldPitch = DesiredRotation.Pitch; - SetDesiredPitch(DesiredRotation.Pitch + GetTickMultiplier() * AxisValue * RotateSpeed * Multiplier); - float Delta = OldPitch - DesiredRotation.Pitch; - Direction = Direction.RotateAngleAxis(Delta, UKismetMathLibrary::GetRightVector(DesiredRotation)); - - float DesiredZ = DesiredLocation.Z; - - FVector NewOriginLocation = Pivot + Direction; - if (LockZAxis) - { - if ((DesiredRotation.Pitch < 8.f && DesiredRotation.Pitch > -8.f) || DesiredRotation.Pitch > 172.f || DesiredRotation.Pitch < -172.f) return; - - float DirectionMultiplier = (DesiredZ - NewOriginLocation.Z) / DesiredRotation.Vector().Z; - NewOriginLocation = NewOriginLocation + DesiredRotation.Vector() * DirectionMultiplier; - - SetDesiredZoom(DesiredZoom + DirectionMultiplier); - } - SetDesiredLocation(NewOriginLocation, false, true); -} - -void AUniversalCamera::PrintDesiredPosition(const float Duration) -{ -#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) - GEngine->AddOnScreenDebugMessage(0, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Location: %s"), *DesiredLocation.ToString())); - GEngine->AddOnScreenDebugMessage(1, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Yaw: %f + %f"), DesiredRotation.Yaw, DesiredRotationOffset.Yaw)); - GEngine->AddOnScreenDebugMessage(2, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Pitch: %f + %f"), DesiredRotation.Pitch, DesiredRotationOffset.Pitch)); - GEngine->AddOnScreenDebugMessage(3, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Roll: %f + %f"), DesiredRotation.Roll, DesiredRotationOffset.Roll)); - GEngine->AddOnScreenDebugMessage(4, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Zoom: %f"), DesiredZoom)); - GEngine->AddOnScreenDebugMessage(5, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Socket offset: %s"), *DesiredSocketOffset.ToString())); - GEngine->AddOnScreenDebugMessage(6, Duration, FColor::Yellow, FString::Printf(TEXT("Desired Target offset: %s"), *DesiredTargetOffset.ToString())); -#endif -} - -FVector AUniversalCamera::GetLinePlaneIntersection(FVector Direction, FVector Origin, FVector PlaneNormal, FVector PlaneCoord, bool& Intersect) -{ - float d = PlaneNormal.Dot(PlaneCoord); - if (PlaneNormal.Dot(Direction) == 0) { - Intersect = false; - return FVector(0.f, 0.f, 0.f); // No intersection, the line is parallel to the plane - } - - float x = (d - PlaneNormal.Dot(Origin)) / PlaneNormal.Dot(Direction); - // return contact point - Direction.Normalize(); - FVector Contact = Origin + Direction * x; - Intersect = true; - return Contact; -} - -FVector AUniversalCamera::GetAlternativeForwardVector(FRotator Rotation) -{ - Rotation.Pitch = 0.f; - Rotation.Roll = 0.f; - return UKismetMathLibrary::GetForwardVector(Rotation); -} - -FVector AUniversalCamera::GetAlternativeRightVector(FRotator Rotation) -{ - Rotation.Pitch = 0.f; - Rotation.Roll = 0.f; - return UKismetMathLibrary::GetRightVector(Rotation); -} - -FVector AUniversalCamera::GetAlternativeUpVector(FRotator Rotation) -{ - return FVector::UpVector; -} - -void AUniversalCamera::ClampCustomValue(bool ConstrainMinimum, bool ConstrainMaximum, float* ValueToClamp, float Minimum, float Maximum, bool ReverseRestrictions) -{ - if (!(ConstrainMinimum || ConstrainMaximum)) return; - - if (ReverseRestrictions) - { - if ((*ValueToClamp < Maximum) && (*ValueToClamp > Minimum)) - { - float ClampedValue = FMath::Abs(*ValueToClamp - Maximum) > FMath::Abs(*ValueToClamp - Minimum) ? Minimum : Maximum; - *ValueToClamp = ClampedValue; - } - } - else - { - *ValueToClamp = FMath::Clamp(*ValueToClamp, ConstrainMinimum ? Minimum : *ValueToClamp, ConstrainMaximum ? Maximum : *ValueToClamp); - } -} diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraPlugin.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraPlugin.cpp deleted file mode 100644 index bf14ed3b..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraPlugin.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#include "UniversalCameraPlugin.h" - -#define LOCTEXT_NAMESPACE "FUniversalCameraPluginModule" - -void FUniversalCameraPluginModule::StartupModule() -{ - // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module -} - -void FUniversalCameraPluginModule::ShutdownModule() -{ - // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, - // we call this function before unloading the module. -} - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FUniversalCameraPluginModule, UniversalCameraPlugin) \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraSaveGame.cpp b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraSaveGame.cpp deleted file mode 100644 index 9c50bb3d..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Private/UniversalCameraSaveGame.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - - -#include "UniversalCameraSaveGame.h" - diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/AsyncNode.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/AsyncNode.h deleted file mode 100644 index 4c476b2c..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/AsyncNode.h +++ /dev/null @@ -1,307 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "Kismet/BlueprintAsyncActionBase.h" -#include "SharedStructs.h" -#include "AsyncNode.generated.h" - - -class AUniversalCamera; -class UCurveFloat; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FTravelSpeedSettings -{ - GENERATED_BODY() - - FTravelSpeedSettings() {} - - UPROPERTY() - bool UseSpeed = false; - UPROPERTY() - float Speed = 1000.f; - UPROPERTY() - float Duration = 2.f; - - void DurationInitializer(bool IsValidBool, float Direction, float* DurationRef, float Multiplier); -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FTargetVector -{ - GENERATED_BODY() - - FTargetVector() {} - - - UPROPERTY() - TEnumAsByte TargetMod = ETargetMod::TargetMod_None; - UPROPERTY() - class USplineComponent* SplineComponent = nullptr; - UPROPERTY() - FVector VectorValue = FVector(0.f, 0.f, 0.f); - - FVector GetLocation(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, bool& IsValid); - FVector GetDirection(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, FVector StartingLocation, bool IgnoreRestrictions, bool& IsValid); -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FOffsetSettings -{ - GENERATED_BODY() - - FOffsetSettings() {} - - // 0 - None - // 1 - Target Offset - // 2 - Socket Offset - UPROPERTY() - int32 OffsetMod = 0; - UPROPERTY() - FVector OffsetValue = FVector(0.f, 0.f, 0.f); - - FVector GetDirection(AUniversalCamera* UniversalCamera, bool IgnoreRestrictions, bool& IsValidOffset); -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FTargetFloat -{ - GENERATED_BODY() - - FTargetFloat() {} - - UPROPERTY() - TEnumAsByte TargetMod = ETargetMod::TargetMod_None; - UPROPERTY() - float FloatValue = 0.f; - - // 0 for Yaw, 1 for Pitch, 2 for Roll, 3 for Zoom - float GetDirection(AUniversalCamera* UniversalCamera, int32 Type, FTargetSettings TargetSettings, float StartingValue, bool IgnoreRestrictions, bool& IsValid); - - float GetRotationValue(AUniversalCamera* UniversalCamera, int32 Type, FTargetSettings TargetSettings, bool IgnoreRestrictions, bool& IsValid); - float GetZoomValue(FTargetSettings TargetSettings, bool& IsValid); -}; - -UCLASS() -class UNIVERSALCAMERAPLUGIN_API UAsyncNode : public UBlueprintAsyncActionBase -{ - GENERATED_BODY() - -public: - - // CameraTravel to the specified Location. - // Drag any pin and type in "Use" with Context Sensitive enabled to see the different options. - // Use the "AbortTravelTask()" function to abort. - // All of the settings are optional, but at least one must be valid. - // @Param TargetSettings Set the Target References that can be used by other settings. - // @Param Curve Must go from (0;0) to (1;1). - // @Param LockAllMovement If true, Movement, Rotation and Zoom will be locked during the traveling. If false, only valid settings will be locked. - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true")) - static UAsyncNode* CameraTravel(AUniversalCamera* UniversalCamera, FTargetSettings TargetSettings, FTargetVector LocationSettings, FOffsetSettings OffsetSettings, FTargetFloat YawSettings, FTargetFloat PitchSettings, FTargetFloat RollSettings, FTargetFloat ZoomSettings, UCurveFloat* Curve, FTravelSpeedSettings SpeedSettings, bool LockAllMovement, bool IgnoreLag, bool IgnoreRestrictions); - - // Camera - AUniversalCamera* m_UniversalCamera; - bool m_IgnoreRestrictions = false; - bool m_IgnoreLag = false; - - // Time - float MaxDuration = 0.f; - float ElapsedTime = 0.f; - bool IgnoreTimeDilation = false; - // Duration - FTargetSettings TargetSettings; - // Location - FTargetVector LocationSettings; - FVector StartingLocation; - FVector LocationDirection; - bool IsValidLocation; - // Offset - FOffsetSettings OffsetSettings; - FVector StartingOffset; - FVector OffsetDirection; - bool IsValidOffset; - // Yaw - FTargetFloat YawSettings; - float StartingYaw; - float YawDirection; - bool IsValidYaw; - // Pitch - FTargetFloat PitchSettings; - float StartingPitch; - float PitchDirection; - bool IsValidPitch; - // Roll - FTargetFloat RollSettings; - float StartingRoll; - float RollDirection; - bool IsValidRoll; - // Zoom - FTargetFloat ZoomSettings; - float StartingZoom; - float ZoomDirection; - bool IsValidZoom; - // Curve - UCurveFloat* m_Curve; - // Lock Movement - bool m_LockAllMovement = false; - - DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnTaskResult); - - // Called if the task ended and the camera successfully reached the destination - UPROPERTY(BlueprintAssignable) - FOnTaskResult OnReachedDestination; - // Called if the task ended prematurely - UPROPERTY(BlueprintAssignable) - FOnTaskResult OnAborted; - - - FORCEINLINE bool IsValidTargetLocation(AUniversalCamera* UniversalCamera) { bool IsValid; LocationSettings.GetLocation(m_UniversalCamera, TargetSettings, IsValid); return IsValid; } - FORCEINLINE FVector GetLocationDirection(bool& IsValid) { return LocationSettings.GetDirection(m_UniversalCamera, TargetSettings, StartingLocation, m_IgnoreRestrictions, IsValid); } - - // GetDirection: 0 Yaw - 1 Pitch - 2 Roll - 3 Zoom - - FORCEINLINE float IsValidTargetYaw() { bool IsValid; YawSettings.GetRotationValue(m_UniversalCamera, 0, TargetSettings, m_IgnoreRestrictions, IsValid); return IsValid; } - FORCEINLINE float GetYawDirection(bool& IsValid) { return YawSettings.GetDirection(m_UniversalCamera, 0, TargetSettings, StartingYaw, m_IgnoreRestrictions, IsValid); } - - FORCEINLINE float IsValidTargetPitch() { bool IsValid; PitchSettings.GetRotationValue(m_UniversalCamera, 1, TargetSettings, m_IgnoreRestrictions, IsValid); return IsValid; } - FORCEINLINE float GetPitchDirection(bool& IsValid) { return PitchSettings.GetDirection(m_UniversalCamera, 1, TargetSettings, StartingPitch, m_IgnoreRestrictions, IsValid); } - - FORCEINLINE float IsValidTargetRoll() { bool IsValid; RollSettings.GetRotationValue(m_UniversalCamera, 2, TargetSettings, m_IgnoreRestrictions, IsValid); return IsValid; } - FORCEINLINE float GetRollDirection(bool& IsValid) { return RollSettings.GetDirection(m_UniversalCamera, 2, TargetSettings, StartingRoll, m_IgnoreRestrictions, IsValid); } - - FORCEINLINE float IsValidTargetZoom() { bool IsValid; ZoomSettings.GetZoomValue(TargetSettings, IsValid); return IsValid; } - FORCEINLINE float GetZoomDirection(bool& IsValid) { return ZoomSettings.GetDirection(m_UniversalCamera, 3, TargetSettings, StartingZoom, m_IgnoreRestrictions, IsValid); } - - void TryUpdateLocationDirectionAndValidity(); - FORCEINLINE void TryUpdateYawDirectionAndValidity() { TryUpdateFloatDirectionAndValidity(&YawSettings, &YawDirection, &UAsyncNode::GetYawDirection, &IsValidYaw); } - FORCEINLINE void TryUpdatePitchDirectionAndValidity() { TryUpdateFloatDirectionAndValidity(&PitchSettings, &PitchDirection, &UAsyncNode::GetPitchDirection, &IsValidPitch); } - FORCEINLINE void TryUpdateRollDirectionAndValidity() { TryUpdateFloatDirectionAndValidity(&RollSettings, &RollDirection, &UAsyncNode::GetRollDirection, &IsValidRoll); } - FORCEINLINE void TryUpdateZoomDirectionAndValidity() { TryUpdateFloatDirectionAndValidity(&ZoomSettings, &ZoomDirection, &UAsyncNode::GetZoomDirection, &IsValidZoom); } - - FORCEINLINE bool AreValidSettings() const { return (IsValidLocation || IsValidOffset || IsValidYaw || IsValidPitch || IsValidRoll || IsValidZoom); } - -protected: - - typedef float (UAsyncNode::*DirectionFunction)(bool&); - void TryUpdateFloatDirectionAndValidity(FTargetFloat* FloatSettings, float* FloatValue, DirectionFunction GetFloatDirection, bool* IsValidBool); - - // MAKE BP SETTINGS (USER FRIENDLY) - - - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetVector UseCustomLocation(const FVector Location) - { - FTargetVector Settings; - Settings.TargetMod = TargetMod_CustomValue; - Settings.VectorValue = Location; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetVector UseSpline(class USplineComponent* SplineComponent) - { - FTargetVector Settings; - Settings.TargetMod = TargetMod_Spline; - Settings.SplineComponent = SplineComponent; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetVector UseActorLocation() - { - FTargetVector Settings; - Settings.TargetMod = TargetMod_Actor; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetVector UseSocketLocation() - { - FTargetVector Settings; - Settings.TargetMod = TargetMod_Socket; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetVector UseSceneComponentLocation() - { - FTargetVector Settings; - Settings.TargetMod = TargetMod_SceneComponent; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetFloat UseCustomValue(const float Value = 0.f) - { - FTargetFloat Settings; - Settings.TargetMod = TargetMod_CustomValue; - Settings.FloatValue = Value; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetFloat UseActorValue() - { - FTargetFloat Settings; - Settings.TargetMod = TargetMod_Actor; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetFloat UseSocketValue() - { - FTargetFloat Settings; - Settings.TargetMod = TargetMod_Socket; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTargetFloat UseSceneComponentValue() - { - FTargetFloat Settings; - Settings.TargetMod = TargetMod_SceneComponent; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTravelSpeedSettings UseSpeed(const float Speed = 1000.f) - { - FTravelSpeedSettings Settings; - Settings.UseSpeed = true; - Settings.Speed = Speed; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FTravelSpeedSettings UseDuration(const float Duration = 2.f) - { - FTravelSpeedSettings Settings; - Settings.UseSpeed = false; - Settings.Duration = Duration; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FOffsetSettings UseTargetOffset(const FVector TargetOffset) - { - FOffsetSettings OffsetSettings; - OffsetSettings.OffsetMod = 1; - OffsetSettings.OffsetValue = TargetOffset; - return OffsetSettings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "AsyncNode|Settings") - static FOffsetSettings UseSocketOffset(const FVector SocketOffset) - { - FOffsetSettings OffsetSettings; - OffsetSettings.OffsetMod = 2; - OffsetSettings.OffsetValue = SocketOffset; - return OffsetSettings; - } - -// virtual void Activate() override; -}; diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/PlaceholderCamera.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/PlaceholderCamera.h deleted file mode 100644 index fcbdf484..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/PlaceholderCamera.h +++ /dev/null @@ -1,54 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Actor.h" -#include "GameFramework/SpringArmComponent.h" -#include "Camera/CameraComponent.h" -#include "PlaceholderCamera.generated.h" - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FPlaceholderCameraInfos -{ - GENERATED_BODY() - - FPlaceholderCameraInfos() {} - - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PlaceholderCameraInfos") - FVector Location = FVector(0.f, 0.f, 0.f); - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PlaceholderCameraInfos") - float Yaw = 0.f; - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PlaceholderCameraInfos") - float Pitch = 0.f; - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PlaceholderCameraInfos") - float Zoom = 0.f; -}; - -UCLASS() -class UNIVERSALCAMERAPLUGIN_API APlaceholderCamera : public AActor -{ - GENERATED_BODY() - -public: - // Sets default values for this actor's properties - APlaceholderCamera(); - - - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Components") - TObjectPtr SpringArmComponent; - - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Components") - TObjectPtr CameraComponent; - - UFUNCTION(BlueprintPure, Category = "PlaceholderCameraInfos") - float GetZoom() { return SpringArmComponent->TargetArmLength; } - - UFUNCTION(BlueprintPure, Category = "PlaceholderCameraInfos") - FPlaceholderCameraInfos GetInfos(); - -protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - -}; diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/SharedStructs.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/SharedStructs.h deleted file mode 100644 index 0f886f5d..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/SharedStructs.h +++ /dev/null @@ -1,77 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "Components/MeshComponent.h" -#include "SharedStructs.generated.h" - -UENUM(BlueprintType) -enum ETargetMod -{ - TargetMod_None UMETA(DisplayName = "None"), - TargetMod_CustomValue UMETA(DisplayName = "CustomValue"), - TargetMod_Spline UMETA(DisplayName = "Spline"), - TargetMod_Actor UMETA(DisplayName = "Actor"), - TargetMod_Socket UMETA(DisplayName = "Socket"), - TargetMod_SceneComponent UMETA(DisplayName = "SceneComponent") -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FUniversalCameraPositionSaveFormat -{ - GENERATED_BODY() - - FUniversalCameraPositionSaveFormat() {} - - UPROPERTY() - FVector DesiredLocation = FVector::ZeroVector; - UPROPERTY() - FVector DesiredSocketOffset = FVector::ZeroVector; - UPROPERTY() - FVector DesiredTargetOffset = FVector::ZeroVector; - UPROPERTY() - FRotator DesiredRotation = FRotator::ZeroRotator; - UPROPERTY() - FRotator DesiredRotationOffset = FRotator::ZeroRotator; - UPROPERTY() - float DesiredZoom = 0.f; -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FTargetSettings -{ - GENERATED_BODY() - - FTargetSettings() {} - - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - AActor* Actor = nullptr; - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - USceneComponent* SceneComponent = nullptr; - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - UMeshComponent* Mesh = nullptr; - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - FName Socket; - - bool IsValidActor() const; - // Check for validity before calling those - FORCEINLINE FVector GetActorLocation() const { return Actor->GetActorLocation(); } - FORCEINLINE FRotator GetActorRotation() const { return Actor->GetActorRotation(); } - - bool IsValidSocket() const; - // Check for validity before calling those - FORCEINLINE FVector GetSocketLocation() const { return Mesh->GetSocketLocation(Socket); } - FORCEINLINE FRotator GetSocketRotation() const { return Mesh->GetSocketRotation(Socket); } - - bool IsValidSceneComponent() const; - // Check for validity before calling those - FORCEINLINE FVector GetSceneComponentLocation() const { return SceneComponent->GetComponentLocation(); } - FORCEINLINE FRotator GetSceneComponentRotation() const { return SceneComponent->GetComponentRotation(); } - - - // Check for validity before calling those - float GetTargetActorZoom(bool& IsValidTarget); - - AActor* GetOwnerActor() const; -}; \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCamera.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCamera.h deleted file mode 100644 index 3740f6cd..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCamera.h +++ /dev/null @@ -1,1086 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Pawn.h" -#include "GameFramework/SpringArmComponent.h" -#include "Blueprint/UserWidget.h" -#include "Serialization/ObjectAndNameAsStringProxyArchive.h" -#include "CollisionQueryParams.h" -#include "InputCoreTypes.h" -#include "SharedStructs.h" -#include "Kismet/KismetMathLibrary.h" -#include "UniversalCamera.generated.h" - -UENUM(BlueprintType) -enum EEdgeScrollMode -{ - ScrollMovement UMETA(DisplayName = "Movement"), - ScrollTargetOffset UMETA(DisplayName = "Target"), - ScrollSocketOffset UMETA(DisplayName = "Socket") - -}; - -UENUM(BlueprintType) -enum ESimplifiedMovementDirection -{ - MovementDirection_None UMETA(DisplayName = "None"), - Direction_RightBackward UMETA(DisplayName = "RightBackward"), - Direction_Right UMETA(DisplayName = "Right"), - Direction_RightForward UMETA(DisplayName = "RightForward"), - Direction_Forward UMETA(DisplayName = "Forward"), - Direction_LeftForward UMETA(DisplayName = "LeftForward"), - Direction_Left UMETA(DisplayName = "Left"), - Direction_LeftBackward UMETA(DisplayName = "LeftBackward"), - Direction_Backward UMETA(DisplayName = "Backward") -}; - -UENUM(BlueprintType) -enum EScreenSlidingType -{ - ScreenSliding_None UMETA(DisplayName = "None"), - SlideCamera UMETA(DisplayName = "Camera"), - SlideTargetOffset UMETA(DisplayName = "TargetOffset"), - SlideSocketOffset UMETA(DisplayName = "SocketOffset"), - SlideYaw UMETA(DisplayName = "Yaw"), - SlidePitch UMETA(DisplayName = "Pitch"), - SlideYawAndPitch UMETA(DisplayName = "Yaw and Pitch") -}; - -UENUM(BlueprintType) -enum EConstrainType -{ - NoConstrain UMETA(DisplayName = "None"), - MaxDistance UMETA(DisplayName = "MaxDistance"), - CustomConstrain UMETA(DisplayName = "Custom"), -}; - -UENUM(BlueprintType) -enum class ELocationConstrainType : uint8 -{ - NoConstrain UMETA(DisplayName = "None"), - Sphere UMETA(DisplayName = "Sphere"), - Raw UMETA(DisplayName = "Raw") -}; - -UENUM(BlueprintType) -enum EStopFollowingReason -{ - StopFollowingReason_Manual UMETA(DisplayName = "Manual"), - StopFollowingReason_InvalidTarget UMETA(DisplayName = "Invalid Target"), - StopFollowingReason_DisabledFeature UMETA(DisplayName = "Disabled Feature") -}; - -UENUM(BlueprintType) -enum class EPreciseMouseDragMode : uint8 -{ - Plane UMETA(DisplayName = "Plane"), - TraceToGround UMETA(DisplayName = "Trace to ground") -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FConstrainVector -{ - GENERATED_BODY() - - FConstrainVector() {} - - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool X = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Y = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Z = false; -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FConstrainVector2 -{ - GENERATED_BODY() - - FConstrainVector2() {} - - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool X = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Y = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Z = true; - - bool IsValid() const { return (X || Y || Z); } -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FBoolRotation -{ - GENERATED_BODY() - - FBoolRotation() {} - - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Yaw = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Pitch = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Restrictions") - bool Roll = false; -}; - -USTRUCT(Blueprintable) -struct UNIVERSALCAMERAPLUGIN_API FTargetSettings_WithTemplates -{ - GENERATED_BODY() - - FTargetSettings TargetSettings; - int32 Type = -1; - - FVector GetTargetLocation(bool& IsValid, FRotator& Rotation); - - FORCEINLINE void Empty() - { - FTargetSettings EmptySettings; - TargetSettings = EmptySettings; - Type = -1; - } -}; - -UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true")) -enum EEnabledFeatures -{ - None = 0 UMETA(Hidden), -// Forward/Backward, Right/Left, Up/Down Movement. - Movement = 1 << 0, -// Yaw and Pitch Rotation. - Rotation = 1 << 1, -// Zoom. - Zoom = 1 << 2, -// Move the Camera when the mouse cursor comes close to the edges of the screen. - EdgeScrolling = 1 << 3, -// Move the camera by maintaining a key and moving the mouse around. -// Activate/Deactivate it with "ToggleScreenSliding" when pressing/releasing a key (usually a mouse key). - ScreenSliding = 1 << 4, -// Make the Origin of the Universal Camera collide with the environment (see the "Origin Collisions" category in the defaults) - OriginCollisions = 1 << 5 UMETA(DisplayName = "Origin Collisions"), -// Make the SpringArmComponent collide with the environment, so that you can always see the Origin - SpringArmCollisions = 1 << 6 UMETA(DisplayName = "Spring Arm Collisions"), -// Correct the Z location of the camera to adapt to terrain. -// Override "GetTerrainHeightAdaptationValue" if you prefer to implement your own method. - TerrainHeightAdaptation = 1 << 7, -// Lag applied to Forward/Backward, Right/Left, Up/Down Movement. - LagMovement = 1 << 8, -// Lag applied to Offset Movement. - LagOffset = 1 << 9, -// Lag applied to Yaw and Pitch Rotation. - LagRotation = 1 << 10, -// Lag applied to Zoom. - LagZoom = 1 << 11, -// Allows to follow an Actor with "FollowTarget" and "StopFollowing". -// If you want to be able to move around while following an Actor, move the Offset of the camera while following it. - FollowTarget = 1 << 12, -// Use this to drag the Camera around with the mouse, while the cursor remains at the initial position. -// Activate/Deactivate it with "TogglePreciseMouseDrag" when pressing/releasing a key (usually a mouse key). - PreciseMouseDrag = 1 << 13, -}; -ENUM_CLASS_FLAGS(EEnabledFeatures); - -DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnVectorChanged, const FVector&, NewDesiredVector); -DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRotationChanged, const FRotator&, NewDesiredRotation); -DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZoomChanged, float, NewDesiredZoom); - -UCLASS(Abstract, Blueprintable, BlueprintType) -class UNIVERSALCAMERAPLUGIN_API AUniversalCamera : public APawn -{ - GENERATED_BODY() - -public: - // Sets default values for this pawn's properties - AUniversalCamera(); - - // Called every frame - virtual void Tick(float DeltaTime) override; - - // Called to bind functionality to input - virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; - - // EVENTS - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnVectorChanged OnDesiredLocationChanged; - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnVectorChanged OnDesiredSocketOffsetChanged; - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnVectorChanged OnDesiredTargetOffsetChanged; - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnRotationChanged OnDesiredRotationChanged; - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnRotationChanged OnDesiredRotationOffsetChanged; - UPROPERTY(BlueprintAssignable, Category = "Universal Camera Plugin|Events") - FOnZoomChanged OnDesiredZoomChanged; - - // COMPONENTS - - UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Components") - TObjectPtr SpringArmComponent; - - UFUNCTION(BlueprintPure, Category = "Components") - UCameraComponent* GetCameraComponent(); - - // INFO - - UPROPERTY(Replicated, Interp, BlueprintReadOnly, Category = "Universal Camera Plugin|Default") - FVector DesiredLocation; - UPROPERTY(Replicated, Interp, BlueprintReadOnly, Category = "Universal Camera Plugin|Default") - FVector DesiredSocketOffset; - UPROPERTY(Replicated, Interp, BlueprintReadOnly, Category = "Universal Camera Plugin|Default") - FVector DesiredTargetOffset; - UPROPERTY(Replicated, Interp, BlueprintReadOnly, Category = "Universal Camera Plugin|Default") - FRotator DesiredRotation; - UPROPERTY(Replicated, Interp, BlueprintReadOnly, Category = "Universal Camera Plugin|Default") - FRotator DesiredRotationOffset = FRotator(0.f, 0.f, 0.f); - UPROPERTY(Replicated, Interp, BlueprintReadOnly, meta = (ClampMin = 0.0), Category = "Universal Camera Plugin|Default") - float DesiredZoom; - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FORCEINLINE FRotator GetDesiredRotationWithOffset() const {return DesiredRotation + DesiredRotationOffset; } - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FORCEINLINE FVector GetTargetOffsetWorldLocation() const { return GetActorLocation() + SpringArmComponent->TargetOffset; } - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FORCEINLINE FVector GetDesiredTargetOffsetWorldLocation() const { return DesiredLocation + DesiredTargetOffset; } - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FORCEINLINE FVector GetSocketOffsetWorldLocation() const { - return GetTargetOffsetWorldLocation() + FRotationMatrix(GetActorRotation()).TransformVector(SpringArmComponent->SocketOffset); } - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FORCEINLINE FVector GetDesiredSocketOffsetWorldLocation() const { - return GetDesiredTargetOffsetWorldLocation() + FRotationMatrix(DesiredRotation).TransformVector(DesiredSocketOffset); } - - // Returns the desired location of the CameraComponent - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Default") - FVector GetDesiredCameraWorldLocation() const { return GetDesiredSocketOffsetWorldLocation() - DesiredRotation.Vector() * DesiredZoom; } - FVector GetDesiredCameraWorldLocation(FVector DesiredSocketOffsetWorldLocation) const { return DesiredSocketOffsetWorldLocation - DesiredRotation.Vector() * DesiredZoom; } - FVector GetDesiredCameraWorldLocation(FRotator Rotation) const { return GetDesiredSocketOffsetWorldLocation() - Rotation.Vector() * DesiredZoom; } - FVector GetDesiredCameraWorldLocation(float Zoom) const { return GetDesiredSocketOffsetWorldLocation() - DesiredRotation.Vector() * Zoom; } - - FVector GetOriginLocationFromCameraLocation(FVector CameraLocation) const; - - // Velocity - FVector LastLocation; - float LastDeltaTime = 1.f; - FVector Velocity; - - FVector GetVelocity() const override { return GetActorLocation() - LastLocation; } - - // TRAVEL TASK - UFUNCTION() - void StartTraveling_Internal(UAsyncNode* AsyncNode); - UFUNCTION() - void TravelTaskTick(float DeltaTime); - void UpdateCameraTransform(float CurveValue); - UFUNCTION() - void EndTravelTask(const bool Abort = false); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|CameraTravel") - void AbortTravelTask() { EndTravelTask(true); } - - UPROPERTY() - class UAsyncNode* CurrentTravelTask; - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|CameraTravel") - bool IsTraveling = false; - - // RESTRICTIONS - - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - FVector GetClampedLocation(FVector Location); - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - FVector GetClampedOffset(FVector Offset); - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - float GetClampedYaw(float Yaw); - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - float GetClampedPitch(float Pitch); - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - float GetClampedRoll(float Roll); - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - float GetClampedZoom(float Zoom); - - // Get the Corrected Destination from Restrictions - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Basic Movement & Zoom|Restrictions|Location") - FVector GetCorrectedDestinationFromRestrictions(FVector Destination); - - -protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - -#if WITH_EDITOR - void LOG_VerifyStartingSettings(); -#endif - - // TICK UPDATES - void UpdateSpringArmLength(float DeltaTime); - - static FVector FindVectorAtZ(bool& Intersect, FVector Direction, float Z); - -public: - // FEATURES - - // Toggles the listed features On. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Features") - void EnableFeatures(UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/UniversalCameraPlugin.EEnabledFeatures")) int32 FeaturesToEnable); - // Toggles the listed features Off. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Features") - void DisableFeatures(UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/UniversalCameraPlugin.EEnabledFeatures")) int32 FeaturesToDisable); - // Returns true if all the tagged features are enabled. - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Features") - bool AreFeaturesEnabled(UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/UniversalCameraPlugin.EEnabledFeatures")) int32 FeaturesToTest); -protected: - // Features currently enabled - UPROPERTY(SaveGame, EditDefaultsOnly, BlueprintReadOnly, meta = (Bitmask, BitmaskEnum = "/Script/UniversalCameraPlugin.EEnabledFeatures"), Category = "Universal Camera Plugin|Features") - int32 EnabledFeatures = 16151; -public: - // TOOLS - // Use these to modify the camera position - - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredPosition(FVector NewLocation, FVector NewTargetOffset, FVector NewSocketOffset, float NewYaw, float NewPitch, float NewRoll, float NewZoom, bool IgnoreLag = false, bool IgnoreRestrictions = false); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredLocation(FVector NewLocation, bool IgnoreLag = false, bool IgnoreRestrictions = false); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredTargetOffset(FVector NewTargetOffset, bool IgnoreLag = false, bool IgnoreRestrictions = false); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredSocketOffset(FVector NewSocketOffset, bool IgnoreLag = false, bool IgnoreRestrictions = false); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredYaw(float NewYaw, bool IgnoreLag = false, bool IgnoreRestrictions = false); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredYawOffset(float NewYawOffset); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredPitch(float NewPitch, bool IgnoreLag = false, bool IgnoreRestrictions = false); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredPitchOffset(float NewPitchOffset); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredRoll(float NewRoll, bool IgnoreLag = false, bool IgnoreRestrictions = false); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredRollOffset(float NewRollOffset); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredRotation(FRotator NewRotation, bool IgnoreLag = false, bool IgnoreRestrictions = false); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredRotationOffset(FRotator NewRotationOffset); - // @Param IgnoreRestrictions Ignore Restrictions and Collisions - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void SetDesiredZoom(float NewZoom, bool IgnoreLag = false, bool IgnoreRestrictions = false); - -protected: - void SetDesiredLocation_Internal(FVector NewLocation, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredTargetOffset_Internal(FVector NewTargetOffset, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredSocketOffset_Internal(FVector NewSocketOffset, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredYaw_Internal(float NewYaw, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredPitch_Internal(float NewPitch, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredRoll_Internal(float NewPitch, bool IgnoreLag = false, bool IgnoreRestrictions = false); - void SetDesiredZoom_Internal(float NewZoom, bool IgnoreLag = false, bool IgnoreRestrictions = false); - -public: - // Returns the mouse position relative to the viewport size - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - static FVector2D GetMousePositionRatio(APlayerController* PlayerController, FVector2D& RawPosition); - // Returns the ImpactPoint of the HitResult of "GetHitResultUnderCursor" - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Tools") - static FVector GetImpactPointUnderCursor(APlayerController* PlayerController, ECollisionChannel TraceChannel, bool TraceComplex, bool& DidHit); - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void RotateYawAroundPivot(FVector Pivot, float AxisValue, float Multiplier = 1.0f); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void RotatePitchAroundPivot(FVector Pivot, float AxisValue, float Multiplier = 1.0f, bool LockZAxis= false); - - // Resets the TargetOffset back to (0.0.0) - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - FORCEINLINE void ResetTargetOffset() { SetDesiredTargetOffset(FVector(0.f, 0.f, 0.f)); } - // Resets the SocketOffset back to (0.0.0) - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - FORCEINLINE void ResetSocketOffset() { SetDesiredSocketOffset(FVector(0.f, 0.f, 0.f)); } - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - FORCEINLINE void ResetRotationOffset() { SetDesiredRotationOffset(FRotator(0.f, 0.f, 0.f)); } - // Returns the focus position for the Actor - UFUNCTION(BlueprintNativeEvent, BlueprintPure, Category = "Universal Camera Plugin|Tools") - bool GetActorFocusLocation(AActor* Actor, FVector& Location, float& IdealZoom); - - // Zoom towards the location. Uses ZoomScaling settings. - // @param LockZoomLevel If false, move the Zoom Level and lock the Z axis of the Origin. If true, move the Origin instead of the Zoom Level. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void ZoomAtLocation(float AxisValue, FVector Location, float Multiplier = 1.0f, bool LockZoomLevel = false); - - // Zoom towards the mouse location on the ground. Uses ZoomScaling settings. - // @param LockZoomLevel If false, move the Zoom Level and lock the Z axis of the Origin. If true, move the Origin instead of the Zoom Level. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Tools") - void ZoomAtCursor(float AxisValue, ECollisionChannel CollisionChannel, bool& DidHit, float Multiplier = 1.0f, bool LockZoomLevel = false); - - // Save & Load - - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Save") - TArray GetSettingsSaveFormat(); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void LoadSettingsSaveFormat(TArray SettingsSaveFormat); - - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Save") - FUniversalCameraPositionSaveFormat GetPositionSaveFormat(); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void LoadPositionSaveFormat(FUniversalCameraPositionSaveFormat PositionSaveFormat); - - // SaveGameObj - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void QuickSavePosition(FUniversalCameraPositionSaveFormat PositionSaveFormat, const FString SlotName, const int32 UserIndex); - // Will make sure the SaveGameObject has valid data (meaning the position has been saved before) - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void QuickLoadPosition(const FString SlotName, const int32 UserIndex); - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void QuickSaveSettings(TArray SettingsSaveFormat, const FString SlotName, const int32 UserIndex); - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Save") - void QuickLoadSettings(const FString SlotName, const int32 UserIndex); - -protected: - void InitUCSaveGameInstance(); - class UUniversalCameraSaveGame* UCSaveGameInstance; - - - - // STARTING POSITION - - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingLocation = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingLocation"), Category = "Universal Camera Plugin|Starting Position") - FVector StartingLocation = FVector(0.0f, 0.0f, 0.0f); - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingTargetOffset = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingTargetOffset"), Category = "Universal Camera Plugin|Starting Position") - FVector StartingTargetOffset = FVector(0.0f, 0.0f, 0.0f); - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingSocketOffset = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingSocketOffset"), Category = "Universal Camera Plugin|Starting Position") - FVector StartingSocketOffset = FVector(0.0f, 0.0f, 0.0f); - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingYaw = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingYaw"), Category = "Universal Camera Plugin|Starting Position") - float StartingYaw = 0.0f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingPitch = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingPitch"), Category = "Universal Camera Plugin|Starting Position") - float StartingPitch = -65.0f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, Category = "Universal Camera Plugin|Starting Position") - bool OverrideStartingZoom = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditAnywhere, meta = (EditCondition = "OverrideStartingZoom"), Category = "Universal Camera Plugin|Starting Position") - float StartingZoom = 500.0f; - -public: - - // BASIC MOVEMENT - - // @param AxisValue - Feed a negative value to go in the opposite direction. - // @param MoveTargetOffset - Set this to true to move the TargetOffset instead of the Origin. - // @param MoveSocketOffset - Set this to true to move the SocketOffset instead of the Origin. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void MoveForward(float AxisValue, float Multiplier = 1.0f, bool MoveTargetOffset = false, bool MoveSocketOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - // @param MoveTargetOffset - Set this to true to move the TargetOffset instead of the Origin. - // @param MoveSocketOffset - Set this to true to move the SocketOffset instead of the Origin. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void MoveRight(float AxisValue, float Multiplier = 1.0f, bool MoveTargetOffset = false, bool MoveSocketOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - // @param MoveTargetOffset - Set this to true to move the TargetOffset instead of the Origin. - // @param MoveSocketOffset - Set this to true to move the SocketOffset instead of the Origin. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void MoveUp(float AxisValue, float Multiplier = 1.f, bool MoveTargetOffset = false, bool MoveSocketOffset = false); - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void Move(float ForwardAxis, float RightAxis, float UpAxis, float Multiplier = 1.f, bool NormalizeDirection = true, bool MoveTargetOffset = false, bool MoveSocketOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void RotateYaw(float AxisValue, float Multiplier = 1.f, bool RotateOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void RotatePitch(float AxisValue, float Multiplier = 1.f, bool RotateOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void RotateRoll(float AxisValue, float Multiplier = 1.f, bool RotateOffset = false); - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void Rotate(float YawAxis, float PitchAxis, float RollAxis, float Multiplier = 1.f, bool RotateOffset = false); - - // @param AxisValue - Feed a negative value to go in the opposite direction. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin") - void ZoomIn(float AxisValue, float Multiplier = 1.f); - float GetZoomInValue(float AxisValue, float Multiplier = 1.f); - // Returns the ZoomIn value with a scaling dependent a distance instead of the current ZoomLevel (used for ZoomAtLocation) - float GetZoomInValueFromDistance(float AxisValue, float Multiplier = 1.f, float Distance = 0.f); - - float GetScaledValue(float AxisValue, float Multiplier, float Speed, float ScalingValue, float Min, float Max) const; - - // BASIC MOVEMENT - - // MovementSpeed is used with MoveForward(), MoveRight(), ScreenSliding(), EdgeScrolling(). - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom") - float MovementSpeed = 10.0f; - - // If true, MoveForward() will ignore the Pitch to take the forward vector. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom") - bool UseAlternativeForwardVector = true; - - // If true, MoveRight() will ignore the Roll to take the right vector. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom") - bool UseAlternativeRightVector = true; - - // If true, MoveUp() will always move along the Z axis. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom") - bool UseAlternativeUpVector = true; - - // OffsetSpeed is used with MoveForward(), MoveRight(), ScreenSliding, EdgeScrolling when Offset is checked. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom") - float OffsetSpeed = 10.0f; - - // RotateSpeed is used with RotateYaw(), RotatePitch(), and ScreenSliding when Yaw or Pitch is used. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom") - float RotateSpeed = 1.4f; - - // ZoomSpeed is used with ZoomIn(). - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom") - float ZoomSpeed = 50.0f; - - // Ignore the current TimeDilation value - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom") - bool IgnoreTimeDilation; - -protected: - - FORCEINLINE float GetTimeDilationCorrectiveValue() {return IgnoreTimeDilation ? 1.f / LastTimeDilation : 1.f;} - FORCEINLINE float GetTickMultiplier() { return 100.f * GetWorld()->GetDeltaSeconds() * GetTimeDilationCorrectiveValue(); } - float LastTimeDilation = 1.f; - -public: - -// Override this to make your own scaling method! -// You don't need to worry about MinimumMovementSpeed and MaximumMovementSpeed as it is automatically applied. - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin") - float GetMovementScaling(); - - // Adapt the Movement Speed depending on the distance from the ground. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - bool ApplyMovementScaling = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - bool ApplyOffsetScaling = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - bool ApplyMoveUpScaling = false; - // If true, the Movement Scaling will use the Camera Height instead of the Origin. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - bool UseZoomLevel = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.00001", UIMin = "0.00001"), Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - float MinimumMovementSpeed = 1.0f; - // Set it to 0 to ignore this setting. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - float MaximumMovementSpeed = 0.0f; - // Distance from the ground at which the camera will move at the default speed. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.00001", UIMin = "0.00001"), Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - float ScalingDistanceReference = 600.0f; - // If your ground level never changes in the level, set its Z location here. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - float GroundLevel = 0.0f; - // If true, will trace down the Z Axis to find the nearest ground and override GroundLevel. - // If you're working with great distances, consider increasing "TraceDistance" inside your PlayerController. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - bool ScalingTraceToGround = false; - // Channels to trace to the ground. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Movement Scaling") - TArray> ScalingTraceChannels; - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Movement & Zoom|Zoom Scaling") - bool UseZoomScaling = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.00001", UIMin = "0.00001", EditCondition = UseZoomScaling), Category = "Universal Camera Plugin|Movement & Zoom|Zoom Scaling") - float MinimumZoomSpeed = 1.0f; - // Set it to 0 to ignore this setting - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0", EditCondition = UseZoomScaling), Category = "Universal Camera Plugin|Movement & Zoom|Zoom Scaling") - float MaximumZoomSpeed = 0.0f; - // Sets the scaling of your Zoom. The greater the distances you're working with are, the greater this value must be. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.00001", UIMin = "0.00001", EditCondition = UseZoomScaling), Category = "Universal Camera Plugin|Movement & Zoom|Zoom Scaling") - float ZoomReference = 500.0f; - - // Override this to make your own scaling method! - // You don't need to worry about MinimumZoomSpeed and MaximumZoomSpeed as it is automatically applied. - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin") - float GetZoomInScaling(); - - // ORIGIN COLLISIONS - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Origin Collisions") - bool ApplyOriginCollisions = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Origin Collisions") - bool ApplyTargetOffsetCollisions = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Origin Collisions") - bool ApplySocketOffsetCollisions = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Origin Collisions") - TEnumAsByte OriginCollisionsChannel; - UPROPERTY(SaveGame, BlueprintReadWrite, meta = (ClampMin = 0.1), EditDefaultsOnly, Category = "Universal Camera Plugin|Origin Collisions") - float OriginCollisionsProbeSize = 10.f; - - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin | Origin Collisions") - FVector GetCorrectedDestinationFromOriginCollisions(FVector Location, FVector Destination, bool& DidHit); - - // SPRING ARM COLLISIONS - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Spring Arm Collisions") - TEnumAsByte SpringArmCollisionsChannel = ECC_Camera; - - UPROPERTY(SaveGame, BlueprintReadWrite, meta = (ClampMin = 0.1), EditDefaultsOnly, Category = "Universal Camera Plugin|Spring Arm Collisions") - float SpringArmCollisionsProbeSize = 10.f; - - // TERRAIN HEIGHT ADAPTATION - - // Override this function if you want to implement your own Z Correction depending on the environment for TerrainHeightAdaptation - // You can use the defaults in the section "Universal Camera Plugin | Terrain Height Adaptation" if you want - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin |Terrain Height Adaptation") - float GetTerrainHeightAdaptationValue(bool& IsValid); - -protected: - - void ApplyTerrainHeightAdaptationTick(); - -public: - - // Collision Channel to test the probe against. - // Set the camera to react to this type of terrain - // If you're working with great distances, consider increasing "TraceDistance" inside your PlayerController. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Terrain Height Adaptation") - TArray> TerrainHeightAdaptationChannels; - // Origin distance from the ground - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Terrain Height Adaptation") - float OriginDistanceFromGround = 0.0f; - // Radius of the probe to see if there's valid ground above or under - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Terrain Height Adaptation") - float ZProbeRadius = 50.0f; - // Enable to use camera height to test for upper ground (will allow you to go below surfaces instead of always looking for the highest ground) - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Terrain Height Adaptation") - bool CanGoBelowSurfaces = true; - // If true, an additional check will make sure that you can always see Origin - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Terrain Height Adaptation") - bool AlwaysSeeOrigin = false; - // Radius of the probe to check for Origin visibility - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0", EditCondition = AlwaysSeeOrigin), Category = "Universal Camera Plugin|Terrain Height Adaptation") - float VisibilityProbeRadius = 0; - // Allows the camera to ignore TerrainHeightAdaptation while at a certain height from the ground - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Terrain Height Adaptation") - bool DistanceAdaptation = false; - // The height from which the camera will ignore TerrainHeightAdaptation - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = DistanceAdaptation), Category = "Universal Camera Plugin|Terrain Height Adaptation") - float DistanceBypassValue = 1000; - - // EDGE SCROLLING - - // Override this to implement your own EdgeScrolling method - // - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void EdgeScrollingTick(float RightAxis, float ForwardAxis, float RightMultiplier, float ForwardMultiplier, bool bTargetOffset, bool bSocketOffset); - // Will return the strenght multiplier of the EdgeScrolling. If "UseEdgeScrollingStrength" is false, will return 1.f. - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin | Edge Scrolling") - void EdgeScrollingTick_Internal(); - - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnBeginEdgeScrolling(); - void OnBeginEdgeScrolling_Implementation() {} - - // Used for UI events - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnUpdateEdgeScrolling(ESimplifiedMovementDirection SimplifiedDirection, FVector2D MovementDirection); - void OnUpdateEdgeScrolling_Implementation(ESimplifiedMovementDirection SimplifiedDirection, FVector2D MovementDirection) {} - - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnEndEdgeScrolling(); - void OnEndEdgeScrolling_Implementation() {} - - -public: - // The distance from the edges of the screen at which your cursor must be to edge scroll - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0", ClampMax = "0.5", UIMax = "0.5"), Category = "Universal Camera Plugin|Edge Scrolling") - float EdgeScrollingSensitivity = 0.2f; - // Speed of the edge scrolling movement - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Edge Scrolling") - float EdgeScrollingSpeedMultiplier = 1.f; - // If enabled, the speed of the camera will adapt depending on the distance your cursor is from the border - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Edge Scrolling") - bool UseEdgeScrollingStrength = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Edge Scrolling") - bool NormalizeEdgeScrollingDirection = true; - // If enabled, move the SocketOffset instead of the Origin - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Edge Scrolling") - TEnumAsByte EdgeScrollMode = ScrollMovement; - - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|Edge Scrolling") - bool IsEdgeScrolling = false; - - // PRECISE MOUSE DRAG - - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Precise Mouse Control") - void TogglePreciseMouseDrag(bool Activate); - - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnBeginMouseDrag(); - void OnBeginMouseDrag_Implementation() {} - - // Used for UI events - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnUpdateMouseDrag(FVector Direction); - void OnUpdateMouseDrag_Implementation(FVector Direction) {} - - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin | Edge Scrolling") - void OnEndMouseDrag(); - void OnEndMouseDrag_Implementation() {} -protected: - void PreciseMouseDragTick(); - - public: - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (DisplayName = "Mode"), Category = "Universal Camera Plugin|Precise Mouse Drag") - EPreciseMouseDragMode PreciseMouseDragMode; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (DisplayName = "Point"), Category = "Universal Camera Plugin|Precise Mouse Drag|Plane") - FVector PreciseMouseDragPoint; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (DisplayName = "Normal"), Category = "Universal Camera Plugin|Precise Mouse Drag|Plane") - FVector PreciseMouseDragNormal = FVector(0.f, 0.f, 1.f); - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta= (DisplayName="CollisionChannel"), Category = "Universal Camera Plugin|Precise Mouse Drag|Trace to ground") - TEnumAsByte PreciseMouseDragCollisionChannel; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta= (DisplayName="TraceComplex"), Category = "Universal Camera Plugin|Precise Mouse Drag|Trace to ground") - bool PreciseMouseDragTraceComplex; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (DisplayName = "IgnoreMovementLag"), Category = "Universal Camera Plugin|Precise Mouse Drag|Trace to ground") - bool PreciseMouseDragIgnoreMovementLag = false; - - - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|Precise Mouse Drag") - bool IsPreciseMouseDragging = false; - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|Precise Mouse Drag") - FVector PreciseMouseDragOrigin; - - - - - - // SCREEN SLIDING - - // When you activate screen sliding, the position of your cursor will be stored. - // The camera will then move depending of the position of your cursor compared to its initial position - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Screen Sliding") - void ToggleScreenSliding(bool Activate); -protected: - void ScreenSlidingTick(); -public: - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Screen Sliding") - void OnBeginScreenSliding(FVector2D OriginPosition); - virtual void OnBeginScreenSliding_Implementation(FVector2D OriginPosition) {} - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Screen Sliding") - void OnUpdateScreenSliding(FVector2D Direction); - virtual void OnUpdateScreenSliding_Implementation(FVector2D Direction) {} - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Screen Sliding") - void OnEndScreenSliding(); - virtual void OnEndScreenSliding_Implementation() {} - - // The Maximum Speed of the Screen Sliding, reached whenever your cursor distance from its initial position is more than the ScreenSlidingMaxRatio. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Screen Sliding") - float ScreenSlidingMaxSpeed = 1.0f; - // Max effective distance from initial cursor position - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (ClampMin = "0.0", UIMin = "0.0"), Category = "Universal Camera Plugin|Screen Sliding") - float ScreenSlidingMaxRatio = 0.2f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Screen Sliding") - bool ScreenSlidingInvertXAxis = false; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Screen Sliding") - bool ScreenSlidingInvertYAxis = false; - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Screen Sliding") - TEnumAsByte ScreenSlidingType = SlideCamera; - - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|Screen Sliding") - bool IsScreenSliding = false; - - protected: - FVector2D ScreenSlidingOriginRatio; - - public: - // FOLLOW TARGET - - // Follow the target Actor (Mesh and Socket are optional) - // You won't be able to move the Origin while following, however you can move the Offset - // @Param ResetOffsetIfPrematurelyEnded Will reset the offset if the task prematurely ended (invalid target, disabled feature, etc.) - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Follow Actor") - void FollowTarget(FTargetSettings_WithTemplates TargetSettings, FConstrainVector2 FollowAxis, FBoolRotation FollowRotations, bool IgnoreRestrictions = true, bool ResetOffsetIfPrematurelyEnded = false); - - // Stops following the current Actor - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Follow Actor") - FORCEINLINE void StopFollowing(bool bResetOffset = false) { StopFollowing_Internal(bResetOffset, StopFollowingReason_Manual); } - - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Follow Actor") - void OnStoppedFollowing(EStopFollowingReason Reason); - virtual void OnStoppedFollowing_Implementation(EStopFollowingReason Reason) {} - -protected: - UFUNCTION() - void FollowTargetTick(); - void StopFollowing_Internal(bool bResetOffset, EStopFollowingReason Reason); - - - -public: - // Returns true if the Camera is currently following an Actor - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Follow Actor") - bool IsFollowingAnyActor() { return bIsFollowingAnyActor; } - - UPROPERTY(BlueprintReadOnly, Category = "Universal Camera Plugin|Follow Actor") - FTargetSettings_WithTemplates FollowTargetSettings; - UPROPERTY(BlueprintReadWrite, Category = "Universal Camera Plugin|Follow Actor") - FConstrainVector2 FollowedAxis; - UPROPERTY(BlueprintReadWrite, Category = "Universal Camera Plugin|Follow Actor") - FBoolRotation FollowedRotations; - -protected: - - UPROPERTY() - bool bIsFollowingAnyActor = false; - UPROPERTY() - bool bFollowTargetIgnoreRestrictions = false; - UPROPERTY() - bool bShouldResetOffsetIfFailed = false; - -public: - // LAG - - // Movement - - // On each Tick, this function will gradually make the Origin location closer to its DesiredLocation - // Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - FVector Lag_GetTickDesiredLocation(float DeltaTime); - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float MovementLagSpeed = 5.0f; - - // TargetOffset - -// On each Tick, this function will gradually make the TargetOffset closer to its DesiredTargetOffset location -// Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Universal Camera Plugin|Movement & Zoom|Lag") - FVector Lag_GetTickDesiredTargetOffset(float DeltaTime); - - // SocketOffset - -// On each Tick, this function will gradually make the SocketOffset closer to its DesiredSocketOffset location -// Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Universal Camera Plugin|Movement & Zoom|Lag") - FVector Lag_GetTickDesiredSocketOffset(float DeltaTime); - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = UseOffsetLag), Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float OffsetLagSpeed = 5.0f; - - // Height - - // On each Tick, this function will gradually make the Origin Height closer to its desired Height (Same as for "Lag_GetTickDesiredOffset" but for the Z axis) - // Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float Lag_GetTickDesiredHeight(float DeltaTime); - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float HeightLagSpeed = 5.0f; - - // Rotation - - // On each Tick, this function will gradually make the Origin Rotation closer to its DesiredRotation - // Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - FRotator Lag_GetTickDesiredRotation(float DeltaTime); - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float RotationLagSpeed = 5.0f; - - // Zoom - - // On each Tick, this function will gradually make the Zoom closer to its DesiredZoom - // Override this function if you want to implement your own method! - UFUNCTION(BlueprintNativeEvent, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float Lag_GetTickDesiredZoom(float DeltaTime); - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Lag") - float ZoomLagSpeed = 5.0f; - - // RESTRICTIONS - - // Location - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location") - ELocationConstrainType LocationConstrainType; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Sphere") - FVector SphereOrigin; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Sphere") - float SphereRadius = 1000.f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Raw") - FConstrainVector ConstrainLocationMinimum; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Raw") - FVector MinimumLocation; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Raw") - FConstrainVector ConstrainLocationMaximum; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Raw") - FVector MaximumLocation; - - - - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Dots Shape") - static TArray GetActorsLocation2D(TArray Actors); - -protected: - FVector GetCorrectedDestinationFromDotsShape(const FVector& Destination, const TArray& PolygonPoints); - bool IsPointInPolygon(const FVector2D& Point, const TArray& PolygonPoints); - FVector2D GetClosestPointOnPolygon(const FVector2D& Point, const TArray& PolygonPoints); - -public: - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Dots Shape") - void ToggleConstrainDots(bool ConstrainWithDots) { ConstrainLocationToShape = ConstrainWithDots; } - UFUNCTION(BlueprintCallable, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Dots Shape") - void SetConstrainDots(TArray Dots) { ConstrainDots = Dots; } - - UPROPERTY(SaveGame, BlueprintReadOnly, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Dots Shape") - bool ConstrainLocationToShape = false; - // The dots are used to draw a 2D shape. The last position of the array will close the shape going back to the first element. - // If "ConstrainLocationToShape" is enabled, the Origin will only be able to move within that shape. - // You need at least three dots to draw a shape. - UPROPERTY(SaveGame, BlueprintReadOnly, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Location|Dots Shape") - TArray ConstrainDots; - - // Offset - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - TEnumAsByte OffsetConstrainType; - // Represents the max distance the Offset can be from the Origin. - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - float OffsetMaxDistance = 1000.f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - FConstrainVector ConstrainOffsetMinimum; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - FVector MinimumOffset; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - FConstrainVector ConstrainOffsetMaximum; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Offset") - FVector MaximumOffset; - - // Yaw - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Yaw") - bool ConstrainYaw; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainYaw), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Yaw") - float MinimumYaw; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainYaw), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Yaw") - float MaximumYaw; - // Useful if you rotation is around -180 / 180 - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainYaw), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Yaw") - bool ReverseYawRestriction = false; - - // Pitch - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Pitch") - bool ConstrainPitch = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Pitch") - float MinimumPitch = -89.9f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Pitch") - float MaximumPitch = -10.0f; - // Useful if you rotation is around -180 / 180 - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Pitch") - bool ReversePitchRestriction = false; - - // Roll - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Roll") - bool ConstrainRoll = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Roll") - float MinimumRoll = -180.f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Roll") - float MaximumRoll = 180.f; - // Useful if you rotation is around -180 / 180 - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainPitch), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Roll") - bool ReverseRollRestriction = false; - - // Zoom - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Zoom") - bool ConstrainZoomMinimum = true; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainZoomMinimum), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Zoom") - float MinimumZoom = 0.0f; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Zoom") - bool ConstrainZoomMaximum; - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, meta = (EditCondition = ConstrainZoomMaximum), Category = "Universal Camera Plugin|Movement & Zoom|Restrictions|Zoom") - float MaximumZoom; - - // DEBUG - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Debug") - bool DrawDebugSpheres = true; - - UPROPERTY(SaveGame, BlueprintReadWrite, EditDefaultsOnly, Category = "Universal Camera Plugin|Debug") - bool DebugPrintDesiredPosition = false; - -protected: - // Green: Current Location - // Yellow: Desired Location - // Orange: Desired Target Offset - // Red: Desired Socket Offset - void PrintDesiredPosition(const float Duration = 0.f); - - - static FVector GetLinePlaneIntersection(FVector Direction, FVector Origin, FVector PlaneNormal, FVector PlaneCoord, bool& Intesect); - -public: - // CHARACTER - // Tools to help Character Implementation with the Camera - - // Returns the Forward Vector using only the Yaw axis - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Character Tools") - static FVector GetAlternativeForwardVector(FRotator Rotation); - // Returns the Right Vector using only the Yaw axis - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Character Tools") - static FVector GetAlternativeRightVector(FRotator Rotation); - // Returns the Up Vector moving only on the Z axis - UFUNCTION(BlueprintPure, Category = "Universal Camera Plugin|Character Tools") - static FVector GetAlternativeUpVector(FRotator Rotation); - - // TEMPLATES - - // FTargetSettings_WithTemplates - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "FollowTarget|Settings") - static FTargetSettings_WithTemplates UseActor(AActor* Actor) - { - FTargetSettings_WithTemplates Settings; - Settings.TargetSettings.Actor = Actor; - Settings.Type = 0; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "FollowTarget|Settings") - static FTargetSettings_WithTemplates UseSceneComponent(USceneComponent* SceneComponent) - { - FTargetSettings_WithTemplates Settings; - Settings.TargetSettings.SceneComponent = SceneComponent; - Settings.Type = 1; - return Settings; - } - - UFUNCTION(BlueprintPure, meta = (Keywords = "Make"), Category = "FollowTarget|Settings") - static FTargetSettings_WithTemplates UseSocket(UMeshComponent* MeshComponent, FName Socket) - { - FTargetSettings_WithTemplates Settings; - Settings.TargetSettings.Mesh = MeshComponent; - Settings.TargetSettings.Socket = Socket; - Settings.Type = 2; - return Settings; - } - -protected: - - void ClampCustomValue(bool ConstrainMinimum, bool ConstrainMaximum, float* ValueToClamp, float Minimum, float Maximum, bool ReverseRestrictions = false); -}; \ No newline at end of file diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraPlugin.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraPlugin.h deleted file mode 100644 index 28de9f3b..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraPlugin.h +++ /dev/null @@ -1,15 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "Modules/ModuleManager.h" - -class FUniversalCameraPluginModule : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule() override; - virtual void ShutdownModule() override; -}; diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraSaveGame.h b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraSaveGame.h deleted file mode 100644 index bdc6dbc1..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/Public/UniversalCameraSaveGame.h +++ /dev/null @@ -1,31 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/SaveGame.h" -#include "SharedStructs.h" -#include "UniversalCameraSaveGame.generated.h" - -/** - * - */ -UCLASS() -class UNIVERSALCAMERAPLUGIN_API UUniversalCameraSaveGame : public USaveGame -{ - GENERATED_BODY() - -public: - - UPROPERTY() - FUniversalCameraPositionSaveFormat SavedPosition; - UPROPERTY() - bool bIsValidSavePosition = false; - - UPROPERTY() - TArray SavedSettings; - UPROPERTY() - bool bIsValidSaveSettings = false; - - -}; diff --git a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/UniversalCameraPlugin.Build.cs b/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/UniversalCameraPlugin.Build.cs deleted file mode 100644 index fd8dc54d..00000000 --- a/Plugins/UniversalCameraPlugin/Source/RTSCameraPlugin/UniversalCameraPlugin.Build.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Universal Camera Plugin - Mathieu Jacq 2021 - -using System.IO; -using UnrealBuildTool; - -public class UniversalCameraPlugin : ModuleRules -{ - public UniversalCameraPlugin(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - PrecompileForTargets = PrecompileTargetsType.Any; - - - PublicIncludePaths.AddRange( - new string[] { - // ... add public include paths required here ... - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - // ... add other private include paths required here ... - - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - // ... add other public dependencies that you statically link with here ... - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "CoreUObject", - "Engine", - "Slate", - "SlateCore", - "UMG", - "CinematicCamera", - - // ... add private dependencies that you statically link with here ... - } - ); - - - DynamicallyLoadedModuleNames.AddRange( - new string[] - { - // ... add any modules that your module loads dynamically here ... - } - ); - } -} diff --git a/Plugins/UniversalCameraPlugin/UniversalCameraPlugin.uplugin b/Plugins/UniversalCameraPlugin/UniversalCameraPlugin.uplugin deleted file mode 100644 index 352158e7..00000000 --- a/Plugins/UniversalCameraPlugin/UniversalCameraPlugin.uplugin +++ /dev/null @@ -1,28 +0,0 @@ -{ - "FileVersion": 3, - "Version": 1, - "VersionName": "2.19", - "FriendlyName": "Universal Camera Plugin", - "Description": "A customizable Camera!", - "Category": "Camera", - "CreatedBy": "Heac", - "CreatedByURL": "https://www.youtube.com/channel/UCLObFuW7-nONzZpK8waeBXg/videos", - "DocsURL": "https://1drv.ms/b/s!AhiJ5zgIv0iHhDUTtt4YFznnpebR?e=IfK8fr", - "MarketplaceURL": "com.epicgames.launcher://ue/Fab/product/3e455250-77f9-4341-8c8b-00d7d680f1ae", - "SupportURL": "mailto:heac.unreal@gmail.com", - "EngineVersion": "5.8.0", - "CanContainContent": false, - "Installed": true, - "Modules": [ - { - "Name": "UniversalCameraPlugin", - "Type": "Runtime", - "LoadingPhase": "Default", - "PlatformAllowList": [ - "Win64", - "Android", - "LinuxArm64" - ] - } - ] -} \ No newline at end of file diff --git a/ProjectEleri.uproject b/ProjectEleri.uproject index c430b2cf..c4fc0756 100644 --- a/ProjectEleri.uproject +++ b/ProjectEleri.uproject @@ -18,8 +18,7 @@ "AIModule", "DeveloperSettings", "Slate", - "SlateCore", - "GameplayAbilities" + "SlateCore" ] }, { @@ -112,11 +111,6 @@ "Enabled": true, "MarketplaceURL": "https://unrealengineresources.com/plugins" }, - { - "Name": "UniversalCameraPlugin", - "Enabled": true, - "MarketplaceURL": "com.epicgames.launcher://ue/Fab/product/3e455250-77f9-4341-8c8b-00d7d680f1ae" - }, { "Name": "LTween", "Enabled": true, diff --git a/ProjectEleri.uproject.DotSettings.user b/ProjectEleri.uproject.DotSettings.user index 41dccbb7..2b369548 100644 --- a/ProjectEleri.uproject.DotSettings.user +++ b/ProjectEleri.uproject.DotSettings.user @@ -1,3 +1,4 @@  ForceIncluded - ForceIncluded \ No newline at end of file + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/Source/ProjectEleri/Private/EleriPlayerController.cpp b/Source/ProjectEleri/Private/EleriPlayerController.cpp index d811d466..25b40034 100644 --- a/Source/ProjectEleri/Private/EleriPlayerController.cpp +++ b/Source/ProjectEleri/Private/EleriPlayerController.cpp @@ -21,7 +21,6 @@ #include "ProjectEleri/GameObjects/BookActor.h" #include "UI/TradeWidget.h" #include "ProjectEleri/Public/UI/SelectionManager.h" -#include "RTSCameraPlugin/Public/UniversalCamera.h" #include "ProjectEleri/DialogueSystem/DialogueWidget.h" AEleriPlayerController::AEleriPlayerController(const FObjectInitializer &ObjectInitializer) @@ -342,8 +341,8 @@ void AEleriPlayerController::OnMove(const FInputActionValue &Value) // FVector ForwardFacing = UKismetMathLibrary::GetForwardVector(bFlying? PlayerCameraManager->GetCameraRotation() : CharRotForward); float AppliedMovementVelocity = 1.f; // MovementVelocity * (bFlying? 0.5f : 1.f); - FVector ForwardVec = AUniversalCamera::GetAlternativeForwardVector(PlayerCharacter->GetPlayerCamera()->DesiredRotation); - FVector RightVec = AUniversalCamera::GetAlternativeRightVector(PlayerCharacter->GetPlayerCamera()->DesiredRotation); + FVector ForwardVec = PlayerCharacter->GetPlayerCamera()->GetForwardVector(); + FVector RightVec = PlayerCharacter->GetPlayerCamera()->GetRightVector(); PlayerCharacter->AddMovementInput(ForwardVec, MovementDirection.Y * AppliedMovementVelocity); PlayerCharacter->AddMovementInput(RightVec, MovementDirection.X * AppliedMovementVelocity); @@ -409,8 +408,8 @@ void AEleriPlayerController::OnLook(const FInputActionValue &Value) if (PlayerCharacter != nullptr) { - PlayerCharacter->GetPlayerCamera()->RotateYaw(AnalogueValue.X); - PlayerCharacter->GetPlayerCamera()->RotatePitch(AnalogueValue.Y); + AddYawInput(AnalogueValue.X); + AddPitchInput(AnalogueValue.Y); } } diff --git a/Source/ProjectEleri/Private/MyCharacter.cpp b/Source/ProjectEleri/Private/MyCharacter.cpp index 6684cddb..af29e653 100644 --- a/Source/ProjectEleri/Private/MyCharacter.cpp +++ b/Source/ProjectEleri/Private/MyCharacter.cpp @@ -13,8 +13,6 @@ #include "ProjectEleri/GameObjects/BookActor.h" #include "TimeOfDayManager.h" #include "Components/PostProcessComponent.h" -#include "Components/SceneCaptureComponent2D.h" -#include "Engine/TextureRenderTarget2D.h" #include "GameFramework/PawnMovementComponent.h" #include "ProjectEleri/GameObjects/BenchmarkActor.h" #include "ProjectEleri/System/MainBlueprintFunctionLibrary.h" @@ -22,11 +20,8 @@ #include "ProjectEleri/GameObjects/BookActor.h" #include "ProjectEleri/GameObjects/BroomActor.h" #include "Components/CapsuleComponent.h" -#include "DisplayDebugHelpers.h" #include "Components/StatForgeComponent.h" -#include "Engine/Canvas.h" -#include "RTSCameraPlugin/Public/UniversalCamera.h" -#include "RTSCameraPlugin/Public/AsyncNode.h" +#include "GameFramework/SpringArmComponent.h" #if WITH_EDITOR @@ -78,10 +73,10 @@ void AMyCharacter::BeginPlay() InteractableOverlapMesh->OnComponentEndOverlap.AddDynamic(this, &AMyCharacter::OnLeftInteractableObject); } - CameraRef = GetWorld()->SpawnActor(CameraClass, GetActorTransform()); - //CameraRef->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale); - PlayerController->SetViewTarget(CameraRef); - CameraStartFollowPlayer(); + CameraRef = GetComponentByClass(); + SpringArmRef = GetComponentByClass(); + PlayerController->SetViewTarget(this); + SpringArmRef->TargetArmLength = DefaultZoom; TSet CameraComponents = GetComponents(); for (auto Comp : CameraComponents) @@ -100,7 +95,7 @@ void AMyCharacter::BeginPlay() BookTransform.SetRotation(FRotator(0,0,0).Quaternion()); BookTransform.SetScale3D(FVector::OneVector); BookActor = GetWorld()->SpawnActor(BookActorClass, BookTransform); - BookActor->AttachToActor(CameraRef.Get(), FAttachmentTransformRules::KeepRelativeTransform); + BookActor->AttachToComponent(CameraRef.Get(), FAttachmentTransformRules::KeepRelativeTransform); BookActor->SetActorRelativeLocation(FVector(300,0,0)); BookActor->SetActorRelativeRotation(FRotator(0,90,0).Quaternion()); @@ -144,10 +139,10 @@ void AMyCharacter::Tick(float DeltaTime) Super::Tick(DeltaTime); if (CurrentZoomTimer > 0.f) { - float ZoomDelta = (NextZoomOffsetTarget * DeltaTime) / ZoomTime; - CameraRef->ZoomIn(ZoomDelta, 0.01f); + const float ZoomDelta = (NextZoomOffsetTarget * DeltaTime) / ZoomTime; + SpringArmRef->TargetArmLength += ZoomDelta; CurrentZoomTimer -= DeltaTime; - //UE_LOG(LogTemp, Warning, TEXT("Zooming in: ZoomDelta:%f"), ZoomDelta); + UE_LOG(LogTemp, Warning, TEXT("Zooming in: ZoomDelta:%f"), ZoomDelta); } } @@ -173,20 +168,6 @@ FVector AMyCharacter::GetCameraWorldPosition() { return CameraLocation; } -FVector AMyCharacter::GetCameraForwardVector() { - FVector CameraLocation; - FRotator CameraRotation; - GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(CameraLocation, CameraRotation); - return CameraRotation.Quaternion().GetForwardVector(); -} - -FRotator AMyCharacter::GetCameraRotation() { - FVector CameraLocation; - FRotator CameraRotation; - GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(CameraLocation, CameraRotation); - return CameraRotation; -} - void AMyCharacter::ToggleBook(bool bOpen) { if (!IsValid(BookActor)) return; @@ -221,7 +202,6 @@ void AMyCharacter::OnHarvestSeed_Implementation(class UItem* HarvestedItem) { } - void AMyCharacter::ZoomCamera(float CameraZoomAmount, float Time) { CurrentZoomTimer = Time; @@ -230,33 +210,12 @@ void AMyCharacter::ZoomCamera(float CameraZoomAmount, float Time) } void AMyCharacter::ZoomBack(float Time) { - ZoomCamera(-(DefaultCameraZoom - CameraRef->DesiredZoom), Time); + ZoomCamera(SpringArmRef->TargetArmLength - DefaultZoom, Time); } void AMyCharacter::ReturnCameraToPlayer() { - FTargetVector UseActorLocation; - UseActorLocation.TargetMod = TargetMod_Actor; - FTargetFloat UseActorValue; - UseActorValue.TargetMod = TargetMod_Actor; - FTargetFloat UseCustomValue; - UseCustomValue.TargetMod = TargetMod_CustomValue; - UseCustomValue.FloatValue = DefaultCameraZoom; - FTravelSpeedSettings UseDuration; - UseDuration.UseSpeed = false; - UseDuration.Duration = 0.2f; - FTargetSettings UseActor; - UseActor.Actor = this; - - FTargetFloat UsePitchValue; - UsePitchValue.TargetMod = TargetMod_CustomValue; - UsePitchValue.FloatValue = -40.f; - if (UAsyncNode* Node = UAsyncNode::CameraTravel(CameraRef, UseActor, UseActorLocation, FOffsetSettings(), UseActorValue, UsePitchValue, UseActorValue, UseCustomValue, nullptr, UseDuration, false, true, true)) { - Node->OnReachedDestination.AddUniqueDynamic(this, &AMyCharacter::CameraStartFollowPlayer); - } -} - -void AMyCharacter::CameraStartFollowPlayer() { - CameraRef->FollowTarget(AUniversalCamera::UseActor(this), FConstrainVector2(), FBoolRotation()); + SpringArmRef->TargetArmLength = DefaultZoom; + PlayerController->SetViewTargetWithBlend(this, 0.5f); } void AMyCharacter::SetSaveableTagData(FGameplayTag Tag, int32 NewValue) { @@ -369,7 +328,7 @@ void AMyCharacter::BeginWatering() { const FAttachmentTransformRules AttachRules = FAttachmentTransformRules(EAttachmentRule::KeepRelative, false); WaterBallSpawned->AttachToComponent(Cast(this->GetComponentByClass(USceneComponent::StaticClass())), AttachRules); - WaterBallSpawned->SetActorLocation(GetActorLocation() + (CameraRef->GetActorForwardVector() * 100.f) + (GetActorRightVector() * 200.f)); + WaterBallSpawned->SetActorLocation(GetActorLocation() + (CameraRef->GetForwardVector() * 100.f) + (GetActorRightVector() * 200.f)); WaterBallSpawned->BeginAnimating(); } } diff --git a/Source/ProjectEleri/ProjectEleri.Build.cs b/Source/ProjectEleri/ProjectEleri.Build.cs index 884fc319..73b6d159 100644 --- a/Source/ProjectEleri/ProjectEleri.Build.cs +++ b/Source/ProjectEleri/ProjectEleri.Build.cs @@ -26,7 +26,6 @@ public class ProjectEleri : ModuleRules "Json", "JsonUtilities", "GameplayTasks", - "UniversalCameraPlugin", "StateTreeModule", "GameplayStateTreeModule", "DirectiveUtilitiesRuntime", diff --git a/Source/ProjectEleri/Public/EleriSaveGame.h b/Source/ProjectEleri/Public/EleriSaveGame.h index be2d598a..4617c6bb 100644 --- a/Source/ProjectEleri/Public/EleriSaveGame.h +++ b/Source/ProjectEleri/Public/EleriSaveGame.h @@ -11,8 +11,6 @@ #include "../System/Subsystem/ObjectPersistenceSubsystem.h" #include "Interface/SaveableObjectInterface.h" #include "ProjectEleri/GameEventSystem/GameEventSubsystem.h" -#include "AttributeSet.h" -#include "GameplayEffect.h" #include "Data/GameplayStatEffect.h" #include "Data/StatForgeDefs.h" #include "ProjectEleri/System/TimeOfDayStruct.h" diff --git a/Source/ProjectEleri/Public/MyCharacter.h b/Source/ProjectEleri/Public/MyCharacter.h index 2430754e..65d6c094 100644 --- a/Source/ProjectEleri/Public/MyCharacter.h +++ b/Source/ProjectEleri/Public/MyCharacter.h @@ -11,11 +11,11 @@ #include "GlobalEnums.h" #include "Camera/CameraComponent.h" #include "Delegates/Delegate.h" -#include "AbilitySystemInterface.h" #include "ProjectEleri/Public/Interface/SaveableObjectInterface.h" #include "MyCharacter.generated.h" +class USpringArmComponent; class UStatForgeComponent; class AEleriPlayerController; class AWaterBall; @@ -75,14 +75,16 @@ protected: UStatForgeComponent* StatForgeComponent; UPROPERTY() - TObjectPtr CameraRef; + TObjectPtr CameraRef; + UPROPERTY() + TObjectPtr SpringArmRef; + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess)) + float DefaultZoom = 2000.f; float CurrentZoomTimer = 0.f; float ZoomTime = 0.f; float NextZoomOffsetTarget = 0.f; - float DefaultZoom = 0.f; - UFUNCTION() - void CameraStartFollowPlayer(); + //----- ISaveableObjectInterface ----- // This is so actors can have custom data and we don't need to create new classes for it @@ -116,9 +118,6 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) TSubclassOf WaterBallClass; - UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) - TSubclassOf CameraClass; - UPROPERTY(BlueprintReadWrite) bool bIsWatering; UPROPERTY(BlueprintReadOnly, EditAnywhere) @@ -148,24 +147,15 @@ public: UFUNCTION(BlueprintCallable, Category = "Camera Controll") void ReturnCameraToPlayer(); - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) - float DefaultCameraZoom = 0.f; - UFUNCTION(BlueprintCallable) void SetNewCameraPitches(float NewMinPitch, float NewMaxPitch); UFUNCTION(BlueprintCallable, BlueprintPure) - FORCEINLINE AUniversalCamera* GetPlayerCamera() { return CameraRef; } + FORCEINLINE UCameraComponent* GetPlayerCamera() { return CameraRef; } UFUNCTION(BlueprintCallable, BlueprintPure) FVector GetCameraWorldPosition(); - UFUNCTION(BlueprintCallable, BlueprintPure) - FVector GetCameraForwardVector(); - - UFUNCTION(BlueprintCallable, BlueprintPure) - FRotator GetCameraRotation(); - UFUNCTION(BlueprintCallable) void ToggleBook(bool bOpen);