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

187 lines
6.9 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
*
* Data class containing all variables to map an input value from one range to
* another.
*/
#pragma once
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGInterpolationSetKismetLibrary.generated.h"
class USGInterpolationSet;
/**
* Set of variables to map a value from one range to the next.
*/
UCLASS(meta=(ScriptName = "SesneGloveInterpolationSetKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGInterpolationSetKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* Creates a basic interpolation set, without limits.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Interpolation Set",
meta=(WorldContext="WorldContextObject"))
static USGInterpolationSet* MakeInterpolationSet(UObject* WorldContextObject);
/**
* Create a new interpolation set without limits.
*/
UFUNCTION(BlueprintCallable, DisplayName="Make Interpolation Set",
Category="SenseGlove | Core | Kinematics | Interpolation Set", meta=(WorldContext="WorldContextObject"))
static USGInterpolationSet* MakeInterpolationSet_F1_F2_T1_T2(
UObject* WorldContextObject, float From1, float From2, float To1, float To2);
/**
* Create a new interpolation set with limits.
*/
UFUNCTION(BlueprintCallable, DisplayName="Make Interpolation Set",
Category="SenseGlove | Core | Kinematics | Interpolation Set", meta=(WorldContext="WorldContextObject"))
static USGInterpolationSet* MakeInterpolationSet_F1_F2_T1_T2_M_M(
UObject* WorldContextObject, float From1, float From2, float To1, float To2, float Min, float Max);
/**
* Convert a string notation of an InterpolationSet into a new class instance.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Kinematics | Interpolation Set",
meta=(WorldContext="WorldContextObject"))
static USGInterpolationSet* Deserialize(UObject* WorldContextObject, const FString& SerializedString);
/**
* First value of input range.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static float GetX0(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetX0(UPARAM(ref) USGInterpolationSet* InterpolationSet, float X0);
/**
* Second value of input range.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
float GetX1(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetX1(UPARAM(ref) USGInterpolationSet* InterpolationSet, float X1);
/**
* First value of output range.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static float GetY0(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetY0(UPARAM(ref) USGInterpolationSet* InterpolationSet, float Y0);
/**
* Second value of output range.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static float GetY1(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetY1(UPARAM(ref) USGInterpolationSet* InterpolationSet, float Y1);
/**
* Minimum range of the output value.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static float GetMin(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetMin(UPARAM(ref) USGInterpolationSet* InterpolationSet, float Min);
/**
* Maximum range of the output value.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static float GetMax(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static void SetMax(UPARAM(ref) USGInterpolationSet* InterpolationSet, float Max);
/**
* Calculate an output value in range [x0...x1] to [y0..y1]
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static int32 Get(const USGInterpolationSet* InterpolationSet, float Value, bool bLimit,
bool bNormalizeAngle = false);
/**
* Returns true if this InterpolationSet has the same values as another set.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static bool Equals(const USGInterpolationSet* A, const USGInterpolationSet* B);
/**
*
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Kinematics | Interpolation Set")
static FString ToString(const USGInterpolationSet* InterpolationSet);
/**
*
*/
UFUNCTION(BlueprintPure, DisplayName="To String", Category="SenseGlove | Core | Kinematics | Interpolation Set")
static FString ToString_bL(const USGInterpolationSet* InterpolationSet, bool bLimits);
/**
* Convert this InterpolationSet into a string notation so it can be stored on disk.
*/
UFUNCTION(BlueprintPure, DisplayName="Serialize", Category="SenseGlove | Core | Kinematics | Interpolation Set")
static FString SGSerialize(const USGInterpolationSet* InterpolationSet);
};