RapyutaSimulationPlugins
Static Public Member Functions | Static Private Attributes | List of all members
URRMathUtils Class Reference

#include <RRMathUtils.h>

Inheritance diagram for URRMathUtils:
Inheritance graph
[legend]
Collaboration diagram for URRMathUtils:
Collaboration graph
[legend]

Static Public Member Functions

template<typename T >
static FORCEINLINE void BitFlagsToStack (uint32 InBitFlags, TArray< T > &OutStack)
 Convert uint32 BitFlags to TArray. More...
 
static FORCEINLINE bool IsVectorExceedingMaxMagnitude (const FVector &InVector, float InMaxMagnitude, bool b2D)
 Check if a vector's magnitude exceeds a given max value. More...
 
static FORCEINLINE void SetVectorClampedToMaxMagnitude (FVector &InVector, float InMaxMagnitude, bool b2D)
 Set a given vector's magnitude. More...
 
static FORCEINLINE bool ClampVectorToMaxMagnitude (FVector &InVector, float InMaxMagnitude, bool b2D)
 Clamp a given vector's magnitude to its max magnitude. More...
 
static FORCEINLINE void ClampRotatorToMaxAngles (FRotator &InRotator, const FRotator &InMaxAngles)
 Clamp a given rotator to its max axis angles. More...
 
template<typename T >
static FORCEINLINE T ClampAngle (T InAngle, const T InMaxAngle)
 Clamp an angle in a range [-InMaxAxisAngle, InMaxAxisAngle] with maximum values between (-360,360) More...
 
static void InitializeRandomStream ()
 Initialize URRMathUtils::RandomStream by FRandomStream. More...
 
template<typename T >
static FORCEINLINE T GetRandomElement (const TArray< T > &InArray)
 Get the Random Element of given array. More...
 
static FORCEINLINE float GetRandomBias ()
 Return an almost uniformly distributed float random number in [0, 1]. More...
 
static FORCEINLINE bool IsBiased (float InBias)
 Check value get from GetRandomBias in [0, InBias]. More...
 
static FORCEINLINE bool IsBiased (float InMinBias, float InMaxBias)
 Check value get from GetRandomBias in [InMinBias, InMaxBias]. More...
 
static FORCEINLINE bool GetRandomBool ()
 Check value get from GetRandomBias > 0.5. More...
 
static FORCEINLINE float GetRandomFloatInRange (float InValueA, float InValueB)
 Return an almost uniformly distributed float random number between 2 float values [Min, Max] by using. More...
 
static FORCEINLINE float GetRandomFloatInRange (const FVector2f &InValueRange)
 Return an almost uniformly distributed float random number between FVector. More...
 
static FORCEINLINE int32 GetRandomIntegerInRange (int32 InValueA, int32 InValueB)
 Return an almost uniformly distributed int random number between FVector. More...
 
static FORCEINLINE int32 GetRandomIntegerInRange (int32 InValueMax)
 Return an almost uniformly distributed Int random number between 2 int values [0, Max] by using. More...
 
static FORCEINLINE int32 GetRandomIntegerInRange (const FIntPoint &InValueRange)
 Return an almost uniformly distributed int random number between FIntPoint. More...
 
static FORCEINLINE FVector GetRandomLocation (const FVector &InLocationA, const FVector &InLocationB)
 Get the Random Location between two vectors. More...
 
static FORCEINLINE FQuat GetRandomOrientation ()
 Get uniformly distributed random quaternion. More...
 
static FORCEINLINE float GetRandomYawInDegrees ()
 Return a random number between [0, 360]. More...
 
static FORCEINLINE float GetRandomExtent (float InMaxExtent)
 Return a random number between [-InMaxExtent, InMaxExtent]. More...
 
static FVector GetRandomSphericalPosition (const FVector &InCenter, const FVector2f &InDistanceRange, const FVector2f &InHeightRange)
 Get the Random Spherical Position object. More...
 
static FORCEINLINE FLinearColor GetRandomColorFromHSV (const float InMin=0.6f)
 Get the Random Color From H S V object. More...
 
static FORCEINLINE FLinearColor GetRandomColorFromHSV (const TArray< FVector2D > &InHSVRange)
 Get the Random Color From H S V object. More...
 
static FORCEINLINE FLinearColor GetRandomColor ()
 Get the Random Color. More...
 
static FORCEINLINE bool StepUpdate (double &current, const double target, const double step, const double tolerance)
 update current value with step to reach target within tolerance More...
 
