Compare commits

..
297 Commits
Author SHA1 Message Date
Mamadou Babaei 3c5773db0b bump the plugin version to v2.0.3 2024-05-15 04:41:20 +02:00
Mamadou Babaei d8ae5923d5 fix v2.0.2 UE 5.4 RunUAT build issues that mostly caused by missing headers 2024-05-15 04:34:46 +02:00
Mamadou Babaei befb07470e improve target platform detection when building SenseGloveConnectImpl and SenseGloveCoreImpl modules and also distinguish x64 builds from arm64 on windows 2024-05-15 04:34:38 +02:00
Mamadou Babaei b467c679de fix: asking CppCompileEnvironment for a single Architecture, but it has multiple Architectures (arm64, x64) 2024-05-15 04:34:30 +02:00
Mamadou Babaei 9afbd8e54f bump the plugin version to v2.0.2 2024-04-25 12:56:05 +02:00
Mamadou Babaei 4e0d01c3de bump the plugin version to v2.0.1 2024-04-15 15:03:17 +02:00
Mamadou Babaei 8681f78c22 do not call FSGHandLayer::ResetCalibration on every backend initialization 2024-04-15 14:52:20 +02:00
Mamadou Babaei 84e8f46d35 only instantiate the connected glove once instead of recreating and destroying it every frame 2024-04-15 14:52:14 +02:00
Mamadou Babaei 3f0dd4a5b9 bump senseglove libraries to v2.102.0-35d4de3f 2024-04-15 14:52:05 +02:00
Mamadou Babaei d0970504ce fix the wrong header file description sections for the header files 2024-04-15 14:51:58 +02:00
Mamadou Babaei 0c73eccc16 update the changelog with the unreleased changes 2024-04-15 14:51:52 +02:00
Mamadou Babaei f3b9155955 update the outdated platform support matrix remarks 2024-03-23 17:23:03 +01:00
Mamadou Babaei 45da7baa95 add ue 5.4 to the list of supported engines through azure devops 2024-03-23 16:57:47 +01:00
Mamadou Babaei 4550fda587 bump the plugin version to v2.0.0 2024-03-22 21:29:17 +01:00
Mamadou Babaei 560b9e65d3 update the changelog 2024-03-22 21:29:17 +01:00
Mamadou Babaei 8c8236c33c add missing modules to the directory structure 2024-03-22 21:29:17 +01:00
Mamadou Babaei 034d10355a update the planned features status 2024-03-22 20:57:53 +01:00
Mamadou Babaei 8127051da7 fix other build issues with non-unity builds 2024-03-22 20:57:53 +01:00
Mamadou Babaei 802a6b6d0b add the missing string header that causes build issues in non-unity builds 2024-03-22 20:57:53 +01:00
Mamadou Babaei 494f87f4cb remove the platform dependant build hacks inside FSGArrayUtils::FromStdVector as msvc is not able to deduce TArray<T>::SizeType 2024-03-22 20:57:52 +01:00
Mamadou Babaei def46777fa bump the senseglove libraries to v2.101.12-62b1be11 2024-03-22 20:57:52 +01:00
Mamadou Babaei d0c24aeda5 fix android build issue inside FSGArrayUtils::FromStdVector introduced by 0cdc7e03ac 2024-03-22 20:57:52 +01:00
Mamadou Babaei c0c5722f07 Revert "try to init/uninit the backend module at the module start/shutdown"
This reverts commit c45bcaf618.
2024-03-22 20:57:52 +01:00
Mamadou Babaei 8159c03526 fix a build issue inside FSGArrayUtils::FromStdVector introduced by newer msvc updates due to stricter implicit uint64 to int32 conversions 2024-03-22 20:57:51 +01:00
Mamadou Babaei 49eb2f2788 bump the senseglove backend libraries to v2.101.11-2d6fe9ce 2024-03-22 20:57:51 +01:00
Mamadou Babaei e0ea29ca18 correct the module logs grammars 2024-03-22 20:57:49 +01:00
Mamadou Babaei 17f5db48c6 try to init/uninit the backend module at the module start/shutdown 2024-03-22 20:57:49 +01:00
Mamadou Babaei d9647fc1c6 allow the c++ compiler the opportunity to perform rvo/nrvo if applicable 2024-03-22 20:57:48 +01:00
Mamadou Babaei 3995d6e0d9 bump senseglove libraries to v2.101.10-7e515114 2024-03-22 20:57:48 +01:00
Mamadou Babaei fe3bd91807 update the changelog with added quest 3 controllers support 2024-03-22 20:57:47 +01:00
Mamadou Babaei 3150bb6a8a integrate the virtual hand mesh from allbreaker 2024-03-22 20:57:45 +01:00
Mamadou Babaei b2c62b34a5 remove redundant headers 2024-03-22 20:54:55 +01:00
Mamadou Babaei 69bf6161f8 expose as little as dependencies as possible 2024-03-22 20:54:54 +01:00
Mamadou Babaei 560cb73db7 correct the hand mesh yaw rotation inside the sgpawn after the squat/sgvect3d changes 2024-03-22 20:54:54 +01:00
Mamadou Babaei b1ed6fa325 replace SupportedTargetPlatforms with PlatformAllowList 2024-03-22 20:54:53 +01:00
Mamadou Babaei 4bc0b6e6d3 clean up unsed unreal version headers 2024-03-22 20:54:53 +01:00
Mamadou Babaei d7fc6dd211 declare the openxr plugin as a dependency 2024-03-22 20:54:53 +01:00
Mamadou Babaei 8580c4a235 utilize UXRDeviceVisualizationComponent to display meshes on UE 5.2 onwards 2024-03-22 20:54:53 +01:00
Mamadou Babaei b11c329974 fix the changelog errors 2024-03-22 20:54:53 +01:00
Mamadou Babaei c098cade8c remove a changelog that is not valid anymore 2024-03-22 20:54:53 +01:00
Mamadou Babaei cbc3bcd1bd bump the senseglove libraries to v2.101.9-8abfc26d 2024-03-22 20:54:53 +01:00
Mamadou Babaei cb1c473136 bump the plugin version to v1.9.8 2024-03-22 20:54:49 +01:00
Mamadou Babaei 8f7148dd61 apply a temporary workaround in order to ameliorate the hand animation after sgquat, sgvect3d fixes 2024-03-22 20:54:49 +01:00
Mamadou Babaei 242eb35d16 make bones rotations a private field 2024-03-22 20:54:49 +01:00
Mamadou Babaei 5b7e2d5d1e update the changelog 2024-03-22 20:54:49 +01:00
Mamadou Babaei 4fc721fa55 proper angle conversions for vectors 2024-03-22 20:54:49 +01:00
Mamadou Babaei f138ab2ceb proper sgvect3d and squat conversions to fvector and fquat 2024-03-22 20:54:49 +01:00
Mamadou Babaei 68cc271461 apply senseglove/unreal angle conversions in the gloves' api 2024-03-22 20:54:49 +01:00
Mamadou Babaei 0a5553987f fix a crash when calling one of the SGHandInterpolatorImpl constructors which happens due to unintialized pimpl object 2024-03-22 20:54:43 +01:00
Mamadou Babaei 4a8812943b update the changelog 2024-03-22 20:54:43 +01:00
Mamadou Babaei a10b1ff034 bump senseglove libraries to v2.101.8-a2a2075b which resolves the android writehaptics crash 2024-03-22 20:54:42 +01:00
Mamadou Babaei b34c06eb00 update the change log with unreleased changes 2024-03-22 20:54:42 +01:00
Mamadou Babaei 73a4c79741 bump senseglove libraries to v2.101.7-3580cd9f 2024-03-22 20:54:41 +01:00
Mamadou Babaei 0c8d4ef350 bump senseglove libraries to v2.101.5-f0aff76b 2024-03-22 20:54:41 +01:00
Mamadou Babaei 88b337f066 bump senseglove libraries to v2.101.4-6c860c42 with android fixes and fix a android crash 2024-03-22 20:54:35 +01:00
Mamadou Babaei 310a4b148e bump senseglove libraries to v2.101.3-e583f6de 2024-03-22 20:54:34 +01:00
Mamadou Babaei 0061ea9cb6 implement the api updates and bump the senseglove libraries to v2.101.2-2eb7439f 2024-03-22 20:54:34 +01:00
Mamadou Babaei e2da098132 force glove recalibration on backend initialize 2024-03-22 20:54:16 +01:00
Mamadou Babaei c243525c0c add as*glove/device casting methods that resolves the sgpawn vibrotactile issues 2024-03-22 20:54:16 +01:00
Mamadou Babaei 86e283e700 use device impl casts 2024-03-22 20:54:16 +01:00
Mamadou Babaei a26f1d9e42 list nova 2 gloves in the get devices from the device list 2024-03-22 20:54:16 +01:00
Mamadou Babaei beadba4544 another attempt at improving the glove casts 2024-03-22 20:54:16 +01:00
Mamadou Babaei 40f27c227f try an alternative approach for glove instances upcasting at the lower levels of the api 2024-03-22 20:54:16 +01:00
Mamadou Babaei 5bc20edc25 try to add a solution for glove type-casting in higher levels of the api 2024-03-22 20:54:16 +01:00
Mamadou Babaei 4af682b617 fix the send custom waveform signature on the hand layer 2024-03-22 20:54:16 +01:00
Mamadou Babaei 5dbeef8627 fix a bug inside the ESGHapticLocation enum conversions 2024-03-22 20:54:16 +01:00
Mamadou Babaei da7e51e208 bump senseglove libraries for v2.101.1-edc1163a 2024-03-22 20:54:15 +01:00
Mamadou Babaei d83251a57c implement the nova2 api updates and bump the senseglove libraries to v2.101.0-3e1693fb 2024-03-22 20:54:09 +01:00
Mamadou Babaei 695d4f01ba bump the plugin version to v1.9.8 2024-03-12 20:31:34 +01:00
Mamadou Babaei 54e4db3ef6 make bones rotations a private field 2024-03-12 20:31:33 +01:00
Mamadou Babaei 2e653c2a81 fix a crash inside the USGHandPose::FromHandAngles in higher levels of the api 2024-03-12 20:31:33 +01:00
Mamadou Babaei 189c0e50df drop the prefix for internal typedefs 2024-03-12 20:31:32 +01:00
Mamadou Babaei 6eaac124ce add some performance optimizations by utilizing MoveTemp in return statements 2024-03-12 20:31:32 +01:00
Mamadou Babaei 6a5f200ee8 fix a bug where the right hand mesh is always hidden inside the game no matter whether the right glove is connected or not 2024-03-12 20:31:31 +01:00
Mamadou Babaei 5254a94441 fix a wrong variable name 2024-03-12 20:31:31 +01:00
Mamadou Babaei b087debc41 only include the sgconnect header if the build platform is android 2024-03-12 20:31:30 +01:00
Mamadou Babaei 3bae035ed3 bump the plugin version to v1.9.7 2024-02-18 20:29:14 +01:00
Mamadou Babaei 5ea2f1c5be apply vibrotactile and force-feedback fixes backported from next major release 2024-02-18 20:29:14 +01:00
Mamadou Babaei 5742f7f315 bump the plugin version to v1.9.6 2024-02-14 14:55:49 +01:00
Mamadou Babaei e29c037198 fix the NovaGlove class instantiation methods to initialize a NovaGloveImpl instead of a SenseGloveImpl 2024-02-14 14:55:49 +01:00
Mamadou Babaei 4a96590460 bump the plugin version to v1.9.5 2024-02-09 10:53:09 +01:00
Mamadou Babaei 01f74dd141 fix a potential segfault inside SGDeviceModel::ParseFirmware 2024-02-09 10:53:09 +01:00
Mamadou Babaei e8ae0d9267 bump the plugin version to v1.9.4 2024-02-08 07:47:19 +01:00
Mamadou Babaei e6ae1da100 fix the bluprint parse fucntion signature to accept OutGloveInfo by reference 2024-02-08 07:47:19 +01:00
Mamadou Babaei 539855368f fix changelog formatting 2024-02-08 07:47:19 +01:00
Mamadou Babaei b6acf03c95 bump the plugin version to v1.9.3 2024-02-03 04:52:57 +01:00
Mamadou Babaei a0c4e96349 rephrase fixed changes 2024-02-03 04:52:57 +01:00
Mamadou Babaei 6251cb0d37 bump the copyright years 2024-02-03 04:52:57 +01:00
Mamadou Babaei dfda4f28fb minor changelog fixes 2024-02-03 04:52:56 +01:00
Mamadou Babaei 5054063a8a fix the wrong version numbers inside the paltform support matrix and the main .uplugin file 2024-02-03 04:52:56 +01:00
Mamadou Babaei c6294a1f16 apply a few critical fixes backported from the next major release 2024-02-03 04:52:56 +01:00
Mamadou Babaei 1cbe39fd5e a minor changelog fix 2024-02-03 04:52:56 +01:00
Mamadou Babaei f0db0b0846 bump the plugin version to v1.9.2 2023-11-03 18:35:09 +01:00
Mamadou Babaei 5e1cb6a637 fix a bug where released actor is going to be null whenever the OnActorReleased event fires 2023-11-03 18:35:08 +01:00
Mamadou Babaei eca69677b1 restructure the planned features completion status 2023-11-03 18:35:08 +01:00
Mamadou Babaei fbe415c7ae update the list of planned features and their completion status 2023-11-03 18:35:08 +01:00
Mamadou Babaei 0b052356ee update the list of planned features and their completion status 2023-11-03 18:35:07 +01:00
Mamadou Babaei 42316edb95 update the list of planned features and their completion status 2023-11-03 18:35:07 +01:00
Mamadou Babaei 932bdb26d4 add a list of planned features and their completion status to the main readme file 2023-11-03 18:35:07 +01:00
Mamadou Babaei 4fe5281cd8 bump the plugin version to v1.9.1 2023-10-11 17:02:50 +02:00
Mamadou Babaei dcbe1015f8 add the missing unreal header that defines ENGINE_*_VERSION macros in order to pass epic store builds for ue 5.3 2023-10-11 17:02:49 +02:00
Mamadou Babaei 6ebee2aa2f bump the plugin version to v1.9.0 2023-10-10 17:29:53 +02:00
Mamadou Babaei 7c8f26e978 change the ufunction specifier for sgpawn blueprint implementable events to blueprint native event in order to allow overrides from c++ as well 2023-10-10 17:29:53 +02:00
Mamadou Babaei bf234d720b add a missing release note fix for v1.8.0 to the changelog file 2023-10-10 17:29:52 +02:00
Mamadou Babaei 702fdf19fa bump the plugin version to v1.8.0 2023-10-10 16:12:51 +02:00
Mamadou Babaei 0364f67ae2 This single commit inroduces the following changes:
- Introduced new SGPawn events: OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch.
- Exposed OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch events to Blueprint as BlueprintImplementableEvent.

