From 3ba496aa495633a89ce36836474a4602ce9088a8 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Fri, 18 Nov 2022 10:17:36 +0100 Subject: [PATCH] add more documentation --- .../Public/SGCore/SGBasicHandModel.h | 3 +- .../Public/SGCore/SGBetaDevice.h | 3 +- .../Public/SGCore/SGDeviceList.h | 3 +- .../Public/SGCore/SGHapticGlove.h | 5 +- .../SGCore/SGHapticGloveCalibrationSequence.h | 79 ++++++++++++++++++- .../SGCore/SGHapticGloveCommandBuffer.h | 68 +++++++++++++++- .../SGBasicHandModelKismetLibrary.h | 3 +- .../SGCoreKismet/SGBetaDeviceKismetLibrary.h | 3 +- .../SGCoreKismet/SGDeviceListKismetLibrary.h | 3 +- .../SGCoreKismet/SGHandPoseKismetLibrary.h | 4 +- ...ticGloveCalibrationSequenceKismetLibrary.h | 69 +++++++++++++++- .../SGHapticGloveCommandBufferKismetLibrary.h | 65 ++++++++++++++- .../SGCoreKismet/SGHapticGloveKismetLibrary.h | 7 +- 13 files changed, 297 insertions(+), 18 deletions(-) diff --git a/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h b/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h index 6159a51a..ef8c3691 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h +++ b/Source/SenseGloveCore/Public/SGCore/SGBasicHandModel.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * A data class containing the minimum required data for a hand's forward kinematics. + * A data class containing the minimum required data for a hand's forward + * kinematics. * Used in both kinematics and calibration. */ diff --git a/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h b/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h index 7ead602b..9f29ad1e 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h +++ b/Source/SenseGloveCore/Public/SGCore/SGBetaDevice.h @@ -30,7 +30,8 @@ * @section DESCRIPTION * * Represents a Sense Glove Device that has no specific class within the API. - * Used to test different iterations of the same product before integrating it into the Core API. + * Used to test different iterations of the same product before integrating it + * into the Core API. * Allows access to raw sensor values and commands of such a device. */ diff --git a/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h b/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h index 67ea14ab..3ce09104 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h +++ b/Source/SenseGloveCore/Public/SGCore/SGDeviceList.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * Interface for SenseCom, allows the retrieval of Devices and Data, but only as. + * Interface for SenseCom, allows the retrieval of Devices and Data, but only + * as. */ diff --git a/Source/SenseGloveCore/Public/SGCore/SGHapticGlove.h b/Source/SenseGloveCore/Public/SGCore/SGHapticGlove.h index 8727b198..016fb638 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGHapticGlove.h +++ b/Source/SenseGloveCore/Public/SGCore/SGHapticGlove.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback. + * An interface for any of our gloves that can track hand motion and/or send + * force / vibrotactile feedback. */ @@ -217,7 +218,7 @@ public: virtual bool GetImuRotation(FRotator& OutImu); /** - * Calculate the Hand Pose of this device, provided it has Hand Tracking available + * Calculate the Hand Pose of this device, provided it has Hand Tracking available */ virtual bool GetHandPose( UObject* Outer, diff --git a/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCalibrationSequence.h b/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCalibrationSequence.h index f1ce3793..43d1265e 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCalibrationSequence.h +++ b/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCalibrationSequence.h @@ -29,7 +29,6 @@ * * @section DESCRIPTION * - * */ @@ -53,6 +52,9 @@ class FSGHapticGloveCalibrationSequenceImpl; class FSGHapticGloveQuickCalibrationImpl; +/** + * A sequence which collects data points until specific criteria have been met. It must be 'fed' an Update command from your program in order to work. + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGHapticGloveCalibrationSequence : public UObject { @@ -66,16 +68,28 @@ public: UObject* Outer, TSharedRef HapticGloveCalibrationSequence); protected: + /** + * + */ static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(UObject* Outer); public: + /** + * Create a new instance of a base HapitcGlove Calibration Sequence. + */ static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence( UObject* Outer, const USGHapticGlove* LinkedGlove); public: + /** + * The maximum buffer size for calibration points. Once calibrationPoints exceeds this value, the + */ static int32 GetMaxDataPoints(); public: + /** + * Converts a calibration range taken from a Calibration sequence, and converts it into a profile. Use this if you're not actually using the sequence. + */ static bool CompileProfile(UObject* Outer, const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile); @@ -92,9 +106,15 @@ private: FImplDeleter PimplDeleter; protected: + /** + * + */ USGHapticGloveCalibrationSequence(); public: + /** + * Create a new instance of a base HapitcGlove Calibration Sequence. + */ explicit USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove); public: @@ -172,41 +192,96 @@ protected: virtual void SyncUProperties(); public: + /** + * Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called. + */ USGHapticGlove* GetLinkedGlove(UObject* Outer) const; + /** + * + */ void SetLinkedGlove(const USGHapticGlove* LinkedGlove); + /** + * Calibration points collected during this calibration process. One is added every time the "Update()" function is called. + * Used to create a profile after the calibration finishes. + */ TArray GetCalibrationPoints(UObject* Outer) const; + /** + * How much time has elapsed during this calibration sequence. Useful for logging or for automated functions. + */ float GetElapsedTime() const; + /** + * Used to determine if the user has manually ended the sequence, to prevent us from adding any more calibration points. + */ bool IsManuallyCompleted() const; + /** + * If a sequence consists of multiple stages, this integer will show you which one is currently active. + */ int32 GetCurrentStage() const; + /** + * Returns the amount of calibration points collected so far. + */ SIZE_T GetCalibrationPointsCount() const; + /** + * Whether or not this sequence was completed as per its own rules. + */ bool AutoCompleted() const; + /** + * Returns true if this sequence is marked as 'complete' and can begin compiling a profile. + */ bool Completed() const; public: + /** + * Resets this calibration sequence's data, but not it's LinkedGlove. + */ void Reset(); + /** + * + */ void AddDataPoint(const TArray& CalibrationPoints); + /** + * Update this calibration sequence with new data. We use deltaSeconds to check for things like stability. + */ void Update(float DeltaSeconds); + /** + * Manual confirmation of whatever step we're supposed to making at the moment. + */ void ConfirmCurrentStep(); public: + /** + * Compile a min/max range from the data points collected by this sequence. Returns true if it's actually possible. + */ bool CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const; + /** + * Compile a profile from the data points collected by this sequence. Returns true if it's actually possible. + */ bool CompileProfile(UObject* Outer, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile) const; + /** + * Returns the current HandPose; either the one we should be making, or what it would look like at the moment. + */ bool GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const; + /** + * Returns the current HandPose; either the one we should be making, or what it would look like at the moment. + */ bool GetHandPose(UObject* Outer, bool bRightHanded, USGHandPose*& OutCurrentHandPose) const; + /** + * Retrieve instructions on what to do during the current step. + */ FString GetCurrentInstruction(const FString& NextStepKey = FString{""}) const; -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCommandBuffer.h b/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCommandBuffer.h index f6090969..18a8594c 100644 --- a/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCommandBuffer.h +++ b/Source/SenseGloveCore/Public/SGCore/SGHapticGloveCommandBuffer.h @@ -50,6 +50,9 @@ class USGBuzzCommand; class USGForceFeedbackCommand; class USGTimedBuzzCommand; +/** + * + */ UCLASS(BlueprintType) class SENSEGLOVECORE_API USGHapticGloveCommandBuffer final : public UObject { @@ -60,13 +63,25 @@ public: UObject* Outer, const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl); public: + /** + * Create a new HapticsStream for a Haptic Glove. + */ static USGHapticGloveCommandBuffer* NewHapticGloveCommandBuffer(UObject* Outer); public: + /** + * The base maximum amount of Force-Feedback Commands that can be in a queue. + */ static int32 GetMaxForceFeedbackCommands(); + /** + * The base maximum amount of Vibrotactile Commands that can be in a queue. + */ static int32 GetMaxBuzzCommands(); + /** + * The base maximum amount of Thumper Commands that can be in a queue. + */ static int32 GetMaxThumpCommands(); private: @@ -81,6 +96,9 @@ private: FImplDeleter PimplDeleter; public: + /** + * + */ USGHapticGloveCommandBuffer(); public: @@ -108,38 +126,83 @@ public: const FSGHapticGloveCommandBufferImpl& ToHapticGloveCommandBufferImpl() const; public: + /** + * All Force Feedback Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ TArray GetForceFeedbackCommandsQueue(UObject* Outer) const; + /** + * All Timed Buzz Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ TArray GetBuzzCommandsQueue(UObject* Outer) const; + /** + * All Timed Thump Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ TArray GetThumperCommandsQueue(UObject* Outer) const; public: + /** + * Clears only the Force-Feedback Queue. + */ void ClearForceFeedbackCommandsQueue(); + /** + * Clears all vibrations in the queue(s). + */ void ClearVibrations(); + /** + * Clear all ongoing effects to this stream. + */ void Clear(); + /** + * Add a new Force-Feedback command to the queue. Does not actually send it. + */ void AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand); + /** + * Add a new vibrotactile command to the queue. Does not actually send it. + */ void AddCommand(const USGTimedBuzzCommand* BuzzCommand); + /** + * Add a new Thumper command to the queue. Does not actually send it. Does not work with SenseGlove, only for Nova's + */ void AddCommand(const USGTimedThumpCommand* ThumpCommand); + /** + * Update the active commands, using a deltaSeconds since last update, in seconds. Any timedCommands that are elapsed will be removed from the list. + */ void UpdateTimedCommands(float DeltaSeconds); public: + /** + * Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. Returns lastForceFeedbackCommand if no ForceFeedback commands are given. + */ USGForceFeedbackCommand* GetTotalForceFeedbackLevels( UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const; + /** + * Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. + */ USGForceFeedbackCommand* GetTotalForceFeedbackLevels(UObject* Outer) const; + /** + * Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue. + */ USGBuzzCommand* GetTotalBuzzLevels(UObject* Outer) const; + /** + * Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue. + */ USGThumperCommand* GetTotalThumperLevels(UObject* Outer) const; public: + /** + * Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Only clears the ForceFeedback queue, and only if you want it to. + */ void FlushHaptics(UObject* Outer, const USGForceFeedbackCommand* LastBrakeLevel, USGForceFeedbackCommand*& OutForceFeedbackCommand, @@ -147,9 +210,12 @@ public: USGThumperCommand*& OutThumperCommand, bool bClearForceFeedbackQueue = true); + /** + * Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Also updates & clears all queues. + */ void FlushHaptics(UObject* Outer, float DeltaSeconds, const USGForceFeedbackCommand* LastBrakeLevel, USGForceFeedbackCommand*& OutForceFeedbackCommand, USGBuzzCommand*& OutBuzzCommand, USGThumperCommand*& OutThumperCommand); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h index 4bad724a..408cb7f7 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBasicHandModelKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * A data class containing the minimum required data for a hand's forward kinematics. + * A data class containing the minimum required data for a hand's forward + * kinematics. * Used in both kinematics and calibration. */ diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h index 190b4dea..93b29b82 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h @@ -30,7 +30,8 @@ * @section DESCRIPTION * * Represents a Sense Glove Device that has no specific class within the API. - * Used to test different iterations of the same product before integrating it into the Core API. + * Used to test different iterations of the same product before integrating it + * into the Core API. * Allows access to raw sensor values and commands of such a device. */ diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h index 89dec9b6..9bf6d61d 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGDeviceListKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * Interface for SenseCom, allows the retrieval of Devices and Data, but only as. + * Interface for SenseCom, allows the retrieval of Devices and Data, but only + * as. */ diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h index 989015da..7389bf65 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHandPoseKismetLibrary.h @@ -29,8 +29,8 @@ * * @section DESCRIPTION * - * Data class containing all variables to draw or analyze a virtual hand - * in different formats. + * Data class containing all variables to draw or analyze a virtual hand in + * different formats. */ diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCalibrationSequenceKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCalibrationSequenceKismetLibrary.h index 88b82a1f..097e217b 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCalibrationSequenceKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCalibrationSequenceKismetLibrary.h @@ -47,12 +47,18 @@ class USGHapticGlove; class USGHapticGloveCalibrationSequence; class USGSensorRange; +/** + * A sequence which collects data points until specific criteria have been met. It must be 'fed' an Update command from your program in order to work. + */ UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCalibrationSequenceKismetLibrary")) class SENSEGLOVECOREKISMET_API USGHapticGloveCalibrationSequenceKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Create a new instance of a base HapitcGlove Calibration Sequence. + */ UFUNCTION(BlueprintCallable, DisplayName="Make Haptic Glove Calibration Sequence", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) @@ -60,9 +66,15 @@ public: UObject* WorldContextObject, const USGHapticGlove* GloveToCalibrate); + /** + * The maximum buffer size for calibration points. Once calibrationPoints exceeds this value, the + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static int32 GetMaxDataPoints(); + /** + * Converts a calibration range taken from a Calibration sequence, and converts it into a profile. Use this if you're not actually using the sequence. + */ UFUNCTION(BlueprintCallable, DisplayName="CompileProfile", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) @@ -70,59 +82,105 @@ public: UObject* WorldContextObject, const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile); + /** + * Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) static USGHapticGlove* GetLinkedGlove(UObject* WorldContextObject, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static void SetLinkedGlove(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const USGHapticGlove* LinkedGlove); + /** + * Calibration points collected during this calibration process. One is added every time the "Update()" function is called. + * Used to create a profile after the calibration finishes. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) static TArray GetCalibrationPoints( UObject* WorldContextObject, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static float GetElapsedTime(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Used to determine if the user has manually ended the sequence, to prevent us from adding any more calibration points. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static bool IsManuallyCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * If a sequence consists of multiple stages, this integer will show you which one is currently active. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static int32 GetCurrentStage(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Returns the amount of calibration points collected so far. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static int64 GetCalibrationPointsCount(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Whether or not this sequence was completed as per its own rules. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static bool AutoCompleted(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Returns true if this sequence is marked as 'complete' and can begin compiling a profile. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static bool Completed(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Resets this calibration sequence's data, but not it's LinkedGlove. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static void Reset(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static void AddDataPoint(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const TArray& CalibrationData); + /** + * Update this calibration sequence with new data. We use deltaSeconds to check for things like stability. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static void Update(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, float DeltaSeconds); + /** + * Manual confirmation of whatever step we're supposed to making at the moment. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static void ConfirmCurrentStep(USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence); + /** + * Compile a min/max range from the data points collected by this sequence. Returns true if it's actually possible. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) static bool CompileRange(UObject* WorldContextObject, const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, USGSensorRange*& OutSensorRange); + /** + * Compile a profile from the data points collected by this sequence. Returns true if it's actually possible. + */ UFUNCTION(BlueprintPure, DisplayName="CompileProfile", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) @@ -131,6 +189,9 @@ public: const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile); + /** + * Returns the current HandPose; either the one we should be making, or what it would look like at the moment. + */ UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) @@ -138,6 +199,9 @@ public: const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, USGHandPose*& OutCurrentHandPose); + /** + * Returns the current HandPose; either the one we should be making, or what it would look like at the moment. + */ UFUNCTION(BlueprintPure, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence", meta=(WorldContext="WorldContextObject")) @@ -147,7 +211,10 @@ public: bool bRightHanded, USGHandPose*& OutCurrentHandPose); + /** + * Retrieve instructions on what to do during the current step. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Calibration | Haptic Glove Calibration Sequence") static FString GetCurrentInstruction(const USGHapticGloveCalibrationSequence* HapticGloveCalibrationSequence, const FString& NextStepKey = ""); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCommandBufferKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCommandBufferKismetLibrary.h index fb616fe4..92e5f60b 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCommandBufferKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveCommandBufferKismetLibrary.h @@ -47,71 +47,119 @@ class USGThumperCommand; class USGTimedBuzzCommand; class USGTimedThumpCommand; +/** + * + */ UCLASS(meta=(ScriptName = "SesneGloveHapticGloveCommandBufferKismetLibrary")) class SENSEGLOVECOREKISMET_API USGHapticGloveCommandBufferKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: + /** + * Create a new HapticsStream for a Haptic Glove. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static USGHapticGloveCommandBuffer* MakeHapticGloveCommandBuffer(UObject* WorldContextObject); + /** + * The base maximum amount of Force-Feedback Commands that can be in a queue. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static int32 GetMaxForceFeedbackCommands(); + /** + * The base maximum amount of Vibrotactile Commands that can be in a queue. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static int32 GetMaxBuzzCommands(); + /** + * The base maximum amount of Thumper Commands that can be in a queue. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static int32 GetMaxThumpCommands(); + /** + * All Force Feedback Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static TArray GetForceFeedbackCommandsQueue( UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * All Timed Buzz Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static TArray GetBuzzCommandsQueue( UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * All Timed Thump Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static TArray GetThumperCommandsQueue( UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Clears only the Force-Feedback Queue. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void ClearForceFeedbackCommandsQueue(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Clears all vibrations in the queue(s). + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void ClearVibrations(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Clear all ongoing effects to this stream. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void Clear(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Add a new Force-Feedback command to the queue. Does not actually send it. + */ UFUNCTION(BlueprintCallable, DisplayName="Add Command", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void AddCommand_ForceFeedbackCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, const USGForceFeedbackCommand* ForceFeedbackCommand); + /** + * Add a new vibrotactile command to the queue. Does not actually send it. + */ UFUNCTION(BlueprintCallable, DisplayName="Add Command", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void AddCommand_BuzzCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, const USGTimedBuzzCommand* BuzzCommand); + /** + * Add a new Thumper command to the queue. Does not actually send it. Does not work with SenseGlove, only for Nova's + */ UFUNCTION(BlueprintCallable, DisplayName="Add Command", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void AddCommand_ThumpCommand(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, const USGTimedThumpCommand* ThumpCommand); + /** + * Update the active commands, using a deltaSeconds since last update, in seconds. Any timedCommands that are elapsed will be removed from the list. + */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer") static void UpdateTimedCommands(UPARAM(ref) USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, float DeltaSeconds); + /** + * Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. Returns lastForceFeedbackCommand if no ForceFeedback commands are given. + */ UFUNCTION(BlueprintPure, DisplayName="Get Total Force Feedback Levels", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* GetTotalForceFeedbackLevels_LastForceFeedbackCommand( @@ -119,22 +167,34 @@ public: const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer, const USGForceFeedbackCommand* LastForceFeedbackCommand); + /** + * Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static USGForceFeedbackCommand* GetTotalForceFeedbackLevels( UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static USGBuzzCommand* GetTotalBuzzLevels(UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue. + */ UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static USGThumperCommand* GetTotalThumperLevels(UObject* WorldContextObject, const USGHapticGloveCommandBuffer* HapticGloveCommandBuffer); + /** + * Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Only clears the ForceFeedback queue, and only if you want it to. + */ UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static void FlushHaptics_LBL_OutFFC_OutBC_OutTC_bCFFQ( @@ -146,6 +206,9 @@ public: USGThumperCommand*& OutThumperCommand, bool bClearForceFeedbackQueue = true); + /** + * Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Also updates & clears all queues. + */ UFUNCTION(BlueprintCallable, DisplayName="Flush Haptics", Category="SenseGlove | Core | Haptics | Haptic Glove Command Buffer", meta=(WorldContext="WorldContextObject")) static void FlushHaptics_DS_LBL_OutFFC_OutBuzzCommand_OutTC( @@ -156,4 +219,4 @@ public: USGForceFeedbackCommand*& OutForceFeedbackCommand, USGBuzzCommand*& OutBuzzCommand, USGThumperCommand*& OutThumperCommand); -}; \ No newline at end of file +}; diff --git a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveKismetLibrary.h b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveKismetLibrary.h index 465290c0..ec0d82a4 100644 --- a/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveKismetLibrary.h +++ b/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveKismetLibrary.h @@ -29,7 +29,8 @@ * * @section DESCRIPTION * - * An interface for any of our gloves that can track hand motion and/or send force / vibrotactile feedback. + * An interface for any of our gloves that can track hand motion and/or send + * force / vibrotactile feedback. */ @@ -57,7 +58,7 @@ class SENSEGLOVECOREKISMET_API USGHapticGloveKismetLibrary : public USGBlueprint GENERATED_BODY() public: - /** + /** * Get all Haptic Gloves detected on this system. */ UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject")) @@ -127,7 +128,7 @@ public: static bool GetImuRotation_FRotator_OutI(UPARAM(ref) USGHapticGlove* HapticGlove, FRotator& OutImu); /** - * Calculate the Hand Pose of this device, provided it has Hand Tracking available + * Calculate the Hand Pose of this device, provided it has Hand Tracking available */ UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))