static FORCEINLINE bool StepUpdateAngle (double &current, const double target, const double step, const double tolerance)
 update current value with step to reach target within tolerance More...
 
static FRotator GetRotatorFromVectors (const FVector &Vector1, const FVector &Vector2)
 Get the Rotator From Two vectors. More...
 

Static Private Attributes

static FRandomStream RandomStream
 

Detailed Description

UCLASS()

Member Function Documentation

◆ BitFlagsToStack()

template<typename T >
static FORCEINLINE void URRMathUtils::BitFlagsToStack ( uint32  InBitFlags,
TArray< T > &  OutStack 
)
inlinestatic

Convert uint32 BitFlags to TArray.

Template Parameters
T
Parameters
InBitFlags
OutStack
Returns

◆ ClampAngle()

template<typename T >
static FORCEINLINE T URRMathUtils::ClampAngle ( InAngle,
const T  InMaxAngle 
)
inlinestatic

Clamp an angle in a range [-InMaxAxisAngle, InMaxAxisAngle] with maximum values between (-360,360)

Template Parameters
T
Parameters
InAngle
InMaxAngle> 0
Returns
Clamped angle

◆ ClampRotatorToMaxAngles()

static FORCEINLINE void URRMathUtils::ClampRotatorToMaxAngles ( FRotator &  InRotator,
const FRotator &  InMaxAngles 
)
inlinestatic

Clamp a given rotator to its max axis angles.

Parameters
InRotator
InMaxAngles> 0
Returns
Clamped rotator

◆ ClampVectorToMaxMagnitude()

static FORCEINLINE bool URRMathUtils::ClampVectorToMaxMagnitude ( FVector &  InVector,
float  InMaxMagnitude,
bool  b2D 
)
inlinestatic

Clamp a given vector's magnitude to its max magnitude.

Parameters
InVector
InMaxMagnitude
b2DWhether only X,Y are accounted
Returns
True if #InVector exceeds #InMaxMagnitude

◆ GetRandomBias()

static FORCEINLINE float URRMathUtils::GetRandomBias ( )
inlinestatic

Return an almost uniformly distributed float random number in [0, 1].

Return an almost uniformly distributed float random number in [0, 1]. Calls GetFraction from URRMathUtils::RandomStream.

See also
GetFraction
Returns
float

◆ GetRandomBool()

static FORCEINLINE bool URRMathUtils::GetRandomBool ( )
inlinestatic

Check value get from GetRandomBias > 0.5.

Returns
bool

◆ GetRandomColor()

static FORCEINLINE FLinearColor URRMathUtils::GetRandomColor ( )
inlinestatic

Get the Random Color.

Returns
FLinearColor

◆ GetRandomColorFromHSV() [1/2]

static FORCEINLINE FLinearColor URRMathUtils::GetRandomColorFromHSV ( const float  InMin = 0.6f)
inlinestatic

Get the Random Color From H S V object.

Returns
FLinearColor

◆ GetRandomColorFromHSV() [2/2]

static FORCEINLINE FLinearColor URRMathUtils::GetRandomColorFromHSV ( const TArray< FVector2D > &  InHSVRange)
inlinestatic

Get the Random Color From H S V object.

Parameters
InHSVRange
Returns
FLinearColor

◆ GetRandomElement()

template<typename T >
static FORCEINLINE T URRMathUtils::GetRandomElement ( const TArray< T > &  InArray)
inlinestatic

Get the Random Element of given array.

Template Parameters
T
Parameters
InArray
Returns
T

◆ GetRandomExtent()

static FORCEINLINE float URRMathUtils::GetRandomExtent ( float  InMaxExtent)
inlinestatic

Return a random number between [-InMaxExtent, InMaxExtent].

Parameters
InMaxExtent
Returns
float

◆ GetRandomFloatInRange() [1/2]

static FORCEINLINE float URRMathUtils::GetRandomFloatInRange ( const FVector2f &  InValueRange)
inlinestatic

Return an almost uniformly distributed float random number between FVector.

See also
FRandRange
Parameters
InValueRange
Returns
float

◆ GetRandomFloatInRange() [2/2]

static FORCEINLINE float URRMathUtils::GetRandomFloatInRange ( float  InValueA,
float  InValueB 
)
inlinestatic

Return an almost uniformly distributed float random number between 2 float values [Min, Max] by using.

See also
FRandRange
Parameters
InValueA
InValueB
Returns
float

◆ GetRandomIntegerInRange() [1/3]