- Fix a bug where the OnTouchStateUpdated event is mistakenly triggered instead of the OnGrabStateUpdated when the right thumb fingertip grab collider overlaps with a grabbable actor.
2023-10-10 16:12:50 +02:00
Mamadou Babaei 0efd382edb bump the plugin version to v1.7.0 2023-09-14 18:50:05 +02:00
Mamadou Babaei 28b88a5a72 bump senseglove headers and libraries for linux and android to v2.12.0-19c9854 2023-09-14 18:50:05 +02:00
Mamadou Babaei eab9892a5d bump senseglove libraries for windows to v2.12.0-19c9854 2023-09-14 18:50:04 +02:00
Mamadou Babaei da3449b7df move SGCoreImpl/SGPlatform to SGBuildHacks/SGPlatform and introduce SG_CPP20 and SG_CAPTURE_THIS 2023-09-14 18:50:04 +02:00
Mamadou Babaei 25e0d49eea update the changelog 2023-09-14 18:50:04 +02:00
Mamadou Babaei 01fe621704 update the changelog with unreleased changes 2023-09-14 18:50:04 +02:00
Mamadou Babaei ce325f1219 introduce senseglove backend and backend kismet modules in order to properly initialize the backend in order to avoid a bug where sgcoonect::init gets called every frame 2023-09-14 18:50:04 +02:00
Mamadou Babaei 8ce4caadc9 update the changelog with unreleased changes 2023-09-14 18:50:04 +02:00
Mamadou Babaei 2588eade1f remove a duplicate log 2023-09-14 18:50:04 +02:00
Mamadou Babaei 98921356cd add sggameinstance for future use 2023-09-14 18:50:04 +02:00
Mamadou Babaei 7a35364713 remove a duplicated slash in a header's path 2023-09-14 18:50:04 +02:00
Mamadou Babaei 1cac3a70e3 bump the plugin version to v1.6.1 2023-08-14 21:22:20 +02:00
Mamadou Babaei 083a1690e8 fix the platform support matrix 2023-08-14 21:22:19 +02:00
Mamadou Babaei c2244c8ff8 add a missing header that causes build issues on ue 5.0 2023-08-14 21:22:19 +02:00
Mamadou Babaei 8b7bcdd8b8 bump the plugin version to v1.6.0 2023-08-14 17:25:59 +02:00
Mamadou Babaei f0d67ce035 update the changelog 2023-08-14 17:25:59 +02:00
Mamadou Babaei 49bcfbc2d4 update the changelog 2023-08-14 17:25:58 +02:00
Mamadou Babaei 9ed0015db0 do not cache grabbed actors as overlapped actors 2023-08-14 17:25:58 +02:00
Mamadou Babaei 5951ac9c33 inline some pimpl methods in order to improve function call performance for regularly called methods 2023-08-14 17:25:57 +02:00
Mamadou Babaei be3647e310 cache all overlapped actors with the real/virtual hands 2023-08-14 17:25:57 +02:00
Mamadou Babaei 3e35246b39 initial working implementation of the separated virtual/real hand rendering 2023-08-14 17:25:56 +02:00
Mamadou Babaei 8087719bbb fix the wrong default gizmo colors when initialized using the default constructor. 2023-08-14 17:25:56 +02:00
Mamadou Babaei 5ca1da7730 fix ue 5.3 build issues 2023-08-14 17:25:55 +02:00
Mamadou Babaei 41196d69c1 add support for the upcoming unreal engine 5.3 and native toolchain v22 libs to the build system 2023-08-14 17:25:55 +02:00
Mamadou Babaei ead76bb4f5 bump senseglove libraries for windows to v2.11.0-b775a05 2023-08-14 17:25:54 +02:00
Mamadou Babaei 529e751e07 update the changelog 2023-08-14 17:25:53 +02:00
Mamadou Babaei 1b2300d18c remove any mention of msvc 2017 and ue 4.27 third-party libs from the readme file 2023-08-14 17:25:53 +02:00
Mamadou Babaei dbabec4583 bump senseglove headers and libraries for linux and android to v2.11.0-b775a05 2023-08-14 17:25:51 +02:00
Mamadou Babaei e1fea5d60b initial attempt at separating the hand rendering from the real hand 2023-08-14 17:25:50 +02:00
Mamadou Babaei 43bdec8601 alternative velocity calculation for released actors based on the hand's cached position history 2023-08-14 17:25:49 +02:00
Mamadou Babaei a5a8e7149f alternative velocity calculation for released actors based on a cached position history 2023-08-14 17:25:49 +02:00
Mamadou Babaei bb63748644 apply the hand's velocity to the grabbed actor after release 2023-08-14 17:25:48 +02:00
Mamadou Babaei d4e92546e3 bump the plugin version to v1.5.3 2023-07-19 18:22:49 +02:00
Mamadou Babaei daa4031e6b bump senseglove libraries for windows to v2.10.1-3b0e7c9 2023-07-19 18:22:48 +02:00
Mamadou Babaei bc39905bc6 a minor changelog fix 2023-07-19 18:22:47 +02:00
Mamadou Babaei 1fdb94d5c9 bump senseglove libraries for linux and android to v2.10.1-3b0e7c9 2023-07-19 18:22:47 +02:00
Mamadou Babaei 7c9e1b2462 bump the plugin version to v1.5.2 2023-07-19 01:19:59 +02:00
Mamadou Babaei ef6d5b6295 fix a build issue with android shipping builds 2023-07-19 01:13:21 +02:00
Mamadou Babaei 6794a36b0f whitespace fix 2023-07-19 01:13:20 +02:00
Mamadou Babaei 6c77fb0ca9 remove redundant whitespaces 2023-07-19 01:13:20 +02:00
Mamadou Babaei f5d9a02dab fix a grammatical error in the changelog 2023-07-19 01:13:19 +02:00
Mamadou Babaei 75eaea13a4 bump the plugin version to v1.5.1 2023-07-13 19:49:16 +02:00
Mamadou Babaei b2f89c4694 fix grab/release bug for the right hand 2023-07-13 17:27:28 +02:00
Mamadou Babaei b4e547f755 fix a wrist tracker bug where hands are getting tracked in reverse 2023-07-13 17:26:49 +02:00
Mamadou Babaei 8125ad2fc6 do checks against the right hand which is cleaner to read 2023-07-13 17:26:02 +02:00
Mamadou Babaei f7f997019d bump the plugin version to v1.5.0 2023-06-16 02:02:57 +02:00
Mamadou Babaei 914f0c34ac update the changelog 2023-06-16 02:02:56 +02:00
Mamadou Babaei 8e9b45ddc0 fix the motion source options crashes 2023-06-16 02:02:56 +02:00
Mamadou Babaei bf4e1f53f6 refactor the newly added motion source settings and off-load them from the wrist tracker to the settings system, though this causes crashes still 2023-06-16 02:02:55 +02:00
Mamadou Babaei 5c40592070 bump senseglove libraries for windows to v.2.10.0-12133ac 2023-06-16 02:02:55 +02:00
Mamadou Babaei 3fb66fa469 bump senseglove libraries for linux and android to v.2.10.0-12133ac 2023-06-16 02:02:53 +02:00
Mamadou Babaei c0c6d6b262 update the changelog with the latest changes 2023-06-16 02:02:53 +02:00
Mamadou Babaei 03e698de32 remove not yet implemented from ViveTracker and ViveFocus3WristTracker enums' names 2023-06-16 02:02:52 +02:00
Mamadou Babaei 4c0d886518 fix a bug where SteamVR trackers such as HTC VIVE and HTC VIVE Focus 3's wrist orientation and location were not being tracked. 2023-06-16 02:02:52 +02:00
Mamadou Babaei c63c182ab0 bump senseglove libraries and headers for linux and android to v2.9.0-21c54c5 2023-06-16 02:02:51 +02:00
Mamadou Babaei 51af76bf55 update the changelog to reflect the latest changes 2023-06-16 02:02:50 +02:00
Mamadou Babaei a95e067e85 bump senseglove libraries for windows to v2.9.0-21c54c5 2023-06-16 02:02:49 +02:00
Mamadou Babaei e05347f2a4 add (not implemented yet) to the blueprint display name for positional tracking hardware that is not implemented yet 2023-06-16 02:02:48 +02:00
Mamadou Babaei d85428a30f add support for vive focus 3 positional tracking hardwares 2023-06-16 02:02:48 +02:00
Mamadou Babaei 0f5e0e1c7f add support for oculus quest pro positional tracking hardwares 2023-06-16 02:02:47 +02:00
Mamadou Babaei a7efdb75c7 remove support for oculus touch, pico neo 2, and pico neo 3 positional tracking hardwares 2023-06-16 02:02:47 +02:00
Mamadou Babaei f849252dc8 fix ESGPositionalTrackingHardware enum display names and comments 2023-06-16 02:02:46 +02:00
Mamadou Babaei be76335a46 update the changelog 2023-06-16 02:02:46 +02:00
Mamadou Babaei d6f1e21804 fully refactor the top-level configurations in the settings system into ustructs 2023-06-16 02:02:45 +02:00
Mamadou Babaei 08657ceda2 update the platform support matrix to reflect the latest support status 2023-06-16 02:02:45 +02:00
Mamadou Babaei 1f57ae7a8f bump senseglove libraries for windows v2.8.0-ff14904 2023-06-16 02:02:45 +02:00
Mamadou Babaei fcf9bdb0a5 bump senseglove libraries for linux and android to v2.8.0-ff14904 2023-06-16 02:02:43 +02:00
Mamadou Babaei 5cec1ac563 drop support for native toolchain v19, msvc v141 (2017), and thus ue 4.27 in the build system 2023-06-16 02:02:42 +02:00
Mamadou Babaei b6bd971bc8 bump the plugin version to v1.4.3 2023-06-01 23:30:20 +02:00
Mamadou Babaei 3088a60d5a update the changelog 2023-06-01 23:30:20 +02:00
Mamadou Babaei e22625ae34 fix a critical Android crash that happens where the default development hand meshes are not found 2023-06-01 23:30:19 +02:00
Mamadou Babaei 30720e5bd5 add a complementary internal method to IsUsingUserMesh, IsUsingDefaultMesh for checking various hand meshes 2023-06-01 23:30:19 +02:00
Mamadou Babaei a2b8e186b5 fix the changelog release formatting and drop the v prefix in the release titles 2023-06-01 23:30:18 +02:00
Mamadou Babaei 882665e386 bump the plugin version to v1.4.2 2023-06-01 21:44:38 +02:00
Mamadou Babaei 265759e080 update the changelog 2023-06-01 21:44:38 +02:00
Mamadou Babaei cac1c475dc fix the changelog typos and errors 2023-06-01 21:44:37 +02:00
Mamadou Babaei 8478b7caf8 minor grammatical fix 2023-06-01 21:44:37 +02:00
Mamadou Babaei 6b2e5dbcf7 update the changelog with unreleased changes 2023-06-01 21:44:37 +02:00
Mamadou Babaei ae81b15c91 fix an edit condition parsing failure that caused a bug in the settings
system where the virtual hand and the wrist tracker debug gizmos where
always drawn, regardless of chosen settings
2023-06-01 21:44:36 +02:00
Mamadou Babaei 5a8feb24ac fix error C2440: 'initializing': cannot convert from 'void' to 'bool' when engine versio is < 5.2 2023-06-01 21:44:36 +02:00
Mamadou Babaei 418133432f fix typos in the changelog 2023-06-01 21:44:35 +02:00
Mamadou Babaei 0d5c2ee04e fix a typo in the changelog 2023-06-01 21:44:35 +02:00
Mamadou Babaei edad54bd36 fix the changelog 2023-06-01 21:44:34 +02:00
Mamadou Babaei bed8269eba fix a typo in the changelog 2023-06-01 21:44:34 +02:00
Mamadou Babaei 598b0942e4 minor fix in the changelog 2023-06-01 21:44:33 +02:00
Mamadou Babaei a1a36901ea bump the plugin version v1.4.1 2023-05-29 02:08:48 +02:00
Mamadou Babaei 1ee517f392 log unreleased changes 2023-05-29 02:08:48 +02:00
Mamadou Babaei 558e2ffcff remove dead gradle code from the android module 2023-05-29 02:08:47 +02:00
Mamadou Babaei b5452ff3a8 supress a grade warning for non-arm64 archs when the build target is android 2023-05-29 02:08:47 +02:00
Mamadou Babaei 267e518f44 fix an android gradle build issue which happens when the games package name won't start with com.senseglove.* 2023-05-29 02:08:46 +02:00
Mamadou Babaei a6ae25e581 bump the plugin version to v1.4.0 2023-05-19 19:01:37 +02:00
Mamadou Babaei 946df25210 fix linux aarch64 build issues on ue 5.0 2023-05-19 18:35:44 +02:00
Mamadou Babaei 88a57106ff remove SenseGloveCoreTypes from the directory structure 2023-05-19 18:35:44 +02:00
Mamadou Babaei a98e88d27f implement an optional feature in order to automatically stop all haptics on the end play event 2023-05-19 18:04:47 +02:00
Mamadou Babaei 25e095ab11 temporarily disable the debug gizmo for the virtual hand and the wrist tracker due to an esoteric bug in the settings system 2023-05-19 18:04:46 +02:00
Mamadou Babaei 360c669dfd remove commented code 2023-05-19 18:04:46 +02:00
Mamadou Babaei 6fab1830f1 increase the default finger tips collider sizes 2023-05-19 18:04:46 +02:00
Mamadou Babaei 69e13a1de2 get root component instead of iterating over the components in order to disable/enable the actor physics 2023-05-19 18:04:45 +02:00
Mamadou Babaei b7416f1559 fix a potential crash 2023-05-19 18:04:45 +02:00
Mamadou Babaei 6c821bf80d stop all haptics on end play in order to make sure the glove won't get stuck in haptics feedbacks 2023-05-19 18:04:44 +02:00
Mamadou Babaei 318ba52835 set the default attachment rotation rule to keep relative 2023-05-19 18:04:44 +02:00
Mamadou Babaei 3a44a177fd set the default attachment scale rule to snap to target 2023-05-19 18:04:43 +02:00
Mamadou Babaei 7d4c839f9f do not affect collision when grab/release 2023-05-19 18:04:43 +02:00
Mamadou Babaei f17a7ecde8 refactor and remove the need to cache the component in the grab/release workflow 2023-05-19 18:04:42 +02:00
Mamadou Babaei 783f1b317c refactor the grab/touch logic and data structure and also cache the component ready to be grabbed in order to affect its physics state 2023-05-19 18:04:42 +02:00
Mamadou Babaei fcd038d2fc try an alternative approach for the grab/release functionality by disabling/enabling physics simulation 2023-05-19 18:04:42 +02:00
Mamadou Babaei c2f67fce2d add grab sucess/fail checks with error messages 2023-05-19 18:04:41 +02:00
Mamadou Babaei caf9340641 add ensure checks on the grab socket name 2023-05-19 18:04:41 +02:00
Mamadou Babaei 0906a60b66 move socket name to a temp var for easier debugging 2023-05-19 18:04:40 +02:00
Mamadou Babaei cb51f36d87 move attachment rules to a temp var for easier debugging 2023-05-19 18:04:40 +02:00
Mamadou Babaei 7a23dddbe0 fix a release-detection logic error 2023-05-19 18:04:39 +02:00
Mamadou Babaei db7433fe26 clean up and simplify the touch callback lambda 2023-05-19 18:04:39 +02:00
Mamadou Babaei 81a663ae91 update the changelog 2023-05-19 18:04:38 +02:00
Mamadou Babaei ce9590ae65 force off haptic commands when collision ends 2023-05-19 18:04:38 +02:00
Mamadou Babaei 072cf1ea86 only send force-feedback and buzz commands when they are not zero 2023-05-19 18:04:38 +02:00
Mamadou Babaei e5a378a9fa update the platform support matrix with the distribution channels and their remarks 2023-05-19 18:04:37 +02:00
Mamadou Babaei e25004b9e9 add a note about abi/api breaking changes 2023-05-19 18:04:37 +02:00
Mamadou Babaei b9ca46a906 bump senseglove binaries for windows to v2.7.1-965f90c 2023-05-19 18:04:36 +02:00
Mamadou Babaei 7e9d7d9a6b removed the redundant SenseGloveCoreTypes module which causes all kinds of packaging issues with certain versions of the engine. 2023-05-19 18:04:35 +02:00
Mamadou Babaei bc485b9baf try to fix various build issues with the senseglove core types module 2023-05-19 18:04:35 +02:00
Mamadou Babaei 6be4ab7a5b fix linux aarch64 build issues and for older unreal engine versions 2023-05-19 18:04:34 +02:00
Mamadou Babaei 66031095dd whitelist all modules for linuxarm64 target platform 2023-05-19 18:04:34 +02:00
Mamadou Babaei b4968ebd05 fix linux aarch64 build issues and for ue 4.27 up to 5.2 2023-05-19 18:04:33 +02:00
Mamadou Babaei 79d292e159 fix a build error where engine versions are < 5.2 2023-05-19 18:04:33 +02:00
Mamadou Babaei f09bd379d8 add linux aarch64 platform support for unreal 5.2+ and bump senseglove libraries to v2.7.1-965f90c 2023-05-19 18:04:32 +02:00
Mamadou Babaei 5de114f9a4 fix a circular dependency build issue 2023-05-19 18:04:31 +02:00
Mamadou Babaei a78e8cade7 add a missing dependency that causes packaging issues 2023-05-19 18:04:30 +02:00
Mamadou Babaei 65e1670974 capture by reference in the buzz timer callback lambda or otherwise crash 2023-05-19 18:04:30 +02:00
Mamadou Babaei b2ddd29d4c fix a crash due to uninitialized pimpl object 2023-05-19 18:04:29 +02:00
Mamadou Babaei 43070d8ce3 fix lambda crashes and ensure logic bugs 2023-05-19 18:04:29 +02:00
Mamadou Babaei b9fe67814d complete the implementation for the touch functionality and its feedbacks 2023-05-19 18:02:26 +02:00
Mamadou Babaei 67042c7466 add the initial implementation for the touch functionality and its feedbacks 2023-05-19 18:02:26 +02:00
Mamadou Babaei 684331075f expose the connected glove in the virtual hand's api 2023-05-19 18:02:25 +02:00
Mamadou Babaei 5f6641af12 add static get component methods for quickly accessing grab/touch components 2023-05-19 18:02:25 +02:00
Mamadou Babaei 77e62eba30 remove the variable names from the grab/touch signatures 2023-05-19 18:02:24 +02:00
Mamadou Babaei 48152dfcdd add the grab/touch state update events 2023-05-19 18:02:24 +02:00
Mamadou Babaei d7f55e1a78 update the changelog 2023-05-19 18:02:23 +02:00
Mamadou Babaei aa8e2f097e fix a crash by removing wrong delegate binds 2023-05-19 18:02:23 +02:00
Mamadou Babaei 4452b308f5 add a buzz timeout uproperty 2023-05-19 18:02:22 +02:00
Mamadou Babaei ffabc4159c merge all properties inside the grab component into one group 2023-05-19 18:02:22 +02:00
Mamadou Babaei 7941fca732 simplify and merge separate buzz/force-feedback levels into one value on the touch component 2023-05-19 18:02:22 +02:00
Mamadou Babaei 2c0c3a2dbf Revert "move force-feedback properties from the touch component to the grab component"
This reverts commit 9faa9d2ca4.
2023-05-19 18:02:21 +02:00
Mamadou Babaei 9d92e2600b move force-feedback properties from the touch component to the grab component 2023-05-19 18:02:21 +02:00
Mamadou Babaei f3afbccb2b cache which finger can grab or touch objects 2023-05-19 18:02:20 +02:00
Mamadou Babaei b7ea384fd7 set up the overlap events for the grab/touch fingertip colliders 2023-05-19 18:02:20 +02:00
Mamadou Babaei 852f398755 add the api for getting/setting touch properties 2023-05-19 18:02:19 +02:00
Mamadou Babaei 933d75bd63 add the api for getting/setting grab properties 2023-05-19 18:02:19 +02:00
Mamadou Babaei 9721eaa275 add a grab socket uproperty, getters, and setters 2023-05-19 18:01:26 +02:00
Mamadou Babaei afb14d3b89 whitespace fix 2023-05-19 18:01:26 +02:00
Mamadou Babaei 2d77ee8b5d differentiate the default grab/touch socket names 2023-05-19 17:45:02 +02:00
Mamadou Babaei 4485d2b786 integrate the touch component and colliders and rename the grab ones 2023-05-19 17:45:02 +02:00
Mamadou Babaei 508ef0976e add a touch component intended to be used for force-feedback 2023-05-19 17:45:01 +02:00
Mamadou Babaei f45f2ea73d add the api and setup the required components and uproperties in order to implement the basic grab functionality 2023-05-19 17:45:01 +02:00
Mamadou Babaei 434bcf12c5 document the unreleased changes 2023-05-19 17:45:00 +02:00
Mamadou Babaei af18e5453d fix blueprint signatures and make all bp exposed functions static 2023-05-19 17:45:00 +02:00
Mamadou Babaei cb894ef7a8 formatting fix 2023-05-19 17:44:59 +02:00
Mamadou Babaei 75855bcca2 document a missing changelog item 2023-05-19 17:44:59 +02:00
Mamadou Babaei 380d83717c Revert "temporarily revert changes that are not part of the v1.3.1 release"
This reverts commit 116935f54b.
2023-05-19 17:44:59 +02:00
Mamadou Babaei 9a3d44dc81 bump the plugin version to v1.3.1 2023-04-28 02:09:50 +02:00
Mamadou Babaei 22e782e8e5 temporarily revert changes that are not part of the v1.3.1 release 2023-04-28 02:09:50 +02:00
Mamadou Babaei 2ce7439fbf fix runuat rocket build issues by adding the missing headers 2023-04-28 02:09:49 +02:00
Mamadou Babaei ec1c5c9c8a document the senseglove debug module 2023-04-28 02:09:49 +02:00
Mamadou Babaei d32f59a8cb document unreleased changes 2023-04-28 02:09:49 +02:00
Mamadou Babaei dc0cf37e45 Revert "temporarily revert changes that are not part of the v1.3.0 release"
This reverts commit 6a0f2a00a1.
2023-04-28 02:09:48 +02:00
Mamadou Babaei dbd252f487 bump the plugin version to v1.3.0 2023-04-28 01:19:56 +02:00
Mamadou Babaei 37efb4cf51 temporarily revert changes that are not part of the v1.3.0 release 2023-04-28 01:19:56 +02:00
Mamadou Babaei eded9f5ad5 bump senseglove libraries for linux and android to v2.6.0-aac3d56 2023-04-28 01:19:55 +02:00
Mamadou Babaei 82c3993ea9 bump the senseglove libraries for windows/msvc to v2.6.0-aac3d56 2023-04-28 01:19:55 +02:00
Mamadou Babaei 873a850498 document recent changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei a1d78fa767 document the senseglove libraries bump in the changelog 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7b4b06e3d0 adjust senseglove/unreal coordinate system conversions according to changes in the recent sgcore release 2023-04-28 01:19:54 +02:00
Mamadou Babaei daa22b3940 fix a gramatical error 2023-04-28 01:19:54 +02:00
Mamadou Babaei cf8fc5fcda add a debug virtual hand and some other fixes 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7b57334ed0 fix the hand right hand offset 2023-04-28 01:19:54 +02:00
Mamadou Babaei 22ca963bd6 remove redundant headers 2023-04-28 01:19:54 +02:00
Mamadou Babaei 66d0201d12 fix debug gizmo default colors 2023-04-28 01:19:54 +02:00
Mamadou Babaei 3b68860eeb refactor the debug gizmo draw method 2023-04-28 01:19:54 +02:00
Mamadou Babaei 649d88e85d update the changelog with unreleased changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei 2ff9e6f984 refactor the wrist tracker's debug gzmo settings into a ustruct in order to be re-used 2023-04-28 01:19:54 +02:00
Mamadou Babaei 51e1d5f252 fix gizmo drawing issue happens due to a null world object 2023-04-28 01:19:54 +02:00
Mamadou Babaei 66aec3cdea add a new generic senseglove debug module 2023-04-28 01:19:54 +02:00
Mamadou Babaei 1426e2b2c2 add the base implementation for the senseglove grab component 2023-04-28 01:19:54 +02:00
Mamadou Babaei cb9a319a6a increase the default DebugWristTrackerGizmoLength value in the plugin's settings 2023-04-28 01:19:54 +02:00
Mamadou Babaei 1539b09925 increase the default DebugWristTrackerGizmoLength value on the wrist tracker 2023-04-28 01:19:54 +02:00
Mamadou Babaei fd9b8d6a01 document unreleased changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei e1353bb0ec fix the wrong hand offset calculations 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7481d2cd8e fix the wrong tracker origin calculations 2023-04-28 01:19:54 +02:00
Mamadou Babaei 3d0e7fe8d2 fix the platform support matrix for unreal versions >= 5.0 2023-04-20 15:54:59 +02:00
Mamadou Babaei da7bc22ed7 minor code improvements and clean up 2023-04-20 15:54:59 +02:00
Mamadou Babaei a54d252971 fix the directory structure 2023-04-11 21:05:17 +02:00
Mamadou Babaei d711d42562 remove the development virtual hand mesh from master and all the release branches 2023-04-11 20:57:34 +02:00
1045 changed files with 32803 additions and 30610 deletions
+383 -5
View File
@@ -5,13 +5,391 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.2.1] - 2023-03-30
## [2.0.3] - 2024-05-15
This is a bugfix release addressing mostly RunUAT build issues on Unreal Engine 5.4.
### Fixed
- Fix UE 5.4 RunUAT build issue: "Asking CppCompileEnvironment for a single Architecture, but it has multiple Architectures (arm64, x64)", affecting SenseGloveConnectImpl and SenseGloveCoreImpl modues.
- Improved target platform detection when building SenseGloveConnectImpl and SenseGloveCoreImpl modules and also distinguishing the x64 builds from arm64 on Microsoft Windows.
- Fix other UE 5.4 RunUAT build issues, mostly caused by missing headers.
### Removed
- Removed support for Android armeabi-v7a and x86 architectures as they are no longer supported by the supported engine versions.
## [2.0.2] - 2024-04-25
This is a patch release with no code changes.
### Added
- Introduce official Unreal Engine 5.4 support to the Unreal Engine Marketplace.
### Changed
- Updated the Platform Support Matrix with the latest changes. This is the last release to support Unreal Engine 5.1 as we no longer are able to push updates for this release to the Unreal Engine Marketplace. The v2.0.1 release for Unreal Engine 5.1 can be obtained from the Unreal Engine Marketplace, and v2.0.2 through our Microsoft Azure DevOps repositories. Please note that there are no actual code changes between these two releases and in terms of functionality they are almost identical.
## [2.0.1] - 2024-04-15
This is a bugfix release.
### Fixed
- Fix a bug inside both SGVirtualHandComponent and SGWristTrackerComponent where the connected glove's UObject instance gets destroyed and re-instantiated every frame. With this fix now the glove instance will be created or destroyed only when a glove connects to or disconnects from the system.
- Update the outdated Platform Support Matrix and its remarks section to reflect the latest status information.
- Fix the wrong header file description sections for the header files inside <code>SenseGloveKismet/Public/SGKismet/</code>.
### Changed
- SenseGlove libraries have been updated to v2.102.0-35d4de3f.
- Together, SenseGlove libraries v2.102.0-35d4de3f and SenseCom v1.6.1 remove the need to call ResetCalibration every time and are able to store and load calibration profiles from disk.
- SesenGloveBackend module is no longer calling FSGHandLayer::ResetCalibration on every backend initialization.
## [2.0.0] - 2024-03-22
This is the second major release of the SenseGlove Unreal Engine Plugin adding support for Nova 2 with enormous breaking changes to the current C++ and Blueprint APIs.
### Added
- Added support for the SenseGlove Nova 2 devices.
- Added support for Quest 3 controllers.
- Various classes have been added to the API in order to implement the new functionalities and features from the latest upstream SenseGlove libraries.
- Added initial support for the upcoming Unreal Engine 5.4 release.
- Added a pair of default production-ready virtual hand meshes for the left and right hands, courtesy of [Allbreaker LLC Columbia](https://www.allbreaker.co/). For usage and redistribution, please consult the [LICENSE-THIRD-PARTY.md](LICENSE-THIRD-PARTY.md) file.
### Fixed
- A few critical bug fixes that have already been backported to the v1.x.x series through v1.9.3 to v1.9.8 releases.
- Revamped the way we do FVector <-> SGVect3D, FQuat <-> SGQuat, and SenseGlove <-> Unreal Engine angles conversions in order to properly translate between the SenseGlove and Unreal Engine coordinate systems.
- Allow the C++ compiler the opportunity to perform RVO/NRVO if applicable.
- Fix the modules' order inside the .uplugin file.
- Fix a build issue inside FSGArrayUtils::FromStdVector introduced by newer MVSC updates due to stricter implicit uint64 to int32 conversions.
- Fix a build issues inside FSGArrayUtils when performing non-Unity builds due to the missing <string> header.
- Fix other build issues in USGDevice, USGNovaGloveSensorData, FSGDeviceImpl, and FSGSenseGloveVarsImpl when performing non-Unity builds due to the missing relevant headers.
- Fix changelog formatting.
- Some other improverment and fixes.
### Changed
- SenseGlove libraries have been updated to v2.101.12-62b1be11.
- The SenseGlove Unreal Engine Plugin now declares the OpenXR plugin as a dependency, so that the OpenXR plugin will be enabled automatically as soon as the SenseGlove Unreal Engine Plugin gets enabled.
- Various classes and parts of the API have been changed in order to reflect and adhere to upstream SenseGlove libraries.
- Reverse the Platform Support Matrix order from newer Unreal Engine versions to the older ones.
- Clarify the engine support policy in the main readme file by adding the corresponding references from the Epic Marketplace Guidelines and a URL to their guidelines page.
- The SGTouchComponent uproperties BuzzDuration and BuzzLevel now utilize different different names in order to correspond to the underlying API changes. They have been renamed to VibrotactileDuration and VibrotacktileLevel.
- The SGTouchComponent uproperties ForceFeedbackLevel and BuzzLevel (now VibrotacktileLevel) parameters type have changed from int32 to float with the value range varying between 0.0f to 1.0f instead of 1 to 100 in order to correspond to the underlying API changes.
- The SGVirtualHandComponent now assumes the default grab point's name as GenericGrabPoint instead of GrabPoint as default if not specified in the Unreal Blueprint Editor.
- The SGPawn on UE 5.2+ now utilizes UXRDeviceVisualizationComponent in order to properly display the controller meshes shipped with Unreal Engine's OpenXR plugin, or a user-provided mesh. On UE 5.1 this could still be set on the WristTrackerLeft and WristTrackerRight components. Please note that despite the fact that on UE 5.2+ it's still possible to utilize the WristTrackerLeft and WristTrackerRight for setting the controller meshes, this has been deprecated in UE 5.2+ and is no longer supported.
### Removed
- Various classes and parts of the API have been removed in order to reflect and adhere to upstream SenseGlove libraries.
- Removed the redundant SGIC_int32_Ref interop type.
## [1.9.8] - 2024-03-12
This is a bugfix release that contains bugfixes backported from the next major release of the plugin as documented below.
### Fixed
- Fix a bug where the right-hand mesh is always hidden inside the game no matter whether the right glove is connected or not.
- Fix a crash inside the USGHandPose::FromHandAngles method.
- Some performance optimizations by utilizing MoveTemp in return statements.
- Some improvements applied to the source code.
- Some other minor fixes.
### Changed
- The BonesRotations TMap is no longer a public field of FSGVirtualHandAnimInstanceProxy and instead could be retrieved by calling the GetBonesRotations() method.
## [1.9.7] - 2024-02-18
This is a bugfix release that contains bugfixes backported from the next major release of the plugin as documented below.
### Fixed
- Fix various bugs inside the SGPlayerController which occur when the thumb and pinky fingers are simultaneously touching different SGTouchComponents, or only one of them is in touch with such a component. In this case pinky's buzz and force-feedback levels are determined from the SGTouchComponent that is in collision with the thumb instead of the one that is touched by the pinky. Or, the pinky could ignore the buzz and force-feedback level if the thumb is not in collision with an SGTouchComponent. Or, the pinky could have reacted with a buzz or force feedback while only the thumb is in contact with an SGTouchComponent.
- Fix the BuzzDuration UPROPERTY range in order not to get clamped at 100.0f and also use float values for ClampMin and UIMin specifiers instead of integer values.
## [1.9.6] - 2024-02-14
This is a bugfix release.
### Fixed
- Fix a few critical bugs inside the NovaGlove class where the higher levels of the API including constructors, Parse, and NewNovaGlove methods mistakenly instantiate a SenseGloveImpl class instead of a NovaGloveImpl class.
## [1.9.5] - 2024-02-09
This is a bugfix release.
### Fixed
- Fix a wrong type-casting inside SGDeviceModel::ParseFirmware where OutMainVersion and OutSubVersion arguments are getting passed to the lower levels of the API. This could potentially result in a segfault at the FFI boundary between lower and higher levels of the API.
## [1.9.4] - 2024-02-08
This is a bugfix release addressing mostly Blueprint API issues with ABI breaking changes inside the Blueprint layer, backported from the next major release of the plugin as documented below.
### Fixed
- Fix the Blueprint Parse function signature for the NovaGloveInfoKismetLibrary where the OutGloveInfo passed by the caller was never actually assigned as it was not getting passed by reference.
- Changelog formatting.
## [1.9.3] - 2024-02-03
This is a hotfix release addressing a few critical issues that might result in crashes or malfunctions for users of the low-level SenseGlove API, backported from the next major release of the plugin as documented below.
### Fixed
- Fix a potential memory corruption inside one of the SGBasicHandModel constructors where the StartPositions parameter gets passed as the StartRotations parameter to lower levels of the API.
- Fix a potential memory corruption inside one of the SGSenseGloveInfo constructors where the StartPositions parameter gets passed as the Functions parameter to lower levels of the API.
- Fix a potential memory corruption where inside the SGHapticGloveCalibrationSequence::GetCurrentInstruction method, the return statement of the function is getting assigned to the const parameter NextStepKey, thus the return statement of the function will always be empty as well.
- Fix a potential memory corruption where inside one of the overloads of the SGSenseGloveImpl::GetGlovePose method, the out parameter of the method is getting passed as the SensorData parameter to the lower levels of the API.
- Fix multiple Equals methods for a few classes such as SGInterpolationSet, SGNovaGloveHandProfile, SGNovaGloveInfo, SGSenseGloveHandProfile, SenseGloveInfo, SenseGlovePose, where the Equal method compares the current instance against itself instead of the other instance passed to as the parameter to the method.
- Removed a redundant code statement inside the SGNovaGloveImpl::GetSubFirmwareVersion method.
- Some minor const correctness fixes.
- Some other minor code fixes and improvements.
- Fix the wrong version numbers inside the paltform support matrix and the main .uplugin file.
- Minor changelog fixes.
- Bumped the copyright years.
## [1.9.2] - 2023-11-03
### Added
- Added a list of planned features and their completion status to the main README file.
### Fixed
- A bug where the released actor is going to be NULL whenever the OnActorReleased event fires.
## [1.9.1] - 2023-10-11
### Fixed
- Add the missing Unreal Engine C++ header to files that rely on the ENGINE\_\*\_VERSION macros in order to fix the Epic Store build failures on UE 5.3.
## [1.9.0] - 2023-10-10
### Changed
- The BlueprintImplementableEvent UFUNCTION specifier for the OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch events have been changed to BlueprintNativeEvent in order to allow them to be implemented from the child C++ classes as well. This won't break any existing Blueprint code that relies on the previous BlueprintImplementableEvent signature.
### Fixed
- Add a missing release note entry for the v1.8.0 release to the changelog file.
## [1.8.0] - 2023-10-10
### Added
- Introduced new SGPawn events: OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch.
- Exposed OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch events to Blueprint as BlueprintImplementableEvent.
### Fixed
- Fix a bug where the OnTouchStateUpdated event is mistakenly triggered instead of the OnGrabStateUpdated when the right thumb fingertip grab collider overlaps with a grabbable actor.
- Fix the DECLARE_EVENT macro signature for OnGrabStateUpdated and OnTouchStateUpdated events.
## [1.7.0] - 2023-09-14
### Added
- Introduce SGGameInstance, a customized SenseGlove game instance for future use.
- Added the new SenseGloveBackend and SenseGloveBackendKismet modules.
- Added SG_CPP20 C++ macro for C++20 detection, which is now default from UE 5.3 onwards.
- Added SG_CAPTURE_THIS C++ macro as a workaround for error C4855: implicit capture of 'this' via '[=]' is deprecated in /std:c++20 in order to build the same lambda captures without extra #ifdefs on all supported engine versions.
### Changed
- SenseGlove libraries have been updated to v2.12.0-19c9854.
- SGCoreImpl/SGPlatform has been moved to SGBuildHacks/SGPlatform.
### Fixed
- Proper initialization of the SenseGlove backend in order to fix a bug in certain situations where SGConnect::Init() gets called every frame.
- Some other minor fixes and improvements.
## [1.6.1] - 2023-08-14
### Fixed
- Fix Unreal Engine 5.0 build issues.
- Minor documentation fixes.
## [1.6.0] - 2023-08-14
### Added
- Added support for the upcoming Unreal Engine 5.3.
- Now, the hand's velocity is applied to grabbed actors after being released from the hand.
- Introduce the real hands to the SenseGlove module (SGPawn) API.
- Added separation of the virtual and real hand rendering.
### Fixed
- Fix the wrong default debug virtual hand gizmo colors when initialized using the default constructor.
- Some minor performance fixes and improvements.
### Changed
- SenseGlove libraries have been updated to v2.11.0-b775a05.
## [1.5.3] - 2023-07-19
This is a hotfix release mostly addressing Android Bluetooth performance issues.
### Fixed
- Minor changelog fixes.
### Changed
- SenseGlove libraries have been updated to v2.10.1-3b0e7c9.
## [1.5.2] - 2023-07-19
This is a hotfix release mostly addressing Android-related issues.
### Fixed
- Fix a build issue with Android shipping builds due to sgconnect.jar not getting copied automatically in the AFSProject which is compiled for shipping builds when AndroidFileServer (AFS) is enabled.
- Minor changelog fixes and some source code formatting fixes.
## [1.5.1] - 2023-07-13
This is a hotfix release addressing a few critical issues introduced by the recent changes.
### Fixed
- Fix a wrist tracker bug where left and right hands' wrist trackers are mistakenly tracking the opposite hand's motion source.
- Fix a bug where the right hand is not able to do grab or release.
## [1.5.0] - 2023-06-16
This release breaks ABI/API compatibility with the previous versions in some areas as documented below.
### Added
- Added HTC VIVE Focus 3 positional tracking hardware enum.
- Added support for the Meta Quest Pro, HTC VIVE, and HTC VIVE Focus 3 positional tracking hardware.
- Added two options to the wrist tracker settings (to the global plugin settings and the overrides in the wrist tracker component) in order to be able to specify a custom motion source for the left and right hands, so that it allows SteamVR-based trackers such as HTC VIVE or HTC VIVE Focus 3 to operate with the SGPawn.
### Fixed
- Fix a bug where SteamVR trackers such as HTC VIVE and HTC VIVE Focus 3's wrist orientation and location were not being tracked.
### Changed
- Fully refactored the top-level configurations in the settings system into USTRUCTs.
- SenseGlove libraries have been updated to v2.10.0-12133ac.
### Removed
- Dropped support for the Epic Native Toolchain v19, MSVC v141 (Visual Studio 2017), and thus Unreal Engine 4.27 as it has been marked as deprecated since v1.4.x.
- Removed any kind of support for Oculus Touch (Oculus Rift S and Oculus Quest 1) positional tracking hardware, thus the enum as well.
- Removed any kind of support for Pico Neo 2 positional tracking hardware, thus the enum as well.
- Removed any kind of support for Pico Neo 3 positional tracking hardware, thus the enum as well.
## [1.4.3] - 2023-06-01
This is a hotfix release addressing a critical Android crash.
### Fixed
- Fix a critical Android crash that happens where the default development hand meshes are not found, which means almost always since we don't ship any default virtual hand mesh at the moment.
- Minor changelog release formatting fix in order to stay consistent.
## [1.4.2] - 2023-06-01
This is a hotfix release addressing a few critical issues.
### Fixed
- Fix build issues with certain compilers when the Unreal Engine version is older than 5.2.
- Reintroduced the Virtual Hand and the Wrist Tracker debug gizmos which have temporarily been disabled due to a bug in the settings system.
- Some minor changelog fixes.
## [1.4.1] - 2023-05-29
This is a bugfix release with a focus on Android build issues.
### Fixed
- Fix an Android Gradle build issue that happens when the game's package name won't start with com.senseglove.*.
- Suppress a grade warning for non-arm64 architectures when the build target is Android.
### Removed
- Remove dead Gradle code from the Android module.
## [1.4.0] - 2023-05-19
This release breaks ABI/API compatibility with the previous versions.
### Added
- Added support for the stable release of Unreal Engine 5.2 (the preview release has been supported since v1.2.0).
- Added Linux AArch64 platform support.
- Added a new Grab component that can turn any actor into a grabbable object.
- Added a new Touch component that enables haptic feedback such as Buzz and Force-Feedback commands.
- Added an optional feature in order to automatically stop all haptics on the EndPlay event, wherever the virtual hand component is used. By default, it's enabled.
### Fixed
- Fix Blueprint signatures for USGVirtualHandComponentKismetLibrary and make all the Blueprint exposed functions static.
### Changed
- SenseGlove libraries have been updated to v2.7.1-965f90c with support for Linux AArch64.
- The Virtual Hand and the Wrist Tracker debug gizmos (the intended use is only for SenseGlove developers for really low-level stuff; thus won't affect the users of the plugin at all) have been disabled and will be ignored due to an esoteric bug in the settings systems which has been scheduled to be fixed in the future releases.
### Removed
- Removed the redundant SenseGloveCoreTypes module which causes all kinds of packaging issues with certain versions of the engine.
### Deprecated
- This is the last release to support Unreal Engine 4.27 and please keep in mind that the current release is not obtainable through the Unreal Engine Marketplace. The latest published version on the Marketplace for 4.27 is v1.3.1. Per Epic's Marketplace policy regarding Code Plugins, we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps.
## [1.3.1] - 2023-04-28
### Fixed
- Fix RunUAT build issues caused by missing headers.
- Minor documentation fixes.
## [1.3.0] - 2023-04-28
This release breaks ABI/API compatibility with the previous versions in addition to breaking coordinates systems conversions between Unreal Engine and the SenseGlove libraries.
### Added
- A new generic SenseGlove Debug module.
- A debug virtual hand.
### Fixed
- Fix the wrist tracker miscalculations for the Quest 2 controllers (other headsets might need fixing as well, in that case, future releases will address that).
- Minor code improvement and fixes.
- Minor documentation fixes.
### Changed
- Breaking API/ABI changes in the Settings and the main SenseGlove module due to some settings refactoring.
- Breaking changes in the SenseGlove/Unreal coordinates systems conversions due to underlying changes in the SenseGlove Core Libraries.
- SenseGlove libraries have been updated to v2.6.0-aac3d56.
## [1.2.1] - 2023-03-30
### Fixed
- Fix RunUAT build issues with Android.
## [v1.2.0] - 2023-03-28
## [1.2.0] - 2023-03-28
This release breaks ABI/API compatibility with the previous versions.
@@ -35,7 +413,7 @@ This release breaks ABI/API compatibility with the previous versions.
### Removed
- Removed a few thousands lines of archaic pre-public-release dead code.
- Removed a few thousand lines of archaic pre-public-release dead code.
- Dropped Android NDK r21b binaries used by the older engine versions.
- Purged the dead code for dropped engine versions by v1.1.1 (4.22, 4.23, 4.24, 4.25, and 4.26) that carried over to the current version.
- Removed redundant SGConnectImpl/SGPlatform.
@@ -67,7 +445,7 @@ This release breaks ABI/API compatibility with the previous versions.
- Whitelist Android as a target platform.
- Introduce Android support.
- Add third-pary library SGConnect for Android v1.1.0.
- Add third-party library SGConnect for Android v1.1.0.
### Fixed
@@ -109,7 +487,7 @@ This is a minor release focusing on adherence to the Unreal Engine Marketplace G
### Added
- Added the newly acquired Unreal Engine Market Place Offer ID to the .uplugin file.
- List the dot files inside FilterPlugin.ini file as well.
- List the dotfiles inside the FilterPlugin.ini file as well.
- Add the copyright notice to the source files missing it.
- Add the SenseGlove SDK license to the third-party license file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13
View File
@@ -85,3 +85,16 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
## Allbreaker Virtual Hand Models
```
The virtual hand model mesh included in this plugin, situated within the
Contents/Meshes/Allbreaker folder, is graciously supplied by Allbreaker LLC
Colombia. This provision is made pursuant to an agreement between SenseGlove
B.V. and Allbreaker LLC. Users of this plugin are bound by the terms outlined in
the license agreement and are advised to review the terms and conditions
specified therein.
Please visit https://www.allbreaker.co/ to obtain information about the work of
Allbreaker.
```
+1 -1
View File
@@ -5,7 +5,7 @@ The SenseGlove plug-in for Unreal Engine is licensed under the terms of the MIT
```
MIT License
Copyright (c) 2020 - 2023 SenseGlove
Copyright (c) 2020 - 2024 SenseGlove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+109 -76
View File
@@ -6,17 +6,19 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
## Platform Support Matrix
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux (Native Toolchain)** | **macOS** | **Oculus Mobile (Android NDK)** |
|:--------:|:-----------------------:|:-----------------------:|:-----------------------:|:----------------------------:|:---------:|:-------------------------------:|
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | |
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | ❌ |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | ❌ |
| **4.27** | v1.2.x | v1.2.x | v1.2.x | v1.2.x | | v1.2.x (r21e) |
| **5.0** | v1.2.x | v1.2.x | ✅ v1.2.x | v1.2.x | ❌ | ✅ v1.2.x (r21e) |
| **5.1** | v1.2.x | v1.2.x | ✅ v1.2.x | v1.2.x | ❌ | ✅ v1.2.x (r25b) |
| **5.2** | v1.2.x | v1.2.x | ✅ v1.2.x | v1.2.x | ❌ | ✅ v1.2.x (r25b) |
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Android (NDK)** | **UE Marketplace Version** | **Azure DevOps Version** |
|----------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:-----------------:|:--------------------------:|:------------------------:|
| **5.4** | | ❌ | ✅ v2.0.x | ✅ v2.0.x | v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.3 | ✅ v2.0.3 |
| **5.3** | ❌ | ✅ v2.0.x | v2.0.x | ✅ v2.0.x | v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.3 | ✅ v2.0.3 |
| **5.2** | ❌ | ✅ v2.0.x | v2.0.x | ✅ v2.0.x | v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.3 | ✅ v2.0.3 |
| **5.1** | ❌ | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x (r25b) | ⚠️ v2.0.1 | ⚠️ v2.0.2 |
| **5.0** | ❌ | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x (r21e) | ⚠️ v1.6.1 | ⚠️ v1.6.1 |
| **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
* <code>✅</code> Supported
* <code>⚠️</code> Not supported by the latest release and might be lacking features
@@ -24,11 +26,10 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
* <code>❓</code> Unknown or untested
Remarks:
* Microsoft Visual Studio 2022 is not supported by Unreal Engine 4.22 through 4.26.
* Per [Epic's Marketplace Guidelines](https://www.unrealengine.com/en-US/marketplace-guidelines) in regards to Code Plugins (sections 2.6.3.d and 3.1.b), we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps.
* All third-party libraries on Windows built against Windows SDK 10.0.
* Oculus support is only provided through the recommended Android NDK versions by Epic Games.
* The Unreal Engine 4.27+ support is provided for Android/Oculus development.
* [wjwwood/serial](https://github.com/wjwwood/serial) requires Android NDK API Level 28+ in order to be built successfully, thus some older NDKs such as r14b.
* Oculus and VIVE support is only provided through the recommended Android NDK versions by Epic Games.
* [wjwwood/serial](https://github.com/wjwwood/serial) requires Android NDK API Level 28+ in order to be built successfully.
* All third-party libraries target Android NDK API Level 29, thus any project relying on the plug-in should be build with the same NDK API Level.
## Changelog
@@ -51,10 +52,60 @@ The following modules are intended to be used by the C++ users of this plugin:
Please note that modules postfixed with **Impl** are intended for interal use and are discouraged to be used by the users of the API. The modules postfixed with **Kismet** are exposing the functionality of the equivalent modules to Blueprints. For other modules descriptions, please see [the Directory Structure section](#directory-structure).
## Planned Features Completion Status
### Implemented as of v2.0.3
- [X] Full SenseGlove low-level core API access through Unreal C++.
- [X] Full SenseGlove low-level core API access through Blueprint.
- [X] DK 1 Support.
- [X] Nova 1 Support.
- [X] Nova 2 Support.
- [X] Support for Microsoft Windows as a development platform.
- [X] Support for GNU/Linux as a development platform.
- [X] Support for Microsoft Windows as a deployment platform.
- [X] Support for GNU/Linux x64 as a deployment platform.
- [X] Support for GNU/Linux AArch64 as a deployment platform.
- [X] Support for Android as a deployment platform.
- [X] Support for Oculus Quest 2 and Oculus Quest Pro.
- [X] Support for HTC VIVE Pro and HTC VIVE Focus 3.
- [X] Support for HTC VIVE Trackers and HTC VIVE Wrist Trackers.
- [X] On-device calibration for Android without the need for SenseCom.
- [X] Haptic feedback including force feedback, buzz, and thumper commands.
- [X] A customizable Grab component that could be added to any actor.
- [X] A customizable Touch component that could be added to any actor.
- [X] Ability to grab, release, and throw objects around.
- [X] Separation of the real and virtual hand rendering.
- [X] An out-of-the-box customizable SGPawn with the ability to be extended in C++ and Blueprint.
- [X] Easy wrist/hand tracking debugging using the SenseGlove Debug module.
- [X] A generic Settings module with the ability to override settings.
- [X] C++/Blueprint interaction events such as OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch.
- [X] A default hand mesh rigged with the standard SenseGlove default hand pose.
### Upcoming features planned for the v2.1.0 release
- [ ] OpenXR-compatible hand tracking (XR_EXT_hand_tracking) support.
- [ ] FXRMotionControllerData compatible hand animation system.
- [ ] FXRMotionControllerData compatible wrist tracking system.
- [ ] FXRMotionControllerData compatible hand interaction manipulation system.
- [ ] Ability to fallback to hand tracking when a glove is not present and use the bare hands for interactions, or a combination of glove and hand tracking if no motion controller input is detected.
### Planned features long-term
- [ ] Get tracking input from sources other than a SenseGlove device.
- [ ] Be able to assign behaviors to different objects (meshes) in the scene (e.g. Slider, Hinge, basic Grabables, etc).
- [ ] Make it so developers can define or extend their own behavior(s) to an object through Code / Blueprints (e.g. I want a car door that is like a slider, but follows a path rather than a straight line).
- [ ] Make the hand(s) able to push around physics-driven objects (for as much as their behaviors allow) (in backlog).
- [ ] Be able to grab objects with up to 2 hands (and move them around with both hands at the same time in a way that seems realistic).
- [ ] Ensure that our virtual hands (and the objects they hold) do not phase through other physics objects (e.g. walls and tables).
- [ ] Allow other scripts to force a grab and/or release to occur (for example, when you place it apart at the designated location, it gets removed from your hand and snaps into place).
- [ ] Have some form of weight simulation by making certain objects harder to push, lowering manipulation speed, or making objects only moveable with two hands.
- [ ] (Optional) Make it so the fingers of your virtual hands do not clip inside the meshes you are holding (certain people see this as an indicator of how fast the Force-Feedback activates - but it's basically just rendering).
## Directory Structure
```
Source
/
├── Config
@@ -66,6 +117,10 @@ Source
├── SenseGloveAndroid (the Android-specific module)
├── SenseGloveBackend (responsible for initialization and deinitialization of the backend libraries)
├── SenseGloveBackendKismet (exposes Blueprints-specific functionality from the SenseGloveBackend module)
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
├── SenseGloveConnect (exposes part of the SGConnect low-level API to C++)
@@ -80,7 +135,7 @@ Source
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprints)
├── SenseGloveCoreTypes (exposes special public types from the SenseGloveCore module in order to be shared by with other modules)
├── SenseGloveDebug (a utility debug module)
├── SenseGloveEditor (the Editor module)
@@ -118,55 +173,15 @@ Source
├── android
│ │
│ ├── r21e (Android NDK r21e dependencies for UE 4.27 and 5.0)
│ │ │
│ │ │
│ │ ├── arm64 (64-bit Arm variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── armv7 (32-bit ARM variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── x64 (64-bit x86-64 variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ └── x86 (32-bit x86 variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── r25b (Android NDK r21b dependencies for UE 5.1)
│ │
│ ├── arm64 (64-bit Arm variant of Android)
├── arm64 (64-bit ARM variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
── armv7 (32-bit ARM variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ ├── x64 (64-bit x86-64 variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── x86 (32-bit x86 variant of Android)
── x64 (64-bit x86-64 variant of Android)
│ │
│ ├── debug
│ │
@@ -174,31 +189,49 @@ Source
├── linux
│ │
│ ├── v19 (UE 4.27 Linux dependencies)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ ├── v20 (UE 5.0 and 5.1 Linux dependencies)
│ │ │
│ │ ├── debug
│ │ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ └── release
│ │ └── x86-64 (dependencies targeting x86-64 Linux architecture)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
── v21 (UE 5.2 Linux dependencies)
── v21 (UE 5.2 Linux dependencies)
│ │ │
│ │ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ └── x86-64 (dependencies targeting x86-64 Linux architecture)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── v22 (UE 5.3 Linux dependencies)
│ │
│ ├── debug
│ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── release
│ └── x86-64 (dependencies targeting x86-64 Linux architecture)
│ │
│ ├── debug
│ │
│ └── release
└── win64
├── msvc141 (Microsoft Visual Studio 2017 dependencies)
│ │
│ ├── debug
│ │
│ └── release
├── msvc142 (Microsoft Visual Studio 2019 dependencies)
│ │
+54 -3
View File
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.2.1",
"VersionName": "2.0.2",
"FriendlyName": "SenseGlove",
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
"Category": "Virtual Reality",
@@ -27,6 +27,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -37,6 +38,29 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{
"Name": "SenseGloveBackend",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{
"Name": "SenseGloveBackendKismet",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -47,6 +71,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -57,6 +82,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -67,6 +93,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -77,6 +104,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -87,6 +115,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -97,6 +126,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -107,16 +137,18 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{
"Name": "SenseGloveCoreTypes",
"Name": "SenseGloveDebug",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -126,6 +158,7 @@
"LoadingPhase": "PostEngineInit",
"WhitelistPlatforms": [
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -136,6 +169,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -146,6 +180,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -156,6 +191,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -166,6 +202,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -176,6 +213,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -186,6 +224,7 @@
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
@@ -194,10 +233,22 @@
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
}
],
"Plugins": [
{
"Name": "OpenXR",
"Enabled": true,
"PlatformAllowList": [
"Android",
"Linux",
"Win64"
]
}
]
}
}
+1 -1
View File
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
+1 -1
View File
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -44,9 +44,9 @@
#include "Engine/SkeletalMesh.h"
#include "Math/Rotator.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGLog/SGLog.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "SGLog/SGLog.h"
FSGVirtualHandAnimInstanceProxy::FSGVirtualHandAnimInstanceProxy()
: FAnimInstanceProxy()
@@ -0,0 +1,129 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGlove/Components/SGGrabComponent.h"
#include "GameFramework/Actor.h"
struct USGGrabComponent::FImpl
{
/************************
* Static methods
************************/
/************************
* Owner object
************************/
USGGrabComponent* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGGrabComponent* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
/************************
* Methods
************************/
};
USGGrabComponent* USGGrabComponent::GetGrabComponent(const AActor* Actor)
{
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
{
return nullptr;
}
USGGrabComponent* GrabComponent = Cast<USGGrabComponent>(
Actor->GetComponentByClass(USGGrabComponent::StaticClass()));
return GrabComponent;
}
bool USGGrabComponent::IsGrabbable(const AActor* Actor)
{
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
{
return false;
}
const USGGrabComponent* GrabComponent = Cast<USGGrabComponent>(
Actor->GetComponentByClass(USGGrabComponent::StaticClass()));
if (!IsValid(GrabComponent))
{
return false;
}
return true;
}
USGGrabComponent::USGGrabComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer),
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
AttachmentLocationRule = EAttachmentRule::SnapToTarget;
AttachmentRotationRule = EAttachmentRule::KeepRelative;
AttachmentScaleRule = EAttachmentRule::KeepWorld;
bAttachmentWeldSimulatedBodies = true;
AttachmentSocketName = NAME_None;
DetachmentLocationRule = EDetachmentRule::KeepWorld;
DetachmentRotationRule = EDetachmentRule::KeepWorld;
DetachmentScaleRule = EDetachmentRule::KeepWorld;
bDetachmentCallModify = false;
bAffectPhysicsState = true;
}
USGGrabComponent::FImpl::FImpl(USGGrabComponent* InOwner)
: Owner(InOwner)
{
}
USGGrabComponent::FImpl::~FImpl() = default;
void USGGrabComponent::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,120 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGlove/Components/SGTouchComponent.h"
#include "GameFramework/Actor.h"
struct USGTouchComponent::FImpl
{
/************************
* Static methods
************************/
/************************
* Owner object
************************/
USGTouchComponent* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGTouchComponent* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
/************************
* Methods
************************/
};
USGTouchComponent* USGTouchComponent::GetTouchComponent(const AActor* Actor)
{
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
{
return nullptr;
}
USGTouchComponent* TouchComponent = Cast<USGTouchComponent>(
Actor->GetComponentByClass(USGTouchComponent::StaticClass()));
return TouchComponent;
}
bool USGTouchComponent::IsTouchable(const AActor* Actor)
{
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
{
return false;
}
const USGTouchComponent* TouchComponent = Cast<USGTouchComponent>(
Actor->GetComponentByClass(USGTouchComponent::StaticClass()));
if (!IsValid(TouchComponent))
{
return false;
}
return true;
}
USGTouchComponent::USGTouchComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer),
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
ForceFeedbackLevel = 1.0f;
VibrotactileDuration = 0.25f;
VibrotactileLevel = 0.0f;
}
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
: Owner(InOwner)
{
}
USGTouchComponent::FImpl::~FImpl() = default;
void USGTouchComponent::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -38,16 +38,15 @@
#include "Animation/Skeleton.h"
#include "Components/SkeletalMeshComponent.h"
#include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UnrealTypeTraits.h"
#include "UObject/ConstructorHelpers.h"
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
#include "SGConnect/SGConnect.h"
#include "SGCore/SGDeviceList.h"
#include "SenseGlove/Components/SGWristTrackerComponent.h"
#include "SGBackend/SGBackend.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGDebug/SGDebugVirtualHand.h"
#include "SGLog/SGLog.h"
struct USGVirtualHandComponent::FImpl
@@ -58,29 +57,29 @@ struct USGVirtualHandComponent::FImpl
FORCEINLINE static const FString& GetDefaultLeftHandMeshPath()
{
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_VirtualHand_Left'")};
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Left.SK_Allbreaker_VirtualHand_Left'")};
return Path;
}
FORCEINLINE static const FString& GetDefaultLeftHandMeshPathOnly()
{
static const FString Path{TEXT("/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_VirtualHand_Left")};
static const FString Path{TEXT("/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Left.SK_Allbreaker_VirtualHand_Left")};
return Path;
}
FORCEINLINE static const FString& GetDefaultRightHandMeshPath()
{
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Right.SK_SenseGlove_VirtualHand_Right'")};
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Right.SK_Allbreaker_VirtualHand_Right'")};
return Path;
}
FORCEINLINE static const FString& GetDefaultRightHandMeshPathOnly()
{
static const FString Path{TEXT("/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Right.SK_SenseGlove_VirtualHand_Right")};
static const FString Path{TEXT("/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Right.SK_Allbreaker_VirtualHand_Right")};
return Path;
}
@@ -111,6 +110,7 @@ struct USGVirtualHandComponent::FImpl
bool IsEditor() const;
FString GetDefaultMeshPath() const;
bool IsUsingDefaultMesh() const;
bool IsUsingUserMesh() const;
USkeletalMesh* LoadDefaultMesh() const;
void SetDefaultMesh() const;
@@ -119,11 +119,14 @@ struct USGVirtualHandComponent::FImpl
USkeleton* GetSkeleton() const;
const FReferenceSkeleton& GetRefSkeleton() const;
bool InitializeBackend() const;
bool UninitializeBackend() const;
bool CheckGlove() const;
void SetVisibility(bool bInVisible) const;
FORCEINLINE void SetVisibility(const bool bInVisible) const
{
Owner->SetVisibility(bInVisible, true);
}
void DrawDebugVirtualHand() const;
};
const TArray<TArray<FName>>& USGVirtualHandComponent::GetLeftHandFingerBoneNames()
@@ -206,10 +209,40 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
bRight = true;
bHiddenInGameIfNoGloveDetected = false;
bAutoStopAllHapticsOnEndPlay = true;
GrabSocketName = FName{TEXT("GenericGrabPoint")};
DefaultFingertipsGrabColliderSize = FVector{0.08f, 0.08f, 0.08f};
ThumbFingertipGrabSocketName = FName{TEXT("GrabThumbFingertip")};
IndexFingertipGrabSocketName = FName{TEXT("GrabIndexFingertip")};
MiddleFingertipGrabSocketName = FName{TEXT("GrabMiddleFingertip")};
DefaultFingertipsTouchColliderSize = FVector{0.08f, 0.08f, 0.08f};
ThumbFingertipTouchSocketName = FName{TEXT("TouchThumbFingertip")};
IndexFingertipTouchSocketName = FName{TEXT("TouchIndexFingertip")};
MiddleFingertipTouchSocketName = FName{TEXT("TouchMiddleFingertip")};
RingFingertipTouchSocketName = FName{TEXT("TouchRingFingertip")};
PinkyFingertipTouchSocketName = FName{TEXT("TouchPinkyFingertip")};
DebugVirtualHandSettings = FSGDebugVirtualHandSettings{
false,
ESGDebugVirtualHandDrawingMode::None,
FVector(0.5f, 0.5f, 0.5f),
FColor(255, 0, 0, 255),
0.1f, 1.0f, 1.0f,
FColor(255, 0, 0, 255),
FColor(0, 255, 0, 255),
FColor(0, 0, 255, 255),
false, 1.1f, 0
};
Super::SetSkeletalMesh(nullptr, true);
bBackendInitialized = false;
Glove = nullptr;
WristTracker = nullptr;
}
void USGVirtualHandComponent::SetRight(const bool bInRight)
@@ -224,7 +257,7 @@ void USGVirtualHandComponent::SetRight(const bool bInRight)
void USGVirtualHandComponent::SetAnimClass(UClass* NewClass)
{
ensureAlwaysMsgf(Cast<USGVirtualHandAnimInstance>(NewClass),
ensureAlwaysMsgf((TIsDerivedFrom<decltype(NewClass), USGVirtualHandAnimInstance>::IsDerived),
TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!"));
Super::SetAnimClass(NewClass);
@@ -269,34 +302,34 @@ void USGVirtualHandComponent::InitializeComponent()
Pimpl->SetDefaultMesh();
}
if (Pimpl->InitializeBackend())
{
(void) Pimpl->CheckGlove();
}
(void) Pimpl->CheckGlove();
}
void USGVirtualHandComponent::UninitializeComponent()
{
Super::UninitializeComponent();
(void) Pimpl->UninitializeBackend();
if (IsValid(Glove) && AutoStopsAllHapticsOnEndPlay())
{
Glove->StopHaptics();
}
}
void USGVirtualHandComponent::BeginPlay()
{
Super::BeginPlay();
if (Pimpl->InitializeBackend())
{
(void) Pimpl->CheckGlove();
}
(void) Pimpl->CheckGlove();
}
void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
(void) Pimpl->UninitializeBackend();
if (IsValid(Glove) && AutoStopsAllHapticsOnEndPlay())
{
Glove->StopHaptics();
}
}
void USGVirtualHandComponent::TickComponent(
@@ -313,6 +346,11 @@ void USGVirtualHandComponent::TickComponent(
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
(void) Pimpl->CheckGlove();
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
}
void USGVirtualHandComponent::SetSkeletalMesh(USkeletalMesh* NewMesh, const bool bReinitPose)
@@ -331,6 +369,11 @@ void USGVirtualHandComponent::EditorTick(
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
(void) Pimpl->CheckGlove();
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
}
bool USGVirtualHandComponent::IsGloveConnected() const
@@ -344,13 +387,7 @@ USGHandPose* USGVirtualHandComponent::GetHandPose()
if (IsValid(Glove))
{
#if ! PLATFORM_ANDROID
Glove->GetHandPose(this, HandPose);
#else /* ! PLATFORM_ANDROID */
const UWorld* World{GetWorld()};
const float DeltaTime = UGameplayStatics::GetWorldDeltaSeconds(World);
Glove->GetHandPose(this, DeltaTime, HandPose);
#endif /* ! PLATFORM_ANDROID */
}
return HandPose;
@@ -386,8 +423,8 @@ const FTransform& USGVirtualHandComponent::GetFingerBoneRefTransform(const int32
FRotator USGVirtualHandComponent::GetFingerBoneRefRotation(const int32 Finger, const int32 Joint) const
{
const FTransform BoneTransform{GetFingerBoneRefTransform(Finger, Joint)};
FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
return MoveTemp(BoneRotation);
const FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
return BoneRotation;
}
TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
@@ -396,16 +433,16 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
if (!IsGloveConnected())
{
return MoveTemp(Rotations);
return Rotations;
}
const USGHandPose* HandPose = GetHandPose();
if (!IsValid(HandPose))
{
return MoveTemp(Rotations);
return Rotations;
}
const TArray<TArray<FVector>> HandAngles{HandPose->GetHandAngles()};
const TArray<TArray<FVector>>& HandAngles{HandPose->GetHandAngles()};
for (int32 FingerIndex = 0; FingerIndex < HandAngles.Num(); ++FingerIndex)
{
@@ -414,7 +451,7 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
for (int32 JointIndex = 0; JointIndex < FingerJointAngles.Num(); ++JointIndex)
{
const FVector& JointAngle{FingerJointAngles[JointIndex]};
const FQuat JointRotation{FQuat::MakeFromEuler(JointAngle)};
const FQuat JointRotation{FQuat::MakeFromEuler(FVector{-JointAngle.Y, -JointAngle.X, -JointAngle.Z})};
const FTransform& BoneRefTransform{GetFingerBoneRefTransform(FingerIndex, JointIndex)};
@@ -426,7 +463,7 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
}
}
return MoveTemp(Rotations);
return Rotations;
}
USGVirtualHandComponent::FImpl::FImpl(USGVirtualHandComponent* InOwner)
@@ -460,7 +497,31 @@ FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
SkeletalMeshPath = GetDefaultLeftHandMeshPath();
}
return MoveTemp(SkeletalMeshPath);
return SkeletalMeshPath;
}
bool USGVirtualHandComponent::FImpl::IsUsingDefaultMesh() const
{
const USkeletalMesh* CurrentMesh{GetMesh()};
if (!IsValid(CurrentMesh))
{
return false;
}
const FString CurrentMeshPath(CurrentMesh->GetPathName());
const FString LeftHandDefaultMeshPath(GetDefaultLeftHandMeshPath());
const FString LeftHandDefaultMeshPathOnly(GetDefaultLeftHandMeshPathOnly());
const FString RightHandDefaultMeshPath(GetDefaultRightHandMeshPath());
const FString RightHandDefaultMeshPathOnly(GetDefaultRightHandMeshPathOnly());
if (CurrentMeshPath == LeftHandDefaultMeshPath
|| CurrentMeshPath == LeftHandDefaultMeshPathOnly
|| CurrentMeshPath == RightHandDefaultMeshPath
|| CurrentMeshPath == RightHandDefaultMeshPathOnly)
{
return true;
}
return false;
}
bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
@@ -509,13 +570,7 @@ void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
USkeletalMesh* USGVirtualHandComponent::FImpl::GetMesh() const
{
return Owner->
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1
GetSkeletalMeshAsset()
#else /* ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 */
SkeletalMesh
#endif /* ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 */
;
return Owner->GetSkeletalMeshAsset();
}
USkeleton* USGVirtualHandComponent::FImpl::GetSkeleton() const
@@ -532,114 +587,29 @@ const FReferenceSkeleton& USGVirtualHandComponent::FImpl::GetRefSkeleton() const
return Mesh->GetRefSkeleton();
}
bool USGVirtualHandComponent::FImpl::InitializeBackend() const
{
if (!Owner->bBackendInitialized)
{
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Init();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Device Scanning is already running within a different program.");
return false;
case -1:
SGLOG_ERROR("Device Scanning already being initialized (function called twice in short succession).");
return false;
case 0:
// Do not pollute the logs!
//SGLOG_ERROR("Device Scanning is already running within this program.");
// We must return here in case there are two virtual hand components are present in the scene.
return true;
case 1:
SGLOG("Successfully started up DeviceScanning from the current program.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Init return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
// Ensure that the device list is empty before doing anything.
FSGDeviceList::Dispose();
FSGDeviceList::Reinitialize();
// Load the latest hand profiles.
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
Owner->bBackendInitialized = true;
return true;
}
return false;
}
bool USGVirtualHandComponent::FImpl::UninitializeBackend() const
{
// NOTE
// In Editor builds we should be avoiding dispose, since stopping the game in PIE mode, causes the virtual-hand
// to disappear in the editor as the plugin won't be able to retrieve the glove status anymore.
#if ! WITH_EDITOR
if (Owner->bBackendInitialized)
{
FSGDeviceList::Dispose();
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Dispose();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Not allowed to dispose of Device Scanning because this is not the program which started it.");
return false;
case -1:
SGLOG_ERROR("Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).");
return false;
case 0:
SGLOG_ERROR("There is no deviceScanner running from any program, so disposing is skipped.");
return false;
case 1:
SGLOG("Successfully disposed of DeviceScanner resources.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Dispose return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
Owner->bBackendInitialized = false;
return true;
}
#endif /* ! WITH_EDITOR */
return false;
}
bool USGVirtualHandComponent::FImpl::CheckGlove() const
{
if (!Owner->bBackendInitialized)
if (!USGBackend::GetInstance()->IsBackendInitialized())
{
const bool bSucceeded = InitializeBackend();
const bool bSucceeded = USGBackend::GetInstance()->InitializeBackend();
if (!bSucceeded)
{
return false;
}
}
const bool bGloveWasPresent = IsValid(Owner->Glove);
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bFoundGlove && bGloveWasPresent)
bool bGloveConnected;
if (!IsValid(Owner->Glove) || !Owner->Glove->IsConnected())
{
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
bGloveConnected = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bGloveConnected)
{
Owner->Glove = nullptr;
}
}
else
{
bGloveConnected = true;
}
const bool bIsEditor = IsEditor();
@@ -648,7 +618,7 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
const bool bIsVisible = Owner->IsVisible();
if (Owner->bHiddenInGameIfNoGloveDetected)
{
if (bFoundGlove)
if (bGloveConnected)
{
if (!bIsVisible)
{
@@ -672,12 +642,32 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
}
}
return bFoundGlove;
return bGloveConnected;
}
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) const
void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
{
Owner->SetVisibility(bInVisible, true);
const UWorld* World{Owner->GetWorld()};
if (!IsValid(Owner->WristTracker))
{
return;
}
const FVector& WristLocation{Owner->WristTracker->GetWristLocation()};
const FRotator& WristRotation{Owner->WristTracker->GetWristRotation()};
const USGHandPose* HandPose{Owner->GetHandPose()};
if (!IsValid(HandPose))
{
return;
}
const TArray<TArray<FVector>>& JointPositions{HandPose->GetJointPositions()};
const TArray<TArray<FRotator>>& JointRotations{HandPose->GetJointRotations()};
FSGDebugVirtualHand::Draw(World, WristLocation, WristRotation, JointPositions, JointRotations,
Owner->DebugVirtualHandSettings);
}
void USGVirtualHandComponent::FImplDeleter::operator()(const FImpl* P) const
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -37,15 +37,12 @@
#include "Animation/Skeleton.h"
#include "Components/SkeletalMeshComponent.h"
#include "DrawDebugHelpers.h"
#include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h"
#include "UObject/ConstructorHelpers.h"
#include "SGConnect/SGConnect.h"
#include "SGCore/SGDeviceList.h"
#include "SGBackend/SGBackend.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGDebug/SGDebugGizmo.h"
#include "SGLog/SGLog.h"
#include "SGSettings/SGSettings.h"
@@ -81,10 +78,9 @@ struct USGWristTrackerComponent::FImpl
bool IsEditor() const;
bool InitializeBackend() const;
bool UninitializeBackend() const;
bool CheckGlove() const;
void UpdateMotionSource() const;
void UpdateWristTrackingData() const;
void DrawDebugGizmo();
};
@@ -107,377 +103,61 @@ USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& Obj
SetReceivesDecals(false);
SetCanEverAffectNavigation(false);
SetRight(true);
bOverridePluginWristTrackingSettings = false;
bDrawDebugWristTrackerGizmo = false;
TrackingHardware = ESGPositionalTrackingHardware::None;
TrackingHardwareLocationOffset = FVector::ZeroVector;
TrackingHardwareLocationOffset = FVector::ZeroVector;
WristTrackingSettings = FSGWristTrackingSettings(
ESGPositionalTrackingHardware::None,
FVector::ZeroVector,
FVector::ZeroVector,
FRotator::ZeroRotator,
FRotator::ZeroRotator,
EControllerHand::Left,
EControllerHand::Right,
false,
FSGDebugGizmoSettings(
4.0f, 1.0f,
FColor(255, 0, 0, 255),
FColor(0, 255, 0, 255),
FColor(0, 0, 255, 255),
false, 1.1f, 0
)
);
bOverridePluginWristTrackingDebugSettings = false;
bDrawDebugWristTrackerGizmo = false;
DebugWristTrackerGizmoLength = 1.0f;
DebugWristTrackerGizmoXAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoYAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f);
bDebugWristTrackerGizmoPersistentLines = false;
DebugWristTrackerGizmoLifeTimeModifier = 1.1f;
DebugWristTrackerGizmoDepthPriority = 0;
DebugWristTrackerGizmoThickness = 1.0f;
bRight = true;
bBackendInitialized = false;
Glove = nullptr;
WristLocation = FVector::ZeroVector;
WristRotation = FRotator::ZeroRotator;
}
void USGWristTrackerComponent::SetRight(const bool bRight)
void USGWristTrackerComponent::SetRight(const bool bInRight)
{
SetTrackingSource(bRight ? EControllerHand::Right : EControllerHand::Left);
bRight = bInRight;
Pimpl->UpdateMotionSource();
}
ESGPositionalTrackingHardware USGWristTrackerComponent::GetTrackingHardware() const
const FSGWristTrackingSettings& USGWristTrackerComponent::GetWristTrackingSettings() const
{
if (OverridesPluginWristTrackingSettings())
{
return TrackingHardware;
return WristTrackingSettings;
}
return USGSettings::GetInstance()->GetTrackingHardware();
const USGSettings* Settings{USGSettings::GetInstance()};
if (!ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!")))
{
return WristTrackingSettings;
}
return Settings->GetWristTrackingSettings();
}
void USGWristTrackerComponent::SetTrackingHardware(const ESGPositionalTrackingHardware InTrackingHardware)
void USGWristTrackerComponent::SetWristTrackingSettings(const FSGWristTrackingSettings& InWristTrackingSettings)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingSettings(),
TEXT( "Setting TrackingHardware is only permitted when bOverridePluginWristTrackingSettings is enabled!"));
TEXT( "Setting WristTrackingSettings is only permitted when bOverridePluginWristTrackingSettings is enabled!"));
TrackingHardware = InTrackingHardware;
}
const FVector& USGWristTrackerComponent::GetTrackingHardwareLocationOffset() const
{
ensureAlwaysMsgf(
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
TEXT( "Getting TrackingHardwareLocationOffset is only permitted when TrackingHardware is set to Custom!"));
if (OverridesPluginWristTrackingSettings())
{
return TrackingHardwareLocationOffset;
}
return IsRight()
? USGSettings::GetInstance()->GetTrackingHardwareLocationOffsetRightHand()
: USGSettings::GetInstance()->GetTrackingHardwareLocationOffsetLeftHand();
}
void USGWristTrackerComponent::SetTrackingHardwareLocationOffset(const FVector& InTrackingHardwareLocationOffset)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingSettings(),
TEXT(
"Setting TrackingHardwareLocationOffset is only permitted when bOverridePluginWristTrackingSettings is enabled!"
));
ensureAlwaysMsgf(
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
TEXT( "Setting TrackingHardwareLocationOffset is only permitted when TrackingHardware is set to Custom!"));
TrackingHardwareLocationOffset = InTrackingHardwareLocationOffset;
}
const FRotator& USGWristTrackerComponent::GetTrackingHardwareRotationOffset() const
{
ensureAlwaysMsgf(
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
TEXT( "Getting TrackingHardwareRotationOffset is only permitted when TrackingHardware is set to Custom!"));
if (OverridesPluginWristTrackingSettings())
{
return TrackingHardwareRotationOffset;
}
return IsRight()
? USGSettings::GetInstance()->GetTrackingHardwareRotationOffsetRightHand()
: USGSettings::GetInstance()->GetTrackingHardwareRotationOffsetLeftHand();
}
void USGWristTrackerComponent::SetTrackingHardwareRotationOffset(const FRotator& InTrackingHardwareRotationOffset)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingSettings(),
TEXT(
"Setting TrackingHardwareRotationOffset is only permitted when bOverridePluginWristTrackingSettings is enabled!"
));
ensureAlwaysMsgf(
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
TEXT("Setting TrackingHardwareRotationOffsetRightHand is only permitted when TrackingHardware is set to Custom!"
));
TrackingHardwareRotationOffset = InTrackingHardwareRotationOffset;
}
bool USGWristTrackerComponent::GetDrawDebugWristTrackerGizmo() const
{
if (OverridesPluginWristTrackingDebugSettings())
{
return !!bDrawDebugWristTrackerGizmo;
}
return USGSettings::GetInstance()->GetDrawDebugWristTrackerGizmo();
}
void USGWristTrackerComponent::SetDrawDebugWristTrackerGizmo(const bool bInDrawDebugWristTrackerGizmo)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT( "Setting bDrawDebugWristTrackerGizmo is only permitted when bOverridePluginWristTrackingDebugSettings is"
" enabled!"));
bDrawDebugWristTrackerGizmo = bInDrawDebugWristTrackerGizmo;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLength() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoLength;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLength();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLength(const float InDebugWristTrackerGizmoLength)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bOverridePluginWristTrackingDebugSettings is"
" enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
DebugWristTrackerGizmoLength = InDebugWristTrackerGizmoLength;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoXAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoXAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoXAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoXAxisColor(
const FColor& InDebugWristTrackerGizmoXAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoXAxisColor = InDebugWristTrackerGizmoXAxisColor;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoYAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoYAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoYAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoYAxisColor(
const FColor& InDebugWristTrackerGizmoYAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoYAxisColor = InDebugWristTrackerGizmoYAxisColor;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoZAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoZAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoZAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoZAxisColor(
const FColor& InDebugWristTrackerGizmoZAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoZAxisColor = InDebugWristTrackerGizmoZAxisColor;
}
bool USGWristTrackerComponent::GetDebugWristTrackerGizmoPersistentLines() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return !!bDebugWristTrackerGizmoPersistentLines;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoPersistentLines();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoPersistentLines(
const bool bInDebugWristTrackerGizmoPersistentLines)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoPersistentLines is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
bDebugWristTrackerGizmoPersistentLines = bInDebugWristTrackerGizmoPersistentLines;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLifeTimeModifier() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoLifeTimeModifier;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLifeTimeModifier();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLifeTimeModifier(
const float InDebugWristTrackerGizmoLifeTimeModifier)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoLifetimeModifier is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoLifeTimeModifier = InDebugWristTrackerGizmoLifeTimeModifier;
}
uint8 USGWristTrackerComponent::GetDebugWristTrackerGizmoDepthPriority() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoDepthPriority;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoDepthPriority();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoDepthPriority(const uint8 InDebugWristTrackerGizmoDepthPriority)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoDepthPriority = InDebugWristTrackerGizmoDepthPriority;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoThickness() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoThickness;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoThickness();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoDepthThickness is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
DebugWristTrackerGizmoThickness = InDebugWristTrackerGizmoThickness;
WristTrackingSettings = InWristTrackingSettings;
}
#if WITH_EDITOR
@@ -499,34 +179,18 @@ void USGWristTrackerComponent::InitializeComponent()
{
Super::InitializeComponent();
if (Pimpl->InitializeBackend())
{
(void) Pimpl->CheckGlove();
}
}
(void) Pimpl->CheckGlove();
void USGWristTrackerComponent::UninitializeComponent()
{
Super::UninitializeComponent();
(void) Pimpl->UninitializeBackend();
Pimpl->UpdateMotionSource();
}
void USGWristTrackerComponent::BeginPlay()
{
Super::BeginPlay();
if (Pimpl->InitializeBackend())
{
(void) Pimpl->CheckGlove();
}
}
(void) Pimpl->CheckGlove();
void USGWristTrackerComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
(void) Pimpl->UninitializeBackend();
Pimpl->UpdateMotionSource();
}
void USGWristTrackerComponent::TickComponent(
@@ -542,7 +206,7 @@ void USGWristTrackerComponent::TickComponent(
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (GetDrawDebugWristTrackerGizmo())
if (!!WristTrackingSettings.bDrawWristTrackerDebugGizmo)
{
Pimpl->DrawDebugGizmo();
}
@@ -575,140 +239,69 @@ bool USGWristTrackerComponent::FImpl::IsEditor() const
return false;
}
bool USGWristTrackerComponent::FImpl::InitializeBackend() const
{
if (!Owner->bBackendInitialized)
{
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Init();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Device Scanning is already running within a different program.");
return false;
case -1:
SGLOG_ERROR("Device Scanning already being initialized (function called twice in short succession).");
return false;
case 0:
// Do not pollute the logs!
//SGLOG_ERROR("Device Scanning is already running within this program.");
// We must return here in case there are two virtual hand components are present in the scene.
return true;
case 1:
SGLOG("Successfully started up DeviceScanning from the current program.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Init return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
// Ensure that the device list is empty before doing anything.
FSGDeviceList::Dispose();
FSGDeviceList::Reinitialize();
// Load the latest hand profiles.
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
Owner->bBackendInitialized = true;
return true;
}
return false;
}
bool USGWristTrackerComponent::FImpl::UninitializeBackend() const
{
// NOTE
// In Editor builds we should be avoiding dispose, since stopping the game in PIE mode, causes the virtual-hand
// to disappear in the editor as the plugin won't be able to retrieve the glove status anymore.
#if ! WITH_EDITOR
if (Owner->bBackendInitialized)
{
FSGDeviceList::Dispose();
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Dispose();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Not allowed to dispose of Device Scanning because this is not the program which started it.");
return false;
case -1:
SGLOG_ERROR("Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).");
return false;
case 0:
SGLOG_ERROR("There is no deviceScanner running from any program, so disposing is skipped.");
return false;
case 1:
SGLOG("Successfully disposed of DeviceScanner resources.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Dispose return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
Owner->bBackendInitialized = false;
return true;
}
#endif /* ! WITH_EDITOR */
return false;
}
bool USGWristTrackerComponent::FImpl::CheckGlove() const
{
if (!Owner->bBackendInitialized)
if (!USGBackend::GetInstance()->IsBackendInitialized())
{
const bool bSucceeded = InitializeBackend();
const bool bSucceeded = USGBackend::GetInstance()->InitializeBackend();
if (!bSucceeded)
{
return false;
}
}
const bool bGloveWasPresent = IsValid(Owner->Glove);
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bFoundGlove && bGloveWasPresent)
bool bGloveConnected;
if (!IsValid(Owner->Glove) || !Owner->Glove->IsConnected())
{
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
bGloveConnected = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bGloveConnected)
{
Owner->Glove = nullptr;
}
}
if (bFoundGlove)
else
{
bGloveConnected = true;
UpdateWristTrackingData();
}
return bFoundGlove;
return bGloveConnected;
}
void USGWristTrackerComponent::FImpl::UpdateMotionSource() const
{
if (GEngine)
{
Owner->SetTrackingSource(Owner->IsRight()
? Owner->GetWristTrackingSettings().RightHandMotionSource
: Owner->GetWristTrackingSettings().LeftHandMotionSource);
}
}
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
{
ensureAlwaysMsgf(Owner->Glove, TEXT("Invalid Glove!"));
FVector TrackerLocation{Owner->GetRelativeLocation()};
FRotator TrackerRotation{Owner->GetRelativeRotation()};
FVector TrackerLocation{Owner->GetComponentLocation()};
FRotator TrackerRotation{Owner->GetComponentRotation()};
ESGPositionalTrackingHardware TrackerHardware = Owner->GetTrackingHardware();
ESGPositionalTrackingHardware TrackerHardware = Owner->GetWristTrackingSettings().TrackingHardware;
if (TrackerHardware == ESGPositionalTrackingHardware::None)
{
TrackerHardware = ESGPositionalTrackingHardware::Custom;
}
else if (TrackerHardware == ESGPositionalTrackingHardware::Custom)
{
TrackerLocation += Owner->GetTrackingHardwareLocationOffset();
TrackerRotation += Owner->GetTrackingHardwareRotationOffset();
if (Owner->IsRight())
{
TrackerLocation += Owner->GetWristTrackingSettings().TrackingHardwareLocationOffsetRightHand;
TrackerRotation += Owner->GetWristTrackingSettings().TrackingHardwareRotationOffsetRightHand;
}
else
{
TrackerLocation += Owner->GetWristTrackingSettings().TrackingHardwareLocationOffsetLeftHand;
TrackerRotation += Owner->GetWristTrackingSettings().TrackingHardwareRotationOffsetLeftHand;
}
}
FVector NewWristLocation;
@@ -748,26 +341,11 @@ void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
void USGWristTrackerComponent::FImpl::DrawDebugGizmo()
{
const UWorld* World{Owner->GetWorld()};
const FVector& Location{Owner->GetRelativeLocation()};
const FRotator& Rotation{Owner->GetRelativeRotation()};
const float Length = Owner->GetDebugWristTrackerGizmoLength();
const bool bPersistentLines = Owner->GetDebugWristTrackerGizmoPersistentLines();
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World)
* Owner->GetDebugWristTrackerGizmoLifeTimeModifier();
const float DepthPriority = Owner->GetDebugWristTrackerGizmoDepthPriority();
const float Thickness = Owner->GetDebugWristTrackerGizmoThickness();
const FColor& XAxisColor{Owner->GetDebugWristTrackerGizmoXAxisColor()};
const FColor& YAxisColor{Owner->GetDebugWristTrackerGizmoYAxisColor()};
const FColor& ZAxisColor{Owner->GetDebugWristTrackerGizmoZAxisColor()};
const FVector& Location{Owner->GetComponentLocation()};
const FRotator& Rotation{Owner->GetComponentRotation()};
const FSGDebugGizmoSettings& DebugGizmoSettings{Owner->GetWristTrackingSettings().WristTrackerDebugGizmoSettings};
const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Length, 0.0f, 0.0f)));
DrawDebugLine(World, Location, XAxisLineEnd, XAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Length, 0.0f}));
DrawDebugLine(World, Location, YAxisLineEnd, YAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Length})};
DrawDebugLine(World, Location, ZAxisLineEnd, ZAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
FSGDebugGizmo::Draw(World, Location, Rotation, DebugGizmoSettings);
}
void USGWristTrackerComponent::FImplDeleter::operator()(const FImpl* P) const
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,16 +33,25 @@
*/
#pragma once
#include "SenseGlove/Engine/SGGameInstance.h"
#include "Templates/SharedPointer.h"
#include "SGLog/SGLog.h"
class FSGHapticGloveCalibrationSequenceImpl;
class FSGHapticGloveQuickCalibrationImpl;
class SENSEGLOVECORE_API FSGHapticGloveCalibrationSequenceImplCast
USGGameInstance::USGGameInstance(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
public:
static TSharedRef<FSGHapticGloveQuickCalibrationImpl> ToHapticGloveQuickCalibrationImpl(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl);
};
}
void USGGameInstance::Init()
{
Super::Init();
SGLOG("Initializing the SenseGlove GameInstance...")
}
void USGGameInstance::Shutdown()
{
Super::Shutdown();
SGLOG("Shutting down the SenseGlove GameInstance...")
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
*/
#include "SenseGlove/GameFramework//SGGameModeBase.h"
#include "SenseGlove/GameFramework/SGGameModeBase.h"
#include "SenseGlove/GameFramework/SGPawn.h"
#include "SenseGlove/GameFramework/SGPlayerController.h"
File diff suppressed because it is too large Load Diff
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,12 +35,331 @@
#include "SenseGlove/GameFramework/SGPlayerController.h"
#include "Runtime/Launch/Resources/Version.h"
#if ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 )
#include "Engine/TimerHandle.h"
#else /* ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 ) */
#include "Engine/EngineTypes.h"
#endif /* ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 ) */
#include "TimerManager.h"
#include "SenseGlove/Components/SGTouchComponent.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "SenseGlove/GameFramework/SGPawn.h"
#include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCore/SGHapticGlove.h"
struct ASGPlayerController::FImpl
{
/************************
* Static methods
************************/
static float GetForceFeedbackLevel(const AActor* Actor);
static float GetVibrotactileDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static float GetVibrotactileLevel(const AActor* Actor);
static TArray<float> GetForceFeedbackLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static TArray<float> GetVibrotactileLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
/************************
* Member variables
************************/
FTimerHandle TouchVibrotactileStopTimer;
/************************
* Owner object
************************/
ASGPlayerController* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(ASGPlayerController* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
/************************
* Methods
************************/
void UpdateHapticsFeedback(const FSGTouchState& TouchState);
};
float ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
{
if (IsValid(Actor))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
if (IsValid(TouchComponent))
{
return TouchComponent->GetForceFeedbackLevel();
}
}
return 0.0f;
}
float ASGPlayerController::FImpl::GetVibrotactileDuration(const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
if (IsValid(ActorThumbTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorThumbTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorIndexTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorIndexTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorMiddleTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorMiddleTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorRingTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorRingTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorPinkyTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorPinkyTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
return 0.0f;
}
float ASGPlayerController::FImpl::GetVibrotactileLevel(const AActor* Actor)
{
if (IsValid(Actor))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileLevel();
}
}
return 0.0f;
}
TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
const float ThumbForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
const float IndexForceFeedbackLevel = GetForceFeedbackLevel(ActorIndexTouching);
const float MiddleForceFeedbackLevel = GetForceFeedbackLevel(ActorMiddleTouching);
const float RingForceFeedbackLevel = GetForceFeedbackLevel(ActorRingTouching);
const float PinkyForceFeedbackLevel = GetForceFeedbackLevel(ActorPinkyTouching);
const TArray<float> ForceFeedbackLevels{
ThumbForceFeedbackLevel,
IndexForceFeedbackLevel,
MiddleForceFeedbackLevel,
RingForceFeedbackLevel,
PinkyForceFeedbackLevel,
};
return ForceFeedbackLevels;
}
TArray<float> ASGPlayerController::FImpl::GetVibrotactileLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
const float ThumbVibrotactileLevel = GetVibrotactileLevel(ActorThumbTouching);
const float IndexVibrotactileLevel = GetVibrotactileLevel(ActorIndexTouching);
const float MiddleVibrotactileLevel = GetVibrotactileLevel(ActorMiddleTouching);
const float RingVibrotactileLevel = GetVibrotactileLevel(ActorRingTouching);
const float PinkyVibrotactileLevel = GetVibrotactileLevel(ActorPinkyTouching);
const TArray<float> ForceFeedbackLevels{
ThumbVibrotactileLevel,
IndexVibrotactileLevel,
MiddleVibrotactileLevel,
RingVibrotactileLevel,
PinkyVibrotactileLevel,
};
return ForceFeedbackLevels;
}
ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
: Super(ObjectInitializer),
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
}
void ASGPlayerController::SetupInputComponent()
void ASGPlayerController::BeginPlay()
{
Super::SetupInputComponent();
Super::BeginPlay();
ASGPawn* SGPawn = Cast<ASGPawn>(GetPawn());
if (!ensureAlwaysMsgf(IsValid(SGPawn), TEXT("%s"), TEXT("ERROR: invalid SenseGlove pawn!")))
{
return;
}
SGPawn->OnGrabStateUpdated().AddWeakLambda(
this, [= SG_CAPTURE_THIS](const FSGGrabState& GrabState) -> void
{
if (!IsValid(SGPawn))
{
return;
}
if (!IsValid(GrabState.Hand))
{
return;
}
if (SGPawn->IsGrabbing(GrabState.Hand))
{
if (!IsValid(GrabState.ActorThumbCanGrab) ||
(GrabState.ActorIndexCanGrab != GrabState.ActorThumbCanGrab
&& GrabState.ActorMiddleCanGrab != GrabState.ActorThumbCanGrab))
{
SGPawn->Release(GrabState.Hand);
}
}
else
{
if (SGPawn->CanGrab(GrabState.Hand, GrabState.ActorThumbCanGrab))
{
SGPawn->Grab(GrabState.Hand, GrabState.ActorThumbCanGrab);
}
}
});
SGPawn->OnTouchStateUpdated().AddWeakLambda(
this, [= SG_CAPTURE_THIS](const FSGTouchState& TouchState) -> void
{
Pimpl->UpdateHapticsFeedback(TouchState);
});
}
ASGPlayerController::FImpl::FImpl(ASGPlayerController* InOwner)
: Owner(InOwner)
{
}
ASGPlayerController::FImpl::~FImpl() = default;
void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState)
{
static const TArray<float> VibrotactileOffCommand{0.0f, 0.0f, 0.0, 0.0, 0.0f};
if (!IsValid(TouchState.Hand))
{
return;
}
USGHapticGlove* Glove = TouchState.Hand->GetConnectedGlove();
if (!IsValid(Glove))
{
return;
}
// Queue the Force-Feedback command...
TArray<float> ForceFeedbackLevels{
GetForceFeedbackLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
};
Glove->QueueForceFeedbackLevels(MoveTemp(ForceFeedbackLevels));
// Queue the Vibrotactile command...
TArray<float> VibrotactileLevels{
GetVibrotactileLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
};
Glove->QueueVibroLevels(MoveTemp(VibrotactileLevels));
// Send the haptics commands!
Glove->SendHaptics();
// Stop the Vibrotactile command after the timeout if a.
const float VibrotactileDuration = FImpl::GetVibrotactileDuration(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching);
Owner->GetWorldTimerManager().ClearTimer(TouchVibrotactileStopTimer);
FTimerDelegate TouchVibrotactileStopHandler;
TouchVibrotactileStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
{
if (IsValid(Glove))
{
Glove->QueueVibroLevels(VibrotactileOffCommand);
Glove->SendHaptics();
}
});
Owner->GetWorldTimerManager().SetTimer(
TouchVibrotactileStopTimer, TouchVibrotactileStopHandler, VibrotactileDuration, false, -1.0f);
}
void ASGPlayerController::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,6 +35,10 @@
#include "SenseGlove/GameFramework/SGVirtualHandActor.h"
#include "Components/SphereComponent.h"
#include "SenseGlove/Components/SGGrabComponent.h"
#include "SenseGlove/Components/SGTouchComponent.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "SenseGlove/Components/SGWristTrackerComponent.h"
@@ -63,6 +67,15 @@ struct ASGVirtualHandActor::FImpl
/************************
* Methods
************************/
void BindFingerGrabOverlapEvents();
void UnbindFingerGrabOverlapEvents();
void BindFingerTouchOverlapEvents();
void UnbindFingerTouchOverlapEvents();
bool IsFingerGrabbing(AActor* Actor) const;
bool IsFingerTouching(AActor* Actor) const;
};
ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitializer)
@@ -79,10 +92,165 @@ ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitial
VirtualHand->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
false, nullptr, ETeleportType::None);
ThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("ThumbFingertipGrabCollider"));
ThumbFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetThumbFingertipGrabSocketName());
ThumbFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
ThumbFingertipGrabCollider->SetCastShadow(false);
ThumbFingertipGrabCollider->bCastDynamicShadow = false;
ThumbFingertipGrabCollider->SetReceivesDecals(true);
ThumbFingertipGrabCollider->SetCanEverAffectNavigation(false);
ThumbFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
ThumbFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
ThumbFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
IndexFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("IndexFingertipGrabCollider"));
IndexFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
IndexFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetIndexFingertipGrabSocketName());
IndexFingertipGrabCollider->SetCastShadow(false);
IndexFingertipGrabCollider->bCastDynamicShadow = false;
IndexFingertipGrabCollider->SetReceivesDecals(true);
IndexFingertipGrabCollider->SetCanEverAffectNavigation(false);
IndexFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
IndexFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
IndexFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
MiddleFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("MiddleFingertipGrabCollider"));
MiddleFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
MiddleFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetMiddleFingertipGrabSocketName());
MiddleFingertipGrabCollider->SetCastShadow(false);
MiddleFingertipGrabCollider->bCastDynamicShadow = false;
MiddleFingertipGrabCollider->SetReceivesDecals(true);
MiddleFingertipGrabCollider->SetCanEverAffectNavigation(false);
MiddleFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
MiddleFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
MiddleFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
ThumbFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("ThumbFingertipTouchCollider"));
ThumbFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetThumbFingertipTouchSocketName());
ThumbFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
ThumbFingertipTouchCollider->SetCastShadow(false);
ThumbFingertipTouchCollider->bCastDynamicShadow = false;
ThumbFingertipTouchCollider->SetReceivesDecals(true);
ThumbFingertipTouchCollider->SetCanEverAffectNavigation(false);
ThumbFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
ThumbFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
ThumbFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
IndexFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("IndexFingertipTouchCollider"));
IndexFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
IndexFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetIndexFingertipTouchSocketName());
IndexFingertipTouchCollider->SetCastShadow(false);
IndexFingertipTouchCollider->bCastDynamicShadow = false;
IndexFingertipTouchCollider->SetReceivesDecals(true);
IndexFingertipTouchCollider->SetCanEverAffectNavigation(false);
IndexFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
IndexFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
IndexFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
MiddleFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("MiddleFingertipTouchCollider"));
MiddleFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
MiddleFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetMiddleFingertipTouchSocketName());
MiddleFingertipTouchCollider->SetCastShadow(false);
MiddleFingertipTouchCollider->bCastDynamicShadow = false;
MiddleFingertipTouchCollider->SetReceivesDecals(true);
MiddleFingertipTouchCollider->SetCanEverAffectNavigation(false);
MiddleFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
MiddleFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
MiddleFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
RingFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("RingFingertipTouchCollider"));
RingFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
RingFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetRingFingertipTouchSocketName());
RingFingertipTouchCollider->SetCastShadow(false);
RingFingertipTouchCollider->bCastDynamicShadow = false;
RingFingertipTouchCollider->SetReceivesDecals(true);
RingFingertipTouchCollider->SetCanEverAffectNavigation(false);
RingFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
RingFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
RingFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
PinkyFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("PinkyFingertipTouchCollider"));
PinkyFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
PinkyFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetPinkyFingertipTouchSocketName());
PinkyFingertipTouchCollider->SetCastShadow(false);
PinkyFingertipTouchCollider->bCastDynamicShadow = false;
PinkyFingertipTouchCollider->SetReceivesDecals(true);
PinkyFingertipTouchCollider->SetCanEverAffectNavigation(false);
PinkyFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
PinkyFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
PinkyFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
WristTracker = CreateDefaultSubobject<USGWristTrackerComponent>(TEXT("WristTracker"));
WristTracker->SetupAttachment(RootComponent);
WristTracker->SetRight(VirtualHand->IsRight());
GrabState = FSGGrabState(VirtualHand, FVector::Zero(), {}, nullptr, nullptr, nullptr, nullptr);
TouchState = FSGTouchState(VirtualHand, nullptr, nullptr, nullptr, nullptr, nullptr);
}
void ASGVirtualHandActor::BeginPlay()
@@ -96,13 +264,24 @@ void ASGVirtualHandActor::BeginPlay()
WristTracker->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
{
VirtualHand->SetRelativeLocation(Location);
VirtualHand->SetWorldLocation(Location);
});
WristTracker->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
{
VirtualHand->SetRelativeRotation(Rotation);
VirtualHand->SetWorldRotation(Rotation);
});
Pimpl->BindFingerGrabOverlapEvents();
Pimpl->BindFingerTouchOverlapEvents();
}
void ASGVirtualHandActor::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
Pimpl->UnbindFingerGrabOverlapEvents();
Pimpl->UnbindFingerTouchOverlapEvents();
}
void ASGVirtualHandActor::PreInitializeComponents()
@@ -112,6 +291,292 @@ void ASGVirtualHandActor::PreInitializeComponents()
WristTracker->SetRight(VirtualHand->IsRight());
}
void ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGGrabComponent::IsGrabbable(OtherActor))
{
GrabState.ActorThumbCanGrab = OtherActor;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
if (GrabState.ActorThumbCanGrab == OtherActor)
{
GrabState.ActorThumbCanGrab = nullptr;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGGrabComponent::IsGrabbable(OtherActor))
{
GrabState.ActorIndexCanGrab = OtherActor;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
if (GrabState.ActorIndexCanGrab == OtherActor)
{
GrabState.ActorIndexCanGrab = nullptr;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGGrabComponent::IsGrabbable(OtherActor))
{
GrabState.ActorMiddleCanGrab = OtherActor;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherBodyIndex;
if (GrabState.ActorMiddleCanGrab == OtherActor)
{
GrabState.ActorMiddleCanGrab = nullptr;
GrabStateUpdatedEvent.Broadcast(GrabState);
}
}
void ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGTouchComponent::IsTouchable(OtherActor))
{
TouchState.ActorThumbTouching = OtherActor;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
if (TouchState.ActorThumbTouching == OtherActor)
{
TouchState.ActorThumbTouching = nullptr;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGTouchComponent::IsTouchable(OtherActor))
{
TouchState.ActorIndexTouching = OtherActor;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
if (TouchState.ActorIndexTouching == OtherActor)
{
TouchState.ActorIndexTouching = nullptr;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
(void) bFromSweep;
(void) SweepResult;
if (USGTouchComponent::IsTouchable(OtherActor))
{
TouchState.ActorMiddleTouching = OtherActor;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
if (TouchState.ActorMiddleTouching == OtherActor)
{
TouchState.ActorMiddleTouching = nullptr;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
if (USGTouchComponent::IsTouchable(OtherActor))
{
TouchState.ActorRingTouching = OtherActor;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
if (TouchState.ActorRingTouching == OtherActor)
{
TouchState.ActorRingTouching = nullptr;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex,
const bool bFromSweep,
const FHitResult& SweepResult)
{
if (USGTouchComponent::IsTouchable(OtherActor))
{
TouchState.ActorPinkyTouching = OtherActor;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
void ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
const int32 OtherBodyIndex)
{
(void) OverlappedComponent;
(void) OtherComp;
(void) OtherBodyIndex;
if (TouchState.ActorPinkyTouching == OtherActor)
{
TouchState.ActorPinkyTouching = nullptr;
TouchStateUpdatedEvent.Broadcast(TouchState);
}
}
bool ASGVirtualHandActor::IsLeft() const
{
return WristTracker->IsLeft() && VirtualHand->IsLeft();
@@ -138,6 +603,98 @@ ASGVirtualHandActor::FImpl::FImpl(ASGVirtualHandActor* InOwner)
{
}
void ASGVirtualHandActor::FImpl::BindFingerGrabOverlapEvents()
{
Owner->ThumbFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins);
Owner->ThumbFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds);
Owner->IndexFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins);
Owner->IndexFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds);
Owner->MiddleFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins);
Owner->MiddleFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds);
}
void ASGVirtualHandActor::FImpl::UnbindFingerGrabOverlapEvents()
{
Owner->ThumbFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins);
Owner->ThumbFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds);
Owner->IndexFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins);
Owner->IndexFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds);
Owner->MiddleFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins);
Owner->MiddleFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds);
}
void ASGVirtualHandActor::FImpl::BindFingerTouchOverlapEvents()
{
Owner->ThumbFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins);
Owner->ThumbFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds);
Owner->IndexFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins);
Owner->IndexFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds);
Owner->MiddleFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins);
Owner->MiddleFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds);
Owner->RingFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins);
Owner->RingFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds);
Owner->PinkyFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins);
Owner->PinkyFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds);
}
void ASGVirtualHandActor::FImpl::UnbindFingerTouchOverlapEvents()
{
Owner->ThumbFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins);
Owner->ThumbFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds);
Owner->IndexFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins);
Owner->IndexFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds);
Owner->MiddleFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins);
Owner->MiddleFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds);
Owner->RingFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins);
Owner->RingFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds);
Owner->PinkyFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins);
Owner->PinkyFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds);
}
ASGVirtualHandActor::FImpl::~FImpl() = default;
void ASGVirtualHandActor::FImplDeleter::operator()(const FImpl* P) const
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,39 +33,36 @@
*/
#pragma once
#include "SenseGlove/Haptics/SGGrabState.h"
#include "Containers/Array.h"
#include "Math/Vector.h"
#include "GameFramework/Actor.h"
#include "SGNovaGloveCalibration.generated.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
class USGNovaGloveHandProfile;
/**
*
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGNovaGloveCalibration
FSGGrabState::FSGGrabState()
: Hand(nullptr),
PreviousHandLocation(FVector::Zero()),
HandVelocityHistory{},
ActorThumbCanGrab(nullptr),
ActorIndexCanGrab(nullptr),
ActorMiddleCanGrab(nullptr),
GrabbedActor(nullptr)
{
GENERATED_BODY()
}
public:
/**
* Apply a glove's default interpolation values to a profile, using the 'default' hand angles from calibration.
*/
static void ApplyDefaultCalibrationInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const USGNovaGloveHandProfile* Profile);
/**
* Apply a set of sensor-to-joint-angle interpolations to a nova profile.
*/
static void ApplyInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const TArray<TArray<FVector>>& RetractedAngles,
const TArray<TArray<FVector>>& ExtendedAngles,
const USGNovaGloveHandProfile* Profile);
};
FSGGrabState::FSGGrabState(USGVirtualHandComponent* InHand,
const FVector& InPreviousHandLocation,
const TArray<FVector>& InHandVelocityHistory,
AActor* InActorThumbCanGrab,
AActor* InActorIndexCanGrab,
AActor* InActorMiddleCanGrab,
AActor* InGrabbedActor)
: Hand(InHand),
PreviousHandLocation(InPreviousHandLocation),
HandVelocityHistory(InHandVelocityHistory),
ActorThumbCanGrab(InActorThumbCanGrab),
ActorIndexCanGrab(InActorIndexCanGrab),
ActorMiddleCanGrab(InActorMiddleCanGrab),
GrabbedActor(InGrabbedActor)
{
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,31 +33,33 @@
*/
#include "SGCoreKismet/SGFingerCommandKismetLibrary.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGCore/SGFingerCommand.h"
#include "GameFramework/Actor.h"
TArray<int32> USGFingerCommandKismetLibrary::GetLevels(const USGFingerCommand* FingerCommand)
#include "SenseGlove/Components/SGVirtualHandComponent.h"
FSGTouchState::FSGTouchState()
: Hand(nullptr),
ActorThumbTouching(nullptr),
ActorIndexTouching(nullptr),
ActorMiddleTouching(nullptr),
ActorRingTouching(nullptr),
ActorPinkyTouching(nullptr)
{
return FingerCommand->GetLevels();
}
int32 USGFingerCommandKismetLibrary::GetLevel(const USGFingerCommand* FingerCommand, const int32 Finger)
FSGTouchState::FSGTouchState(USGVirtualHandComponent* InHand,
AActor* InActorThumbTouching,
AActor* InActorIndexTouching,
AActor* InActorMiddleTouching,
AActor* InActorRingTouching,
AActor* InActorPinkyTouching)
: Hand(InHand),
ActorThumbTouching(InActorThumbTouching),
ActorIndexTouching(InActorIndexTouching),
ActorMiddleTouching(InActorMiddleTouching),
ActorRingTouching(InActorRingTouching),
ActorPinkyTouching(InActorPinkyTouching)
{
return FingerCommand->GetLevel(Finger);
}
void USGFingerCommandKismetLibrary::SetLevel(USGFingerCommand* FingerCommand, const int32 Finger, const int32 Value)
{
FingerCommand->SetLevel(Finger, Value);
}
bool USGFingerCommandKismetLibrary::Equals(const USGFingerCommand* A, const USGFingerCommand* B)
{
return A->Equals(B);
}
FString USGFingerCommandKismetLibrary::ToString(const USGFingerCommand* FingerCommand)
{
return FingerCommand->ToString();
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -40,12 +40,12 @@
void FSenseGloveModule::StartupModule()
{
SGLOG("Starting up SenseGlove module...");
SGLOG("Starting up the SenseGlove module...");
}
void FSenseGloveModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGlove module...");
SGLOG("Unloading the SenseGlove module...");
}
void FSenseGloveModule::PostLoadCallback()
@@ -55,7 +55,7 @@ void FSenseGloveModule::PostLoadCallback()
void FSenseGloveModule::ShutdownModule()
{
SGLOG("Shutting down SenseGlove module...");
SGLOG("Shutting down the SenseGlove module...");
}
#undef LOCTEXT_NAMESPACE
+1 -1
View File
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,13 +46,19 @@ struct SENSEGLOVE_API FSGVirtualHandAnimInstanceProxy : public FAnimInstanceProx
{
GENERATED_USTRUCT_BODY()
public:
private:
TMap<FName, FRotator> BonesRotations;
public:
FSGVirtualHandAnimInstanceProxy();
FSGVirtualHandAnimInstanceProxy(UAnimInstance* Instance);
public:
FORCEINLINE const TMap<FName, FRotator>& GetBonesRotations() const
{
return BonesRotations;
}
protected:
virtual void PreEvaluateAnimation(UAnimInstance* InAnimInstance) override;
@@ -0,0 +1,199 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Components/SceneComponent.h"
#include "Engine/EngineTypes.h"
#include "Templates/UniquePtr.h"
#include "UObject/NameTypes.h"
#include "SGGrabComponent.generated.h"
class AActor;
UCLASS(Blueprintable, BlueprintType, meta=(BlueprintSpawnableComponent))
class SENSEGLOVE_API USGGrabComponent : public USceneComponent
{
GENERATED_UCLASS_BODY()
public:
static USGGrabComponent* GetGrabComponent(const AActor* Actor);
static bool IsGrabbable(const AActor* Actor);
private:
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EAttachmentRule AttachmentLocationRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EAttachmentRule AttachmentRotationRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EAttachmentRule AttachmentScaleRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bAttachmentWeldSimulatedBodies : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
FName AttachmentSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EDetachmentRule DetachmentLocationRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EDetachmentRule DetachmentRotationRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
EDetachmentRule DetachmentScaleRule;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bDetachmentCallModify : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bAffectPhysicsState : 1;
private:
struct FImpl;
struct FImplDeleter
{
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
public:
FORCEINLINE EAttachmentRule GetAttachmentLocationRule() const
{
return AttachmentLocationRule;
}
FORCEINLINE void SetAttachmentLocationRule(const EAttachmentRule InAttachmentLocationRule)
{
AttachmentLocationRule = InAttachmentLocationRule;
}
FORCEINLINE EAttachmentRule GetAttachmentRotationRule() const
{
return AttachmentRotationRule;
}
FORCEINLINE void SetAttachmentRotationRule(const EAttachmentRule InAttachmentRotationRule)
{
AttachmentRotationRule = InAttachmentRotationRule;
}
FORCEINLINE EAttachmentRule GetAttachmentScaleRule() const
{
return AttachmentScaleRule;
}
FORCEINLINE void SetAttachmentScaleRule(const EAttachmentRule InAttachmentScaleRule)
{
AttachmentScaleRule = InAttachmentScaleRule;
}
FORCEINLINE bool GetAttachmentWeldSimulatedBodies() const
{
return !!bAttachmentWeldSimulatedBodies;
}
FORCEINLINE void SetAttachmentWeldSimulatedBodies(const bool bInAttachmentWeldSimulatedBodies)
{
bAttachmentWeldSimulatedBodies = bInAttachmentWeldSimulatedBodies;
}
FORCEINLINE const FName& GetAttachmentSocketName() const
{
return AttachmentSocketName;
}
FORCEINLINE void SetAttachmentSocketName(const FName& InAttachmentSocketName)
{
AttachmentSocketName = InAttachmentSocketName;
}
FORCEINLINE EDetachmentRule GetDetachmentLocationRule() const
{
return DetachmentLocationRule;
}
FORCEINLINE void SetDetachmentLocationRule(const EDetachmentRule InDetachmentLocationRule)
{
DetachmentLocationRule = InDetachmentLocationRule;
}
FORCEINLINE EDetachmentRule GetDetachmentRotationRule() const
{
return DetachmentRotationRule;
}
FORCEINLINE void SetDetachmentRotationRule(const EDetachmentRule InDetachmentRotationRule)
{
DetachmentRotationRule = InDetachmentRotationRule;
}
FORCEINLINE EDetachmentRule GetDetachmentScaleRule() const
{
return DetachmentScaleRule;
}
FORCEINLINE void SetDetachmentScaleRule(const EDetachmentRule InDetachmentScaleRule)
{
DetachmentScaleRule = InDetachmentScaleRule;
}
FORCEINLINE bool GetDetachmentInCallModify() const
{
return !!bDetachmentCallModify;
}
FORCEINLINE void SetDetachmentInCallModify(const bool bInDetachmentCallModify)
{
bDetachmentCallModify = bInDetachmentCallModify;
}
FORCEINLINE bool GetAffectPhysicsState() const
{
return !!bAffectPhysicsState;
}
FORCEINLINE void SetAffectPhysicsState(const bool bInAffectPhysicsState)
{
bAffectPhysicsState = bInAffectPhysicsState;
}
};
@@ -0,0 +1,107 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Components/SceneComponent.h"
#include "Templates/UniquePtr.h"
#include "SGTouchComponent.generated.h"
class AActor;
UCLASS(Blueprintable, BlueprintType, meta=(BlueprintSpawnableComponent))
class SENSEGLOVE_API USGTouchComponent : public USceneComponent
{
GENERATED_UCLASS_BODY()
public:
static USGTouchComponent* GetTouchComponent(const AActor* Actor);
static bool IsTouchable(const AActor* Actor);
private:
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
float ForceFeedbackLevel;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false", ClampMin = "0.0", UIMin = "0.0"))
float VibrotactileDuration;
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "100.0", UIMin = "0.0", UIMax = "100.0"))
float VibrotactileLevel;
private:
struct FImpl;
struct FImplDeleter
{
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
public:
FORCEINLINE float GetForceFeedbackLevel() const
{
return ForceFeedbackLevel;
}
FORCEINLINE void SetForceFeedbackLevel(const float Level)
{
ForceFeedbackLevel = Level;
}
FORCEINLINE float GetVibrotactileDuration() const
{
return VibrotactileDuration;
}
FORCEINLINE void SetVibrotactileDuration(const float Duration)
{
VibrotactileDuration = Duration;
}
FORCEINLINE float GetVibrotactileLevel() const
{
return VibrotactileLevel;
}
FORCEINLINE void SetVibrotactileLevel(const float Level)
{
VibrotactileLevel = Level;
}
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -45,12 +45,16 @@
#include "Templates/UniquePtr.h"
#include "UObject/NameTypes.h"
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGVirtualHandComponent.generated.h"
class USphereComponent;
class USkeletalMesh;
class USGHandPose;
class USGHapticGlove;
class USGWristTrackerComponent;
UCLASS(Config=Engine, Blueprintable, ClassGroup=(Rendering, Common), hidecategories=(Object, "Mesh|SkeletalAsset"),
editinlinenew, meta=(BlueprintSpawnableComponent))
@@ -83,12 +87,51 @@ private:
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bHiddenInGameIfNoGloveDetected : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove | Haptics", meta=(AllowPrivateAccess="false"))
uint8 bAutoStopAllHapticsOnEndPlay : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName GrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FVector DefaultFingertipsGrabColliderSize;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName ThumbFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName IndexFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName MiddleFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FVector DefaultFingertipsTouchColliderSize;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName ThumbFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName IndexFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName MiddleFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName RingFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName PinkyFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
FSGDebugVirtualHandSettings DebugVirtualHandSettings;
private:
UPROPERTY(Transient)
uint8 bBackendInitialized : 1;
USGHapticGlove* Glove;
UPROPERTY(Transient)
USGHapticGlove* Glove;
USGWristTrackerComponent* WristTracker;
public:
FORCEINLINE bool IsLeft() const
@@ -103,6 +146,126 @@ public:
void SetRight(const bool bInRight);
FORCEINLINE const FName& GetMiddleFingertipTouchSocketName() const
{
return MiddleFingertipTouchSocketName;
}
FORCEINLINE void SetMiddleFingertipTouchSocketName(const FName& SocketName)
{
MiddleFingertipTouchSocketName = SocketName;
}
FORCEINLINE bool AutoStopsAllHapticsOnEndPlay() const
{
return !!bAutoStopAllHapticsOnEndPlay;
}
FORCEINLINE void SetAutoStopAllHapticsOnEndPlay(const bool bInAutoStopAllHapticsOnEndPlay)
{
bAutoStopAllHapticsOnEndPlay = bInAutoStopAllHapticsOnEndPlay;
}
FORCEINLINE const FName& GetGrabSocketName() const
{
return GrabSocketName;
}
FORCEINLINE const FVector& GetDefaultFingertipsGrabColliderSize() const
{
return DefaultFingertipsGrabColliderSize;
}
FORCEINLINE const FName& GetThumbFingertipGrabSocketName() const
{
return ThumbFingertipGrabSocketName;
}
FORCEINLINE void SetThumbFingertipGrabSocketName(const FName& SocketName)
{
ThumbFingertipGrabSocketName = SocketName;
}
FORCEINLINE const FName& GetIndexFingertipGrabSocketName() const
{
return IndexFingertipGrabSocketName;
}
FORCEINLINE void SetIndexFingertipGrabSocketName(const FName& SocketName)
{
IndexFingertipGrabSocketName = SocketName;
}
FORCEINLINE const FName& GetMiddleFingertipGrabSocketName() const
{
return MiddleFingertipGrabSocketName;
}
FORCEINLINE void SetMiddleFingertipGrabSocketName(const FName& SocketName)
{
MiddleFingertipGrabSocketName = SocketName;
}
FORCEINLINE const FVector& GetDefaultFingertipsTouchColliderSize() const
{
return DefaultFingertipsTouchColliderSize;
}
FORCEINLINE const FName& GetThumbFingertipTouchSocketName() const
{
return ThumbFingertipTouchSocketName;
}
FORCEINLINE void SetThumbFingertipTouchSocketName(const FName& SocketName)
{
ThumbFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FName& GetIndexFingertipTouchSocketName() const
{
return IndexFingertipTouchSocketName;
}
FORCEINLINE void SetIndexFingertipTouchSocketName(const FName& SocketName)
{
IndexFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FName& GetRingFingertipTouchSocketName() const
{
return RingFingertipTouchSocketName;
}
FORCEINLINE void SetRingFingertipTouchSocketName(const FName& SocketName)
{
RingFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FName& GetPinkyFingertipTouchSocketName() const
{
return PinkyFingertipTouchSocketName;
}
FORCEINLINE void SetPinkyFingertipTouchSocketName(const FName& SocketName)
{
PinkyFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FSGDebugVirtualHandSettings& GetDebugVirtualHandSettings() const
{
return DebugVirtualHandSettings;
}
FORCEINLINE FSGDebugVirtualHandSettings& GetDebugVirtualHandSettings()
{
return DebugVirtualHandSettings;
}
FORCEINLINE void SetDebugVirtualHandSettings(const FSGDebugVirtualHandSettings& InDebugVirtualHandSettings)
{
DebugVirtualHandSettings = InDebugVirtualHandSettings;
}
FORCEINLINE bool IsHiddenInGameIfNoGloveDetected() const
{
return !!bHiddenInGameIfNoGloveDetected;
@@ -113,10 +276,15 @@ public:
bHiddenInGameIfNoGloveDetected = bInHiddenIfNoGloveDetected;
}
FORCEINLINE void SetWristTracker(USGWristTrackerComponent* InWristTracker)
{
WristTracker = InWristTracker;
}
public:
virtual void SetAnimClass(class UClass* NewClass) override;
virtual void PostInitProperties() override;
virtual void PostInitProperties() override;
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
@@ -143,6 +311,12 @@ protected:
public:
bool IsGloveConnected() const;
FORCEINLINE USGHapticGlove* GetConnectedGlove() const
{
return Glove;
}
USGHandPose* GetHandPose();
public:
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -41,6 +41,7 @@
#include "MotionControllerComponent.h"
#include "Templates/UniquePtr.h"
#include "SGSettings/SGWristTrackingSettings.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGWristTrackerComponent.generated.h"
@@ -93,112 +94,23 @@ private:
FImplDeleter PimplDeleter;
private:
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings")
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bRight : 1;
/**
* Determines whether to override the plugin's wrist tracking settings or not.
*/
UPROPERTY(EditAnywhere, Category = "SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bOverridePluginWristTrackingSettings : 1;
/**
* If set to Custom, any desired location and rotation can be specified.
* Overrides the plugin's wrist tracking settings.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingSettings", EditConditionHides))
ESGPositionalTrackingHardware TrackingHardware;
/**
* Valid only if TrackingHardware is set to Custom.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition=
"bOverridePluginWristTrackingSettings && TrackingHardware == ESGPositionalTrackingHardware::Custom",
EditConditionHides))
FVector TrackingHardwareLocationOffset;
/**
* Valid only if TrackingHardware is set to Custom.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition=
"bOverridePluginWristTrackingSettings && TrackingHardware == ESGPositionalTrackingHardware::Custom",
EditConditionHides))
FRotator TrackingHardwareRotationOffset;
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings")
uint8 bOverridePluginWristTrackingDebugSettings : 1;
/**
* If enabled, draws debug Wrist trackers where possible.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings", EditConditionHides))
uint8 bDrawDebugWristTrackerGizmo : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
float DebugWristTrackerGizmoLength;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoXAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoYAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoZAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
uint8 bDebugWristTrackerGizmoPersistentLines : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
float DebugWristTrackerGizmoLifeTimeModifier;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
uint8 DebugWristTrackerGizmoDepthPriority;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
float DebugWristTrackerGizmoThickness;
UPROPERTY(EditAnywhere, Category = "SenseGlove",
meta=(AllowPrivateAccess="false", EditCondition="bOverridePluginWristTrackingSettings", EditConditionHides))
FSGWristTrackingSettings WristTrackingSettings;
private:
UPROPERTY(Transient)
uint8 bBackendInitialized : 1;
UPROPERTY(Transient)
USGHapticGlove* Glove;
@@ -209,6 +121,18 @@ private:
FRotator WristRotation;
public:
FORCEINLINE bool IsLeft() const
{
return !IsRight();
}
FORCEINLINE bool IsRight() const
{
return !!bRight;
}
void SetRight(const bool bInRight);
FORCEINLINE bool OverridesPluginWristTrackingSettings() const
{
return !!bOverridePluginWristTrackingSettings;
@@ -219,63 +143,8 @@ public:
bOverridePluginWristTrackingSettings = bInOverridePluginWristTrackingSettings;
}
ESGPositionalTrackingHardware GetTrackingHardware() const;
void SetTrackingHardware(ESGPositionalTrackingHardware InTrackingHardware);
const FVector& GetTrackingHardwareLocationOffset() const;
void SetTrackingHardwareLocationOffset(const FVector& InTrackingHardwareLocationOffset);
const FRotator& GetTrackingHardwareRotationOffset() const;
void SetTrackingHardwareRotationOffset(const FRotator& InTrackingHardwareRotationOffset);
FORCEINLINE bool OverridesPluginWristTrackingDebugSettings() const
{
return !!bOverridePluginWristTrackingDebugSettings;
}
FORCEINLINE void OverridePluginWristTrackingDebugSettings(const bool bInOverridePluginWristTrackingDebugSettings)
{
bOverridePluginWristTrackingDebugSettings = bInOverridePluginWristTrackingDebugSettings;
}
bool GetDrawDebugWristTrackerGizmo() const;
void SetDrawDebugWristTrackerGizmo(bool bInDrawDebugWristTrackerGizmo);
float GetDebugWristTrackerGizmoLength() const;
void SetDebugWristTrackerGizmoLength(float InDebugWristTrackerGizmoLength);
const FColor& GetDebugWristTrackerGizmoXAxisColor() const;
void SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor);
const FColor& GetDebugWristTrackerGizmoYAxisColor() const;
void SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor);
const FColor& GetDebugWristTrackerGizmoZAxisColor() const;
void SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor);
bool GetDebugWristTrackerGizmoPersistentLines() const;
void SetDebugWristTrackerGizmoPersistentLines(bool bInDebugWristTrackerGizmoPersistentLines);
float GetDebugWristTrackerGizmoLifeTimeModifier() const;
void SetDebugWristTrackerGizmoLifeTimeModifier(float InDebugWristTrackerGizmoLifeTimeModifier);
uint8 GetDebugWristTrackerGizmoDepthPriority() const;
void SetDebugWristTrackerGizmoDepthPriority(uint8 InDebugWristTrackerGizmoDepthPriority);
float GetDebugWristTrackerGizmoThickness() const;
void SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness);
FORCEINLINE bool IsLeft() const
{
return GetTrackingSource() == EControllerHand::Left;
}
FORCEINLINE bool IsRight() const
{
return GetTrackingSource() == EControllerHand::Right;
}
void SetRight(const bool bRight);
const FSGWristTrackingSettings& GetWristTrackingSettings() const;
void SetWristTrackingSettings(const FSGWristTrackingSettings& InWristTrackingSettings);
FORCEINLINE const FVector& GetWristLocation() const
{
@@ -294,12 +163,8 @@ public:
virtual void InitializeComponent() override;
virtual void UninitializeComponent() override;
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
virtual void TickComponent(float DeltaTime,
enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override;
@@ -308,4 +173,4 @@ protected:
virtual void EditorTick(float DeltaTime,
enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction);
};
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,11 +35,16 @@
#pragma once
#include "Containers/Array.h"
#include "Engine/GameInstance.h"
#include "SGCoreImpl/SGCalibrationDataPointImpl.h"
#include "SGGameInstance.generated.h"
struct FSGIC_TArray_FSGCalibrationDataPointImpl
UCLASS(config=Game, Transient, BlueprintType, Blueprintable)
class SENSEGLOVE_API USGGameInstance : public UGameInstance
{
TArray<FSGCalibrationDataPointImpl> Array;
GENERATED_UCLASS_BODY()
public:
virtual void Init() override;
virtual void Shutdown() override;
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,12 +35,20 @@
#pragma once
#include "Containers/Array.h"
#include "GameFramework/Pawn.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGPawn.generated.h"
class UCameraComponent;
class UPrimitiveComponent;
class USphereComponent;
class UXRDeviceVisualizationComponent;
class USGVirtualHandComponent;
class USGWristTrackerComponent;
@@ -50,6 +58,57 @@ class SENSEGLOVE_API ASGPawn : public APawn
{
GENERATED_UCLASS_BODY()
public:
DECLARE_EVENT_OneParam(ASGPawn, FGrabStateUpdatedEvent, const FSGGrabState& GrabState);
FGrabStateUpdatedEvent& OnGrabStateUpdated()
{
return GrabStateUpdatedEvent;
};
DECLARE_EVENT_OneParam(ASGPawn, FTouchStateUpdatedEvent, const FSGTouchState& TouchState)
FTouchStateUpdatedEvent& OnTouchStateUpdated()
{
return TouchStateUpdatedEvent;
};
DECLARE_EVENT_TwoParams(ASGPawn, FActorGrabbedEvent, const USGVirtualHandComponent* Hand, const AActor* Actor);
FActorGrabbedEvent& OnGrabbed()
{
return ActorGrabbedEvent;
};
DECLARE_EVENT_TwoParams(ASGPawn, FActorReleasedEvent, const USGVirtualHandComponent* Hand, const AActor* Actor);
FActorReleasedEvent& OnReleased()
{
return ActorReleasedEvent;
};
DECLARE_EVENT_TwoParams(ASGPawn, FActorBeginTouchEvent, const USGVirtualHandComponent* Hand, const AActor* Actor);
FActorBeginTouchEvent& OnActorBeginTouch()
{
return ActorBeginTouchEvent;
};
DECLARE_EVENT_TwoParams(ASGPawn, FActorEndTouchEvent, const USGVirtualHandComponent* Hand, const AActor* Actor);
FActorEndTouchEvent& OnActorEndTouch()
{
return ActorEndTouchEvent;
};
private:
FGrabStateUpdatedEvent GrabStateUpdatedEvent;
FTouchStateUpdatedEvent TouchStateUpdatedEvent;
FActorGrabbedEvent ActorGrabbedEvent;
FActorReleasedEvent ActorReleasedEvent;
FActorBeginTouchEvent ActorBeginTouchEvent;
FActorEndTouchEvent ActorEndTouchEvent;
private:
struct FImpl;
@@ -72,14 +131,115 @@ private:
USGWristTrackerComponent* WristTrackerLeft;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGWristTrackerComponent* WristTrackerRight;
UXRDeviceVisualizationComponent* ControllerVisualizerLeft;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* HandLeft;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* RealHandLeft;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftThumbFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftIndexFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftMiddleFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftThumbFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftIndexFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftMiddleFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftRingFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* LeftPinkyFingertipTouchCollider;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGWristTrackerComponent* WristTrackerRight;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
UXRDeviceVisualizationComponent* ControllerVisualizerRight;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* HandRight;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* RealHandRight;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightThumbFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightIndexFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightMiddleFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightThumbFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightIndexFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightMiddleFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightRingFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RightPinkyFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
int32 MaxNumberOfHandVelocitySamples;
private:
UPROPERTY(Transient)
FSGGrabState LeftHandGrabState;
UPROPERTY(Transient)
FSGTouchState LeftHandTouchState;
UPROPERTY(Transient)
FSGGrabState RightHandGrabState;
UPROPERTY(Transient)
FSGTouchState RightHandTouchState;
UPROPERTY(Transient)
TArray<const AActor*> LeftHandOverlappedActors;
UPROPERTY(Transient)
TArray<const AActor*> RightHandOverlappedActors;
protected:
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnGrabStateUpdated(const FSGGrabState& GrabState);
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnTouchStateUpdated(const FSGTouchState& TouchState);
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnActorGrabbed(const USGVirtualHandComponent* Hand, const AActor* Actor);
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnActorReleased(const USGVirtualHandComponent* Hand, const AActor* Actor);
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnActorBeginTouch(const USGVirtualHandComponent* Hand, const AActor* Actor);
UFUNCTION(BlueprintNativeEvent, Category="SenseGlove | Game Framework | Pawn")
void OnActorEndTouch(const USGVirtualHandComponent* Hand, const AActor* Actor);
public:
FORCEINLINE UCameraComponent* GetCamera() const
{
@@ -91,22 +251,504 @@ public:
return WristTrackerLeft;
}
FORCEINLINE USGWristTrackerComponent* GetWristTrackerRight() const
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
FORCEINLINE UXRDeviceVisualizationComponent* GetControllerVisualizerLeft() const
{
return WristTrackerRight;
return ControllerVisualizerLeft;
}
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
FORCEINLINE USGVirtualHandComponent* GetHandLeft() const
{
return HandLeft;
}
FORCEINLINE USGVirtualHandComponent* GetRealHandLeft() const
{
return RealHandLeft;
}
FORCEINLINE USphereComponent* GetLeftThumbFingertipGrabCollider() const
{
return LeftThumbFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetLeftIndexFingertipGrabCollider() const
{
return LeftIndexFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetLeftMiddleFingertipGrabCollider() const
{
return LeftMiddleFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetLeftThumbFingertipTouchCollider() const
{
return LeftThumbFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetLeftIndexFingertipTouchCollider() const
{
return LeftIndexFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetLeftMiddleFingertipTouchCollider() const
{
return LeftMiddleFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetLeftRingFingertipTouchCollider() const
{
return LeftRingFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetLeftPinkyFingertipTouchCollider() const
{
return LeftPinkyFingertipTouchCollider;
}
FORCEINLINE USGWristTrackerComponent* GetWristTrackerRight() const
{
return WristTrackerRight;
}
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
FORCEINLINE UXRDeviceVisualizationComponent* GetControllerVisualizerRight() const
{
return ControllerVisualizerLeft;
}
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
FORCEINLINE USGVirtualHandComponent* GetHandRight() const
{
return HandRight;
}
FORCEINLINE USGVirtualHandComponent* GetRealHandRight() const
{
return RealHandRight;
}
FORCEINLINE USphereComponent* GetRightThumbFingertipGrabCollider() const
{
return RightThumbFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetRightIndexFingertipGrabCollider() const
{
return RightIndexFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetRightMiddleFingertipGrabCollider() const
{
return RightMiddleFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetRightThumbFingertipTouchCollider() const
{
return RightThumbFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetRightIndexFingertipTouchCollider() const
{
return RightIndexFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetRightMiddleFingertipTouchCollider() const
{
return RightMiddleFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetRightRingFingertipTouchCollider() const
{
return RightRingFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetRightPinkyFingertipTouchCollider() const
{
return RightPinkyFingertipTouchCollider;
}
FORCEINLINE int32 GetMaxNumberOfHandVelocitySamples() const
{
return MaxNumberOfHandVelocitySamples;
}
FORCEINLINE void SetMaxNumberOfHandVelocitySamples(const int32 InMaxNumberOfHandVelocitySamples)
{
MaxNumberOfHandVelocitySamples = InMaxNumberOfHandVelocitySamples;
}
public:
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
virtual void Tick(float DeltaSeconds) override;
virtual void PreInitializeComponents() override;
};
virtual void PostInitializeComponents() override;
protected:
UFUNCTION()
virtual void OnRealLeftHandOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRealLeftHandOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRealRightHandOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRealRightHandOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftThumbFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftThumbFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftIndexFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftIndexFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftMiddleFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftMiddleFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftThumbFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftThumbFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftIndexFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftIndexFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftMiddleFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftMiddleFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftRingFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftRingFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnLeftPinkyFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnLeftPinkyFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightThumbFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightThumbFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightIndexFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightIndexFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightMiddleFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightMiddleFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightThumbFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightThumbFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightIndexFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightIndexFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightMiddleFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightMiddleFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightRingFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightRingFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRightPinkyFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRightPinkyFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
public:
FORCEINLINE bool CanLeftHandGrab(const AActor* Actor) const
{
return !IsLeftHandGrabbing() && ((IsValid(Actor) && Actor == LeftHandGrabState.ActorThumbCanGrab)
&& (Actor == LeftHandGrabState.ActorIndexCanGrab || Actor == LeftHandGrabState.ActorMiddleCanGrab));
}
FORCEINLINE bool IsLeftHandGrabbing(const AActor* Actor) const
{
return IsValid(Actor) && LeftHandGrabState.GrabbedActor == Actor;
}
bool IsLeftHandGrabbing(AActor*& OutActor) const;
FORCEINLINE bool IsLeftHandGrabbing() const
{
return IsValid(LeftHandGrabState.GrabbedActor);
}
FORCEINLINE bool CanRightHandGrab(const AActor* Actor) const
{
return !IsRightHandGrabbing() && ((IsValid(Actor) && Actor == RightHandGrabState.ActorThumbCanGrab)
&& (Actor == RightHandGrabState.ActorIndexCanGrab || Actor == RightHandGrabState.ActorMiddleCanGrab));
}
FORCEINLINE bool IsRightHandGrabbing(const AActor* Actor) const
{
return IsValid(Actor) && RightHandGrabState.GrabbedActor == Actor;
}
FORCEINLINE bool IsRightHandGrabbing() const
{
return IsValid(RightHandGrabState.GrabbedActor);
}
bool IsRightHandGrabbing(AActor*& OutActor) const;
FORCEINLINE bool CanGrab(const USGVirtualHandComponent* Hand, const AActor* Actor) const
{
return Hand == HandRight ? CanRightHandGrab(Actor) : CanLeftHandGrab(Actor);
}
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand, const AActor* Actor) const
{
return Hand == HandRight ? IsRightHandGrabbing(Actor) : IsLeftHandGrabbing(Actor);
}
bool IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor) const;
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand) const
{
return Hand == HandRight ? IsRightHandGrabbing() : IsLeftHandGrabbing();
}
public:
FORCEINLINE void GrabLeft(AActor* Actor)
{
Grab(HandLeft, Actor);
}
FORCEINLINE void GrabRight(AActor* Actor)
{
Grab(HandRight, Actor);
}
void Grab(USGVirtualHandComponent* Hand, AActor* Actor);
void ReleaseLeft();
void ReleaseRight();
FORCEINLINE void Release(const USGVirtualHandComponent* Hand)
{
return Hand == HandRight ? ReleaseRight() : ReleaseLeft();
}
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,6 +36,7 @@
#pragma once
#include "GameFramework/PlayerController.h"
#include "Templates/UniquePtr.h"
#include "SGPlayerController.generated.h"
@@ -44,6 +45,17 @@ class SENSEGLOVE_API ASGPlayerController : public APlayerController
{
GENERATED_UCLASS_BODY()
private:
struct FImpl;
struct FImplDeleter
{
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
protected:
virtual void SetupInputComponent() override;
virtual void BeginPlay() override;
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -41,11 +41,15 @@
#include "Templates/UniquePtr.h"
#include "UObject/NameTypes.h"
#include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGVirtualHandActor.generated.h"
class USceneComponent;
class USkeletalMesh;
class USkeleton;
class USceneComponent;
class USphereComponent;
class USGHandPose;
class USGVirtualHandComponent;
@@ -56,6 +60,25 @@ class SENSEGLOVE_API ASGVirtualHandActor : public AActor
{
GENERATED_UCLASS_BODY()
public:
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FGrabStateUpdatedEvent, const FSGGrabState& GrabState);
FGrabStateUpdatedEvent& OnGrabStateUpdated()
{
return GrabStateUpdatedEvent;
};
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FTouchStateUpdatedEvent, const FSGTouchState& TouchState)
FTouchStateUpdatedEvent& OnTouchStateUpdated()
{
return TouchStateUpdatedEvent;
};
private:
FGrabStateUpdatedEvent GrabStateUpdatedEvent;
FTouchStateUpdatedEvent TouchStateUpdatedEvent;
private:
struct FImpl;
@@ -77,6 +100,37 @@ private:
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* VirtualHand;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* ThumbFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* IndexFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* MiddleFingertipGrabCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* ThumbFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* IndexFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* MiddleFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* RingFingertipTouchCollider;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USphereComponent* PinkyFingertipTouchCollider;
private:
UPROPERTY(Transient)
FSGGrabState GrabState;
UPROPERTY(Transient)
FSGTouchState TouchState;
public:
FORCEINLINE USGWristTrackerComponent* GetWristTracker() const
{
@@ -88,6 +142,46 @@ public:
return VirtualHand;
}
FORCEINLINE USphereComponent* GetThumbFingertipGrabCollider() const
{
return ThumbFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetIndexFingertipGrabCollider() const
{
return IndexFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetMiddleFingertipGrabCollider() const
{
return MiddleFingertipGrabCollider;
}
FORCEINLINE USphereComponent* GetThumbFingertipTouchCollider() const
{
return ThumbFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetIndexFingertipTouchCollider() const
{
return IndexFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetMiddleFingertipTouchCollider() const
{
return MiddleFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetRingFingertipTouchCollider() const
{
return RingFingertipTouchCollider;
}
FORCEINLINE USphereComponent* GetPinkyFingertipTouchCollider() const
{
return PinkyFingertipTouchCollider;
}
protected:
FORCEINLINE void SetMesh(USGVirtualHandComponent* InVirtualHand)
{
@@ -96,12 +190,148 @@ protected:
public:
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
virtual void PreInitializeComponents() override;
protected:
UFUNCTION()
virtual void OnThumbFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnThumbFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnIndexFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnIndexFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnMiddleFingertipGrabColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnMiddleFingertipGrabColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnThumbFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnThumbFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnIndexFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnIndexFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnMiddleFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnMiddleFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnRingFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnRingFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
UFUNCTION()
virtual void OnPinkyFingertipTouchColliderOverlapBegins(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult);
UFUNCTION()
virtual void OnPinkyFingertipTouchColliderOverlapEnds(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex);
public:
bool IsLeft() const;
bool IsRight() const;
void SetRight(bool bRight);
bool IsGloveConnected() const;
FORCEINLINE bool CanGrab(const AActor* Actor) const
{
return ((IsValid(Actor) && Actor == GrabState.ActorThumbCanGrab)
&& (Actor == GrabState.ActorIndexCanGrab || Actor == GrabState.ActorMiddleCanGrab));
}
};
@@ -0,0 +1,86 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Containers/Array.h"
#include "Math/Vector.h"
#include "UObject/ObjectMacros.h"
#include "SGGrabState.generated.h"
class AActor;
class UPrimitiveComponent;
class USGVirtualHandComponent;
USTRUCT(BlueprintType)
struct SENSEGLOVE_API FSGGrabState
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
USGVirtualHandComponent* Hand;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
FVector PreviousHandLocation;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
TArray<FVector> HandVelocityHistory;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorThumbCanGrab;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorIndexCanGrab;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorMiddleCanGrab;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* GrabbedActor;
public:
FSGGrabState();
explicit FSGGrabState(USGVirtualHandComponent* InHand,
const FVector& InPreviousHandLocation,
const TArray<FVector>& InHandVelocityHistory,
AActor* InActorThumbCanGrab,
AActor* InActorIndexCanGrab,
AActor* InActorMiddleCanGrab,
AActor* InGrabbedActor);
};
@@ -0,0 +1,79 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "SGTouchState.generated.h"
class AActor;
class USGVirtualHandComponent;
USTRUCT(BlueprintType)
struct SENSEGLOVE_API FSGTouchState
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
USGVirtualHandComponent* Hand;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorThumbTouching;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorIndexTouching;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorMiddleTouching;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorRingTouching;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
AActor* ActorPinkyTouching;
public:
FSGTouchState();
explicit FSGTouchState(USGVirtualHandComponent* InHand,
AActor* InActorThumbTouching,
AActor* InActorIndexTouching,
AActor* InActorMiddleTouching,
AActor* InActorRingTouching,
AActor* InActorPinkyTouching);
};
+20 -9
View File
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -42,26 +42,37 @@ public class SenseGlove : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"AnimGraphRuntime",
"Core",
"CoreUObject",
"Engine",
"HeadMountedDisplay",
"InputCore",
// NOTE
// UE 5.3+ provides UXRDeviceVisualizationComponent as part of the XRBase plugin.
// UE 5.2 provides UXRDeviceVisualizationComponent as part of the HeadMountDisplay module.
// UE 5.1 does not provide the UXRDeviceVisualizationComponent type.
#if UE_5_3_OR_LATER
"XRBase",
#endif
"SenseGloveBackend",
"SenseGloveConnect",
"SenseGloveCore",
"SenseGloveDebug",
"SenseGloveLog",
"SenseGloveSettings",
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
}
);
}
}
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -50,6 +50,8 @@
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
#endif /* PLATFORM_ANDROID */
#include "SGLog/SGLog.h"
int32 FSGConnectJNI::Initialize()
{
int32 Result = -999999;
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -117,7 +117,7 @@ int32 FSGCoreJNI::Initialize()
SGLOG("FSGCoreJNI: attempting to find the Android JNI method 'WriteHaptics'...");
jmethodID WriteHapticsMethodID = Env->GetStaticMethodID(Class, "WriteHaptics", "(ILjava/lang/String;)I");
jmethodID WriteHapticsMethodID = Env->GetStaticMethodID(Class, "WriteHaptics", "(IILjava/lang/String;)I");
FAndroidApplication::CheckJavaException();
if (!WriteHapticsMethodID)
{
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
void FSenseGloveAndroidModule::StartupModule()
{
SGLOG("Starting up SenseGloveAndroid module...");
SGLOG("Starting up the SenseGloveAndroid module...");
#if PLATFORM_ANDROID
const int32 R1 = FSGConnectJNI::Initialize();
@@ -59,17 +59,17 @@ void FSenseGloveAndroidModule::StartupModule()
void FSenseGloveAndroidModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveAndroid module...");
SGLOG("Unloading the SenseGloveAndroid module...");
}
void FSenseGloveAndroidModule::PostLoadCallback()
{
SGLOG("Loading SenseGloveAndroid module has succeeded!");
SGLOG("Loading the SenseGloveAndroid module has succeeded!");
}
void FSenseGloveAndroidModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveAndroid module...");
SGLOG("Shutting down the SenseGloveAndroid module...");
}
#undef LOCTEXT_NAMESPACE
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -43,25 +43,25 @@ public class SenseGloveAndroid : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveConnectImpl",
"SenseGloveCoreImpl",
"SenseGloveInterop",
"SenseGloveLog",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveInterop",
}
);
if (Target.Platform == UnrealTargetPlatform.Android)
{
AdditionalPropertiesForReceipt.Add("AndroidPlugin",
@@ -7,7 +7,7 @@
(The MIT License)
Copyright (c) 2020 - 2023 SenseGlove
Copyright (c) 2020 - 2024 SenseGlove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,7 @@
<setBool result="bSupportedArch" value="false"/>
<isArch arch="armeabi-v7a">
<setBool result="bSupportedArch" value="false"/>
<setBool result="bSupportedArch" value="true"/>
</isArch>
<isArch arch="arm64-v8a">
@@ -47,11 +47,11 @@
</isArch>
<isArch arch="x86">
<setBool result="bSupportedArch" value="false"/>
<setBool result="bSupportedArch" value="true"/>
</isArch>
<isArch arch="x86_64">
<setBool result="bSupportedArch" value="false"/>
<setBool result="bSupportedArch" value="true"/>
</isArch>
<if condition="bSupportedArch">
@@ -59,68 +59,47 @@
<log text="SenseGloveAndroid [WARN]: this architecture is not supported!"/>
</false>
</if>
<setBoolFromProperty result="bCreateAFSProject" ini="Engine" section="/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings" property="bEnablePlugin" default="true"/>
</init>
<!--
<prebuildCopies>
<copyDir src="$S(PluginDir)/Private/Java" dst="$S(BuildDir)/src/com/senseglove/sgconnect" />
</prebuildCopies>
-->
<resourceCopies>
<isArch arch="arm64-v8a">
<if condition="Distribution">
<true>
<!--
<copyFile src="$S(PluginDir)/ThirdParty/lib/oculus/release/somelib.so"
dst="$S(BuildDir)/libs/$S(Architecture)/somelib.so" />
-->
</true>
<false>
<!--
<copyFile src="$S(PluginDir)/ThirdParty/lib/oculus/debug/somelib.so"
dst="$S(BuildDir)/libs/$S(Architecture)/somelib.so" />
-->
</false>
</if>
</isArch>
<copyFile src="$S(PluginDir)/../ThirdParty/android/sgconnect.jar" dst="$S(BuildDir)/gradle/app/libs/sgconnect.jar" />
</resourceCopies>
<gradleCopies>
<if condition="bCreateAFSProject">
<true>
<!-- Also copy into AFSProject -->
<!--
We have a dependency in the buildGradleAdditions which
isn't in the AFSProject which is compiled for shipping
builds when AndroidFileServer (AFS) is enabled. To keep
the size of the AFS APK small it doesn't automatically
copy all the libs over.
-->
<copyFile src="$S(PluginDir)/../ThirdParty/android/sgconnect.jar" dst="$S(BuildDir)/gradle/AFSProject/app/libs/sgconnect.jar" />
</true>
</if>
</gradleCopies>
<gradleProperties>
<insert>
<!--android.useAndroidX=true
android.enableJetifier=true-->
kapt.incremental.apt=true
</insert>
</gradleProperties>
<proguardAdditions>
<insert>
<!-- Disable obfuscation for SenseGlove classes -->
-dontwarn com.senseglove.**
-keep class com.senseglove.** { *; }
-keep interface com.senseglove.** { *; }
-keep public class com.senseglove.sgconnect.** { public protected *; }
<!-- Disable obfuscation for AndroidX classes -->
<!---dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }-->
</insert>
</proguardAdditions>
<soLoadLibrary>
<!--
<loadLibrary name="somelib" failmsg="SenseGlove [WARN]: somelib.so library failed to load!" />
-->
</soLoadLibrary>
<androidManifestUpdates>
<!-- For target SDK 31 update the SplashActivity activity -->
<loopElements tag="activity">
<setStringFromAttribute result="activityName" tag="$" name="android:name"/>
@@ -132,28 +111,12 @@
</if>
</loopElements>
<addElements tag="application">
<!--
<addAttribute tag="application" name="android:requestSomeThingHere" value="true"/>
-->
</addElements>
<addPermission android:name="android.permission.BLUETOOTH"/>
<addPermission android:name="android.permission.BLUETOOTH_ADMIN"/>
<addPermission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<addPermission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</androidManifestUpdates>
<!--
<AARImports>
<insertValue value="repository $S(PluginDir)/../../ThirdParty/android"/>
<insertNewline/>
<insertValue value="com.senseglove.sgconnect,sgconnect-android,release" />
<insertNewline/>
</AARImports>
-->
<buildGradleAdditions>
<insert>
ext {
@@ -174,7 +137,6 @@
dependencies {
implementation files('libs/sgconnect.jar')
}
</insert>
</buildGradleAdditions>
@@ -189,21 +151,4 @@
</insert>
</baseBuildGradleAdditions>
<buildscriptGradleAdditions>
</buildscriptGradleAdditions>
<gradleCopies>
</gradleCopies>
<buildXmlPropertyAdditions>
</buildXmlPropertyAdditions>
<minimumSDKAPI>
</minimumSDKAPI>
<gameActivityImportAdditions>
<insert>
import com.senseglove.*;
</insert>
</gameActivityImportAdditions>
</root>
@@ -0,0 +1,223 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBackend/SGBackend.h"
#include "Engine/Engine.h"
#if PLATFORM_ANDROID
#include "SGConnect/SGConnect.h"
#endif /* PLATFORM_ANDROID */
#include "SGCore/SGDeviceList.h"
#include "SGCore/SGHandLayer.h"
#include "SGLog/SGLog.h"
struct USGBackend::FImpl
{
/************************
* Owner object
************************/
USGBackend* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGBackend* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGBackend* USGBackend::GetInstance()
{
if (!ensureAlwaysMsgf(GEngine, TEXT("The engine has not been initialized!")))
{
return nullptr;
}
USGBackend* Instance{GEngine->GetEngineSubsystem<USGBackend>()};
return Instance;
}
USGBackend::USGBackend()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
bBackendInitialized = false;
}
bool USGBackend::InitializeBackend()
{
if (!IsBackendInitialized())
{
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Init();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Device Scanning is already running within a different program.");
return false;
case -1:
SGLOG_ERROR("Device Scanning already being initialized (function called twice in short succession).");
return false;
case 0:
SGLOG_ERROR("Device Scanning is already running within this program.");
return false;
case 1:
SGLOG("Successfully started up DeviceScanning from the current program.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Init return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
// Ensure that the device list is empty before doing anything.
FSGDeviceList::Dispose();
FSGDeviceList::Reinitialize();
bBackendInitialized = true;
return true;
}
return false;
}
bool USGBackend::UninitializeBackend()
{
if (IsBackendInitialized())
{
FSGDeviceList::Dispose();
#if PLATFORM_ANDROID
const int32_t Result = FSGConnect::Dispose();
switch (Result)
{
case -3:
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
return false;
case -2:
SGLOG_ERROR("Not allowed to dispose of Device Scanning because this is not the program which started it.");
return false;
case -1:
SGLOG_ERROR("Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).");
return false;
case 0:
SGLOG_ERROR("There is no deviceScanner running from any program, so disposing is skipped.");
return false;
case 1:
SGLOG("Successfully disposed of DeviceScanner resources.");
break;
default:
ensureAlwaysMsgf(false, TEXT("Unhandled Dispose return status code!"));
return false;
}
#endif /* PLATFORM_ANDROID */
bBackendInitialized = false;
return true;
}
return false;
}
bool USGBackend::ShouldCreateSubsystem(UObject* Outer) const
{
return true;
}
void USGBackend::Initialize(FSubsystemCollectionBase& Collection)
{
SGLOG("Initializing the SenseGlove Backend singleton with the engine lifetime...");
Super::Initialize(Collection);
SGLOG("Initializing the SenseGlove Backend singleton with the engine lifetime...");
if (InitializeBackend())
{
SGLOG("The bridge to the SenseGlove Backend has been initialized successfully!")
}
else
{
SGLOG_ERROR("Failed to initialize the bridge to the SenseGlove Backend!")
}
SGLOG("The SenseGlove Backend singleton has been successfully initialized with the engine lifetime!");
}
void USGBackend::Deinitialize()
{
SGLOG("De-initializing the SenseGlove Backend singleton due to the engine lifetime expiration...");
Super::Deinitialize();
if (UninitializeBackend())
{
SGLOG("The bridge to the SenseGlove Backend has been uninitialized successfully!")
}
else
{
SGLOG_ERROR("Failed to uninitialize the bridge to the SenseGlove Backend!")
}
(void)Pimpl.Release();
SGLOG("The SenseGlove Backend singleton has been successfully de-initialized!");
}
USGBackend::FImpl::FImpl(USGBackend* InOwner)
: Owner(InOwner)
{
}
USGBackend::FImpl::~FImpl() = default;
void USGBackend::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,8 +33,8 @@
*/
#include "SenseGloveCoreTypes.h"
#include "SenseGloveBackend.h"
#include "Modules/ModuleManager.h"
#include "SenseGloveCoreTypesModule.h"
#include "SenseGloveBackendModule.h"
IMPLEMENT_MODULE(FSenseGloveCoreTypesModule, SenseGloveCoreTypes)
IMPLEMENT_MODULE(FSenseGloveBackendModule, SenseGloveBackend)
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,4 +35,4 @@
#pragma once
#include "CoreMinimal.h"
#include "CoreMinimal.h"
@@ -0,0 +1,63 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGloveBackendModule.h"
#include "SGLog/SGLog.h"
#include "SGBackend/SGBackend.h"
#define LOCTEXT_NAMESPACE "FSenseGloveBackendModule"
void FSenseGloveBackendModule::StartupModule()
{
SGLOG("Starting up SenseGloveBackend module...");
}
void FSenseGloveBackendModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveBackend module...");
}
void FSenseGloveBackendModule::PostLoadCallback()
{
SGLOG("Loading of SenseGloveBackend module has succeeded!");
}
void FSenseGloveBackendModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveBackend module...");
}
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,51 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Modules/ModuleInterface.h"
#define LOCTEXT_NAMESPACE "SenseGloveBackend"
class FSenseGloveBackendModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void PreUnloadCallback() override;
virtual void PostLoadCallback() override;
virtual void ShutdownModule() override;
};
#undef LOCTEXT_NAMESPACE
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,38 +35,53 @@
#pragma once
#include "Containers/Array.h"
#include "Math/Color.h"
#include "Math/Rotator.h"
#include "Math/Vector.h"
#include "Subsystems/EngineSubsystem.h"
#include "Templates/UniquePtr.h"
#include "UObject/ObjectMacros.h"
class FSGNovaGloveHandProfileImpl;
#include "SGBackend.generated.h"
namespace SGCore
UCLASS(config = SenseGloveBackend)
class SENSEGLOVEBACKEND_API USGBackend : public UEngineSubsystem
{
namespace Calibration
GENERATED_BODY()
private:
UPROPERTY(Transient)
uint8 bBackendInitialized : 1;
public:
static USGBackend* GetInstance();
private:
struct FImpl;
struct FImplDeleter
{
class NovaGloveCalibration;
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
public:
USGBackend();
public:
FORCEINLINE bool IsBackendInitialized() const
{
return !!bBackendInitialized;
}
}
class SENSEGLOVECOREIMPL_API FSGNovaGloveCalibrationImpl final
{
public:
typedef SGCore::Calibration::NovaGloveCalibration FNovaGloveCalibrationType;
bool InitializeBackend();
bool UninitializeBackend();
public:
static void ApplyDefaultCalibrationInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const FSGNovaGloveHandProfileImpl& Profile);
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
static void ApplyInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const TArray<TArray<FVector>>& RetractedAngles,
const TArray<TArray<FVector>>& ExtendedAngles,
const FSGNovaGloveHandProfileImpl& Profile);
public:
FSGNovaGloveCalibrationImpl() = delete;
virtual ~FSGNovaGloveCalibrationImpl() = delete;
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
};
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,32 +36,23 @@
using System;
using UnrealBuildTool;
public class SenseGloveCoreTypes : ModuleRules
public class SenseGloveBackend : ModuleRules
{
public SenseGloveCoreTypes(ReadOnlyTargetRules Target) : base(Target)
public SenseGloveBackend(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
"SenseGloveConnect",
"SenseGloveCore",
"SenseGloveLog",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveCore",
"SenseGloveTypes",
}
);
}
@@ -0,0 +1,58 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBackendKismet/SGBackendKismetLibrary.h"
#include "SGBackend/SGBackend.h"
USGBackend* USGBackendKismetLibrary::GetInstance()
{
return USGBackend::GetInstance();
}
bool USGBackendKismetLibrary::IsBackendInitialized(const USGBackend* Backend)
{
return Backend->IsBackendInitialized();
}
bool USGBackendKismetLibrary::InitializeBackend(USGBackend* Backend)
{
return Backend->InitializeBackend();
}
bool USGBackendKismetLibrary::UninitializeBackend(USGBackend* Backend)
{
return Backend->UninitializeBackend();
}
@@ -0,0 +1,40 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGloveBackendKismet.h"
#include "Modules/ModuleManager.h"
#include "SenseGloveBackendKismetModule.h"
IMPLEMENT_MODULE(FSenseGloveBackendKismetModule, SenseGloveBackendKismet)
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,4 +33,6 @@
*/
#include "SGInterop/SGIC_ESGCVar.h"
#pragma once
#include "CoreMinimal.h"
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,23 +33,30 @@
*/
#pragma once
#include "SenseGloveBackendKismetModule.h"
#include "Templates/SharedPointer.h"
#include "SGLog/SGLog.h"
class FSGFingerCommandImpl;
class FSGBuzzCommandImpl;
class FSGForceFeedbackCommandImpl;
class FSGTimedBuzzCommandImpl;
#define LOCTEXT_NAMESPACE "FSenseGloveBackendKismetModule"
class SENSEGLOVECORE_API FSGFingerCommandImplCast
void FSenseGloveBackendKismetModule::StartupModule()
{
public:
static TSharedRef<FSGBuzzCommandImpl> ToBuzzCommandImpl(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
SGLOG("Starting up the SenseGloveBackendKismet module...");
}
static TSharedRef<FSGForceFeedbackCommandImpl> ToForceFeedbackCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
void FSenseGloveBackendKismetModule::PreUnloadCallback()
{
SGLOG("Unloading the SenseGloveBackendKismet module...");
}
static TSharedRef<FSGTimedBuzzCommandImpl> ToTimedBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
};
void FSenseGloveBackendKismetModule::PostLoadCallback()
{
SGLOG("Loading of SenseGloveBackendKismet module has succeeded!");
}
void FSenseGloveBackendKismetModule::ShutdownModule()
{
SGLOG("Shutting down the SenseGloveBackendKismet module...");
}
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,51 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Modules/ModuleInterface.h"
#define LOCTEXT_NAMESPACE "SenseGloveBackendKismet"
class FSenseGloveBackendKismetModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void PreUnloadCallback() override;
virtual void PostLoadCallback() override;
virtual void ShutdownModule() override;
};
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,61 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGBackendKismetLibrary.generated.h"
class USGBackend;
UCLASS(meta=(ScriptName = "SesneGloveBackendKismetLibrary"))
class SENSEGLOVEBACKENDKISMET_API USGBackendKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="SenseGlove | Backend")
static USGBackend* GetInstance();
UFUNCTION(BlueprintPure, Category="SenseGlove | Backend")
static bool IsBackendInitialized(const USGBackend* Backend);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Backend")
bool InitializeBackend(UPARAM(ref) USGBackend* Backend);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Backend")
bool UninitializeBackend(UPARAM(ref) USGBackend* Backend);
};
@@ -0,0 +1,58 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
using System;
using UnrealBuildTool;
public class SenseGloveBackendKismet : ModuleRules
{
public SenseGloveBackendKismet(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveBackend",
"SenseGloveLog",
"SenseGloveKismet",
"SenseGloveTypes",
}
);
}
}
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -33,4 +33,4 @@
*/
#include "SGBuildHacks/SGInclude_Core_SensorRange.h"
#include "SGBuildHacks/SGInclude_Core_CustomWaveform.h"
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HandLayer.h"
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticChannelInfo.h"
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationCheck.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationSequence.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCommandBuffer.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveHandProfiles.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveQuickCalibration.h"
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -7,7 +7,7 @@
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

Some files were not shown because too many files have changed in this diff Show More