Files
Plugin/Source/SenseGloveCore/Public/SGCore/SGTracking.h
T

150 lines
5.2 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 "Containers/UnrealString.h"
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGTracking.generated.h"
USTRUCT()
struct SENSEGLOVECORE_API FSGTracking
{
GENERATED_BODY()
public:
static void CalculateLocation(
const FVector& TrackedPosition, const FQuat& TrackedRotation,
const FVector& PositionOffset, const FQuat& RotationOffset,
FVector& OutNewPosition, FQuat& OutNewRotation);
static void CalculateLocation(
const FVector& TrackedPosition, const FRotator& TrackedRotation,
const FVector& PositionOffset, const FRotator& RotationOffset,
FVector& OutNewPosition, FRotator& OutNewRotation);
static TArray<FVector> GetSenseGloveFingerToGlovePositionOrigin();
static TArray<FQuat> GetSenseGloveFingerToGloveRotationOriginQ();
static TArray<FRotator> GetSenseGloveFingerToGloveRotationOrigin();
static FVector GetSenseGloveWristPositionOffset();
static FQuat GetSenseGloveWristRotationOffsetQ();
static FRotator GetSenseGloveWristRotationOffset();
static void GetSenseGloveMountOffset(bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FQuat& OutIRotation);
static void GetSenseGloveMountOffset(bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FRotator& OutIRotation);
static void GetSenseGloveTrackerMountOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
static void GetSenseGloveTrackerMountOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
static FVector GetSenseGloveViveToAttachPosition();
static FQuat GetSenseGloveViveToAttachRotationQ();
static FRotator GetSenseGloveViveToAttachRotation();
static FVector GetSenseGloveOculusTouchToAttachPosition();
static FQuat GetSenseGloveOculusTouchToAttachRotationQ();
static FRotator GetSenseGloveOculusTouchToAttachRotation();
static FVector GetNovaToWristPositionOffset();
static FQuat GetNovaToWristRotationOffsetQ();
static FRotator GetNovaToWristRotationOffset();
static void GetNovaGloveWristOffset(bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset);
static void GetNovaGloveWristOffset(bool bRightHanded, FVector& OutPositionOffset, FRotator& OutRotationOffset);
static FVector GetRightNovaViveToAttachPosition();
static FQuat GetRightNovaViveToAttachRotationQ();
static FRotator GetRightNovaViveToAttachRotation();
static FVector GetLeftNovaViveToAttachPosition();
static FQuat GetLeftNovaViveToAttachRotationQ();
static FRotator GetLeftNovaViveToAttachRotation();
static FVector GetRightNovaQuest2ToAttachPosition();
static FQuat GetRightNovaQuest2ToAttachRotationQ();
static FRotator GetRightNovaQuest2ToAttachRotation();
static FVector GetLeftNovaQuest2ToAttachPosition();
static FQuat GetLeftNovaQuest2ToAttachRotationQ();
static FRotator GetLeftNovaQuest2ToAttachRotation();
static FVector GetRightNovaPico2ToAttachPosition();
static FQuat GetRightNovaPico2ToAttachRotationQ();
static FRotator GetRightNovaPico2ToAttachRotation();
static FQuat GetLeftNovaPico2ToAttachRotationQ();
static FRotator GetLeftNovaPico2ToAttachRotation();
static void GetNovaGloveTrackerOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
static void GetNovaGloveTrackerOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
static FString ToString(ESGPositionalTrackingHardware Hardware);
};