Files
Plugin/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGTrackingKismetLibrary.h
T

228 lines
11 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Containers/Array.h"
#include "Math/Quat.h"
#include "Math/Rotator.h"
#include "Math/Vector.h"
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGTrackingKismetLibrary.generated.h"
UCLASS(meta=(ScriptName = "SesneGloveTrackingKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGTrackingKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, DisplayName="Calculate Location", Category="SenseGlove | Core | Tracking")
static void
CalculateLocation_TrackedPosition_FQuatTrackedRotation_PositionOffset_FQuatRotationOffset_OutNewPosition_FQuatOutNewRotation(
const FVector& TrackedPosition, const FQuat& TrackedRotation,
const FVector& PositionOffset, const FQuat& RotationOffset,
FVector& OutNewPosition, FQuat& OutNewRotation);
UFUNCTION(BlueprintCallable, DisplayName="Calculate Location", Category="SenseGlove | Core | Tracking")
static void
CalculateLocation_TrackedPosition_FRotatorTrackedRotation_PositionOffset_FRotatorRotationOffset_OutNewPosition_FRotatorOutNewRotation(
const FVector& TrackedPosition, const FRotator& TrackedRotation,
const FVector& PositionOffset, const FRotator& RotationOffset,
FVector& OutNewPosition, FRotator& OutNewRotation);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static TArray<FVector> GetSenseGloveFingerToGlovePositionOrigin();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Finger To Glove Rotation Origin",
Category="SenseGlove | Core | Tracking")
static TArray<FQuat> GetSenseGloveFingerToGloveRotationOrigin_TArrayFQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Finger To Glove Rotation Origin",
Category="SenseGlove | Core | Tracking")
static TArray<FRotator> GetSenseGloveFingerToGloveRotationOrigin_TArrayFRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetSenseGloveWristPositionOffset();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Wrist Rotation Offset",
Category="SenseGlove | Core | Tracking")
static FQuat GetSenseGloveWristRotationOffset_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Wrist Rotation Offset",
Category="SenseGlove | Core | Tracking")
static FRotator GetSenseGloveWristRotationOffset_FRotator();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Mount Offset", Category="SenseGlove | Core | Tracking")
static void GetSenseGloveMountOffset_bRightHanded_ToFinger_OutIPosition_FQuatOutIRotation(
bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FQuat& OutIRotation);
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Mount Offset", Category="SenseGlove | Core | Tracking")
static void GetSenseGloveMountOffset_bRightHanded_ToFinger_OutIPosition_FRotatorOutIRotation(
bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FRotator& OutIRotation);
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Tracker Mouunt Offset",
Category="SenseGlove | Core | Tracking")
static void GetSenseGloveTrackerMountOffset_Hardware_bRightHanded_OutPositionOffset_FQuatOutRotationOffset(
ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Tracker Mouunt Offset",
Category="SenseGlove | Core | Tracking")
static void GetSenseGloveTrackerMountOffset_Hardware_bRightHanded_OutPositionOffset_FRotatorOutRotationOffset(
ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetSenseGloveViveToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetSenseGloveViveToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetSenseGloveViveToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetSenseGloveOculusTouchToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Oculus Touch To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetSenseGloveOculusTouchToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get SenseGlove Oculus Touch To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetSenseGloveOculusTouchToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetNovaToWristPositionOffset();
UFUNCTION(BlueprintCallable, DisplayName="Get Nove To Wrist Rotation Offset",
Category="SenseGlove | Core | Tracking")
static FQuat GetNovaToWristRotationOffset_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Nove To Wrist Rotation Offset",
Category="SenseGlove | Core | Tracking")
static FRotator GetNovaToWristRotationOffset_FRotator();
UFUNCTION(BlueprintCallable, DisplayName="Get Nova Glove Wrist Offset", Category="SenseGlove | Core | Tracking")
static void GetNovaGloveWristOffset_bRightHanded_OutPositionOffset_FQuatOutRotationOffset(
bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset);
UFUNCTION(BlueprintCallable, DisplayName="Get Nova Glove Wrist Offset", Category="SenseGlove | Core | Tracking")
static void GetNovaGloveWristOffset_bRightHanded_OutPositionOffset_FRotatorOutRotationOffset(
bool bRightHanded, FVector& OutPositionOffset, FRotator& OutRotationOffset);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetRightNovaViveToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetRightNovaViveToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetRightNovaViveToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetLeftNovaViveToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetLeftNovaViveToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Vive To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetLeftNovaViveToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetRightNovaQuest2ToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Quest 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetRightNovaQuest2ToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Quest 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetRightNovaQuest2ToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetLeftNovaQuest2ToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Quest 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetLeftNovaQuest2ToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Quest 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetLeftNovaQuest2ToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FVector GetRightNovaPico2ToAttachPosition();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Pico 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetRightNovaPico2ToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Right Nova Pico 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetRightNovaPico2ToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Pico 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FQuat GetLeftNovaPico2ToAttachRotation_FQuat();
UFUNCTION(BlueprintCallable, DisplayName="Get Left Nova Pico 2 To Attach Rotation",
Category="SenseGlove | Core | Tracking")
static FRotator GetLeftNovaPico2ToAttachRotation_FRotator();
UFUNCTION(BlueprintCallable, DisplayName="Get Nova Glove Tracker Offset", Category="SenseGlove | Core | Tracking")
static void GetNovaGloveTrackerOffset_Hardware_bRightHanded_OutPositionOffset_FQuatOutRotationOffset(
ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
UFUNCTION(BlueprintCallable, DisplayName="Get Nova Glove Tracker Offset", Category="SenseGlove | Core | Tracking")
static void GetNovaGloveTrackerOffset_Hardware_bRightHanded_OutPositionOffset_FRotatorOutRotationOffset(
ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Tracking")
static FString ToString(ESGPositionalTrackingHardware Hardware);
};