static FORCEINLINE int32 URRMathUtils::GetRandomIntegerInRange ( const FIntPoint &  InValueRange)
inlinestatic

Return an almost uniformly distributed int random number between FIntPoint.

See also
FRandRange
Parameters
InValueRange
Returns
int32

◆ GetRandomIntegerInRange() [2/3]

static FORCEINLINE int32 URRMathUtils::GetRandomIntegerInRange ( int32  InValueA,
int32  InValueB 
)
inlinestatic

Return an almost uniformly distributed int random number between FVector.

See also
FRandRange
Parameters
InValueA
InValueB
Returns
int32

◆ GetRandomIntegerInRange() [3/3]

static FORCEINLINE int32 URRMathUtils::GetRandomIntegerInRange ( int32  InValueMax)
inlinestatic

Return an almost uniformly distributed Int random number between 2 int values [0, Max] by using.

See also
FRandRange
Parameters
InValueMax
Returns
int32

◆ GetRandomLocation()

static FORCEINLINE FVector URRMathUtils::GetRandomLocation ( const FVector &  InLocationA,
const FVector &  InLocationB 
)
inlinestatic

Get the Random Location between two vectors.

Parameters
InLocationA
InLocationB
Returns
FVector

◆ GetRandomOrientation()

static FORCEINLINE FQuat URRMathUtils::GetRandomOrientation ( )
inlinestatic

◆ GetRandomSphericalPosition()

static FVector URRMathUtils::GetRandomSphericalPosition ( const FVector &  InCenter,
const FVector2f &  InDistanceRange,
const FVector2f &  InHeightRange 
)
static

Get the Random Spherical Position object.

Parameters
InCenter
InDistanceRange
InHeightRange
Returns
FVector

◆ GetRandomYawInDegrees()

static FORCEINLINE float URRMathUtils::GetRandomYawInDegrees ( )
inlinestatic

Return a random number between [0, 360].

Returns
float

◆ GetRotatorFromVectors()

static FRotator URRMathUtils::GetRotatorFromVectors ( const FVector &  Vector1,
const FVector &  Vector2 
)
inlinestatic

Get the Rotator From Two vectors.

Parameters
Vector1
Vector2
Returns
FRotator

UFUNCTION(BlueprintCallable)

◆ InitializeRandomStream()

static void URRMathUtils::InitializeRandomStream ( )
static

Initialize URRMathUtils::RandomStream by FRandomStream.

See also
FRandomStream

◆ IsBiased() [1/2]

static FORCEINLINE bool URRMathUtils::IsBiased ( float  InBias)
inlinestatic

Check value get from GetRandomBias in [0, InBias].

Parameters
InBias
Returns
bool

◆ IsBiased() [2/2]

static FORCEINLINE bool URRMathUtils::IsBiased ( float  InMinBias,
float  InMaxBias 
)
inlinestatic

Check value get from GetRandomBias in [InMinBias, InMaxBias].

Parameters
InMinBias
InMaxBias
Returns
bool

◆ IsVectorExceedingMaxMagnitude()

static FORCEINLINE bool URRMathUtils::IsVectorExceedingMaxMagnitude ( const FVector &  InVector,
float  InMaxMagnitude,
bool  b2D 
)
inlinestatic

Check if a vector's magnitude exceeds a given max value.

Parameters
InVector
InMaxMagnitude
b2DWhether only X,Y are accounted

◆ SetVectorClampedToMaxMagnitude()

static FORCEINLINE void URRMathUtils::SetVectorClampedToMaxMagnitude ( FVector &  InVector,
float  InMaxMagnitude,
bool  b2D 
)
inlinestatic

Set a given vector's magnitude.

Parameters
InVector
InMaxMagnitude
b2DWhether only X,Y are accounted

◆ StepUpdate()

static FORCEINLINE bool URRMathUtils::StepUpdate ( double &  current,
const double  target,
const double  step,
const double  tolerance 
)
inlinestatic

update current value with step to reach target within tolerance

Parameters
current
target
step
tolerance

◆ StepUpdateAngle()

static FORCEINLINE bool URRMathUtils::StepUpdateAngle ( double &  current,
const double  target,
const double  step,
const double  tolerance 
)
inlinestatic

update current value with step to reach target within tolerance

Parameters
current
target
step
tolerance

Member Data Documentation

◆ RandomStream

FRandomStream URRMathUtils::RandomStream
staticprivate

The documentation for this class was generated from the following file: