Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cbe24a4c9
|
||
|
|
1e11ab6320
|
||
|
|
551e625c1f
|
||
|
|
287a81356d
|
||
|
|
02690badc6
|
||
|
|
ba4441655f
|
||
|
|
9b361f5ef9
|
||
|
|
22210f05f0
|
||
|
|
baa2998c8d
|
||
|
|
4b2654a296
|
||
|
|
3393a31e5f
|
||
|
|
3d274c1734
|
||
|
|
eb8a8b197b
|
||
|
|
f3f5893fd8
|
||
|
|
c8801a48fa
|
||
|
|
de11ff03c8
|
||
|
|
42c560c43c
|
||
|
|
dfdb6017dc
|
||
|
|
2523b54a91
|
||
|
|
1d9ca12cf8
|
||
|
|
50599d2832
|
||
|
|
843c528fe1
|
||
|
|
33a0bc10b8
|
||
|
|
2dfb39842e
|
||
|
|
bae22c36f5
|
||
|
|
cfa01f1b97
|
||
|
|
ab72a893e5
|
||
|
|
5c902276e9
|
||
|
|
63ff7ba433
|
||
|
|
4ee17604dd
|
||
|
|
937b298d83
|
||
|
|
5c33917333
|
||
|
|
6d2103bb9b
|
||
|
|
0b30940ee7
|
||
|
|
ba92e4313d
|
||
|
|
c9e8e24ee0
|
||
|
|
f19f76d439
|
||
|
|
3ddef7fe40
|
||
|
|
98c40746d2
|
||
|
|
59f8e1a71a
|
||
|
|
5a9768b42e
|
||
|
|
fc679a9f42
|
||
|
|
978883d19b
|
@@ -43,7 +43,7 @@ SG_HANDBOOK_DEPLOY_TEMP_DIR_NAME := unreal-docs-senseglove-com-deploy-XXXXXXXXXX
|
|||||||
SG_HANDBOOK_FAVICON_FILE := $(SG_HANDBOOK_SRC_DIR)/favicon.svg
|
SG_HANDBOOK_FAVICON_FILE := $(SG_HANDBOOK_SRC_DIR)/favicon.svg
|
||||||
|
|
||||||
SG_DOT_GIT_DIR := $(realpath $(SG_HANDBOOK_DIR)/../.git)
|
SG_DOT_GIT_DIR := $(realpath $(SG_HANDBOOK_DIR)/../.git)
|
||||||
SG_DOT_GIT_SHALLOW_FILE := $(realpath $(SG_DOT_GIT_DIR)/shallow)
|
SG_DOT_GIT_SHALLOW_FILE := $(SG_DOT_GIT_DIR)/shallow
|
||||||
|
|
||||||
SG_PLUGIN_DIR := $(realpath $(SG_HANDBOOK_DIR)/..)
|
SG_PLUGIN_DIR := $(realpath $(SG_HANDBOOK_DIR)/..)
|
||||||
SG_PLUGIN_RESOURCES_DIR := $(SG_PLUGIN_DIR)/Resources
|
SG_PLUGIN_RESOURCES_DIR := $(SG_PLUGIN_DIR)/Resources
|
||||||
@@ -63,7 +63,7 @@ SG_HANDBOOK_PACKED_HTML_DIR := $(SG_DOCUMENTATION_PACK_DIR)/$(SG_HANDBOOK_ESCAP
|
|||||||
SG_HANDBOOK_PACKED_HTML_FILE := $(SG_DOCUMENTATION_PACK_DIR)/$(SG_HANDBOOK_ESCAPED_NAME).zip
|
SG_HANDBOOK_PACKED_HTML_FILE := $(SG_DOCUMENTATION_PACK_DIR)/$(SG_HANDBOOK_ESCAPED_NAME).zip
|
||||||
SG_HANDBOOK_PACKED_PDF_FILE := $(SG_DOCUMENTATION_PACK_DIR)/$(SG_HANDBOOK_ESCAPED_NAME).pdf
|
SG_HANDBOOK_PACKED_PDF_FILE := $(SG_DOCUMENTATION_PACK_DIR)/$(SG_HANDBOOK_ESCAPED_NAME).pdf
|
||||||
|
|
||||||
SG_BROWSER_BINARY_PATH_LINUX := $(shell which brave-bin 2>/dev/null)
|
SG_BROWSER_BINARY_PATH_LINUX := /opt/brave.com/brave/brave
|
||||||
SG_BROWSER_BINARY_PATH_WINDOWS := C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe
|
SG_BROWSER_BINARY_PATH_WINDOWS := C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe
|
||||||
|
|
||||||
SG_RSYNC_BIN_PATH_WINDOWS := C:\Program Files\cwrsync\bin
|
SG_RSYNC_BIN_PATH_WINDOWS := C:\Program Files\cwrsync\bin
|
||||||
@@ -189,9 +189,9 @@ SG_BUILD_HOST := $(shell hostname)
|
|||||||
SG_BUILD_TIME := $(shell date '+%a %b %d, %Y %H:%M %Z %z')
|
SG_BUILD_TIME := $(shell date '+%a %b %d, %Y %H:%M %Z %z')
|
||||||
|
|
||||||
ifeq ($(strip $(SG_GIT_BRANCH)),dev)
|
ifeq ($(strip $(SG_GIT_BRANCH)),dev)
|
||||||
ifeq ($(strip $(SG_GIT_VERSION)),)
|
ifeq ($(strip $(SG_GIT_TAG)),)
|
||||||
SG_HANDBOOK_REVISION := next
|
SG_HANDBOOK_REVISION := next
|
||||||
endif # ($(strip $(SG_GIT_VERSION)),)
|
endif # ($(strip $(SG_GIT_TAG)),)
|
||||||
endif # ($(strip $(SG_GIT_BRANCH)),dev)
|
endif # ($(strip $(SG_GIT_BRANCH)),dev)
|
||||||
|
|
||||||
SG_IS_GIT_BRANCH_HEAD_OR_MASTER := $(or $(filter HEAD,$(strip $(SG_GIT_BRANCH))),$(filter master,$(strip $(SG_GIT_BRANCH))))
|
SG_IS_GIT_BRANCH_HEAD_OR_MASTER := $(or $(filter HEAD,$(strip $(SG_GIT_BRANCH))),$(filter master,$(strip $(SG_GIT_BRANCH))))
|
||||||
@@ -635,6 +635,9 @@ endif # ($(SG_BUILD_PLATFORM),$(SG_BUILD_PLATFORM_LINUX))
|
|||||||
@echo "transform: scale(1.05);" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo "transform: scale(1.05);" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
@echo "}" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo "}" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
@echo ".cell a {" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo ".cell a {" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
|
@echo "display: block;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
|
@echo "height: 100%;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
|
@echo "width: 100%;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
@echo "text-decoration: none;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo "text-decoration: none;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
@echo "color: #fff;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo "color: #fff;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
@echo "font-weight: bold;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
@echo "font-weight: bold;" >> $(SG_HANDBOOK_DEPLOY_GENERATED_HOME_INDEX_FILE)
|
||||||
|
|||||||
+1
-1
@@ -88,4 +88,4 @@ SG_RSYNC_SSH_BINARY_PATH_WINDOWS := $(SG_RSYNC_BIN_PATH_WINDOWS)\ssh.exe
|
|||||||
|
|
||||||
### make pack
|
### make pack
|
||||||
|
|
||||||
This target is meant to be used by the `sgum-packager` utility located in the [Packager](../Packager) folder in order to deploy the documentation in various formats along with the plugin to the Unreal Engine Marketplace.
|
This target is meant to be used by the `sgum-packager` utility located in the [Packager](../Packager) folder in order to deploy the documentation in various formats along with the plugin to [Fab](https://www.fab.com/).
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ This handbook is an ongoing effort and a work in progress to document the SenseG
|
|||||||
Due to superior formatting and frequent updates, we recommend [the online version of the handbook]({{ #sg-handbook-revision-url }}); nonetheless, it's available in [PDF format]({{ #sg-handbook-pdf-url }}) as well.
|
Due to superior formatting and frequent updates, we recommend [the online version of the handbook]({{ #sg-handbook-revision-url }}); nonetheless, it's available in [PDF format]({{ #sg-handbook-pdf-url }}) as well.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Feel free to check out [the SenseGlove Unreal Engine Plugin landing page on the UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/the-senseglove-unreal-engine-plugin) as well.
|
> Feel free to check out [the SenseGlove Unreal Engine Plugin landing page on Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099) as well.
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Welcom to the SenseGlove Unreal Engine Handbook!
|
|||||||
# 🚀 Getting Started
|
# 🚀 Getting Started
|
||||||
|
|
||||||
- [Installation](getting-started/installation/README.md)
|
- [Installation](getting-started/installation/README.md)
|
||||||
- [Through the Epic Games Launcher](getting-started/installation/epic-games-launcher.md)
|
- [Via the Epic Games Launcher](getting-started/installation/epic-games-launcher.md)
|
||||||
- [Through Microsoft Azure DevOps Repositories](getting-started/installation/microsoft-azure-devops-repositories.md)
|
- [Via Microsoft Azure DevOps Repositories](getting-started/installation/microsoft-azure-devops-repositories.md)
|
||||||
- [Enabling and Verifying the Plugin Version](getting-started/plugin-verify-version-enable/README.md)
|
- [Enabling and Verifying the Plugin Version](getting-started/plugin-verify-version-enable/README.md)
|
||||||
- [SenseCom](getting-started/sensecom/README.md)
|
- [SenseCom](getting-started/sensecom/README.md)
|
||||||
- [SenseCom on GNU/Linux](getting-started/sensecom/gnu-linux/README.md)
|
- [SenseCom on GNU/Linux](getting-started/sensecom/gnu-linux/README.md)
|
||||||
@@ -63,8 +63,11 @@ Welcom to the SenseGlove Unreal Engine Handbook!
|
|||||||
|
|
||||||
- [Safe Glove Access in Blueprint](advanced-topics/safe-glove-access-blueprint/README.md)
|
- [Safe Glove Access in Blueprint](advanced-topics/safe-glove-access-blueprint/README.md)
|
||||||
- [OpenXR](advanced-topics/openxr/README.md)
|
- [OpenXR](advanced-topics/openxr/README.md)
|
||||||
|
- [Consuming FXRHandTrackingState](advanced-topics/openxr/consuming-fxrhandtrackingstate/README.md)
|
||||||
|
- [Blueprint](advanced-topics/openxr/consuming-fxrhandtrackingstate/blueprint.md)
|
||||||
|
- [C++](advanced-topics/openxr/consuming-fxrhandtrackingstate/cpp.md)
|
||||||
- [Consuming FXRMotionControllerData](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/README.md)
|
- [Consuming FXRMotionControllerData](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/README.md)
|
||||||
- [Blueprints](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/blueprint.md)
|
- [Blueprint](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/blueprint.md)
|
||||||
- [C++](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/cpp.md)
|
- [C++](advanced-topics/openxr/consuming-fxrmotioncontrollerdata/cpp.md)
|
||||||
|
|
||||||
# 🔌 Low-Level API
|
# 🔌 Low-Level API
|
||||||
|
|||||||
@@ -4,6 +4,32 @@ The SenseGlove Unreal Engine Plugin has provided OpenXR-compatible hand tracking
|
|||||||
|
|
||||||
Typically a user does not need to know anything about OpenXR to use the plugin, so this section of the handbook is for advanced users who are looking for a way to directly consume the OpenXR data coming directly from either a SenseGlove device or if enabled in the plugin settings from hand-tracking.
|
Typically a user does not need to know anything about OpenXR to use the plugin, so this section of the handbook is for advanced users who are looking for a way to directly consume the OpenXR data coming directly from either a SenseGlove device or if enabled in the plugin settings from hand-tracking.
|
||||||
|
|
||||||
Since the SenseGlove Unreal Engine Plugin registers itself as an `OpenXRHandTracking` motion controller device it becomes a hand-tracking provider for Unreal Engine, thus the OpenXR data from SenseGlove could always be retrieved from the Unreal Engine's `IXTrackingSystem` with one caveat. The caveat is if another OpenXR-compatible hand-tracking plugin, e.g. Epic's own OpenXRHandTracking, is enabled simultaneously it's not guaranteed that the `FXRMotionControllerData` retrieved from the `IXTrackingSystem::GetMotionControllerData()` method is coming from SenseGlove, as this method returns the first hand-tracking plugin it could find. Thus, SenseGlove provides its own implementation of `GetMotionControllerData()` which guarantees the retrieved `FXRMotionControllerData` is coming from the SenseGlove Unreal Engine Plugin; and this is the preferred way to that.
|
Since the SenseGlove Unreal Engine Plugin registers itself as an `OpenXRHandTracking` motion controller device it becomes a hand-tracking provider for Unreal Engine, thus the OpenXR data from SenseGlove could always be retrieved from the Unreal Engine's `IXTrackingSystem` with one caveat. The caveat is if another OpenXR-compatible hand-tracking plugin, e.g. Epic's own OpenXRHandTracking, is enabled simultaneously it's not guaranteed that the `FXRMotionControllerData` and `FXRHandTrackingState` structs retrieved from the `IXTrackingSystem::GetMotionControllerData()` and `IXTrackingSystem::GetHandTrackingState()` methods are coming from SenseGlove, as these methods return the first hand-tracking plugin they could find. Thus, SenseGlove provides its own implementation of `GetMotionControllerData()` and `GetHandTrackingState()` which guarantee the retrieved `FXRMotionControllerData` or `FXRHandTrackingState` are coming from the SenseGlove Unreal Engine Plugin; and this is the preferred way to that.
|
||||||
|
|
||||||
In the next sections we'll see [how we can directly consume the `FXRMotionControllerData`](consuming-fxrmotioncontrollerdata/) to draw and animate debug virtual hands in both [Blueprint](consuming-fxrmotioncontrollerdata/blueprint.md) and [C++](consuming-fxrmotioncontrollerdata/cpp.md).
|
> [!NOTE]
|
||||||
|
> In order to retrieve the latest `FXRMotionControllerState` available, The
|
||||||
|
> SenseGlove Unreal Engine Plugin provides an alternative implementation for
|
||||||
|
> `IXTrackingSystem::GetMotionControllerState()` as well . However, since this
|
||||||
|
> method does not rely on the `OpenXRHandTracking` provider, it may become
|
||||||
|
> redundant. As a result, we might consider removing this functionality in
|
||||||
|
> future updates in favor of the one that Unreal Engine provides.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
|
In the next sections we'll see:
|
||||||
|
|
||||||
|
- [How we can directly consume the `FXRMotionControllerData`](consuming-fxrmotioncontrollerdata/) on UE `5.2`, `5.3`, `5.4`, and `5.5` to draw and animate debug virtual hands in both [Blueprint](consuming-fxrmotioncontrollerdata/blueprint.md) and [C++](consuming-fxrmotioncontrollerdata/cpp.md).
|
||||||
|
|
||||||
|
- [How we can directly consume the `FXRHandTrackingState`](consuming-fxrhandtrackingstate/) on UE `5.5` to draw and animate debug virtual hands in both [Blueprint](consuming-fxrhandtrackingstate/blueprint.md) and [C++](consuming-fxrhandtrackingstate/cpp.md).
|
||||||
|
|||||||
@@ -0,0 +1,216 @@
|
|||||||
|
# Consuming FXRHandTrackingState
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand-tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
|
Taking a closer look at the `FXRHandTrackingState` declaration inside the Unreal Engine's `HeadMountedDisplay` module at `[Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h](https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h)`, figuring out the data structure might not seem very straightforward:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct FXRHandTrackingState
|
||||||
|
{
|
||||||
|
GENERATED_USTRUCT_BODY();
|
||||||
|
|
||||||
|
// The state is valid if poses have ever been provided.
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
bool bValid = false;
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
FName DeviceName;
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
FGuid ApplicationInstanceID;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
EXRSpaceType XRSpaceType = EXRSpaceType::UnrealWorldSpace;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
EControllerHand Hand = EControllerHand::Left;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
ETrackingStatus TrackingStatus = ETrackingStatus::NotTracked;
|
||||||
|
|
||||||
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
TArray<FVector> HandKeyLocations;
|
||||||
|
|
||||||
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
TArray<FQuat> HandKeyRotations;
|
||||||
|
|
||||||
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
|
TArray<float> HandKeyRadii;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Which on the Blueprint side it looks like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
But, fear not, we've got you covered!
|
||||||
|
|
||||||
|
## FXRHandTrackingState in Unreal Engine
|
||||||
|
|
||||||
|
`FXRHandTrackingState` is a structure in Unreal Engine designed to hold detailed information about the state of a hand-tracking device at a given moment. This structure is essential for handling hand-tracking inputs in virtual reality (VR) applications, providing the necessary data to accurately track and represent the user's hand movements and actions within the virtual environment.
|
||||||
|
|
||||||
|
### Structure Members of FXRHandTrackingState
|
||||||
|
|
||||||
|
- **bValid**
|
||||||
|
- **Description**: A boolean flag indicating whether the data is valid or not.
|
||||||
|
- **Usage**: This is used to check if the motion controller data is correctly initialized and can be used for further processing.
|
||||||
|
|
||||||
|
- **DeviceName**
|
||||||
|
- **Type**: `FName`
|
||||||
|
- **Description**: The name of the device.
|
||||||
|
- **Usage**: Identifies which device the data is coming from, useful when multiple devices are in use.
|
||||||
|
|
||||||
|
- **ApplicationInstanceID**
|
||||||
|
- **Type**: `FString`
|
||||||
|
- **Description**: A unique identifier for the application instance.
|
||||||
|
- **Usage**: Helps in differentiating data from different instances of an application, ensuring the correct instance processes the data.
|
||||||
|
|
||||||
|
- **XRSpaceType**
|
||||||
|
- **Type**: `EXRSpaceType`
|
||||||
|
- **Description**: Enum specifying the type of XR space being used (e.g., unreal world or tracking space).
|
||||||
|
- **Usage**: Specifies the coordinate system the XR Device is tracking itself in.
|
||||||
|
|
||||||
|
- **Hand**
|
||||||
|
- **Type**: `EControllerHand`
|
||||||
|
- **Description**: Enum indicating which hand is being tracked (left or right).
|
||||||
|
- **Usage**: Helps identify whether the hand-tracking data pertains to the left or right hand, essential for hand-specific actions or interactions.
|
||||||
|
|
||||||
|
- **TrackingStatus**
|
||||||
|
- **Type**: `EXRTrackingStatus`
|
||||||
|
- **Description**: Enum indicating the tracking status of the hand-tracking device.
|
||||||
|
- **Usage**: Shows whether the hand-tracking device is being tracked accurately, with possible statuses like `Tracked`, `NotTracked`, etc.
|
||||||
|
|
||||||
|
- **HandKeyLocations**
|
||||||
|
- **Type**: `TArray<FVector>`
|
||||||
|
- **Description**: An array of vectors representing key locations of the hand.
|
||||||
|
- **Usage**: Provides detailed locations of key points on the hand, useful for precise hand-tracking and interaction.
|
||||||
|
|
||||||
|
- **HandKeyRotations**
|
||||||
|
- **Type**: `TArray<FQuat>`
|
||||||
|
- **Description**: An array of quaternions representing key rotations of the hand.
|
||||||
|
- **Usage**: Complements the hand key locations with rotational data, ensuring accurate representation of hand movements.
|
||||||
|
|
||||||
|
- **HandKeyRadii**
|
||||||
|
- **Type**: `TArray<float>`
|
||||||
|
- **Description**: An array of floats representing the radii of key points of the hand.
|
||||||
|
- **Usage**: Gives the size of the hand key points, aiding in collision detection and interaction fidelity.
|
||||||
|
|
||||||
|
### Organization of FXRHandTrackingState
|
||||||
|
|
||||||
|
The structure is organized to encapsulate all relevant data needed for hand-tracking in a coherent and accessible manner. Boolean flag `bValid` provides quick checks on the state of the controller data. Identifiers `DeviceName` and `ApplicationInstanceID` ensure the correct association of data. Arrays `HandKeyLocations`, `HandKeyRotations`, and `HandKeyRadii` allow detailed hand-tracking, which is critical for immersive VR experiences. Lastly, the tracking status `TrackingStatus` informs the system of the reliability of the data being processed and whether the hands are actively being tracked or they are inactive at the moment.
|
||||||
|
|
||||||
|
### Processing the Data for Drawing and Animating a Virtual Hand
|
||||||
|
|
||||||
|
In order to draw and animate a virtual hand in real-time whether the data is coming from hand-tracking or a SenseGlove device, we could consume the data from the `HandKeyLocations` and `HandKeyRotations` fields of the `FXRHandTrackingState` struct.
|
||||||
|
|
||||||
|
Both `HandKeyLocations` and `HandKeyRotations` contain 26 elements as defined by OpenXR's [`XR_HAND_JOINT_COUNT_EXT`](https://registry.khronos.org/OpenXR/specs/1.1/man/html/XR_HAND_JOINT_COUNT_EXT.html) and [`XrHandJointLocationsEXT`](https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrHandJointLocationsEXT.html), etc.
|
||||||
|
|
||||||
|
Unreal Engine also provides an enum called `EHandKeypoint` naming the 26 joints, and the equivalent of `XR_HAND_JOINT_COUNT_EXT` as `EHandKeypointCount` inside `[Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h](https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h)` as follows:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
/**
|
||||||
|
* Transforms that are tracked on the hand.
|
||||||
|
* Matches the enums from WMR to make it a direct mapping
|
||||||
|
*/
|
||||||
|
UENUM(BlueprintType)
|
||||||
|
enum class EHandKeypoint : uint8
|
||||||
|
{
|
||||||
|
Palm,
|
||||||
|
Wrist,
|
||||||
|
ThumbMetacarpal,
|
||||||
|
ThumbProximal,
|
||||||
|
ThumbDistal,
|
||||||
|
ThumbTip,
|
||||||
|
IndexMetacarpal,
|
||||||
|
IndexProximal,
|
||||||
|
IndexIntermediate,
|
||||||
|
IndexDistal,
|
||||||
|
IndexTip,
|
||||||
|
MiddleMetacarpal,
|
||||||
|
MiddleProximal,
|
||||||
|
MiddleIntermediate,
|
||||||
|
MiddleDistal,
|
||||||
|
MiddleTip,
|
||||||
|
RingMetacarpal,
|
||||||
|
RingProximal,
|
||||||
|
RingIntermediate,
|
||||||
|
RingDistal,
|
||||||
|
RingTip,
|
||||||
|
LittleMetacarpal,
|
||||||
|
LittleProximal,
|
||||||
|
LittleIntermediate,
|
||||||
|
LittleDistal,
|
||||||
|
LittleTip
|
||||||
|
};
|
||||||
|
|
||||||
|
const int32 EHandKeypointCount = static_cast<int32>(EHandKeypoint::LittleTip) + 1;
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
So, getting the any joint's location or rotation is as easy as casting the enum value and passing it as the array index.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
const bool bGotHandTrackingState = FSGXRTracker::GetHandTrackingState(
|
||||||
|
GetWorld(), EXRSpaceType::UnrealWorldSpace, EControllerHand::Left, HandTrackingState);
|
||||||
|
|
||||||
|
// Return if the struct data is invalid!
|
||||||
|
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return if the device is not being tracked!
|
||||||
|
if (HandTrackingState.TrackingStatus == ETrackingStatus::NotTracked)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that HandTrackingState.HandKeyLocations has the location data
|
||||||
|
// for 26 joints!
|
||||||
|
if (!ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num()
|
||||||
|
== EHandKeypointCount,
|
||||||
|
TEXT("Invalid HandKeyLocations count!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that HandTrackingState.HandKeyRotations has the rotation data
|
||||||
|
// for 26 joints!
|
||||||
|
if (!ensureAlwaysMsgf(HandTrackingState.HandKeyRotations.Num()
|
||||||
|
== EHandKeypointCount,
|
||||||
|
TEXT("Invalid HandKeyRotations count!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr int32 PalmIndex = static_cast<int32>(EHandKeypoint::Palm);
|
||||||
|
|
||||||
|
const FVector& PalmLocation{
|
||||||
|
HandTrackingState.HandKeyLocations[PalmIndex]
|
||||||
|
};
|
||||||
|
const FRotator& PalmRotation{
|
||||||
|
HandTrackingState.HandKeyRotations[PalmIndex].Rotator()
|
||||||
|
};
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
The equivalent Blueprint code for the above looks something like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
OK, now that we've got a glimpse of how the virtual hand's joint data could be processed we are going to draw and animate a virtual hand in both [Blueprint](blueprint.md) and [C++](cpp.md) in the upcoming sections.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Consuming FXRHandTrackingState in Blueprint
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
|
Before continuing this section, please ensure you've studied the [Consuming FXRHandTrackingState](./) section, first.
|
||||||
|
|
||||||
|
## Drawing and Animating Virtual Hands
|
||||||
|
|
||||||
|
1. Create a new Virtual Reality project based [the Unreal VR Template](https://dev.epicgames.com/documentation/en-us/unreal-engine/vr-template-in-unreal-engine).
|
||||||
|
|
||||||
|
2. Make sure the [SenseGlove UnrealEngine plugin is installed and enabled](/getting-started/installation.md) inside your new project.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. You could use either hand-tracking or a SenseGlove device as the input data, or both of the inside the same project. Whether you would like to use hand-tracking or a SenseGlove device, please make sure the required steps are taken for each of those first.
|
||||||
|
|
||||||
|
4. You could add the required Blueprint code for drawing virtual hands to either your Level Buleprint or the VRPawn Blueprint Class located at `/Content/VRTemplate/Blueprints/VRPawn`. In this guide we are going to add the code to our VRPawn.
|
||||||
|
|
||||||
|
5. Add a new function named `Draw Hand` with an input parameter of type `EController Hand` named `Hand`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. Inside this function's event graph add a `Get Hand Tracking State` node from `SenseGlove > Tracking > XR Tracker > Get Hand Tracking State`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
7. Then connect the functions `Hand` input parameter to the `Get Hand Tracking State`'s `Hand` input and right-click on the `OutHandTrackingState` parameter and use the `Break XRHandTrackingState` node to break the struct to it's fields.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
8. After this, we need to perform data validation by checking the return status of the `Get Hand Tracking State` function and `FXRHandTrackingState`'s `Valid` field. Then, we check if the hand-tracking device is being tracked and indeed coming from a hand-tracking source. And, finally, we check whether we have the positions and rotations for exactly `26` joints or not.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
9. OK, now it's time to draw the joints! If we check out the SenseGlove Debug module's draw option, we notice there are various ways to draw the debug virtual hand. Drawing a cube or a gizmo per joint, or draw the whole hand all at once by passing the retrieved `FXRHandTrackingState` to the `DebugVirtualHand::Draw` function! But, since the point of this tutorial is to learn how to consume the `FXRHandTrackingState` we ignore the last option. Between the debug cubes or gizmos, we are going to choose the gizmos since they better represent the rotations than the cubes.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
10. In the last step inside the `Draw Hand` function, in order to draw a virtual hand with `26` joints, we have to first iterate through either of the `Hand Key Positions` or `Hand Key Rotations` arrays from the `FXRHandTrackingState` struct. Since we made sure both arrays have `26` elements before we reached this step, it's safe to just iterate over one and use the `Array Index` inside a `For Each Loop` or a `For Loop` to access the position and rotation of every joint. Then we use each array `Get (a ref)` method to access the position and rotation data inside the loop and call the `Draw` function from `SenseGlove > Debug > Gizmo` per every joint. Please note that there are two `Draw` functions and the only difference between the two is that one accepts an `FQuat` and the other a `FRotator` for its `Rotation` input parameter. In this case, we use the `FQuat` variant to avoid an extra conversion to `FRotator`. Also, please adjust the `Thickness` option for the `Settings` parameter from `1.0` to `0.2`, as the default value might be too thick for drawing a joint gizmo.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
11. Well, now the full implementation for the `Draw Hand` function insde the `VRPawn` should look something like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
12. Finally, go back to `VRPawn`'s event graph and the following code to the `Tick` event. Basically what we do here is call our newly implemented `Draw Hand` twice, once for each hand.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
13. Now, go back to the `VRTemplateMap` and use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
||||||
|
|
||||||
|

|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,259 @@
|
|||||||
|
# Consuming FXRHandTrackingState in C++
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
|
Before continuing this section, please ensure you've first studied the [Consuming FXRHandTrackingState](./) section.
|
||||||
|
|
||||||
|
## Drawing and Animating Virtual Hands
|
||||||
|
|
||||||
|
1. Create a new Virtual Reality project based [the Unreal VR Template](https://dev.epicgames.com/documentation/en-us/unreal-engine/vr-template-in-unreal-engine).
|
||||||
|
|
||||||
|
2. Make sure the [SenseGlove UnrealEngine plugin is installed and enabled](/getting-started/installation.md) inside your new project.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. You could use either hand-tracking or a SenseGlove device as the input data, or both of the inside the same project. Whether you would like to use hand-tracking or a SenseGlove device, please make sure the required steps are taken for each of those first.
|
||||||
|
|
||||||
|
4. From the `Tools` menu choose `New C++ class...`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
5. Choose the Unreal Engine's `APawn` class as the parent class for the new C++ pawn class.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. Name the new pawn class `DebugPawn`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
7. Since we have created a new C++ class, this converts the current Blueprint VRTemplateMap project to a C++ one. That's why the Unreal Editor will give us a few prompts regarding opening the project in the default IDE and rebuilding the code. It might be simpler to just close the editor, then rebuild the source code inside your favorite IDE, and then start the editor with the converted project again.
|
||||||
|
|
||||||
|
8. Find and open the VRPawn Blueprint Class located at `/Content/VRTemplate/Blueprints/VRPawn` inside the Blueprint Editor and from the `File` menu choose the `Reparent Blueprint` class.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
9. In the new `Reparent blueprint` window choose `DebugPawn` as the new parent.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
10. By looking at the `Parent Class` label located under the Blueprint Editor window control buttons verify that the `ADebugPawn` class has been set as the new parent.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
11. Locate the project's main Build file, in our case `VirtualHandCpp/Source/VirtualHandCpp/VirtualHandCpp.Build.cs` and add the `InputDevice`, `OpenXRHMD`, `SenseGloveBuildHacks`, `SenseGloveDebug`, `SenseGloveSettings`, and `SenseGloveTracking` modules as either a private or public dependency.
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class VirtualHandCpp : ModuleRules
|
||||||
|
{
|
||||||
|
public VirtualHandCpp(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||||
|
|
||||||
|
PrivateDependencyModuleNames.AddRange(new string[]
|
||||||
|
{
|
||||||
|
"InputDevice",
|
||||||
|
"OpenXRHMD",
|
||||||
|
"SenseGloveBuildHacks",
|
||||||
|
"SenseGloveDebug",
|
||||||
|
"SenseGloveSettings",
|
||||||
|
"SenseGloveTracking"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Uncomment if you are using Slate UI
|
||||||
|
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||||
|
|
||||||
|
// Uncomment if you are using online features
|
||||||
|
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
||||||
|
|
||||||
|
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
12. Locate the C++ header and source file for the `ADebugPawn` inside the project in your C++ IDE. In our case they are located at `VirtualHandCpp/Source/VirtualHandCpp/DebugPawn.h` and `VirtualHandCpp/Source/VirtualHandCpp/DebugPawn.cpp`.
|
||||||
|
|
||||||
|
13. Modify the `DebugPawn.h` header file to look like this:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/Pawn.h"
|
||||||
|
|
||||||
|
#include "SGSettings/SGDebugGizmoSettings.h"
|
||||||
|
|
||||||
|
#include "DebugPawn.generated.h"
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class VIRTUALHANDCPP_API ADebugPawn : public APawn
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
private:
|
||||||
|
// The virtual hand drawing settings.
|
||||||
|
UPROPERTY(EditDefaultsOnly, Category="DebugPawn",
|
||||||
|
meta=(AllowPrivateAccess="false"))
|
||||||
|
FSGDebugGizmoSettings HandDrawingSettings;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Sets default values for this pawn's properties
|
||||||
|
ADebugPawn();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Called every frame
|
||||||
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
|
// Called to bind functionality to input
|
||||||
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// The method responsible for drawing a virtual hand.
|
||||||
|
void DrawHand(EControllerHand Hand) const;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
14. Modify the `DebugPawn.cpp` implementation file to look like this:
|
||||||
|
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "DebugPawn.h"
|
||||||
|
|
||||||
|
#include "SGDebug/SGDebugGizmo.h"
|
||||||
|
#include "SGTracking/SGXRTracker.h"
|
||||||
|
|
||||||
|
// Sets default values
|
||||||
|
ADebugPawn::ADebugPawn()
|
||||||
|
{
|
||||||
|
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
|
// Set the default virtual hand drawing settings.
|
||||||
|
HandDrawingSettings = FSGDebugGizmoSettings{
|
||||||
|
1.0f,
|
||||||
|
FColor{255, 0, 0, 255},
|
||||||
|
FColor{0, 255, 0, 255},
|
||||||
|
FColor{0, 0, 255, 255},
|
||||||
|
false,
|
||||||
|
1.1f,
|
||||||
|
0,
|
||||||
|
0.2f,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
void ADebugPawn::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
void ADebugPawn::Tick(float DeltaTime)
|
||||||
|
{
|
||||||
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
// Attempt at drawing the left/right virtual hands every frame.
|
||||||
|
DrawHand(EControllerHand::Left);
|
||||||
|
DrawHand(EControllerHand::Right);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called to bind functionality to input
|
||||||
|
void ADebugPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||||
|
{
|
||||||
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADebugPawn::DrawHand(const EControllerHand Hand) const
|
||||||
|
{
|
||||||
|
// Get the world and cache it, if it's null we return early.
|
||||||
|
UWorld* World{GetWorld()};
|
||||||
|
if (!IsValid(World))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
const bool bGotHandTrackingState = FSGXRTracker::GetHandTrackingState(
|
||||||
|
World, EXRSpaceType::UnrealWorldSpace, Hand, HandTrackingState);
|
||||||
|
|
||||||
|
// Return if the struct data is invalid!
|
||||||
|
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return if the device is not being tracked!
|
||||||
|
if (HandTrackingState.TrackingStatus == ETrackingStatus::NotTracked)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that HandTrackingState.HandKeyLocations has the location data
|
||||||
|
// for 26 joints!
|
||||||
|
if (!ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num()
|
||||||
|
== EHandKeypointCount,
|
||||||
|
TEXT("Invalid HandKeyLocations count!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that HandTrackingState.HandKeyRotations has the rotation data
|
||||||
|
// for 26 joints!
|
||||||
|
if (!ensureAlwaysMsgf(HandTrackingState.HandKeyRotations.Num()
|
||||||
|
== EHandKeypointCount,
|
||||||
|
TEXT("Invalid HandKeyRotations count!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterate over the hand joint locations and rotations!
|
||||||
|
for (int32 JointIndex = 0; JointIndex < EHandKeypointCount; ++JointIndex)
|
||||||
|
{
|
||||||
|
const FVector& JointLocation{
|
||||||
|
HandTrackingState.HandKeyLocations[JointIndex]
|
||||||
|
};
|
||||||
|
const FQuat& JointRotation{
|
||||||
|
HandTrackingState.HandKeyRotations[JointIndex]
|
||||||
|
};
|
||||||
|
|
||||||
|
// Draw a single joint's gizmo!
|
||||||
|
// Please note that we could alternatively:
|
||||||
|
// Use FSGDebugCube::Draw() to draw a cube.
|
||||||
|
// Or use the FSGDebugVirtualHand::Draw() method and pass the
|
||||||
|
// HandTrackingState directly to draw the virtual hand
|
||||||
|
// all at once without iterating the joints. But, that's not
|
||||||
|
// goal of this tutorial.
|
||||||
|
FSGDebugGizmo::Draw(World, JointLocation, JointRotation, HandDrawingSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
15. Now, rebuild the source code and go back to the `VRTemplateMap`, then use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
||||||
|
|
||||||
|

|
||||||
BIN
Binary file not shown.
@@ -1,61 +1,75 @@
|
|||||||
# Consuming FXRMotionControllerData
|
# Consuming FXRMotionControllerData
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
Taking a closer look at the `FXRMotionControllerData` declaration inside the Unreal Engine's `HeadMountedDisplay` module at `[Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h](https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h)`, figuring out the data structure might not seem very straightforward:
|
Taking a closer look at the `FXRMotionControllerData` declaration inside the Unreal Engine's `HeadMountedDisplay` module at `[Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h](https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/HeadMountedDisplay/Public/HeadMountedDisplayTypes.h)`, figuring out the data structure might not seem very straightforward:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct FXRMotionControllerData
|
struct FXRMotionControllerData
|
||||||
{
|
{
|
||||||
GENERATED_USTRUCT_BODY();
|
GENERATED_USTRUCT_BODY();
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
bool bValid = false;
|
bool bValid = false;
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FName DeviceName;
|
FName DeviceName;
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FGuid ApplicationInstanceID;
|
FGuid ApplicationInstanceID;
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
EXRVisualType DeviceVisualType = EXRVisualType::Controller;
|
EXRVisualType DeviceVisualType = EXRVisualType::Controller;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
EControllerHand HandIndex = EControllerHand::Left;
|
EControllerHand HandIndex = EControllerHand::Left;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
ETrackingStatus TrackingStatus = ETrackingStatus::NotTracked;
|
ETrackingStatus TrackingStatus = ETrackingStatus::NotTracked;
|
||||||
|
|
||||||
// Vector representing an object being held in the player's hand
|
// Vector representing an object being held in the player's hand
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FVector GripPosition = FVector(0.0f);
|
FVector GripPosition = FVector(0.0f);
|
||||||
// Quaternion representing an object being held in the player's hand
|
// Quaternion representing an object being held in the player's hand
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FQuat GripRotation = FQuat(EForceInit::ForceInitToZero);
|
FQuat GripRotation = FQuat(EForceInit::ForceInitToZero);
|
||||||
|
|
||||||
// For handheld controllers, gives a vector for pointing at objects
|
// For handheld controllers, gives a vector for pointing at objects
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FVector AimPosition = FVector(0.0f);
|
FVector AimPosition = FVector(0.0f);
|
||||||
// For handheld controllers, gives a quaternion for pointing at objects
|
// For handheld controllers, gives a quaternion for pointing at objects
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FQuat AimRotation = FQuat(EForceInit::ForceInitToZero);
|
FQuat AimRotation = FQuat(EForceInit::ForceInitToZero);
|
||||||
|
|
||||||
// For handheld controllers, gives a vector for representing the hand
|
// For handheld controllers, gives a vector for representing the hand
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FVector PalmPosition = FVector(0.0f);
|
FVector PalmPosition = FVector(0.0f);
|
||||||
// For handheld controllers, gives a quaternion for representing the hand
|
// For handheld controllers, gives a quaternion for representing the hand
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
FQuat PalmRotation = FQuat(EForceInit::ForceInitToZero);
|
FQuat PalmRotation = FQuat(EForceInit::ForceInitToZero);
|
||||||
|
|
||||||
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
TArray<FVector> HandKeyPositions;
|
TArray<FVector> HandKeyPositions;
|
||||||
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
TArray<FQuat> HandKeyRotations;
|
TArray<FQuat> HandKeyRotations;
|
||||||
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
// The indices of this array are the values of EHandKeypoint (Palm, Wrist, ThumbMetacarpal, etc).
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
TArray<float> HandKeyRadii;
|
TArray<float> HandKeyRadii;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
UPROPERTY(BlueprintReadOnly, Category = "XR")
|
||||||
bool bIsGrasped = false;
|
bool bIsGrasped = false;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -71,68 +85,88 @@ But, fear not, we've got you covered!
|
|||||||
|
|
||||||
### Structure Members of FXRMotionControllerData
|
### Structure Members of FXRMotionControllerData
|
||||||
|
|
||||||
1. **bValid**
|
- **bValid**
|
||||||
- **Description**: A boolean flag indicating whether the data is valid or not.
|
- **Description**: A boolean flag indicating whether the data is valid or not.
|
||||||
- **Usage**: This is used to check if the motion controller data is correctly initialized and can be used for further processing.
|
- **Usage**: This is used to check if the motion controller data is correctly initialized and can be used for further processing.
|
||||||
|
|
||||||
2. **DeviceName**
|
- **DeviceName**
|
||||||
- **Type**: `FName`
|
- **Type**: `FName`
|
||||||
- **Description**: The name of the device.
|
- **Description**: The name of the device.
|
||||||
- **Usage**: Identifies which motion controller device the data is coming from, useful when multiple devices are in use.
|
- **Usage**: Identifies which motion controller device the data is coming from, useful when multiple devices are in use.
|
||||||
|
|
||||||
3. **ApplicationInstanceID**
|
- **ApplicationInstanceID**
|
||||||
- **Type**: `FString`
|
- **Type**: `FString`
|
||||||
- **Description**: A unique identifier for the application instance.
|
- **Description**: A unique identifier for the application instance.
|
||||||
- **Usage**: Helps in differentiating data from different instances of an application, ensuring the correct instance processes the data.
|
- **Usage**: Helps in differentiating data from different instances of an application, ensuring the correct instance processes the data.
|
||||||
|
|
||||||
4. **TrackingStatus**
|
- **DeviceVisualType**
|
||||||
|
- **Type**: `EXRVisualType`
|
||||||
|
- **Description**: Enum specifying the visual type of the device (e.g., controller, hand).
|
||||||
|
- **Usage**: Used to differentiate between various motion controller devices or hand-tracking representations for rendering and interaction purposes.
|
||||||
|
|
||||||
|
- **HandIndex**
|
||||||
|
- **Type**: `EControllerHand`
|
||||||
|
- **Description**: Enum indicating which hand is being tracked (left or right).
|
||||||
|
- **Usage**: Helps identify whether the motion data pertains to the left or right hand, essential for hand-specific actions or interactions.
|
||||||
|
|
||||||
|
- **TrackingStatus**
|
||||||
- **Type**: `EXRTrackingStatus`
|
- **Type**: `EXRTrackingStatus`
|
||||||
- **Description**: Enum indicating the tracking status of the motion controller.
|
- **Description**: Enum indicating the tracking status of the motion controller.
|
||||||
- **Usage**: Shows whether the controller is being tracked accurately, with possible statuses like `Tracked`, `NotTracked`, etc.
|
- **Usage**: Shows whether the controller is being tracked accurately, with possible statuses like `Tracked`, `NotTracked`, etc.
|
||||||
|
|
||||||
5. **GripPosition**
|
- **GripPosition**
|
||||||
- **Type**: `FVector`
|
- **Type**: `FVector`
|
||||||
- **Description**: The position of the grip in world coordinates.
|
- **Description**: The position of the grip in world coordinates.
|
||||||
- **Usage**: Provides the 3D coordinates of the controller's grip, essential for positioning the virtual representation of the controller.
|
- **Usage**: Provides the 3D coordinates of the controller's grip, essential for positioning the virtual representation of the controller.
|
||||||
|
|
||||||
6. **GripRotation**
|
- **GripRotation**
|
||||||
- **Type**: `FQuat`
|
- **Type**: `FQuat`
|
||||||
- **Description**: The rotation of the grip in world coordinates.
|
- **Description**: The rotation of the grip in world coordinates.
|
||||||
- **Usage**: Provides the orientation of the controller's grip, allowing for accurate rotation and alignment in the virtual space.
|
- **Usage**: Provides the orientation of the controller's grip, allowing for accurate rotation and alignment in the virtual space.
|
||||||
|
|
||||||
7. **AimPosition**
|
- **AimPosition**
|
||||||
- **Type**: `FVector`
|
- **Type**: `FVector`
|
||||||
- **Description**: The position of the aim point in world coordinates.
|
- **Description**: The position of the aim point in world coordinates.
|
||||||
- **Usage**: Specifies where the controller is aiming, useful for aiming or pointing actions.
|
- **Usage**: Specifies where the controller is aiming, useful for aiming or pointing actions.
|
||||||
|
|
||||||
8. **AimRotation**
|
- **AimRotation**
|
||||||
- **Type**: `FQuat`
|
- **Type**: `FQuat`
|
||||||
- **Description**: The rotation of the aim point in world coordinates.
|
- **Description**: The rotation of the aim point in world coordinates.
|
||||||
- **Usage**: Determines the orientation of the aim direction, important for actions like shooting or selecting objects in VR.
|
- **Usage**: Determines the orientation of the aim direction, important for actions like shooting or selecting objects in VR.
|
||||||
|
|
||||||
9. **HandKeyPositions**
|
- **PalmPosition**
|
||||||
|
- **Type**: `FVector`
|
||||||
|
- **Description**: The position of the palm in world coordinates.
|
||||||
|
- **Usage**: Provides the 3D location of the palm, important for determining hand gestures or interactions in VR.
|
||||||
|
|
||||||
|
- **PalmRotation**
|
||||||
|
- **Type**: `FQuat`
|
||||||
|
- **Description**: The rotation of the palm in world coordinates.
|
||||||
|
- **Usage**: Defines the orientation of the palm, crucial for hand-based interaction accuracy and realism in VR experiences.
|
||||||
|
|
||||||
|
- **HandKeyPositions**
|
||||||
- **Type**: `TArray<FVector>`
|
- **Type**: `TArray<FVector>`
|
||||||
- **Description**: An array of vectors representing key positions of the hand.
|
- **Description**: An array of vectors representing key positions of the hand.
|
||||||
- **Usage**: Provides detailed positions of key points on the hand, useful for precise hand tracking and interaction.
|
- **Usage**: Provides detailed positions of key points on the hand, useful for precise hand tracking and interaction.
|
||||||
|
|
||||||
10. **HandKeyRotations**
|
- **HandKeyRotations**
|
||||||
- **Type**: `TArray<FQuat>`
|
- **Type**: `TArray<FQuat>`
|
||||||
- **Description**: An array of quaternions representing key rotations of the hand.
|
- **Description**: An array of quaternions representing key rotations of the hand.
|
||||||
- **Usage**: Complements the hand key positions with rotational data, ensuring accurate representation of hand movements.
|
- **Usage**: Complements the hand key positions with rotational data, ensuring accurate representation of hand movements.
|
||||||
|
|
||||||
11. **HandKeyRadii**
|
- **HandKeyRadii**
|
||||||
- **Type**: `TArray<float>`
|
- **Type**: `TArray<float>`
|
||||||
- **Description**: An array of floats representing the radii of key points of the hand.
|
- **Description**: An array of floats representing the radii of key points of the hand.
|
||||||
- **Usage**: Gives the size of the hand key points, aiding in collision detection and interaction fidelity.
|
- **Usage**: Gives the size of the hand key points, aiding in collision detection and interaction fidelity.
|
||||||
|
|
||||||
12. **bIsGrasped**
|
- **bIsGrasped**
|
||||||
- **Type**: `bool`
|
- **Type**: `bool`
|
||||||
- **Description**: A boolean indicating whether the controller is currently grasping an object.
|
- **Description**: A boolean indicating whether the controller is currently grasping an object.
|
||||||
- **Usage**: Determines if the user is holding something, affecting interactions and animations.
|
- **Usage**: Determines if the user is holding something, affecting interactions and animations.
|
||||||
|
|
||||||
### Organization of FXRMotionControllerData
|
### Organization of FXRMotionControllerData
|
||||||
|
|
||||||
The structure is organized to encapsulate all relevant data needed for motion controller tracking in a coherent and accessible manner. Boolean flags `bValid` and `bIsGrasped` provide quick checks on the state of the controller data. Identifiers `DeviceName` and `ApplicationInstanceID` ensure the correct association of data. Positional and rotational data `GripPosition`, `GripRotation`, `AimPosition`, and `AimRotation` offer precise tracking of the controller's movement. Arrays `HandKeyPositions`, `HandKeyRotations`, and `HandKeyRadii` allow detailed hand tracking, which is critical for immersive VR experiences. Lastly, the tracking status `TrackingStatus` informs the system of the reliability of the data being processed and whether the motion controller is actively being tracked or it's inactive at the moment.
|
The structure is organized to encapsulate all relevant data needed for hand and motion controller tracking in a coherent and accessible manner. Boolean flags `bValid` and `bIsGrasped` provide quick checks on the state of the controller data. Identifiers `DeviceName` and `ApplicationInstanceID` ensure the correct association of data. Positional and rotational data `GripPosition`, `GripRotation`, `AimPosition`, and `AimRotation` offer precise tracking of the controller's movement. Arrays `HandKeyPositions`, `HandKeyRotations`, and `HandKeyRadii` allow detailed hand tracking, which is critical for immersive VR experiences. Lastly, the tracking status `TrackingStatus` informs the system of the reliability of the data being processed and whether the motion controller is actively being tracked or it's inactive at the moment.
|
||||||
|
|
||||||
### Processing the Data for Drawing and Animating a Virtual Hand
|
### Processing the Data for Drawing and Animating a Virtual Hand
|
||||||
|
|
||||||
@@ -150,32 +184,32 @@ Unreal Engine also provides an enum called `EHandKeypoint` naming the 26 joints,
|
|||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
enum class EHandKeypoint : uint8
|
enum class EHandKeypoint : uint8
|
||||||
{
|
{
|
||||||
Palm,
|
Palm,
|
||||||
Wrist,
|
Wrist,
|
||||||
ThumbMetacarpal,
|
ThumbMetacarpal,
|
||||||
ThumbProximal,
|
ThumbProximal,
|
||||||
ThumbDistal,
|
ThumbDistal,
|
||||||
ThumbTip,
|
ThumbTip,
|
||||||
IndexMetacarpal,
|
IndexMetacarpal,
|
||||||
IndexProximal,
|
IndexProximal,
|
||||||
IndexIntermediate,
|
IndexIntermediate,
|
||||||
IndexDistal,
|
IndexDistal,
|
||||||
IndexTip,
|
IndexTip,
|
||||||
MiddleMetacarpal,
|
MiddleMetacarpal,
|
||||||
MiddleProximal,
|
MiddleProximal,
|
||||||
MiddleIntermediate,
|
MiddleIntermediate,
|
||||||
MiddleDistal,
|
MiddleDistal,
|
||||||
MiddleTip,
|
MiddleTip,
|
||||||
RingMetacarpal,
|
RingMetacarpal,
|
||||||
RingProximal,
|
RingProximal,
|
||||||
RingIntermediate,
|
RingIntermediate,
|
||||||
RingDistal,
|
RingDistal,
|
||||||
RingTip,
|
RingTip,
|
||||||
LittleMetacarpal,
|
LittleMetacarpal,
|
||||||
LittleProximal,
|
LittleProximal,
|
||||||
LittleIntermediate,
|
LittleIntermediate,
|
||||||
LittleDistal,
|
LittleDistal,
|
||||||
LittleTip
|
LittleTip
|
||||||
};
|
};
|
||||||
|
|
||||||
const int32 EHandKeypointCount = static_cast<int32>(EHandKeypoint::LittleTip) + 1;
|
const int32 EHandKeypointCount = static_cast<int32>(EHandKeypoint::LittleTip) + 1;
|
||||||
@@ -217,7 +251,7 @@ So, getting the any joint's position or rotation is as easy as casting the enum
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that MotionControllerData.HandKeyPositions has the rotation data
|
// Ensure that MotionControllerData.HandKeyRotations has the rotation data
|
||||||
// for 26 joints!
|
// for 26 joints!
|
||||||
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyRotations.Num()
|
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyRotations.Num()
|
||||||
== EHandKeypointCount,
|
== EHandKeypointCount,
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# Consuming FXRMotionControllerData in Blueprint
|
# Consuming FXRMotionControllerData in Blueprint
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
Before continuing this section, please ensure you've studied the [Consuming FXRMotionControllerData](./) section, first.
|
Before continuing this section, please ensure you've studied the [Consuming FXRMotionControllerData](./) section, first.
|
||||||
|
|
||||||
## Drawing and Animating Virtual Hands
|
## Drawing and Animating Virtual Hands
|
||||||
@@ -48,4 +62,4 @@ Before continuing this section, please ensure you've studied the [Consuming FXRM
|
|||||||
|
|
||||||
13. Now, go back to the `VRTemplateMap` and use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
13. Now, go back to the `VRTemplateMap` and use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# Consuming FXRMotionControllerData in C++
|
# Consuming FXRMotionControllerData in C++
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Unreal Engine versions `5.2`, `5.3`, and `5.4` are limited to
|
||||||
|
> `FXRMotionControllerData` since at the time of their release no
|
||||||
|
> `FXRHandTrackingState` was available.
|
||||||
|
> Also please keep in mind that, while `FXRMotionControllerData` is pretty much
|
||||||
|
> usable and functional in Unreal Engine `5.5`, it is recommended to utilize
|
||||||
|
> `FXRHandTrackingState` instead. This is because this version of UE has
|
||||||
|
> deprecated `FXRMotionControllerData` in favor of the
|
||||||
|
> `FXRMotionControllerState` and `FXRHandTrackingState` structs. Prior to
|
||||||
|
> version `5.5`, `FXRMotionControllerData` handled both motion controller and
|
||||||
|
> hand tracking data. From `5.5` onward, these responsibilities have been
|
||||||
|
> separated into the two distinct structs, providing clearer and more
|
||||||
|
> specialized handling of each.
|
||||||
|
|
||||||
Before continuing this section, please ensure you've first studied the [Consuming FXRMotionControllerData](./) section.
|
Before continuing this section, please ensure you've first studied the [Consuming FXRMotionControllerData](./) section.
|
||||||
|
|
||||||
## Drawing and Animating Virtual Hands
|
## Drawing and Animating Virtual Hands
|
||||||
@@ -47,30 +61,30 @@ using UnrealBuildTool;
|
|||||||
|
|
||||||
public class VirtualHandCpp : ModuleRules
|
public class VirtualHandCpp : ModuleRules
|
||||||
{
|
{
|
||||||
public VirtualHandCpp(ReadOnlyTargetRules Target) : base(Target)
|
public VirtualHandCpp(ReadOnlyTargetRules Target) : base(Target)
|
||||||
{
|
{
|
||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(new string[]
|
PrivateDependencyModuleNames.AddRange(new string[]
|
||||||
{
|
{
|
||||||
"InputDevice",
|
"InputDevice",
|
||||||
"OpenXRHMD",
|
"OpenXRHMD",
|
||||||
"SenseGloveBuildHacks",
|
"SenseGloveBuildHacks",
|
||||||
"SenseGloveDebug",
|
"SenseGloveDebug",
|
||||||
"SenseGloveSettings",
|
"SenseGloveSettings",
|
||||||
"SenseGloveTracking"
|
"SenseGloveTracking"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Uncomment if you are using Slate UI
|
// Uncomment if you are using Slate UI
|
||||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||||
|
|
||||||
// Uncomment if you are using online features
|
// Uncomment if you are using online features
|
||||||
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
||||||
|
|
||||||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -93,32 +107,32 @@ public class VirtualHandCpp : ModuleRules
|
|||||||
UCLASS()
|
UCLASS()
|
||||||
class VIRTUALHANDCPP_API ADebugPawn : public APawn
|
class VIRTUALHANDCPP_API ADebugPawn : public APawn
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The virtual hand drawing settings.
|
// The virtual hand drawing settings.
|
||||||
UPROPERTY(EditDefaultsOnly, Category="DebugPawn",
|
UPROPERTY(EditDefaultsOnly, Category="DebugPawn",
|
||||||
meta=(AllowPrivateAccess="false"))
|
meta=(AllowPrivateAccess="false"))
|
||||||
FSGDebugGizmoSettings HandDrawingSettings;
|
FSGDebugGizmoSettings HandDrawingSettings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Sets default values for this pawn's properties
|
// Sets default values for this pawn's properties
|
||||||
ADebugPawn();
|
ADebugPawn();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Called every frame
|
// Called every frame
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
// Called to bind functionality to input
|
// Called to bind functionality to input
|
||||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The method responsible for drawing a virtual hand.
|
// The method responsible for drawing a virtual hand.
|
||||||
void DrawHand(EControllerHand Hand) const;
|
void DrawHand(EControllerHand Hand) const;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -137,116 +151,116 @@ private:
|
|||||||
// Sets default values
|
// Sets default values
|
||||||
ADebugPawn::ADebugPawn()
|
ADebugPawn::ADebugPawn()
|
||||||
{
|
{
|
||||||
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
PrimaryActorTick.bCanEverTick = true;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
// Set the default virtual hand drawing settings.
|
// Set the default virtual hand drawing settings.
|
||||||
HandDrawingSettings = FSGDebugGizmoSettings{
|
HandDrawingSettings = FSGDebugGizmoSettings{
|
||||||
1.0f,
|
1.0f,
|
||||||
FColor{255, 0, 0, 255},
|
FColor{255, 0, 0, 255},
|
||||||
FColor{0, 255, 0, 255},
|
FColor{0, 255, 0, 255},
|
||||||
FColor{0, 0, 255, 255},
|
FColor{0, 0, 255, 255},
|
||||||
false,
|
false,
|
||||||
1.1f,
|
1.1f,
|
||||||
0,
|
0,
|
||||||
0.2f,
|
0.2f,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
void ADebugPawn::BeginPlay()
|
void ADebugPawn::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame
|
// Called every frame
|
||||||
void ADebugPawn::Tick(float DeltaTime)
|
void ADebugPawn::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
// Attempt at drawing the left/right virtual hands every frame.
|
// Attempt at drawing the left/right virtual hands every frame.
|
||||||
DrawHand(EControllerHand::Left);
|
DrawHand(EControllerHand::Left);
|
||||||
DrawHand(EControllerHand::Right);
|
DrawHand(EControllerHand::Right);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called to bind functionality to input
|
// Called to bind functionality to input
|
||||||
void ADebugPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
void ADebugPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||||
{
|
{
|
||||||
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADebugPawn::DrawHand(const EControllerHand Hand) const
|
void ADebugPawn::DrawHand(const EControllerHand Hand) const
|
||||||
{
|
{
|
||||||
// Get the world and cache it, if it's null we return early.
|
// Get the world and cache it, if it's null we return early.
|
||||||
UWorld* World{GetWorld()};
|
UWorld* World{GetWorld()};
|
||||||
if (!IsValid(World))
|
if (!IsValid(World))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FXRMotionControllerData MotionControllerData;
|
FXRMotionControllerData MotionControllerData;
|
||||||
const bool bGotMotionControllerData = FSGXRTracker::GetMotionControllerData(
|
const bool bGotMotionControllerData = FSGXRTracker::GetMotionControllerData(
|
||||||
World, Hand, MotionControllerData);
|
World, Hand, MotionControllerData);
|
||||||
|
|
||||||
// Return if the struct data is invalid!
|
// Return if the struct data is invalid!
|
||||||
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return if the device is not being tracked!
|
// Return if the device is not being tracked!
|
||||||
if (MotionControllerData.TrackingStatus == ETrackingStatus::NotTracked)
|
if (MotionControllerData.TrackingStatus == ETrackingStatus::NotTracked)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that MotionControllerData.DeviceVisualType is a hand!
|
// Ensure that MotionControllerData.DeviceVisualType is a hand!
|
||||||
if (!ensureAlwaysMsgf(MotionControllerData.DeviceVisualType
|
if (!ensureAlwaysMsgf(MotionControllerData.DeviceVisualType
|
||||||
== EXRVisualType::Hand,
|
== EXRVisualType::Hand,
|
||||||
TEXT("Invalid DeviceVisualType type!")))
|
TEXT("Invalid DeviceVisualType type!")))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that MotionControllerData.HandKeyPositions has the position data
|
// Ensure that MotionControllerData.HandKeyPositions has the position data
|
||||||
// for 26 joints!
|
// for 26 joints!
|
||||||
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num()
|
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num()
|
||||||
== EHandKeypointCount,
|
== EHandKeypointCount,
|
||||||
TEXT("Invalid HandKeyPositions count!")))
|
TEXT("Invalid HandKeyPositions count!")))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that MotionControllerData.HandKeyPositions has the rotation data
|
// Ensure that MotionControllerData.HandKeyRotations has the rotation data
|
||||||
// for 26 joints!
|
// for 26 joints!
|
||||||
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyRotations.Num()
|
if (!ensureAlwaysMsgf(MotionControllerData.HandKeyRotations.Num()
|
||||||
== EHandKeypointCount,
|
== EHandKeypointCount,
|
||||||
TEXT("Invalid HandKeyRotations count!")))
|
TEXT("Invalid HandKeyRotations count!")))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over the hand joint positions and rotations!
|
// Iterate over the hand joint positions and rotations!
|
||||||
for (int32 JointIndex = 0; JointIndex < EHandKeypointCount; ++JointIndex)
|
for (int32 JointIndex = 0; JointIndex < EHandKeypointCount; ++JointIndex)
|
||||||
{
|
{
|
||||||
const FVector& JointPosition{
|
const FVector& JointPosition{
|
||||||
MotionControllerData.HandKeyPositions[JointIndex]
|
MotionControllerData.HandKeyPositions[JointIndex]
|
||||||
};
|
};
|
||||||
const FQuat& JointRotation{
|
const FQuat& JointRotation{
|
||||||
MotionControllerData.HandKeyRotations[JointIndex]
|
MotionControllerData.HandKeyRotations[JointIndex]
|
||||||
};
|
};
|
||||||
|
|
||||||
// Draw a single joint's gizmo!
|
// Draw a single joint's gizmo!
|
||||||
// Please note that we could alternatively:
|
// Please note that we could alternatively:
|
||||||
// Use FSGDebugCube::Draw() to draw a cube.
|
// Use FSGDebugCube::Draw() to draw a cube.
|
||||||
// Or use the FSGDebugVirtualHand::Draw() method and pass the
|
// Or use the FSGDebugVirtualHand::Draw() method and pass the
|
||||||
// MotionControllerData directly to draw the virtual hand
|
// MotionControllerData directly to draw the virtual hand
|
||||||
// all at once without iterating the joints. But, that's not
|
// all at once without iterating the joints. But, that's not
|
||||||
// goal of this tutorial.
|
// goal of this tutorial.
|
||||||
FSGDebugGizmo::Draw(World, JointPosition, JointRotation, HandDrawingSettings);
|
FSGDebugGizmo::Draw(World, JointPosition, JointRotation, HandDrawingSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
15. Now, rebuild the source code and go back to the `VRTemplateMap`, then use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
15. Now, rebuild the source code and go back to the `VRTemplateMap`, then use the VR Preview button to run the game. If everything's done correctly, you should be able to see the virtual hands inside your VR simulation.
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -5,6 +5,120 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.2.2] - 2024-11-08
|
||||||
|
|
||||||
|
This patch release addresses a few issues with both glove and hand-tracking.
|
||||||
|
|
||||||
|
# Fixed
|
||||||
|
|
||||||
|
- Fixed a chain of critical bugs that gets triggered due to `GloveConnectivityCheckInterval` getting passed as seconds to the engine rather than milliseconds. Thus, the default or any large value for `GloveConnectivityCheckInterval` causes noticeable long delays between glove-connectivity-check intervals and consequently renders the hand-tracking state invalid in certain situations when the `bFallbackToHandTrackingIfNoGloveDetected` option is false.
|
||||||
|
|
||||||
|
## [2.2.1] - 2024-10-23
|
||||||
|
|
||||||
|
This patch release focuses exclusively on updates to the documentation.
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Updated all URLs, screenshots, and tutorials to reflect the transition from the Unreal Engine Marketplace to Fab, Epic’s new unified content marketplace.
|
||||||
|
- Revised documentation now points to the new home of the SenseGlove Unreal Engine Plugin on Fab, ensuring users have access to the latest resources and information.
|
||||||
|
|
||||||
|
## [2.2.0] - 2024-10-22
|
||||||
|
|
||||||
|
This is a minor release with some breaking API and ABI changes, focusing mainly on migrating away from the deprecated `FXRMotionControllerData` in favor of `FXRMotionControllerState` and `FXRHandTrackingState` on Unreal Engine `5.5+`.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Completed support for the upcoming Unreal Engine `5.5` release.
|
||||||
|
- Added `USGVirtualHandComponent::GetMotionControllerState()` and the equivalent Blueprint function`UVirtualHandComponentKismetLibrary::GetMotionControllerState` on UE `5.5+`.
|
||||||
|
- Added `USGVirtualHandComponent::GetHandTrackingState()` and the equivalent Blueprint function `UVirtualHandComponentKismetLibrary::GetHandTrackingState` on UE `5.5+`.
|
||||||
|
- Added `USGWristTrackerComponent::GetMotionControllerState()` and the equivalent Blueprint function `UWristTrackerComponentKismetLibrary::GetMotionControllerState` on UE `5.5+`.
|
||||||
|
- Added `USGWristTrackerComponent::GetHandTrackingState()` and the equivalent Blueprint function `UWristTrackerComponentKismetLibrary::GetHandTrackingState` on UE `5.5+`.
|
||||||
|
- Added a variant of `FSGDebugVirtualHand::Draw()` and the equivalent Blueprint function `USGDebugVirtualHandKismetLibrary::Draw_FXRHandTrackingState()` which accept `FXRHandTrackingState` on UE `5.5+`.
|
||||||
|
- Added the new member `bTracked` to the `FSGXRHandState` struct.
|
||||||
|
- Added `FSGXRTracker::GetMotionControllerState()` and the equivalent Blueprint function `USGXRTrackerKismetLibrary::GetMotionControllerState()`.
|
||||||
|
- Added `FSGXRTracker::GetHandTrackingState()` and the equivalent Blueprint function `USGXRTrackerKismetLibrary::GetHandTrackingState()`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Additional minor fixes and improvements that may not be listed here.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Replaced all internal usages of the `FXRMotionControllerData` struct with either `FXRMotionControllerState` or `FXRHandTrackingState` on UE `5.5+`.
|
||||||
|
- Deprecated `USGVirtualHandComponent::GetMotionControllerData()` on UE `5.5+`.
|
||||||
|
- Deprecated `USGWristTrackerComponent::GetMotionControllerData()` on UE `5.5+`.
|
||||||
|
- Deprecated the variant of `FSGDebugVirtualHand::Draw()` which accepts `FXRMotionControllerData` as a parameter on UE `5.5+`.
|
||||||
|
- Renamed `USGDebugVirtualHandKismetLibrary::Draw` to `USGDebugVirtualHandKismetLibrary::Draw_FXRMotionControllerData` for more clarification.
|
||||||
|
- Renamed an `FSGXRHandState` member from `bReceivedJointPoses` to `bHasReceivedJointPoses`.
|
||||||
|
- Changed the `FSGXRTracker::GetAllKeypointStates()` signature on UE `5.5+` to match the `IHandTracker` interface API changes.
|
||||||
|
- The animation system on UE `5.5+` has been revamped to utilize `FXRHandTrackingState` instead of `FXRMotionControllerData`.
|
||||||
|
- The wrist tracking system on UE `5.5+` has been revamped to utilize `FXRHandTrackingState` instead of `FXRMotionControllerData`.
|
||||||
|
- The hand interaction manipulation on UE `5.5+` has been revamped to utilize `FXRHandTrackingState`.
|
||||||
|
- The virtual hand debugging system on UE `5.5+` has been revamped to utilize `FXRHandTrackingState`.
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Added the documentation on consuming the `FXRHandTrackingState` struct in both Blueprint and C++.
|
||||||
|
- Updated the documentation on consuming the `FXRMotionControllerData` struct.
|
||||||
|
- Additional minor documentation fixes and improvements that may not be listed here.
|
||||||
|
|
||||||
|
## [2.1.4] - 2024-10-22
|
||||||
|
|
||||||
|
This is a bugfix release that delivers some documentation fixes.
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Updated the documentation on consuming the `FXRMotionControllerData` struct.
|
||||||
|
- Additional minor documentation fixes and improvements that may not be listed here.
|
||||||
|
|
||||||
|
## [2.1.3] - 2024-10-11
|
||||||
|
|
||||||
|
This bugfix release centers on adding initial support for the upcoming Unreal Engine `5.5`.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added initial support for the upcoming Unreal Engine `5.5` release. Please note that, while the plugin is functional, a few adjustments are still required to address deprecation warnings. Specifically, the `FXRMotionControllerData` struct needs to be replaced with the newly introduced `FXRMotionControllerState` and `FXRHandTrackingState` structs, along with adjustments to adhere to the new hand-tracking API changes.
|
||||||
|
- Added support for Epic Native Toolchain `v23`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix a bug inside `USGVirtualHandComponent::PostEditChangeProperty()` where the get member name check happens against the wrong class and member names.
|
||||||
|
- Additional minor fixes and improvements that may not be listed here.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The SenseGlove libraries have been updated to `v2.105.0-02a2e508`.
|
||||||
|
|
||||||
|
## [2.1.2] - 2024-09-02
|
||||||
|
|
||||||
|
This is a bugfix release that addresses a few non-critical issues and documentation fixes.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix a bug where the hands are always visible even when `bVisibleWhenHandDataUnavailable` is disabled.
|
||||||
|
- Fix a bug where the `HandVisibilityChangedEvent` event is not triggered on the virtual hand component visibility changes.
|
||||||
|
- Fix the wrong script name for `USGHMDTrackerKismetLibrary`.
|
||||||
|
- Fix the wrong script name for `USGXRTrackerKismetLibrary `.
|
||||||
|
- Fix `LogPython: Warning: 'SGHMDTrackerKismetLibrary' and 'SGXRTrackerKismetLibrary' have the same name (SenseGloveHeadMountDisplayKismetLibrary) when exposed to Python. Rename one of them using 'ScriptName' meta-data` when packaging the game.
|
||||||
|
- Fix the non-existent default hand-mesh warnings polluting the logs when packaging the game.
|
||||||
|
- Expanded the clickable area on the handbook index page revision buttons.
|
||||||
|
- Minor documentation fixes.
|
||||||
|
|
||||||
|
## [2.1.1] - 2024-08-18
|
||||||
|
|
||||||
|
This is a bugfix release with no actual plugin code changes, mostly addressing issues in the documentation and third-party dependencies caused by source control merge conflicts.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix the messed up changelog file caused by cherry-picking merge conflicts between the dev branch and the master branch.
|
||||||
|
- Fix a bug that causes a handbook revision mismatch when deploying the handbook from the dev branch.
|
||||||
|
- Fix a bug where `SG_GIT_IS_SHALLOW_CLONE` while building the handbook is always set to `yes` even if it's not a shadow clone because `SG_DOT_GIT_SHALLOW_FILE` evaluates to an empty string when the `.git/shallow` file does not exist.
|
||||||
|
- Fix some documentation typos.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Removed Android NDK r25 armv7 and x86 dependencies brought back by mistake while merging v2.1.0 from the dev branch to the master branch.
|
||||||
|
|
||||||
## [2.1.0] - 2024-08-16
|
## [2.1.0] - 2024-08-16
|
||||||
|
|
||||||
This is a minor release focusing mainly on bringing OpenXR-compatible hand tracking support (`XR_EXT_hand_tracking`) and Head-mounted Display automatic detection for adjusting wrist tracker offsets automatically at runtime.
|
This is a minor release focusing mainly on bringing OpenXR-compatible hand tracking support (`XR_EXT_hand_tracking`) and Head-mounted Display automatic detection for adjusting wrist tracker offsets automatically at runtime.
|
||||||
@@ -127,6 +241,14 @@ This is a minor release focusing mainly on bringing OpenXR-compatible hand track
|
|||||||
- The `UXRDeviceVisualizationComponent` provided by Unreal Engine is used in the SGPawn class as ControllerVisualizerLeft and ControllerVisualizerRight for implementing the wrist tracking hardware visualization feature. However, it is not compatible with the new OpenXR system in certain scenarios. For instance, when the motion controllers serve as wrist tracking hardware since the SenseGlove plugin is now introduced to the engine as an `OpenXRHandTracking` system, it causes the UXRDeviceVisualizationComponent to visualize the wrist tracking hardware at coordinates (0.0f, 0.0f, 0.0f) instead of their actual location and rotation in the world. This happens because the component incorrectly registers them as inactive, possibly because it's assumed hand tracking and motion controllers cannot be in use at the same time. Currently, we use this feature solely for debugging, and we have an alternative in the form of wrist-tracking debug gizmos, which can be toggled on or off via the settings system. In future releases, we might remove this feature due to its incompatibility, unless we find a solution to make the `UXRDeviceVisualizationComponent` work with the new system. Alternatively, we may develop our own version of the `UXRDeviceVisualizationComponent`.
|
- The `UXRDeviceVisualizationComponent` provided by Unreal Engine is used in the SGPawn class as ControllerVisualizerLeft and ControllerVisualizerRight for implementing the wrist tracking hardware visualization feature. However, it is not compatible with the new OpenXR system in certain scenarios. For instance, when the motion controllers serve as wrist tracking hardware since the SenseGlove plugin is now introduced to the engine as an `OpenXRHandTracking` system, it causes the UXRDeviceVisualizationComponent to visualize the wrist tracking hardware at coordinates (0.0f, 0.0f, 0.0f) instead of their actual location and rotation in the world. This happens because the component incorrectly registers them as inactive, possibly because it's assumed hand tracking and motion controllers cannot be in use at the same time. Currently, we use this feature solely for debugging, and we have an alternative in the form of wrist-tracking debug gizmos, which can be toggled on or off via the settings system. In future releases, we might remove this feature due to its incompatibility, unless we find a solution to make the `UXRDeviceVisualizationComponent` work with the new system. Alternatively, we may develop our own version of the `UXRDeviceVisualizationComponent`.
|
||||||
- Although the SenseGlove OpenXR implementation is fully compatible with the `IOpenXRHMD` interface and the `FOpenXRHMD` `XRTrackingSystem`, it is not compatible with the `FOculusXRHMD` backend provided by the Meta XR plugin. The same issue likely applies to the VIVE OpenXR plugin. So, if these plugins are enabled in your project, the SenseGlove OpenXR will not function as intended, effectively breaking the plugin's functionality. It seems these plugins are necessary in order to make the fallback to the hand-tracking feature work on Android. While we may add support and compatibility with Meta XR and VIVE OpenXR plugins in the future, for the time being, if your project requires these plugins, we advise continuing with the `v2.0.x` release of the SenseGlove Unreal Engine plugin until this issue is addressed.
|
- Although the SenseGlove OpenXR implementation is fully compatible with the `IOpenXRHMD` interface and the `FOpenXRHMD` `XRTrackingSystem`, it is not compatible with the `FOculusXRHMD` backend provided by the Meta XR plugin. The same issue likely applies to the VIVE OpenXR plugin. So, if these plugins are enabled in your project, the SenseGlove OpenXR will not function as intended, effectively breaking the plugin's functionality. It seems these plugins are necessary in order to make the fallback to the hand-tracking feature work on Android. While we may add support and compatibility with Meta XR and VIVE OpenXR plugins in the future, for the time being, if your project requires these plugins, we advise continuing with the `v2.0.x` release of the SenseGlove Unreal Engine plugin until this issue is addressed.
|
||||||
|
|
||||||
|
## [2.0.8] - 2024-07-15
|
||||||
|
|
||||||
|
This is a bugfix release that contains a somewhat important bugfix backported from the next release of the plugin as documented below.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix a bug where the SGPawn right-hand grab colliders' default size is mistakenly set to the default value for the left-hand grab colliders at CDO initialization time.
|
||||||
|
|
||||||
## [2.0.7] - 2024-05-29
|
## [2.0.7] - 2024-05-29
|
||||||
|
|
||||||
This is a bugfix release with no actual plugin code changes, only fixing issues with binary assets incompatible with UE versions earlier than 5.4.
|
This is a bugfix release with no actual plugin code changes, only fixing issues with binary assets incompatible with UE versions earlier than 5.4.
|
||||||
@@ -192,13 +314,6 @@ This is a patch release with no code changes.
|
|||||||
|
|
||||||
This is a bugfix release.
|
This is a bugfix release.
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- A fallback to HMD and wrist tracker hardware auto-detection mechanism has been added to be triggered in situations when automatic detection of the wrist tracker hardware is desired, e.g., either by not setting it explicitly, or setting it to the default None value.
|
|
||||||
- Added the SGHeadMountDisplay utility class, exposed to both C++ and Blueprint, in order to easily gather information about the HMD at runtime.
|
|
||||||
- Added the SGTypes header to the SenseGloveTypes module in order to define and share SenseGlove module types through this header across the plugin modules.
|
|
||||||
- Added ESGHeadMountDisplayDevice enum with supported HMDs list.
|
|
||||||
|
|
||||||
### Fixed
|
### 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.
|
- 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.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
│
|
│
|
||||||
├── Documentation (this will be generated by running the <code>make</code> command inside the Handbook directory)
|
├── Documentation (this will be generated by running the <code>make</code> command inside the Handbook directory)
|
||||||
│
|
│
|
||||||
├── Handbook (this is the mdBook source code, used to generate the Documentation folder and not distributed to the Unreal Engine Marketplace)
|
├── Handbook (this is the mdBook source code, used to generate the Documentation folder and not distributed to [Fab](https://www.fab.com/))
|
||||||
│
|
│
|
||||||
├── Resources
|
├── Resources
|
||||||
│
|
│
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
│
|
│
|
||||||
├── SenseGloveBackend (responsible for initialization and deinitialization of the backend libraries)
|
├── SenseGloveBackend (responsible for initialization and deinitialization of the backend libraries)
|
||||||
│
|
│
|
||||||
├── SenseGloveBackendKismet (exposes Blueprints-specific functionality from the SenseGloveBackend module)
|
├── SenseGloveBackendKismet (exposes Blueprint-specific functionality from the SenseGloveBackend module)
|
||||||
│
|
│
|
||||||
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
|
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
|
||||||
│
|
│
|
||||||
@@ -27,33 +27,33 @@
|
|||||||
│
|
│
|
||||||
├── SenseGloveConnectImpl (uses Exceptions and RTTI, intended for internal use only)
|
├── SenseGloveConnectImpl (uses Exceptions and RTTI, intended for internal use only)
|
||||||
│
|
│
|
||||||
├── SenseGloveConnectKismet (SGConnect functionality exposed to Blueprints)
|
├── SenseGloveConnectKismet (SGConnect functionality exposed to Blueprint)
|
||||||
│
|
│
|
||||||
├── SenseGloveCore (exposes part of the SGCoreCpp low-level API to C++)
|
├── SenseGloveCore (exposes part of the SGCoreCpp low-level API to C++)
|
||||||
│
|
│
|
||||||
├── SenseGloveCoreImpl (uses Exceptions and RTTI, intended for internal use only)
|
├── SenseGloveCoreImpl (uses Exceptions and RTTI, intended for internal use only)
|
||||||
│
|
│
|
||||||
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprints)
|
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprint)
|
||||||
│
|
│
|
||||||
├── SenseGloveDebug (a utility debug module)
|
├── SenseGloveDebug (a utility debug module)
|
||||||
│
|
│
|
||||||
├── SenseGloveDebugKismet (exposes Blueprints-specific functionality from the SenseGloveDebug module)
|
├── SenseGloveDebugKismet (exposes Blueprint-specific functionality from the SenseGloveDebug module)
|
||||||
│
|
│
|
||||||
├── SenseGloveEditor (the Editor module)
|
├── SenseGloveEditor (the Editor module)
|
||||||
│
|
│
|
||||||
├── SenseGloveInterop (internally used for interoperability between RTTI disabled/enabled modules)
|
├── SenseGloveInterop (internally used for interoperability between RTTI disabled/enabled modules)
|
||||||
│
|
│
|
||||||
├── SenseGloveKismet (exposes Blueprints-specific functionality from the SenseGlove module)
|
├── SenseGloveKismet (exposes Blueprint-specific functionality from the SenseGlove module)
|
||||||
│
|
│
|
||||||
├── SenseGloveLog (the internal log module)
|
├── SenseGloveLog (the internal log module)
|
||||||
│
|
│
|
||||||
├── SenseGloveSettings (the plugin's settings manager)
|
├── SenseGloveSettings (the plugin's settings manager)
|
||||||
│
|
│
|
||||||
├── SenseGloveSettingsKismet (exposes Blueprints-specific functionality from the SenseGloveSettings module)
|
├── SenseGloveSettingsKismet (exposes Blueprint-specific functionality from the SenseGloveSettings module)
|
||||||
│
|
│
|
||||||
├── SenseGloveTracking (provides XR_EXT_hand_tracking support, HMD auto-detection, and SenseGlove device tracking)
|
├── SenseGloveTracking (provides XR_EXT_hand_tracking support, HMD auto-detection, and SenseGlove device tracking)
|
||||||
│
|
│
|
||||||
├── SenseGloveTrackingKismet (exposes Blueprints-specific functionality from the SenseGloveTracking module)
|
├── SenseGloveTrackingKismet (exposes Blueprint-specific functionality from the SenseGloveTracking module)
|
||||||
│
|
│
|
||||||
├── SenseGloveTypes (exposes various enums from the backend libraries and also types from the SenseGlove module)
|
├── SenseGloveTypes (exposes various enums from the backend libraries and also types from the SenseGlove module)
|
||||||
│
|
│
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## Planned Features Completion Status
|
## Planned Features Completion Status
|
||||||
|
|
||||||
### Implemented as of v2.1.0
|
### Implemented as of v2.2.x
|
||||||
|
|
||||||
- [X] Full SenseGlove low-level core API access through Unreal C++.
|
- [X] Full SenseGlove low-level core API access through Unreal C++.
|
||||||
- [X] Full SenseGlove low-level core API access through Blueprint.
|
- [X] Full SenseGlove low-level core API access through Blueprint.
|
||||||
@@ -26,24 +26,26 @@
|
|||||||
- [X] Easy wrist/hand tracking debugging using the SenseGlove Debug module.
|
- [X] Easy wrist/hand tracking debugging using the SenseGlove Debug module.
|
||||||
- [X] A generic Settings module with the ability to override settings.
|
- [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] C++/Blueprint interaction events such as OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch.
|
||||||
- [X] A fallback to HMD and wrist tracker hardware auto-detection mechanism when automatic detection of the wrist tracker hardware is desired.
|
- [X] A fall back to HMD and wrist tracker hardware auto-detection mechanism when automatic detection of the wrist tracker hardware is desired.
|
||||||
- [X] OpenXR-compatible hand tracking (XR_EXT_hand_tracking) support.
|
- [X] OpenXR-compatible hand tracking (XR_EXT_hand_tracking) support.
|
||||||
- [X] FXRMotionControllerData compatible hand animation system.
|
- [X] `FXRMotionControllerData` compatible hand animation system on UE versions `5.2`, `5.3`, and `5.4`.
|
||||||
- [X] FXRMotionControllerData compatible wrist tracking system.
|
- [X] `FXRHandTrackingState` compatible hand animation system on UE versions `5.5+`.
|
||||||
- [X] FXRMotionControllerData compatible hand interaction manipulation system.
|
- [X] `FXRMotionControllerData` compatible wrist tracking system on UE versions `5.2`, `5.3`, and `5.4`.
|
||||||
|
- [X] `FXRHandTrackingState` compatible wrist tracking system on UE versions `5.5+`.
|
||||||
|
- [X] `FXRMotionControllerData` compatible hand interaction manipulation system on UE versions `5.2`, `5.3`, and `5.4`.
|
||||||
|
- [X] `FXRHandTrackingState` compatible hand interaction manipulation system on UE versions `5.5+`.
|
||||||
- [X] 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.
|
- [X] 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.
|
||||||
- [X] The SenseGlove grab/touch sockets one-click-setup ability on any Epic-compliant virtual hand mesh from within the Unreal Editor's Content Browser, Skeleton Editor, or Skeletal Mesh Editor.
|
- [X] The SenseGlove grab/touch sockets one-click-setup ability on any Epic-compliant virtual hand mesh from within the Unreal Editor's Content Browser, Skeleton Editor, or Skeletal Mesh Editor.
|
||||||
- [X] A flexible virtual hand animation system that can take the mesh bone's transforms into account for a more reliable hand animation.
|
- [X] A flexible virtual hand animation system that can take the mesh bone's transforms into account for a more reliable hand animation.
|
||||||
- [X] Ability to manage the Engine Scalability Settings through the SenseGlove plugin in order to change the graphics settings on the fly.
|
- [X] Ability to manage the Engine Scalability Settings through the SenseGlove plugin in order to change the graphics settings on the fly.
|
||||||
|
|
||||||
### Upcoming features planned for the v2.2.0 release
|
### Upcoming features planned for the v2.3.x release
|
||||||
|
|
||||||
|
|
||||||
### Planned features long-term
|
### Planned features long-term
|
||||||
|
|
||||||
- [ ] Get tracking input from sources other than a SenseGlove device.
|
- [ ] 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).
|
- [ ] 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 it so developers can define or extend their own behavior(s) to an object through Code / Blueprint (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).
|
- [ ] 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).
|
- [ ] 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).
|
- [ ] Ensure that our virtual hands (and the objects they hold) do not phase through other physics objects (e.g. walls and tables).
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
## Platform Support Matrix
|
## Platform Support Matrix
|
||||||
|
|
||||||
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Meta Quest Stand-alone (Android NDK)** | **HTC VIVE Stand-alone (Android NDK)** | **UE Marketplace Version** | **Azure DevOps Version** |
|
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Meta Quest Stand-alone (Android NDK)** | **HTC VIVE Stand-alone (Android NDK)** | **Fab** | **Azure DevOps Version** |
|
||||||
|:--------:|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:----------------------------------------:|:--------------------------------------:|:--------------------------:|:------------------------:|
|
|:--------:|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:----------------------------------------:|:--------------------------------------:|:--------:|:------------------------:|
|
||||||
| **5.4** | ❌ | ❌ | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x (r25b) | ❓ | ✅ v2.1.0 | ✅ v2.1.0 |
|
| **5.5** | ❌ | ❌ | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x (r25b) | ❓ | ❌ | ✅ v2.2.2 |
|
||||||
| **5.3** | ❌ | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x (r25b) | ❓ | ✅ v2.1.0 | ✅ v2.1.0 |
|
| **5.4** | ❌ | ❌ | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x (r25b) | ❓ | ✅ v2.2.2 | ✅ v2.2.2 |
|
||||||
| **5.2** | ❌ | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x | ✅ v2.1.x (r25b) | ❓ | ✅ v2.1.0 | ✅ v2.1.0 |
|
| **5.3** | ❌ | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x (r25b) | ❓ | ✅ v2.2.2 | ✅ v2.2.2 |
|
||||||
| **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.2** | ❌ | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x | ✅ v2.2.x (r25b) | ❓ | ✅ v2.2.2 | ✅ v2.2.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 |
|
| **5.1** | ❌ | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x (r25b) | ❓ | ⚠️ v2.0.0 | ⚠️ v2.0.2 |
|
||||||
| **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 |
|
| **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.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
| **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.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
| **4.26** | ⚠️ 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.25** | ⚠️ 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.24** | ⚠️ 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 |
|
| **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> Supported
|
||||||
* <code>⚠️</code> Not supported by the latest release and might be lacking features
|
* <code>⚠️</code> Not supported by the latest release and might be lacking features
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
The SenseGlove Unreal Engine Plugin could be installed using various methods:
|
The SenseGlove Unreal Engine Plugin could be installed using various methods:
|
||||||
|
|
||||||
- Through [the Epic Games Launcher](https://store.epicgames.com/en-US/download) by navigating to [the SenseGlove Unreal Engine Plugin landing page on the Unreal Engine Marketplace](https://www.unrealengine.com/marketplace/en-US/product/the-senseglove-unreal-engine-plugin).
|
- Via [the Epic Games Launcher](https://store.epicgames.com/en-US/download) by navigating to [the SenseGlove Unreal Engine Plugin landing page on Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099).
|
||||||
- Through [the SenseGlove Unreal Engine Plugin Microsoft Azure DevOps repository](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal).
|
- Via [the SenseGlove Unreal Engine Plugin Microsoft Azure DevOps repository](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal).
|
||||||
|
|
||||||
In the following chapters, we discover each of those methods:
|
In the following chapters, we discover each of those methods:
|
||||||
|
|
||||||
- [Installation through the Epic Games Launcher](epic-games-launcher.md)
|
- [Installation via the Epic Games Launcher](epic-games-launcher.md)
|
||||||
- [Installation through Microsoft Azure DevOps Repositories](microsoft-azure-devops-repositories.md)
|
- [Installation via Microsoft Azure DevOps Repositories](microsoft-azure-devops-repositories.md)
|
||||||
|
|
||||||
## Video Tutorials
|
## Video Tutorials
|
||||||
|
|
||||||
|
|||||||
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
LFS
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -1,46 +1,68 @@
|
|||||||
# Plugin Installation through the Epic Games Launcher
|
# Plugin Installation via the Epic Games Launcher
|
||||||
|
|
||||||
Before we start the plugin installation through [the Epic Games Launcher](https://store.epicgames.com/en-US/download) please make sure you have [a signed-in Epic Games account on your installed Epic Games Launcher and a supported Unreal Engine version already installed](https://dev.epicgames.com/documentation/en-us/unreal-engine/installing-unreal-engine). The supported engine versions are listed on [the Platform Support Matrix](../../appendix/platform-support-matrix.md).
|
Before beginning the plugin installation via [the Epic Games Launcher](https://store.epicgames.com/en-US/download), ensure you have [signed into your Epic Games account on the Epic Games Launcher](https://store.epicgames.com/en-US/download) and that you have a [supported version of Unreal Engine installed](https://dev.epicgames.com/documentation/en-us/unreal-engine/installing-unreal-engine). Supported engine versions can be found in the [Platform Support Matrix](../../appendix/platform-support-matrix.md).
|
||||||
|
|
||||||
1. Run the Epic Games Launcher.
|
1. Run the Epic Games Launcher.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2. Navigate to the `Marketplace` tab.
|
2. Navigate to the `Fab` tab and click `Start exploring` button which in turn opens your default web browser pointing to the [Fab home page](https://www.fab.com/).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. On the `Marketplace` tab, inside the search box, start typing `SenseGlove` which filters the plugin matching that search phrase in real-time. Select `The SenseGlove Unreal Engine Plugin`.
|
3. On the [Fab home page](https://www.fab.com/), enter the term `SenseGlove` in the search box and press Enter. Alternatively, you can go directly to the [SenseGlove Unreal Engine Plugin landing page on Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099) directly instead of taking the above two steps.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4. Once on [the SenseGlove Unreal Engine Plugin marketplace page](https://www.unrealengine.com/marketplace/en-US/product/the-senseglove-unreal-engine-plugin), click on the `Install to Engine` button.
|
4. Click on the `SenseGlove Unreal Engine Plugin` in the search results to navigate to its dedicated page.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
5. You'll be prompted to choose a compatible engine version. Select your desired engine version and hit this `Install` button.
|
5. On the [SenseGlove Unreal Engine Plugin landing page on Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099) click the `Download` button.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
6. The launcher will show the download and installation progress. Please wait for it to finish.
|
6. If this is your first download from Fab, you will need to agree to the Fab End User License Agreement (EULA) before proceeding.
|
||||||
|
|
||||||

|
 prompt")
|
||||||
|
|
||||||
7. While the download and installation are in progress you can see the progress in more detail by clicking on the `Downloads` section on the sidebar.
|
7. After clicking `Download`, a pop-up will notify you that the plugin is available in your Vault in the Epic Games Launcher, or the Fab UE5 Plugin.
|
||||||
|
|
||||||

|
> [!NOTE]
|
||||||
|
> According to the
|
||||||
|
> [Fab launch announcement](https://www.unrealengine.com/en-US/blog/fab-epics-new-unified-content-marketplace-launches-today):
|
||||||
|
>
|
||||||
|
> The Fab integration in UEFN is undergoing maintenance and will be back online shortly, and the Fab integration in the Unreal Engine 5 Editor is coming soon.
|
||||||
|
|
||||||
8. Once the download and installation are done, you can head to the `Library` tab to verify the installation. In case you have lots of assets or plugins installed, you could search the term `SenseGlove` inside the search box for the `Vault` section and you should be able to see that the SenseGlove Unreal Engine Plugin has been added to your vault.
|

|
||||||
|
|
||||||

|
8. Go back to the Epic Games Launcher, navigate to the `Library` tab, and in the `Fab Library` section, click the `Refresh Fab items` button.
|
||||||
|
|
||||||
9. If you click on the `Installed Plugins` link under the engine you've just installed the plugin to, you should be able to see the SenseGlove Unreal Engine Plugin listed as installed.
|

|
||||||
|
|
||||||

|
9. Once the Fab library is refreshed and synchronized, use the Vault search box to find the `SenseGlove Unreal Engine Plugin`. Click the `Install to Engine` button.
|
||||||
|
|
||||||
10. One last confirmation could be navigating to `YourEngineInstallationPath/Engine/Plugins/Marketplace` directory. The SenseGlove Unreal Engine Plugin source and binaries can be found inside this directory. This is especially useful in case one desires to copy the plugin for example to their own project's source code to run it at the project level instead of running it at the engine level.
|

|
||||||
|
|
||||||

|
10. You'll be prompted to choose a compatible engine version. Select your desired engine version from the list, then click `Install`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
11. The Epic Games Launcher will show the plugin's download and installation progress. Please wait for it to complete.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
12. While the download and installation are in progress, you can see the progress in more details by clicking on the `Downloads` section on the sidebar.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
13. Once the download and installation are complete, verify its installation by clicking `Installed Plugins` under the engine you've just installed it to. The SenseGlove plugin should appear as installed among other currently installed plugins.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
14. One last confirmation could be navigating to `YourEngineInstallationPath/Engine/Plugins/Marketplace` directory. The SenseGlove Unreal Engine Plugin source and binaries can be found inside this directory. This is especially useful in case one desires to copy the plugin for example to their own project's source code to run it at the project level instead of running it at the engine level.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Please note that it is best practice to install the plugin either at the
|
> Please note that it is best practice to install the plugin either at the
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Plugin Installation through Microsoft Azure DevOps Repositories
|
# Plugin Installation via Microsoft Azure DevOps Repositories
|
||||||
|
|
||||||
While [plugin installation through the Epic Games Launcher](epic-games-launcher.md) is the most convenient method for most users to obtain and install the latest version of [the SenseGlove Unreal Engine Plugin marketplace page](https://www.unrealengine.com/marketplace/en-US/product/the-senseglove-unreal-engine-plugin), there might be valid reasons to instead download and install the plugin directly from [the SenseGlove Unreal Engine Plugin Microsoft Azure DevOps Repository](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal). These reasons may include:
|
While [plugin installation via the Epic Games Launcher](epic-games-launcher.md) is the most convenient method for most users to obtain and install the latest version of [the SenseGlove Unreal Engine Plugin via Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099), there might be valid reasons to instead download and install the plugin directly from [the SenseGlove Unreal Engine Plugin Microsoft Azure DevOps Repository](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal). These reasons may include:
|
||||||
|
|
||||||
- Downloading an older version that is no longer available on [the Unreal Engine Marketplace](https://www.unrealengine.com/marketplace/en-US/store).
|
- Downloading an older version that is no longer available on [Fab](https://www.fab.com/).
|
||||||
- Downloading a recent version that has been submitted to the Unreal Engine Marketplace, but is still awaiting approval and publication by the Unreal Engine Marketplace Team.
|
- Downloading a recent version that has been submitted to Fab, but is still awaiting approval and publication by the Fab Team.
|
||||||
- Downloading an under-development, unstable release of the plugin for testing purposes.
|
- Downloading an under-development, unstable release of the plugin for testing purposes.
|
||||||
- Or, any other specific needs that require direct access to the repository.
|
- Or, any other specific needs that require direct access to the repository.
|
||||||
|
|
||||||
@@ -17,11 +17,11 @@ To download a specific version of the plugin, follow these steps:
|
|||||||
|
|
||||||
2. Locate the branch dropdown menu at the top of the page, just below the navigation bar, and next to the `Copy to clipboard` icon. There you'll find a dropdown menu. By default, it usually selects the [master](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal?path=%2F&version=GBmaster&_a=contents) branch.
|
2. Locate the branch dropdown menu at the top of the page, just below the navigation bar, and next to the `Copy to clipboard` icon. There you'll find a dropdown menu. By default, it usually selects the [master](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal?path=%2F&version=GBmaster&_a=contents) branch.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. Use the dropdown menu to choose a desired branch containing the source code for a specific version of Unreal Engine or a specific release of the plugin marked with a release tag.
|
3. Use the dropdown menu to choose a desired branch containing the source code for a specific version of Unreal Engine or a specific release of the plugin marked with a release tag.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> A branch named with engine version numbers, such as `5.4`, `5.3`, etc.,
|
> A branch named with engine version numbers, such as `5.4`, `5.3`, etc.,
|
||||||
@@ -49,7 +49,7 @@ To download a specific version of the plugin, follow these steps:
|
|||||||
|
|
||||||
4. After selecting your desired branch or tag, click on the kebab menu (three vertical dots) located at the top right of the screen and choose `Download as Zip` to obtain the source code for that branch or tag.
|
4. After selecting your desired branch or tag, click on the kebab menu (three vertical dots) located at the top right of the screen and choose `Download as Zip` to obtain the source code for that branch or tag.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Download a Specific Version for a Specifc Unreal Engine Version
|
## Download a Specific Version for a Specifc Unreal Engine Version
|
||||||
|
|
||||||
@@ -57,17 +57,17 @@ As mentioned earlier, due to breaking changes between Unreal Engine versions, it
|
|||||||
|
|
||||||
1. First, choose the appropriate branch for your desired Unreal Engine version from the branch dropdown menu, as discussed earlier. Then navigate to the `History` tab.
|
1. First, choose the appropriate branch for your desired Unreal Engine version from the branch dropdown menu, as discussed earlier. Then navigate to the `History` tab.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2. Look through the commit history for a commit message that says `bump the plugin version to vX.X.X` as all releases are finalized with this exact commit message and the plugin version. Next, click on the commit message for the version you are looking for.
|
2. Look via the commit history for a commit message that says `bump the plugin version to vX.X.X` as all releases are finalized with this exact commit message and the plugin version. Next, click on the commit message for the version you are looking for.
|
||||||
|
|
||||||
3. Once you've selected the correct commit, click on the `Browse Files` button next to the kebab menu (three vertical dots) at the top right of the screen.
|
3. Once you've selected the correct commit, click on the `Browse Files` button next to the kebab menu (three vertical dots) at the top right of the screen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4. You should now be in the `Content` tab, with the branch dropdown menu displaying the commit hash instead of a branch name or tag. Click on the kebab menu (three vertical dots) again, and select `Download as Zip`. This will give you a zip file containing the exact release you need, compatible with your chosen Unreal Engine version.
|
4. You should now be in the `Content` tab, with the branch dropdown menu displaying the commit hash instead of a branch name or tag. Click on the kebab menu (three vertical dots) again, and select `Download as Zip`. This will give you a zip file containing the exact release you need, compatible with your chosen Unreal Engine version.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Download the Bleeding-edge Development Branch
|
## Download the Bleeding-edge Development Branch
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ As mentioned earlier, due to breaking changes between Unreal Engine versions, it
|
|||||||
|
|
||||||
Downloading the [`dev`](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal?path=%2F&version=GBdev&_a=contents) branch is as easy as choosing the `dev` branch from the branch dropdown menu (as discussed earlier) and then choosing `Download as Zip` from the kebab menu (three vertical dots).
|
Downloading the [`dev`](https://dev.azure.com/SenseGlove/_git/SenseGlove-Unreal?path=%2F&version=GBdev&_a=contents) branch is as easy as choosing the `dev` branch from the branch dropdown menu (as discussed earlier) and then choosing `Download as Zip` from the kebab menu (three vertical dots).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -211,11 +211,11 @@ MyCppProject
|
|||||||
|
|
||||||
For a Blueprint-only project, on Microsoft Windows simply double-clicking the project's `.uproject` file should present you with a pop-up informing you that some binary modules are missing.
|
For a Blueprint-only project, on Microsoft Windows simply double-clicking the project's `.uproject` file should present you with a pop-up informing you that some binary modules are missing.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
After confirming, the build process will start automatically, and a dialog indicating the build progress will be shown:
|
After confirming, the build process will start automatically, and a dialog indicating the build progress will be shown:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Once finished successfully, the project will be loaded.
|
Once finished successfully, the project will be loaded.
|
||||||
|
|
||||||
@@ -224,11 +224,11 @@ Once finished successfully, the project will be loaded.
|
|||||||
|
|
||||||
For C++ projects, on Microsoft Windows, right-click on your C++ `.uproject` file and choose `Generate Visual Studio project files`:
|
For C++ projects, on Microsoft Windows, right-click on your C++ `.uproject` file and choose `Generate Visual Studio project files`:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
A dialog will pop up shows you the progress of generating the Visual Studio project files:
|
A dialog will pop up shows you the progress of generating the Visual Studio project files:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Once the project files are generated, open up the C++ project in your preferred C++ IDE and build the project. After this, the project can be loaded in the Unreal Editor.
|
Once the project files are generated, open up the C++ project in your preferred C++ IDE and build the project. After this, the project can be loaded in the Unreal Editor.
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ To help you navigate the SenseGlove Unreal Engine Handbook, we have organized th
|
|||||||
This section covers the basics of the SenseGlove Unreal Engine Plugin:
|
This section covers the basics of the SenseGlove Unreal Engine Plugin:
|
||||||
|
|
||||||
- [Installation](../getting-started/installation/)
|
- [Installation](../getting-started/installation/)
|
||||||
- [Through the Epic Games Launcher](../getting-started/installation/epic-games-launcher.md)
|
- [Via the Epic Games Launcher](../getting-started/installation/epic-games-launcher.md)
|
||||||
- [Through Microsoft Azure DevOps Repositories](../getting-started/installation/microsoft-azure-devops-repositories.md)
|
- [Via Microsoft Azure DevOps Repositories](../getting-started/installation/microsoft-azure-devops-repositories.md)
|
||||||
- [Enabling and Verifying the Plugin Version](../getting-started/plugin-verify-version-enable/)
|
- [Enabling and Verifying the Plugin Version](../getting-started/plugin-verify-version-enable/)
|
||||||
- [SenseCom](../getting-started/sensecom/)
|
- [SenseCom](../getting-started/sensecom/)
|
||||||
- [SenseCom on GNU/Linux](../getting-started/sensecom/gnu-linux/)
|
- [SenseCom on GNU/Linux](../getting-started/sensecom/gnu-linux/)
|
||||||
@@ -57,7 +57,7 @@ Toipcs that do not fall under any specific category:
|
|||||||
- [SenseGlove Console Commands](../misc/console-commands/)
|
- [SenseGlove Console Commands](../misc/console-commands/)
|
||||||
- [Deploying to Android (Standalone)](../misc/android-standalone-deployment/)
|
- [Deploying to Android (Standalone)](../misc/android-standalone-deployment/)
|
||||||
- [Upgrade Guide](../misc/upgrade-guide/)
|
- [Upgrade Guide](../misc/upgrade-guide/)
|
||||||
- [Optimizing for More FPS](../misc/optimize-higher-fps/)
|
- [Optimizing for Higher FPS](../misc/optimize-higher-fps/)
|
||||||
|
|
||||||
## 🛠️ Advanced Topics
|
## 🛠️ Advanced Topics
|
||||||
|
|
||||||
@@ -65,15 +65,18 @@ For users familiar with the basics, this section explores advanced features of t
|
|||||||
|
|
||||||
- [Safe Glove Access in Blueprint](../advanced-topics/safe-glove-access-blueprint/)
|
- [Safe Glove Access in Blueprint](../advanced-topics/safe-glove-access-blueprint/)
|
||||||
- [OpenXR](../advanced-topics/openxr/)
|
- [OpenXR](../advanced-topics/openxr/)
|
||||||
|
- [Consuming FXRHandTrackingState](../advanced-topics/openxr/consuming-fxrhandtrackingstate/)
|
||||||
|
- [Blueprint](../advanced-topics/openxr/consuming-fxrhandtrackingstate/blueprint.md)
|
||||||
|
- [C++](../advanced-topics/openxr/consuming-fxrhandtrackingstate/cpp.md)
|
||||||
- [Consuming FXRMotionControllerData](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/)
|
- [Consuming FXRMotionControllerData](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/)
|
||||||
- [Blueprints](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/blueprint.md)
|
- [Blueprint](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/blueprint.md)
|
||||||
- [C++](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/cpp.md)
|
- [C++](../advanced-topics/openxr/consuming-fxrmotioncontrollerdata/cpp.md)
|
||||||
|
|
||||||
## 🔌 Low-Level API
|
## 🔌 Low-Level API
|
||||||
|
|
||||||
This section delves into the SenseGlove low-level API:
|
This section delves into the SenseGlove low-level API:
|
||||||
|
|
||||||
- [Low-Level Blueprints API](../low-level-api/blueprint.md)
|
- [Low-Level Blueprint API](../low-level-api/blueprint.md)
|
||||||
- [Low-Level C++ API](../low-level-api/cpp.md)
|
- [Low-Level C++ API](../low-level-api/cpp.md)
|
||||||
|
|
||||||
## 📑 Appendix
|
## 📑 Appendix
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ Deploy:
|
|||||||
PasswordEnvVar: SGUM_PACKAGER_REPOSITORY_PASSWORD
|
PasswordEnvVar: SGUM_PACKAGER_REPOSITORY_PASSWORD
|
||||||
|
|
||||||
Branches:
|
Branches:
|
||||||
|
- "5.5"
|
||||||
- "5.4"
|
- "5.4"
|
||||||
- "5.3"
|
- "5.3"
|
||||||
- "5.2"
|
- "5.2"
|
||||||
@@ -181,11 +182,13 @@ Rocket:
|
|||||||
PackageDirectory: "%TEMP%\\SenseGlove-Unreal\\Rocket"
|
PackageDirectory: "%TEMP%\\SenseGlove-Unreal\\Rocket"
|
||||||
|
|
||||||
EnginePaths:
|
EnginePaths:
|
||||||
|
- "5.5": "C:\\OPT\\UE_5.5"
|
||||||
- "5.4": "C:\\OPT\\UE_5.4"
|
- "5.4": "C:\\OPT\\UE_5.4"
|
||||||
- "5.3": "C:\\OPT\\UE_5.3"
|
- "5.3": "C:\\OPT\\UE_5.3"
|
||||||
- "5.2": "C:\\OPT\\UE_5.2"
|
- "5.2": "C:\\OPT\\UE_5.2"
|
||||||
|
|
||||||
NDKPaths:
|
NDKPaths:
|
||||||
|
- "5.5": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
||||||
- "5.4": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
- "5.4": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
||||||
- "5.3": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
- "5.3": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
||||||
- "5.2": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
- "5.2": "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ For examples, demo scenes, tutorials, and extra resources please check out [the
|
|||||||
|
|
||||||
Various instructions on [how to download and install the SenseGlove Unreal Engine Plugin](Handbook/src/getting-started/installation/README.md) are available. It could either be installed through [the Epic Games Launcher](Handbook/src/getting-started/installation/epic-games-launcher.md), or [through Microsoft Azure DevOps repositories](Handbook/src/getting-started/installation/microsoft-azure-devops-repositories.md).
|
Various instructions on [how to download and install the SenseGlove Unreal Engine Plugin](Handbook/src/getting-started/installation/README.md) are available. It could either be installed through [the Epic Games Launcher](Handbook/src/getting-started/installation/epic-games-launcher.md), or [through Microsoft Azure DevOps repositories](Handbook/src/getting-started/installation/microsoft-azure-devops-repositories.md).
|
||||||
|
|
||||||
For more information, visit [the SenseGlove Unreal Engine Handbook on the Epic Marketplace](https://www.unrealengine.com/marketplace/en-US/product/the-senseglove-unreal-engine-plugin).
|
For more information, visit [the SenseGlove Unreal Engine Plugin on Fab](https://www.fab.com/listings/62bcdd2a-0bb1-4f34-b7b8-c5e7c9313099).
|
||||||
|
|
||||||
### Platform Support Matrix
|
### Platform Support Matrix
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion": 3,
|
||||||
"Version": 1,
|
"Version": 1,
|
||||||
"VersionName": "2.1.0",
|
"VersionName": "2.2.2",
|
||||||
"FriendlyName": "SenseGlove",
|
"FriendlyName": "SenseGlove",
|
||||||
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
|
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
|
||||||
"Category": "Virtual Reality",
|
"Category": "Virtual Reality",
|
||||||
@@ -284,4 +284,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,10 +44,8 @@
|
|||||||
#include "Containers/UnrealString.h"
|
#include "Containers/UnrealString.h"
|
||||||
#include "Engine/SkeletalMesh.h"
|
#include "Engine/SkeletalMesh.h"
|
||||||
#include "Math/Rotator.h"
|
#include "Math/Rotator.h"
|
||||||
#include "Runtime/Launch/Resources/Version.h"
|
|
||||||
|
|
||||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||||
#include "SGLog/SGLog.h"
|
|
||||||
|
|
||||||
FSGVirtualHandAnimInstanceProxy::FSGVirtualHandAnimInstanceProxy()
|
FSGVirtualHandAnimInstanceProxy::FSGVirtualHandAnimInstanceProxy()
|
||||||
: FAnimInstanceProxy{}
|
: FAnimInstanceProxy{}
|
||||||
@@ -108,6 +106,16 @@ void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnim
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
const bool bGotHandTrackingState = VirtualHand->GetHandTrackingState(
|
||||||
|
EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
||||||
|
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
||||||
|
TEXT("Mismatched hand tracking state locations and rotations!"));
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
const bool bGotMotionControllerData = VirtualHand->GetMotionControllerData(MotionControllerData);
|
const bool bGotMotionControllerData = VirtualHand->GetMotionControllerData(MotionControllerData);
|
||||||
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
@@ -115,10 +123,18 @@ void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnim
|
|||||||
}
|
}
|
||||||
ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(),
|
ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(),
|
||||||
TEXT("Mismatched motion controller data positions and rotations!"));
|
TEXT("Mismatched motion controller data positions and rotations!"));
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
|
|
||||||
BoneNamesMap.Empty();
|
BoneNamesMap.Empty();
|
||||||
for (TArray<FQuat>::SizeType HandKeyIndex = 0;
|
for (TArray<FQuat>::SizeType HandKeyIndex = 0;
|
||||||
HandKeyIndex < MotionControllerData.HandKeyRotations.Num(); ++HandKeyIndex)
|
HandKeyIndex <
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
HandTrackingState.HandKeyRotations.Num()
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
MotionControllerData.HandKeyRotations.Num()
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
; ++HandKeyIndex)
|
||||||
{
|
{
|
||||||
const FName& BoneName{VirtualHand->GetHandBoneName(HandKeyIndex)};
|
const FName& BoneName{VirtualHand->GetHandBoneName(HandKeyIndex)};
|
||||||
BoneNamesMap.Add(HandKeyIndex, BoneName);
|
BoneNamesMap.Add(HandKeyIndex, BoneName);
|
||||||
@@ -136,10 +152,17 @@ bool FSGVirtualHandAnimInstanceProxy::Evaluate(FPoseContext& Output)
|
|||||||
return FAnimInstanceProxy::Evaluate(Output);
|
return FAnimInstanceProxy::Evaluate(Output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
if (!HandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return FAnimInstanceProxy::Evaluate(Output);
|
||||||
|
}
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
if (!MotionControllerData.bValid)
|
if (!MotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
return FAnimInstanceProxy::Evaluate(Output);
|
return FAnimInstanceProxy::Evaluate(Output);
|
||||||
}
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
FComponentSpacePoseContext PoseContext{Output.AnimInstanceProxy};
|
FComponentSpacePoseContext PoseContext{Output.AnimInstanceProxy};
|
||||||
PoseContext.Pose.InitPose(Output.Pose);
|
PoseContext.Pose.InitPose(Output.Pose);
|
||||||
@@ -164,9 +187,16 @@ bool FSGVirtualHandAnimInstanceProxy::Evaluate(FPoseContext& Output)
|
|||||||
BoneReference.BoneIndex = BoneIndex;
|
BoneReference.BoneIndex = BoneIndex;
|
||||||
BoneReference.bUseSkeletonIndex = true;
|
BoneReference.bUseSkeletonIndex = true;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
const FVector& HandKeyLocation{HandTrackingState.HandKeyLocations[HandKeyIndex]};
|
||||||
|
const FQuat& HandKeyRotation{HandTrackingState.HandKeyRotations[HandKeyIndex]};
|
||||||
|
const FTransform HandKeyTransform{HandKeyRotation, HandKeyLocation};
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
const FVector& HandKeyPosition{MotionControllerData.HandKeyPositions[HandKeyIndex]};
|
const FVector& HandKeyPosition{MotionControllerData.HandKeyPositions[HandKeyIndex]};
|
||||||
const FQuat& HandKeyRotation{MotionControllerData.HandKeyRotations[HandKeyIndex]};
|
const FQuat& HandKeyRotation{MotionControllerData.HandKeyRotations[HandKeyIndex]};
|
||||||
const FTransform HandKeyTransform{HandKeyRotation, HandKeyPosition};
|
const FTransform HandKeyTransform{HandKeyRotation, HandKeyPosition};
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
const FTransform BoneTransform{AnimationBoneCorrectionOffsetTransform * HandKeyTransform};
|
const FTransform BoneTransform{AnimationBoneCorrectionOffsetTransform * HandKeyTransform};
|
||||||
FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
|
FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
|
||||||
|
|
||||||
|
|||||||
@@ -326,8 +326,8 @@ void USGVirtualHandComponent::PostEditChangeProperty(FPropertyChangedEvent& Prop
|
|||||||
|
|
||||||
static const FName OverridePluginSettingsName{
|
static const FName OverridePluginSettingsName{
|
||||||
FImpl::ParseVirtualHandSettingsOverridesPropertyName(
|
FImpl::ParseVirtualHandSettingsOverridesPropertyName(
|
||||||
GET_MEMBER_NAME_CHECKED(FSGWristTrackingSettingsOverrides,
|
GET_MEMBER_NAME_CHECKED(FSGVirtualHandSettingsOverrides,
|
||||||
FSGWristTrackingSettingsOverrides::bOverridePluginSettings))
|
FSGVirtualHandSettingsOverrides::bOverridePluginSettings))
|
||||||
};
|
};
|
||||||
|
|
||||||
if (PropertyName == RightName)
|
if (PropertyName == RightName)
|
||||||
@@ -452,8 +452,10 @@ bool USGVirtualHandComponent::GetMotionControllerData(FXRMotionControllerData& O
|
|||||||
OutMotionControllerData.bValid = false;
|
OutMotionControllerData.bValid = false;
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
const bool bGotMotionControllerData =
|
const bool bGotMotionControllerData =
|
||||||
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -462,6 +464,46 @@ bool USGVirtualHandComponent::GetMotionControllerData(FXRMotionControllerData& O
|
|||||||
return OutMotionControllerData.bValid;
|
return OutMotionControllerData.bValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
|
||||||
|
bool USGVirtualHandComponent::GetMotionControllerState(
|
||||||
|
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
OutMotionControllerState.bValid = false;
|
||||||
|
|
||||||
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
const bool bGotMotionControllerState =
|
||||||
|
FSGXRTracker::GetMotionControllerState(
|
||||||
|
this, XRSpaceType, Hand, XRControllerPoseType, OutMotionControllerState);
|
||||||
|
if (!bGotMotionControllerState || !OutMotionControllerState.bValid)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutMotionControllerState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool USGVirtualHandComponent::GetHandTrackingState(
|
||||||
|
const EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
OutHandTrackingState.bValid = false;
|
||||||
|
|
||||||
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
const bool bGotHandTrackingState =
|
||||||
|
FSGXRTracker::GetHandTrackingState(
|
||||||
|
this, XRSpaceType, Hand, OutHandTrackingState);
|
||||||
|
if (!bGotHandTrackingState || !OutHandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutHandTrackingState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
const TArray<FName>& USGVirtualHandComponent::GetHandBoneNames() const
|
const TArray<FName>& USGVirtualHandComponent::GetHandBoneNames() const
|
||||||
{
|
{
|
||||||
const TArray<FName>& Names{
|
const TArray<FName>& Names{
|
||||||
@@ -651,17 +693,26 @@ bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
|
|||||||
|
|
||||||
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
|
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
|
||||||
{
|
{
|
||||||
const FString DefaultMeshPath{GetDefaultMeshPath()};
|
// FIXME
|
||||||
USkeletalMesh* DefaultMesh{
|
// Disable this warning altogether as it results in polluting the packaging logs, at least until we ship a set of
|
||||||
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
|
// virtual hand meshes again.
|
||||||
};
|
// const FString DefaultMeshPath{GetDefaultMeshPath()};
|
||||||
|
// USkeletalMesh* DefaultMesh{
|
||||||
|
// Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
|
||||||
|
// };
|
||||||
|
|
||||||
if (!IsValid(DefaultMesh))
|
// FIXME
|
||||||
{
|
// Disable this warning altogether as it results in polluting the packaging logs, at least until we ship a set of
|
||||||
SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
|
// virtual hand meshes again.
|
||||||
}
|
// if (!IsValid(DefaultMesh))
|
||||||
|
// {
|
||||||
|
// SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
|
||||||
|
// }
|
||||||
|
|
||||||
return DefaultMesh;
|
// FIXME
|
||||||
|
//return DefaultMesh;
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
|
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
|
||||||
@@ -677,7 +728,10 @@ void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
|
|||||||
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
||||||
// Temporary hack to make it work inside the Blueprint Editor.
|
// Temporary hack to make it work inside the Blueprint Editor.
|
||||||
#if WITH_EDITOR
|
#if WITH_EDITOR
|
||||||
Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
// FIXME
|
||||||
|
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
||||||
|
// Instead
|
||||||
|
Owner->SetSkeletalMesh(nullptr, true);
|
||||||
#endif /* WITH_EDITOR */
|
#endif /* WITH_EDITOR */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,7 +773,7 @@ void USGVirtualHandComponent::FImpl::RestoreCollisionResponse() const
|
|||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
||||||
{
|
{
|
||||||
Owner->SetVisibility(bInVisible, true);
|
Owner->SetHiddenInGame(!bInVisible, false);
|
||||||
|
|
||||||
if (bInVisible)
|
if (bInVisible)
|
||||||
{
|
{
|
||||||
@@ -735,12 +789,25 @@ void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
|||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
||||||
{
|
{
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
const bool bGotHandTrackingState =
|
||||||
|
Owner->GetHandTrackingState(EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
FXRMotionControllerData MotionControllerData;
|
FXRMotionControllerData MotionControllerData;
|
||||||
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
const bool bHandDataAvailable =
|
const bool bHandDataAvailable =
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
bGotHandTrackingState
|
||||||
|
&& HandTrackingState.bValid
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
bGotMotionControllerData
|
bGotMotionControllerData
|
||||||
&& MotionControllerData.bValid
|
&& MotionControllerData.bValid
|
||||||
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand;
|
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
;
|
||||||
const bool bHandVisible = Owner->IsVisible();
|
const bool bHandVisible = Owner->IsVisible();
|
||||||
const bool bShouldBeVisibleWhenHandDataUnavailable =
|
const bool bShouldBeVisibleWhenHandDataUnavailable =
|
||||||
Owner->GetVirtualHandSettings().bVisibleWhenHandDataUnavailable;
|
Owner->GetVirtualHandSettings().bVisibleWhenHandDataUnavailable;
|
||||||
@@ -786,7 +853,7 @@ void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
|||||||
|
|
||||||
if (bSetNewVisibility)
|
if (bSetNewVisibility)
|
||||||
{
|
{
|
||||||
Owner->SetHiddenInGame(bHandDataAvailable);
|
SetVisibility(bHandDataAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,6 +866,16 @@ void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
const bool bGotHandTrackingState = Owner->GetHandTrackingState(EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
||||||
|
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FSGDebugVirtualHand::Draw(World, HandTrackingState, Owner->GetVirtualHandSettings().DebuggingSettings);
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
FXRMotionControllerData MotionControllerData;
|
FXRMotionControllerData MotionControllerData;
|
||||||
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
||||||
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
||||||
@@ -807,6 +884,7 @@ void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
FSGDebugVirtualHand::Draw(World, MotionControllerData, Owner->GetVirtualHandSettings().DebuggingSettings);
|
FSGDebugVirtualHand::Draw(World, MotionControllerData, Owner->GetVirtualHandSettings().DebuggingSettings);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::TriggerHandVisibilityChangedEvent(const bool bNewVisibility) const
|
void USGVirtualHandComponent::FImpl::TriggerHandVisibilityChangedEvent(const bool bNewVisibility) const
|
||||||
|
|||||||
@@ -246,8 +246,11 @@ bool USGWristTrackerComponent::GetMotionControllerData(FXRMotionControllerData&
|
|||||||
OutMotionControllerData.bValid = false;
|
OutMotionControllerData.bValid = false;
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
const bool bGotMotionControllerData =
|
const bool bGotMotionControllerData =
|
||||||
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -256,6 +259,46 @@ bool USGWristTrackerComponent::GetMotionControllerData(FXRMotionControllerData&
|
|||||||
return OutMotionControllerData.bValid;
|
return OutMotionControllerData.bValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
|
||||||
|
bool USGWristTrackerComponent::GetMotionControllerState(
|
||||||
|
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
OutMotionControllerState.bValid = false;
|
||||||
|
|
||||||
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
const bool bGotMotionControllerState =
|
||||||
|
FSGXRTracker::GetMotionControllerState(
|
||||||
|
this, XRSpaceType, Hand, XRControllerPoseType, OutMotionControllerState);
|
||||||
|
if (!bGotMotionControllerState || !OutMotionControllerState.bValid)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutMotionControllerState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool USGWristTrackerComponent::GetHandTrackingState(
|
||||||
|
const EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
OutHandTrackingState.bValid = false;
|
||||||
|
|
||||||
|
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
const bool bGotHandTrackingState =
|
||||||
|
FSGXRTracker::GetHandTrackingState(
|
||||||
|
this, XRSpaceType, Hand, OutHandTrackingState);
|
||||||
|
if (!bGotHandTrackingState || !OutHandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutHandTrackingState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner)
|
USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner)
|
||||||
: bOverridePluginSettingsPropertyAlreadyModified(false),
|
: bOverridePluginSettingsPropertyAlreadyModified(false),
|
||||||
Owner(InOwner)
|
Owner(InOwner)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "Components/PrimitiveComponent.h"
|
#include "Components/PrimitiveComponent.h"
|
||||||
#include "Components/SphereComponent.h"
|
#include "Components/SphereComponent.h"
|
||||||
#include "Kismet/KismetMathLibrary.h"
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "UObject/UObjectGlobals.h"
|
#include "UObject/UObjectGlobals.h"
|
||||||
#include "XRDeviceVisualizationComponent.h"
|
#include "XRDeviceVisualizationComponent.h"
|
||||||
|
|
||||||
@@ -430,7 +431,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|||||||
this, TEXT("RightThumbFingertipTouchCollider"));
|
this, TEXT("RightThumbFingertipTouchCollider"));
|
||||||
RightThumbFingertipTouchCollider->SetRelativeScale3D(RightHandSettings.TouchSettings.DefaultColliderSize);
|
RightThumbFingertipTouchCollider->SetRelativeScale3D(RightHandSettings.TouchSettings.DefaultColliderSize);
|
||||||
RightThumbFingertipTouchCollider->SetupAttachment(
|
RightThumbFingertipTouchCollider->SetupAttachment(
|
||||||
HandRight,RightHandSettings.TouchSettings.ThumbColliderSocketName);
|
HandRight, RightHandSettings.TouchSettings.ThumbColliderSocketName);
|
||||||
RightThumbFingertipTouchCollider->SetCastShadow(false);
|
RightThumbFingertipTouchCollider->SetCastShadow(false);
|
||||||
RightThumbFingertipTouchCollider->bCastDynamicShadow = false;
|
RightThumbFingertipTouchCollider->bCastDynamicShadow = false;
|
||||||
RightThumbFingertipTouchCollider->SetReceivesDecals(true);
|
RightThumbFingertipTouchCollider->SetReceivesDecals(true);
|
||||||
@@ -1986,7 +1987,7 @@ void ASGPawn::FImpl::SetVisibility(USceneComponent* SceneComponent, const bool b
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneComponent->SetHiddenInGame(!bVisibility);
|
SceneComponent->SetHiddenInGame(!bVisibility, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASGPawn::FImpl::UpdateHandLocation(const bool bRight, const FVector& Location, const bool bUpdateVirtualHand) const
|
void ASGPawn::FImpl::UpdateHandLocation(const bool bRight, const FVector& Location, const bool bUpdateVirtualHand) const
|
||||||
@@ -2192,7 +2193,13 @@ void ASGPawn::FImpl::RecordHandVelocity(FSGGrabState& GrabState, const float Del
|
|||||||
{
|
{
|
||||||
if (GrabState.HandVelocityHistory.IsValidIndex(0))
|
if (GrabState.HandVelocityHistory.IsValidIndex(0))
|
||||||
{
|
{
|
||||||
GrabState.HandVelocityHistory.RemoveAt(0, 1, false);
|
GrabState.HandVelocityHistory.RemoveAt(0, 1,
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
EAllowShrinking::No
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
false
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
);
|
||||||
GrabState.HandVelocityHistory.Emplace(MoveTemp(HandVelocity));
|
GrabState.HandVelocityHistory.Emplace(MoveTemp(HandVelocity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "HeadMountedDisplayTypes.h"
|
#include "HeadMountedDisplayTypes.h"
|
||||||
#include "Math/Quat.h"
|
#include "Math/Quat.h"
|
||||||
#include "Math/Transform.h"
|
#include "Math/Transform.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "Templates/UniquePtr.h"
|
#include "Templates/UniquePtr.h"
|
||||||
#include "UObject/NameTypes.h"
|
#include "UObject/NameTypes.h"
|
||||||
|
|
||||||
@@ -67,7 +68,12 @@ private:
|
|||||||
bool bVirtualHandVisible;
|
bool bVirtualHandVisible;
|
||||||
bool bMarkRenderStateDirty;
|
bool bMarkRenderStateDirty;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
FXRMotionControllerData MotionControllerData;
|
FXRMotionControllerData MotionControllerData;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
TMap<TArray<FQuat>::SizeType, FName> BoneNamesMap;
|
TMap<TArray<FQuat>::SizeType, FName> BoneNamesMap;
|
||||||
|
|
||||||
FTransform AnimationBoneCorrectionOffsetTransform;
|
FTransform AnimationBoneCorrectionOffsetTransform;
|
||||||
@@ -103,10 +109,17 @@ protected:
|
|||||||
return bMarkRenderStateDirty;
|
return bMarkRenderStateDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FORCEINLINE const FXRHandTrackingState& GetHandTrackingState() const
|
||||||
|
{
|
||||||
|
return HandTrackingState;
|
||||||
|
}
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
FORCEINLINE const FXRMotionControllerData& GetMotionControllerData() const
|
FORCEINLINE const FXRMotionControllerData& GetMotionControllerData() const
|
||||||
{
|
{
|
||||||
return MotionControllerData;
|
return MotionControllerData;
|
||||||
}
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
FORCEINLINE const TMap<TArray<FQuat>::SizeType, FName>& GetBoneNamesMap() const
|
FORCEINLINE const TMap<TArray<FQuat>::SizeType, FName>& GetBoneNamesMap() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "Math/Transform.h"
|
#include "Math/Transform.h"
|
||||||
#include "Misc/AssertionMacros.h"
|
#include "Misc/AssertionMacros.h"
|
||||||
#include "ReferenceSkeleton.h"
|
#include "ReferenceSkeleton.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "Templates/UniquePtr.h"
|
#include "Templates/UniquePtr.h"
|
||||||
#include "UObject/NameTypes.h"
|
#include "UObject/NameTypes.h"
|
||||||
|
|
||||||
@@ -175,8 +176,19 @@ protected:
|
|||||||
public:
|
public:
|
||||||
bool IsGloveConnected() const;
|
bool IsGloveConnected() const;
|
||||||
USGHapticGlove* GetConnectedGlove() const;
|
USGHapticGlove* GetConnectedGlove() const;
|
||||||
|
|
||||||
|
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
||||||
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
bool GetMotionControllerState(
|
||||||
|
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
bool GetHandTrackingState(
|
||||||
|
EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const TArray<FName>& GetHandBoneNames() const;
|
const TArray<FName>& GetHandBoneNames() const;
|
||||||
const FName& GetHandBoneName(int32 Joint) const;
|
const FName& GetHandBoneName(int32 Joint) const;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "Math/Rotator.h"
|
#include "Math/Rotator.h"
|
||||||
#include "Math/Vector.h"
|
#include "Math/Vector.h"
|
||||||
#include "MotionControllerComponent.h"
|
#include "MotionControllerComponent.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "Templates/UniquePtr.h"
|
#include "Templates/UniquePtr.h"
|
||||||
|
|
||||||
#include "SGSettings/SGWristTrackingSettings.h"
|
#include "SGSettings/SGWristTrackingSettings.h"
|
||||||
@@ -164,5 +165,15 @@ protected:
|
|||||||
FActorComponentTickFunction* ThisTickFunction);
|
FActorComponentTickFunction* ThisTickFunction);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
||||||
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
bool GetMotionControllerState(
|
||||||
|
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
bool GetHandTrackingState(
|
||||||
|
EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
};
|
};
|
||||||
@@ -113,7 +113,9 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
@@ -128,7 +130,9 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
@@ -233,7 +237,9 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
@@ -248,7 +254,9 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
|
|||||||
@@ -112,7 +112,9 @@ public class SenseGloveCoreImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
@@ -127,7 +129,9 @@ public class SenseGloveCoreImpl : ModuleRules
|
|||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
|
||||||
#if UE_5_3_OR_LATER
|
#if UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_3_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
#elif UE_5_2_OR_LATER
|
#elif UE_5_2_OR_LATER
|
||||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||||
|
|||||||
@@ -72,4 +72,36 @@ void FSGDebugVirtualHand::Draw(const UWorld* World,
|
|||||||
FSGDebugGizmo::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugGizmoHandSettings);
|
FSGDebugGizmo::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugGizmoHandSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
void FSGDebugVirtualHand::Draw(const UWorld* World,
|
||||||
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings)
|
||||||
|
{
|
||||||
|
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||||
|
TEXT("Invalid virtual hand drawing mode!"));
|
||||||
|
|
||||||
|
ensureAlwaysMsgf(HandTrackingState.bValid,
|
||||||
|
TEXT("Invalid hand tracking state!"));
|
||||||
|
|
||||||
|
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
||||||
|
TEXT("Mismatched hand tracking state locations and rotations!"));
|
||||||
|
|
||||||
|
for (TArray<FVector>::SizeType HandKeyIndex = 0;
|
||||||
|
HandKeyIndex < HandTrackingState.HandKeyLocations.Num(); ++HandKeyIndex)
|
||||||
|
{
|
||||||
|
const FVector& HandKeyLocation{HandTrackingState.HandKeyLocations[HandKeyIndex]};
|
||||||
|
const FQuat& HandKeyRotation{HandTrackingState.HandKeyRotations[HandKeyIndex]};
|
||||||
|
|
||||||
|
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
|
||||||
|
{
|
||||||
|
FSGDebugCube::Draw(World, HandKeyLocation, HandKeyRotation, Settings.DebugCubicHandSettings);
|
||||||
|
}
|
||||||
|
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
|
||||||
|
{
|
||||||
|
FSGDebugGizmo::Draw(World, HandKeyLocation, HandKeyRotation, Settings.DebugGizmoHandSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "HeadMountedDisplayTypes.h"
|
#include "HeadMountedDisplayTypes.h"
|
||||||
#include "Math/Rotator.h"
|
#include "Math/Rotator.h"
|
||||||
#include "Math/Vector.h"
|
#include "Math/Vector.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
|
|
||||||
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
|
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
|
||||||
|
|
||||||
@@ -47,11 +48,19 @@ class UWorld;
|
|||||||
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
|
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
UE_DEPRECATED(5.5, "Deprecated in favor of the variant that accepts FXRHandTrackingState")
|
||||||
static void Draw(
|
static void Draw(
|
||||||
const UWorld* World,
|
const UWorld* World,
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
const FXRMotionControllerData& MotionControllerData,
|
||||||
const FSGVirtualHandDebuggingSettings& Settings);
|
const FSGVirtualHandDebuggingSettings& Settings);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
static void Draw(
|
||||||
|
const UWorld* World,
|
||||||
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FSGDebugVirtualHand() = delete;
|
FSGDebugVirtualHand() = delete;
|
||||||
virtual ~FSGDebugVirtualHand() = delete;
|
virtual ~FSGDebugVirtualHand() = delete;
|
||||||
|
|||||||
+15
-2
@@ -37,11 +37,24 @@
|
|||||||
|
|
||||||
#include "SGDebug/SGDebugVirtualHand.h"
|
#include "SGDebug/SGDebugVirtualHand.h"
|
||||||
|
|
||||||
void USGDebugVirtualHandKismetLibrary::Draw(
|
void USGDebugVirtualHandKismetLibrary::Draw_FXRMotionControllerData(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
const FXRMotionControllerData& MotionControllerData, const FSGVirtualHandDebuggingSettings& Settings)
|
const FXRMotionControllerData& MotionControllerData,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings)
|
||||||
{
|
{
|
||||||
ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!"));
|
ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!"));
|
||||||
|
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
FSGDebugVirtualHand::Draw(WorldContextObject->GetWorld(), MotionControllerData, Settings);
|
FSGDebugVirtualHand::Draw(WorldContextObject->GetWorld(), MotionControllerData, Settings);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
}
|
||||||
|
|
||||||
|
void USGDebugVirtualHandKismetLibrary::Draw_FXRHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings)
|
||||||
|
{
|
||||||
|
ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!"));
|
||||||
|
|
||||||
|
FSGDebugVirtualHand::Draw(WorldContextObject->GetWorld(), HandTrackingState, Settings);
|
||||||
}
|
}
|
||||||
+12
-3
@@ -35,8 +35,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "UObject/ObjectMacros.h"
|
||||||
|
#include "HeadMountedDisplayTypes.h"
|
||||||
|
|
||||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||||
#include "SGDebug/SGDebugVirtualHand.h"
|
|
||||||
|
|
||||||
#include "SGDebugVirtualHandKismetLibrary.generated.h"
|
#include "SGDebugVirtualHandKismetLibrary.generated.h"
|
||||||
|
|
||||||
@@ -48,10 +50,17 @@ class SENSEGLOVEDEBUGKISMET_API USGDebugVirtualHandKismetLibrary final : public
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Debug | Virtual Hand",
|
UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand",
|
||||||
meta=(WorldContext="WorldContextObject"))
|
meta=(WorldContext="WorldContextObject"))
|
||||||
static void Draw(
|
static void Draw_FXRMotionControllerData(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
const FXRMotionControllerData& MotionControllerData,
|
||||||
const FSGVirtualHandDebuggingSettings& Settings);
|
const FSGVirtualHandDebuggingSettings& Settings);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand",
|
||||||
|
meta=(WorldContext="WorldContextObject"))
|
||||||
|
static void Draw_FXRHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings);
|
||||||
};
|
};
|
||||||
@@ -113,7 +113,23 @@ USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove(
|
|||||||
bool UVirtualHandComponentKismetLibrary::GetMotionControllerData(
|
bool UVirtualHandComponentKismetLibrary::GetMotionControllerData(
|
||||||
USGVirtualHandComponent* VirtualHandComponent, FXRMotionControllerData& OutMotionControllerData)
|
USGVirtualHandComponent* VirtualHandComponent, FXRMotionControllerData& OutMotionControllerData)
|
||||||
{
|
{
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
return VirtualHandComponent->GetMotionControllerData(OutMotionControllerData);
|
return VirtualHandComponent->GetMotionControllerData(OutMotionControllerData);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UVirtualHandComponentKismetLibrary::GetMotionControllerState(USGVirtualHandComponent* VirtualHandComponent,
|
||||||
|
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
return VirtualHandComponent->GetMotionControllerState(
|
||||||
|
XRSpaceType, XRControllerPoseType, OutMotionControllerState);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UVirtualHandComponentKismetLibrary::GetHandTrackingState(USGVirtualHandComponent* VirtualHandComponent,
|
||||||
|
const EXRSpaceType XRSpaceType, FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
return VirtualHandComponent->GetHandTrackingState(XRSpaceType, OutHandTrackingState);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetHandBoneNames(
|
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetHandBoneNames(
|
||||||
|
|||||||
@@ -93,5 +93,24 @@ const FRotator& UWristTrackerComponentKismetLibrary::GetWristRotation(
|
|||||||
bool UWristTrackerComponentKismetLibrary::GetMotionControllerData(
|
bool UWristTrackerComponentKismetLibrary::GetMotionControllerData(
|
||||||
USGWristTrackerComponent* WristTrackerComponent, FXRMotionControllerData& OutMotionControllerData)
|
USGWristTrackerComponent* WristTrackerComponent, FXRMotionControllerData& OutMotionControllerData)
|
||||||
{
|
{
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
return WristTrackerComponent->GetMotionControllerData(OutMotionControllerData);
|
return WristTrackerComponent->GetMotionControllerData(OutMotionControllerData);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UWristTrackerComponentKismetLibrary::GetMotionControllerState(
|
||||||
|
USGWristTrackerComponent* WristTrackerComponent,
|
||||||
|
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
return WristTrackerComponent->GetMotionControllerState(
|
||||||
|
XRSpaceType, XRControllerPoseType, OutMotionControllerState);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UWristTrackerComponentKismetLibrary::GetHandTrackingState(
|
||||||
|
USGWristTrackerComponent* WristTrackerComponent,
|
||||||
|
const EXRSpaceType XRSpaceType, FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
return WristTrackerComponent->GetHandTrackingState(
|
||||||
|
XRSpaceType, OutHandTrackingState);
|
||||||
}
|
}
|
||||||
@@ -106,6 +106,16 @@ public:
|
|||||||
static bool GetMotionControllerData(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
static bool GetMotionControllerData(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||||
|
static bool GetMotionControllerState(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||||
|
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||||
|
static bool GetHandTrackingState(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||||
|
EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||||
static const TArray<FName>& GetHandBoneNames(const USGVirtualHandComponent* VirtualHandComponent);
|
static const TArray<FName>& GetHandBoneNames(const USGVirtualHandComponent* VirtualHandComponent);
|
||||||
|
|
||||||
|
|||||||
@@ -86,4 +86,14 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||||
static bool GetMotionControllerData(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
static bool GetMotionControllerData(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||||
|
static bool GetMotionControllerState(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||||
|
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||||
|
static bool GetHandTrackingState(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||||
|
EXRSpaceType XRSpaceType,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
};
|
};
|
||||||
@@ -51,7 +51,7 @@ struct SENSEGLOVESETTINGS_API FSGGloveTrackingSettings
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* The interval in which the tracking module checks for glove connectivity.
|
* The interval in which the tracking module checks for glove connectivity (in milliseconds).
|
||||||
*
|
*
|
||||||
* The default is 16.666666f which means 60 times per second.
|
* The default is 16.666666f which means 60 times per second.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ struct SENSEGLOVESETTINGS_API FSGTrackingSettings
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Determines whether to fallback to hand-tracking, or not, when no SenseGlove device is detected:
|
* Determines whether to fall back to hand-tracking, or not, when no SenseGlove device is detected:
|
||||||
*
|
*
|
||||||
* - If disabled, only a real glove will be tracked.
|
* - If disabled, only a real glove will be tracked.
|
||||||
* - If enabled, the plugin will fall back to hand-tracking when it's available and supported by the HMD device.
|
* - If enabled, the plugin will fall back to hand-tracking when it's available and supported by the HMD device.
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ struct USGGloveTracker::FImpl
|
|||||||
{
|
{
|
||||||
const USGSettings* Settings{USGSettings::GetInstance()};
|
const USGSettings* Settings{USGSettings::GetInstance()};
|
||||||
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
|
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
|
||||||
return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval;
|
return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval * 0.001f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
@@ -137,7 +137,16 @@ void USGGloveTracker::Initialize(FSubsystemCollectionBase& Collection)
|
|||||||
Pimpl->GloveConnectivityCheckTimer, GloveConnectivityCheckHandler, GloveConnectivityCheckInterval,
|
Pimpl->GloveConnectivityCheckTimer, GloveConnectivityCheckHandler, GloveConnectivityCheckInterval,
|
||||||
true, -1.0f);
|
true, -1.0f);
|
||||||
|
|
||||||
SGLOG("The glove connectivity check timer has been started successfully!");
|
if (ensureAlwaysMsgf(TimerManager.IsTimerActive(Pimpl->GloveConnectivityCheckTimer),
|
||||||
|
TEXT("GloveConnectivityCheckTimer is not active")))
|
||||||
|
{
|
||||||
|
SGLOG("The glove connectivity check timer has been started successfully!");
|
||||||
|
SGLOG("The glove connectivity timer interval is: ", GloveConnectivityCheckInterval);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SGLOG_ERROR("The glove connectivity check timer has failed to start!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SGLOG("The SenseGlove tracking singleton has been successfully initialized with the world lifetime!");
|
SGLOG("The SenseGlove tracking singleton has been successfully initialized with the world lifetime!");
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ FSGXRHandState::FSGXRHandState()
|
|||||||
Locations{XR_TYPE_HAND_JOINT_LOCATIONS_EXT},
|
Locations{XR_TYPE_HAND_JOINT_LOCATIONS_EXT},
|
||||||
KeypointTransforms{},
|
KeypointTransforms{},
|
||||||
Radii{},
|
Radii{},
|
||||||
bReceivedJointPoses(false)
|
bHasReceivedJointPoses(false),
|
||||||
|
bTracked(false)
|
||||||
{
|
{
|
||||||
Velocities.jointCount = XR_HAND_JOINT_COUNT_EXT;
|
Velocities.jointCount = XR_HAND_JOINT_COUNT_EXT;
|
||||||
Velocities.jointVelocities = JointVelocities;
|
Velocities.jointVelocities = JointVelocities;
|
||||||
@@ -60,7 +61,7 @@ bool FSGXRHandState::GetTransform(const EHandKeypoint Keypoint, FTransform& OutT
|
|||||||
check(static_cast<int32>(Keypoint) < EHandKeypointCount);
|
check(static_cast<int32>(Keypoint) < EHandKeypointCount);
|
||||||
OutTransform = KeypointTransforms[static_cast<uint32>(Keypoint)];
|
OutTransform = KeypointTransforms[static_cast<uint32>(Keypoint)];
|
||||||
|
|
||||||
return bReceivedJointPoses;
|
return bHasReceivedJointPoses;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FTransform& FSGXRHandState::GetTransform(const EHandKeypoint Keypoint) const
|
const FTransform& FSGXRHandState::GetTransform(const EHandKeypoint Keypoint) const
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3
|
||||||
#include "OpenXRHMD.h"
|
#include "OpenXRHMD.h"
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 */
|
||||||
#include "Runtime/Launch/Resources/Version.h"
|
|
||||||
|
|
||||||
#include "SGCore/SGHapticGlove.h"
|
#include "SGCore/SGHapticGlove.h"
|
||||||
#include "SGLog/SGLog.h"
|
#include "SGLog/SGLog.h"
|
||||||
@@ -999,7 +998,9 @@ FTransform FSGXRTracker::FImpl::GetMeshFingerStartBoneRefTransform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FSGXRTracker::GetMotionControllerData(
|
bool FSGXRTracker::GetMotionControllerData(
|
||||||
UObject* WorldContextObject, const EControllerHand Hand, FXRMotionControllerData& OutMotionControllerData)
|
UObject* WorldContextObject,
|
||||||
|
const EControllerHand Hand,
|
||||||
|
FXRMotionControllerData& OutMotionControllerData)
|
||||||
{
|
{
|
||||||
OutMotionControllerData.DeviceName = NAME_None;
|
OutMotionControllerData.DeviceName = NAME_None;
|
||||||
OutMotionControllerData.ApplicationInstanceID = FApp::GetInstanceId();
|
OutMotionControllerData.ApplicationInstanceID = FApp::GetInstanceId();
|
||||||
@@ -1164,9 +1165,41 @@ bool FSGXRTracker::GetMotionControllerData(
|
|||||||
{
|
{
|
||||||
OutMotionControllerData.DeviceVisualType = EXRVisualType::Hand;
|
OutMotionControllerData.DeviceVisualType = EXRVisualType::Hand;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
bool bTracked = false;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates(
|
OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates(
|
||||||
Hand, OutMotionControllerData.HandKeyPositions, OutMotionControllerData.HandKeyRotations,
|
Hand,
|
||||||
OutMotionControllerData.HandKeyRadii);
|
OutMotionControllerData.HandKeyPositions,
|
||||||
|
OutMotionControllerData.HandKeyRotations,
|
||||||
|
OutMotionControllerData.HandKeyRadii
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
, bTracked
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
// Unused!
|
||||||
|
(void) bTracked;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
// TODO
|
||||||
|
// Begin backward compatibility with the deprecated function, remove this block along with the deprecated
|
||||||
|
// GetAllKeypointStates (though it should be time to remove this entire function as well)!
|
||||||
|
if (!OutMotionControllerData.bValid)
|
||||||
|
{
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates(
|
||||||
|
Hand,
|
||||||
|
OutMotionControllerData.HandKeyPositions,
|
||||||
|
OutMotionControllerData.HandKeyRotations,
|
||||||
|
OutMotionControllerData.HandKeyRadii);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
}
|
||||||
|
// End backward compability.
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
if (!ensureAlwaysMsgf(
|
if (!ensureAlwaysMsgf(
|
||||||
!OutMotionControllerData.bValid
|
!OutMotionControllerData.bValid
|
||||||
@@ -1186,13 +1219,293 @@ bool FSGXRTracker::GetMotionControllerData(
|
|||||||
OutMotionControllerData.TrackingStatus = ETrackingStatus::Tracked;
|
OutMotionControllerData.TrackingStatus = ETrackingStatus::Tracked;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TODO
|
|
||||||
// This is reportedly a WMR-specific convenience function for rapid prototyping. Not sure if it's useful for OpenXR.
|
|
||||||
OutMotionControllerData.bIsGrasped = false;
|
|
||||||
|
|
||||||
return OutMotionControllerData.bValid;
|
return OutMotionControllerData.bValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
|
||||||
|
bool FSGXRTracker::GetMotionControllerState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
auto ToMotionSourceName = [](
|
||||||
|
const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType) -> FLazyName
|
||||||
|
{
|
||||||
|
static FLazyName LeftAim = "LeftAim";
|
||||||
|
static FLazyName LeftGrip = "LeftGrip";
|
||||||
|
static FLazyName LeftPalm = "LeftPalm";
|
||||||
|
static FLazyName RightAim = "RightAim";
|
||||||
|
static FLazyName RightGrip = "RightGrip";
|
||||||
|
static FLazyName RightPalm = "RightPalm";
|
||||||
|
if (Hand == EControllerHand::Left)
|
||||||
|
{
|
||||||
|
switch (XRControllerPoseType)
|
||||||
|
{
|
||||||
|
case EXRControllerPoseType::Aim:
|
||||||
|
return LeftAim;
|
||||||
|
case EXRControllerPoseType::Grip:
|
||||||
|
return LeftGrip;
|
||||||
|
case EXRControllerPoseType::Palm:
|
||||||
|
return LeftPalm;
|
||||||
|
default:
|
||||||
|
check(false);
|
||||||
|
return LeftGrip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (XRControllerPoseType)
|
||||||
|
{
|
||||||
|
case EXRControllerPoseType::Aim:
|
||||||
|
return RightAim;
|
||||||
|
case EXRControllerPoseType::Grip:
|
||||||
|
return RightGrip;
|
||||||
|
case EXRControllerPoseType::Palm:
|
||||||
|
return RightPalm;
|
||||||
|
default:
|
||||||
|
check(false);
|
||||||
|
return RightGrip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
OutMotionControllerState.DeviceName = NAME_None;
|
||||||
|
OutMotionControllerState.ApplicationInstanceID = FApp::GetInstanceId();
|
||||||
|
OutMotionControllerState.TrackingStatus = ETrackingStatus::NotTracked;
|
||||||
|
OutMotionControllerState.Hand = Hand;
|
||||||
|
OutMotionControllerState.XRSpaceType = XRSpaceType;
|
||||||
|
OutMotionControllerState.bValid = false;
|
||||||
|
|
||||||
|
if (!IsValid(WorldContextObject))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsValid(WorldContextObject))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IXRTrackingSystem* XRTrackingSystem{GEngine ? GEngine->XRSystem.Get() : nullptr};
|
||||||
|
if (!XRTrackingSystem)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4
|
||||||
|
IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()};
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */
|
||||||
|
FOpenXRHMD* OpenXRHMD{static_cast<FOpenXRHMD*>(GEngine->XRSystem.Get())};
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */
|
||||||
|
if (!OpenXRHMD)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
TArray<int32> Devices;
|
||||||
|
const int32 HandIndex = static_cast<int32>(Hand);
|
||||||
|
const bool bGotDevices =
|
||||||
|
XRTrackingSystem->EnumerateTrackedDevices(Devices, EXRTrackedDeviceType::Controller);
|
||||||
|
if (bGotDevices && Devices.IsValidIndex(HandIndex))
|
||||||
|
{
|
||||||
|
const XrSession Session{OpenXRHMD->GetSession()};
|
||||||
|
if (Session)
|
||||||
|
{
|
||||||
|
XrInteractionProfileState Profile = {XR_TYPE_INTERACTION_PROFILE_STATE};
|
||||||
|
const XrPath TopLevelUserPath{OpenXRHMD->GetTrackedDevicePath(Devices[HandIndex])};
|
||||||
|
const XrResult CurrentInteractionProfile{
|
||||||
|
xrGetCurrentInteractionProfile(Session, TopLevelUserPath, &Profile)
|
||||||
|
};
|
||||||
|
if (XR_SUCCEEDED(CurrentInteractionProfile) && Profile.interactionProfile != XR_NULL_PATH)
|
||||||
|
{
|
||||||
|
OutMotionControllerState.DeviceName = FOpenXRPath(Profile.interactionProfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Hand == EControllerHand::Left) || (Hand == EControllerHand::Right))
|
||||||
|
{
|
||||||
|
static const FName MotionControllerName("OpenXR");
|
||||||
|
TArray<IMotionController*> MotionControllers{
|
||||||
|
IModularFeatures::Get().GetModularFeatureImplementations<IMotionController>(
|
||||||
|
IMotionController::GetModularFeatureName())
|
||||||
|
};
|
||||||
|
IMotionController* MotionController{nullptr};
|
||||||
|
for (IMotionController* MotionControllerIterator: MotionControllers)
|
||||||
|
{
|
||||||
|
if (!MotionControllerIterator)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const FName DeviceTypeName{MotionControllerIterator->GetMotionControllerDeviceTypeName()};
|
||||||
|
if (DeviceTypeName != MotionControllerName)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
MotionController = MotionControllerIterator;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MotionController)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
// Handle the pose that is actually being requested.
|
||||||
|
|
||||||
|
const FName MotionSource{ToMotionSourceName(Hand, XRControllerPoseType)};
|
||||||
|
const FTransform TrackingToWorld{
|
||||||
|
XRSpaceType == EXRSpaceType::UnrealWorldSpace
|
||||||
|
? XRTrackingSystem->GetTrackingToWorldTransform()
|
||||||
|
: FTransform::Identity
|
||||||
|
};
|
||||||
|
const float WorldToMeters = XRSpaceType == EXRSpaceType::UnrealWorldSpace
|
||||||
|
? XRTrackingSystem->GetWorldToMetersScale()
|
||||||
|
: 100.0f;
|
||||||
|
|
||||||
|
FVector Position{FVector::ZeroVector};
|
||||||
|
FRotator Rotation{FRotator::ZeroRotator};
|
||||||
|
|
||||||
|
bool bGotMotionControllerOrientationAndPosition = MotionController->GetControllerOrientationAndPosition(
|
||||||
|
0, MotionSource, Rotation, Position, WorldToMeters);
|
||||||
|
|
||||||
|
if (bGotMotionControllerOrientationAndPosition)
|
||||||
|
{
|
||||||
|
OutMotionControllerState.ControllerLocation = TrackingToWorld.TransformPosition(Position);
|
||||||
|
OutMotionControllerState.ControllerRotation = TrackingToWorld.TransformRotation(FQuat{Rotation});
|
||||||
|
}
|
||||||
|
|
||||||
|
OutMotionControllerState.bValid |= bGotMotionControllerOrientationAndPosition;
|
||||||
|
OutMotionControllerState.TrackingStatus =
|
||||||
|
MotionController->GetControllerTrackingStatus(0, MotionSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// We always provide the grip transform in Unreal space for XRVisualizationFunctionLibrary;
|
||||||
|
// The bValid and TrackingStatus above are also valid for this pose.
|
||||||
|
|
||||||
|
const FName MotionSource = ToMotionSourceName(Hand, EXRControllerPoseType::Grip);
|
||||||
|
const FTransform TrackingToWorld{XRTrackingSystem->GetTrackingToWorldTransform()};
|
||||||
|
const float WorldToMeters = XRTrackingSystem->GetWorldToMetersScale();
|
||||||
|
|
||||||
|
FVector Position = FVector::ZeroVector;
|
||||||
|
FRotator Rotation = FRotator::ZeroRotator;
|
||||||
|
|
||||||
|
bool bGotMotionControllerOrientationAndPosition = MotionController->GetControllerOrientationAndPosition(
|
||||||
|
0, MotionSource, Rotation, Position, WorldToMeters);
|
||||||
|
|
||||||
|
if (bGotMotionControllerOrientationAndPosition)
|
||||||
|
{
|
||||||
|
OutMotionControllerState.GripUnrealSpaceLocation = TrackingToWorld.TransformPosition(Position);
|
||||||
|
OutMotionControllerState.GripUnrealSpaceRotation =
|
||||||
|
TrackingToWorld.TransformRotation(FQuat(Rotation));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutMotionControllerState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FSGXRTracker::GetHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const EXRSpaceType XRSpaceType, const EControllerHand Hand,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
OutHandTrackingState.ApplicationInstanceID = FApp::GetInstanceId();
|
||||||
|
OutHandTrackingState.TrackingStatus = ETrackingStatus::NotTracked;
|
||||||
|
OutHandTrackingState.Hand = Hand;
|
||||||
|
OutHandTrackingState.XRSpaceType = XRSpaceType;
|
||||||
|
OutHandTrackingState.bValid = false;
|
||||||
|
|
||||||
|
if (!IsValid(WorldContextObject))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IXRTrackingSystem* XRTrackingSystem{GEngine ? GEngine->XRSystem.Get() : nullptr};
|
||||||
|
if (!XRTrackingSystem)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4
|
||||||
|
IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()};
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */
|
||||||
|
FOpenXRHMD* OpenXRHMD{static_cast<FOpenXRHMD*>(GEngine->XRSystem.Get())};
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */
|
||||||
|
if (!OpenXRHMD)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
FName HandTrackerName("OpenXRHandTracking");
|
||||||
|
TArray<IHandTracker*> HandTrackers = IModularFeatures::Get().GetModularFeatureImplementations<IHandTracker>(
|
||||||
|
IHandTracker::GetModularFeatureName());
|
||||||
|
IHandTracker* HandTracker = nullptr;
|
||||||
|
for (auto Itr: HandTrackers)
|
||||||
|
{
|
||||||
|
if (Itr->GetHandTrackerDeviceTypeName() == HandTrackerName)
|
||||||
|
{
|
||||||
|
HandTracker = Itr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Hand == EControllerHand::Left) || (Hand == EControllerHand::Right))
|
||||||
|
{
|
||||||
|
const bool bHandTrackingStateValid = HandTracker && HandTracker->IsHandTrackingStateValid();
|
||||||
|
if (bHandTrackingStateValid)
|
||||||
|
{
|
||||||
|
bool bTracked = false;
|
||||||
|
OutHandTrackingState.bValid = HandTracker->GetAllKeypointStates(
|
||||||
|
Hand,
|
||||||
|
OutHandTrackingState.HandKeyLocations,
|
||||||
|
OutHandTrackingState.HandKeyRotations,
|
||||||
|
OutHandTrackingState.HandKeyRadii,
|
||||||
|
bTracked);
|
||||||
|
|
||||||
|
/// TODO
|
||||||
|
// Begin backward compatibility with the deprecated function, remove this block along with the deprecated
|
||||||
|
// GetAllKeypointStates.
|
||||||
|
if (!OutHandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
OutHandTrackingState.bValid = HandTracker->GetAllKeypointStates(
|
||||||
|
Hand,
|
||||||
|
OutHandTrackingState.HandKeyLocations,
|
||||||
|
OutHandTrackingState.HandKeyRotations,
|
||||||
|
OutHandTrackingState.HandKeyRadii);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
bTracked = OutHandTrackingState.bValid;
|
||||||
|
// The inability to distinguish this is the reason for the deprecation.
|
||||||
|
}
|
||||||
|
// End backward compability.
|
||||||
|
|
||||||
|
if (!ensureAlwaysMsgf(
|
||||||
|
!OutHandTrackingState.bValid
|
||||||
|
|| (OutHandTrackingState.HandKeyLocations.Num() == EHandKeypointCount
|
||||||
|
&& OutHandTrackingState.HandKeyRotations.Num() == EHandKeypointCount
|
||||||
|
&& OutHandTrackingState.HandKeyRadii.Num() == EHandKeypointCount),
|
||||||
|
TEXT("Corrupted OutHandTrackingState!")))
|
||||||
|
{
|
||||||
|
OutHandTrackingState.bValid = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OutHandTrackingState.bValid)
|
||||||
|
{
|
||||||
|
OutHandTrackingState.TrackingStatus = bTracked ? ETrackingStatus::Tracked : ETrackingStatus::NotTracked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OutHandTrackingState.bValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
FSGXRTracker::FSGXRTracker(const TSharedRef<FGenericApplicationMessageHandler>& InMessageHandler)
|
FSGXRTracker::FSGXRTracker(const TSharedRef<FGenericApplicationMessageHandler>& InMessageHandler)
|
||||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||||
{
|
{
|
||||||
@@ -1462,7 +1775,7 @@ ETrackingStatus FSGXRTracker::GetControllerTrackingStatus(const int32 Controller
|
|||||||
if (bFallbackToHandTrackingIfNoGloveDetected)
|
if (bFallbackToHandTrackingIfNoGloveDetected)
|
||||||
{
|
{
|
||||||
const FSGXRHandState& HandState{bRight ? GetRightHandState() : GetLeftHandState()};
|
const FSGXRHandState& HandState{bRight ? GetRightHandState() : GetLeftHandState()};
|
||||||
return HandState.bReceivedJointPoses ? ETrackingStatus::Tracked : ETrackingStatus::NotTracked;
|
return HandState.bTracked ? ETrackingStatus::Tracked : ETrackingStatus::NotTracked;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ETrackingStatus::NotTracked;
|
return ETrackingStatus::NotTracked;
|
||||||
@@ -1588,9 +1901,17 @@ bool FSGXRTracker::GetKeypointState(
|
|||||||
return bGotTransform;
|
return bGotTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
bool FSGXRTracker::GetAllKeypointStates(
|
||||||
|
const EControllerHand Hand,
|
||||||
|
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii,
|
||||||
|
bool& OutIsTracked) const
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
bool FSGXRTracker::GetAllKeypointStates(
|
bool FSGXRTracker::GetAllKeypointStates(
|
||||||
const EControllerHand Hand,
|
const EControllerHand Hand,
|
||||||
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii) const
|
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii) const
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5*/
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!IsHandTrackingStateValid())
|
if (!IsHandTrackingStateValid())
|
||||||
{
|
{
|
||||||
@@ -1611,11 +1932,17 @@ bool FSGXRTracker::GetAllKeypointStates(
|
|||||||
Hand == EControllerHand::Left ? GetLeftHandState() : GetRightHandState()
|
Hand == EControllerHand::Left ? GetLeftHandState() : GetRightHandState()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!HandState.bReceivedJointPoses)
|
if (!HandState.bHasReceivedJointPoses)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
OutIsTracked = HandState.bTracked;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5*/
|
||||||
|
|
||||||
|
// If we ever received poses we return the last data we received, even if not currently tracking to avoid poping
|
||||||
|
// back to (0.0f, 0.0f, 0.0f) and the like.
|
||||||
OutPositions.Empty(EHandKeypointCount);
|
OutPositions.Empty(EHandKeypointCount);
|
||||||
OutRotations.Empty(EHandKeypointCount);
|
OutRotations.Empty(EHandKeypointCount);
|
||||||
OutRadii.Empty(EHandKeypointCount);
|
OutRadii.Empty(EHandKeypointCount);
|
||||||
@@ -1747,8 +2074,9 @@ bool FSGXRTracker::FImpl::UpdateXRHandTrackingData(
|
|||||||
|
|
||||||
XR_ENSURE(XRLocateHandJointsEXT(OutHandState.HandTracker, &LocateInfo, &OutHandState.Locations));
|
XR_ENSURE(XRLocateHandJointsEXT(OutHandState.HandTracker, &LocateInfo, &OutHandState.Locations));
|
||||||
|
|
||||||
OutHandState.bReceivedJointPoses = OutHandState.Locations.isActive == XR_TRUE;
|
OutHandState.bTracked = OutHandState.Locations.isActive == XR_TRUE;
|
||||||
if (!OutHandState.bReceivedJointPoses)
|
OutHandState.bHasReceivedJointPoses |= HandStates->bTracked;
|
||||||
|
if (!OutHandState.bTracked)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1875,21 +2203,16 @@ bool FSGXRTracker::FImpl::GetControllerTransform(
|
|||||||
if (!bTracked && bFallbackToHandTrackingIfNoGloveDetected)
|
if (!bTracked && bFallbackToHandTrackingIfNoGloveDetected)
|
||||||
{
|
{
|
||||||
const FSGXRHandState& HandState{bRight ? Owner->GetRightHandState() : Owner->GetLeftHandState()};
|
const FSGXRHandState& HandState{bRight ? Owner->GetRightHandState() : Owner->GetLeftHandState()};
|
||||||
if (!HandState.bReceivedJointPoses)
|
if (!HandState.bHasReceivedJointPoses)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EHandKeypoint KeyPoint = KeyPointInfoPtr->Key;
|
const EHandKeypoint KeyPoint = KeyPointInfoPtr->Key;
|
||||||
const FTransform& ControllerTransform{
|
const FTransform& ControllerTransform{HandStates->GetTransform(KeyPoint)};
|
||||||
bRight
|
|
||||||
? GetRightHandState().GetTransform(KeyPoint)
|
|
||||||
: GetLeftHandState().GetTransform(KeyPoint)
|
|
||||||
};
|
|
||||||
|
|
||||||
OutTransform = ControllerTransform;
|
OutTransform = ControllerTransform;
|
||||||
bOutMotionSourceHandTracking = true;
|
bOutMotionSourceHandTracking = true;
|
||||||
bTracked = true;
|
bTracked = HandState.bTracked;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bTracked;
|
return bTracked;
|
||||||
@@ -2386,7 +2709,8 @@ bool FSGXRTracker::FImpl::UpdateSGHandState(const bool bRight, FSGXRHandState& O
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutHandState.bReceivedJointPoses = true;
|
OutHandState.bHasReceivedJointPoses = true;
|
||||||
|
OutHandState.bTracked = true;
|
||||||
|
|
||||||
const TArray<TArray<FVector>> JointLocations{HandPose->GetJointPositions()};
|
const TArray<TArray<FVector>> JointLocations{HandPose->GetJointPositions()};
|
||||||
const TArray<TArray<FQuat>> JointRotations{HandPose->GetJointRotationsQ()};
|
const TArray<TArray<FQuat>> JointRotations{HandPose->GetJointRotationsQ()};
|
||||||
@@ -2451,4 +2775,4 @@ bool FSGXRTracker::FImpl::UpdateSGHandState(const bool bRight, FSGXRHandState& O
|
|||||||
void FSGXRTracker::FImplDeleter::operator()(const FImpl* P) const
|
void FSGXRTracker::FImplDeleter::operator()(const FImpl* P) const
|
||||||
{
|
{
|
||||||
delete P;
|
delete P;
|
||||||
}
|
}
|
||||||
@@ -51,12 +51,16 @@ public:
|
|||||||
XrHandJointVelocitiesEXT Velocities;
|
XrHandJointVelocitiesEXT Velocities;
|
||||||
XrHandJointLocationsEXT Locations;
|
XrHandJointLocationsEXT Locations;
|
||||||
|
|
||||||
// Transforms are cached in Unreal Tracking Space
|
// Transforms are cached in Unreal Tracking Space.
|
||||||
FTransform KeypointTransforms[EHandKeypointCount];
|
FTransform KeypointTransforms[EHandKeypointCount];
|
||||||
|
|
||||||
float Radii[EHandKeypointCount];
|
float Radii[EHandKeypointCount];
|
||||||
|
|
||||||
bool bReceivedJointPoses;
|
// true if this hand has ever been tracked, and therefore its poses are valid.
|
||||||
|
bool bHasReceivedJointPoses;
|
||||||
|
|
||||||
|
// true if tracked right now.
|
||||||
|
bool bTracked;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FSGXRHandState();
|
FSGXRHandState();
|
||||||
|
|||||||
@@ -55,8 +55,22 @@ class SENSEGLOVETRACKING_API FSGXRTracker final : public IOpenXRExtensionPlugin,
|
|||||||
public IHandTracker
|
public IHandTracker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool GetMotionControllerData(UObject* WorldContextObject, EControllerHand Hand,
|
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
static bool GetMotionControllerData(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
EControllerHand Hand,
|
||||||
|
FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
static bool GetMotionControllerState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
EXRSpaceType XRSpaceType, EControllerHand Hand, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
static bool GetHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
EXRSpaceType XRSpaceType, EControllerHand Hand,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct FImpl;
|
struct FImpl;
|
||||||
@@ -158,7 +172,15 @@ public:
|
|||||||
virtual bool GetKeypointState(
|
virtual bool GetKeypointState(
|
||||||
EControllerHand Hand,
|
EControllerHand Hand,
|
||||||
EHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius) const override;
|
EHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius) const override;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
virtual bool GetAllKeypointStates(
|
||||||
|
EControllerHand Hand,
|
||||||
|
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii,
|
||||||
|
bool& OutIsTracked) const override;
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
virtual bool GetAllKeypointStates(
|
virtual bool GetAllKeypointStates(
|
||||||
EControllerHand Hand,
|
EControllerHand Hand,
|
||||||
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii) const override;
|
TArray<FVector>& OutPositions, TArray<FQuat>& OutRotations, TArray<float>& OutRadii) const override;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
};
|
};
|
||||||
@@ -42,5 +42,24 @@
|
|||||||
bool USGXRTrackerKismetLibrary::GetMotionControllerData(
|
bool USGXRTrackerKismetLibrary::GetMotionControllerData(
|
||||||
UObject* WorldContextObject, const EControllerHand Hand, FXRMotionControllerData& OutMotionControllerData)
|
UObject* WorldContextObject, const EControllerHand Hand, FXRMotionControllerData& OutMotionControllerData)
|
||||||
{
|
{
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
return FSGXRTracker::GetMotionControllerData(WorldContextObject, Hand, OutMotionControllerData);
|
return FSGXRTracker::GetMotionControllerData(WorldContextObject, Hand, OutMotionControllerData);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
}
|
||||||
|
|
||||||
|
bool USGXRTrackerKismetLibrary::GetMotionControllerState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState)
|
||||||
|
{
|
||||||
|
return FSGXRTracker::GetMotionControllerState(
|
||||||
|
WorldContextObject, XRSpaceType, Hand, XRControllerPoseType, OutMotionControllerState);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool USGXRTrackerKismetLibrary::GetHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
const EXRSpaceType XRSpaceType, const EControllerHand Hand,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState)
|
||||||
|
{
|
||||||
|
return FSGXRTracker::GetHandTrackingState(WorldContextObject, XRSpaceType, Hand, OutHandTrackingState);
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include "SGHMDTrackerKismetLibrary.generated.h"
|
#include "SGHMDTrackerKismetLibrary.generated.h"
|
||||||
|
|
||||||
UCLASS(meta=(ScriptName = "SenseGloveHeadMountDisplayKismetLibrary"))
|
UCLASS(meta=(ScriptName = "SenseGloveHMDTrackerKismetLibrary"))
|
||||||
class SENSEGLOVETRACKINGKISMET_API USGHMDTrackerKismetLibrary final : public USGBlueprintFunctionLibrary
|
class SENSEGLOVETRACKINGKISMET_API USGHMDTrackerKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
class UObject;
|
class UObject;
|
||||||
|
|
||||||
UCLASS(meta=(ScriptName = "SenseGloveHeadMountDisplayKismetLibrary"))
|
UCLASS(meta=(ScriptName = "SenseGloveXRTrackerKismetLibrary"))
|
||||||
class SENSEGLOVETRACKINGKISMET_API USGXRTrackerKismetLibrary final : public USGBlueprintFunctionLibrary
|
class SENSEGLOVETRACKINGKISMET_API USGXRTrackerKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
@@ -53,6 +53,22 @@ class SENSEGLOVETRACKINGKISMET_API USGXRTrackerKismetLibrary final : public USGB
|
|||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
||||||
meta=(WorldContext="WorldContextObject"))
|
meta=(WorldContext="WorldContextObject"))
|
||||||
static bool GetMotionControllerData(UObject* WorldContextObject, EControllerHand Hand,
|
static bool GetMotionControllerData(
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
UObject* WorldContextObject,
|
||||||
};
|
EControllerHand Hand,
|
||||||
|
FXRMotionControllerData& OutMotionControllerData);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
||||||
|
meta=(WorldContext="WorldContextObject"))
|
||||||
|
static bool GetMotionControllerState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
EXRSpaceType XRSpaceType, EControllerHand Hand, EXRControllerPoseType XRControllerPoseType,
|
||||||
|
FXRMotionControllerState& OutMotionControllerState);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
||||||
|
meta=(WorldContext="WorldContextObject"))
|
||||||
|
static bool GetHandTrackingState(
|
||||||
|
UObject* WorldContextObject,
|
||||||
|
EXRSpaceType XRSpaceType, EControllerHand Hand,
|
||||||
|
FXRHandTrackingState& OutHandTrackingState);
|
||||||
|
};
|
||||||
@@ -35,12 +35,14 @@
|
|||||||
|
|
||||||
#include "SGUtils/SGEngineUtils.h"
|
#include "SGUtils/SGEngineUtils.h"
|
||||||
|
|
||||||
|
#include "CoreGlobals.h"
|
||||||
#if WITH_EDITOR
|
#if WITH_EDITOR
|
||||||
#include "Editor.h"
|
#include "Editor.h"
|
||||||
#endif /* WITH_EDITOR */
|
#endif /* WITH_EDITOR */
|
||||||
#include "Engine/Engine.h"
|
#include "Engine/Engine.h"
|
||||||
#include "Engine/GameViewportClient.h"
|
#include "Engine/GameViewportClient.h"
|
||||||
#include "Engine/World.h"
|
#include "Engine/World.h"
|
||||||
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "Subsystems/EngineSubsystem.h"
|
#include "Subsystems/EngineSubsystem.h"
|
||||||
|
|
||||||
UWorld* FSGEngineUtils::GetWorld()
|
UWorld* FSGEngineUtils::GetWorld()
|
||||||
@@ -53,8 +55,21 @@ UWorld* FSGEngineUtils::GetWorld()
|
|||||||
if (IsValid(GEditor))
|
if (IsValid(GEditor))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
const bool bIsPIE = GPlayInEditorID != -1;
|
const bool bIsPIE =
|
||||||
const int32 WorldPIEInstance = bIsPIE ? GPlayInEditorID : 1;
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
UE::GetPlayInEditorID()
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
GPlayInEditorID
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
!= -1;
|
||||||
|
const int32 WorldPIEInstance = bIsPIE
|
||||||
|
?
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
UE::GetPlayInEditorID()
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
GPlayInEditorID
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
: 1;
|
||||||
const FWorldContext* WorldContext{GEditor->GetPIEWorldContext(WorldPIEInstance)};
|
const FWorldContext* WorldContext{GEditor->GetPIEWorldContext(WorldPIEInstance)};
|
||||||
if (WorldContext)
|
if (WorldContext)
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user