mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Add RandRange for convenience
This commit is contained in:
parent
a350802221
commit
322edbd185
@ -136,6 +136,7 @@ public:
|
||||
return FRotator(PitchYaw.X, PitchYaw.Y, 0).RotateVector(FVector::UpVector);
|
||||
}
|
||||
|
||||
/// Random point in a box
|
||||
FORCEINLINE FVector RandPointInBox(const FBox& Box) const
|
||||
{
|
||||
const FVector R3 = Rand3D();
|
||||
@ -144,6 +145,12 @@ public:
|
||||
FMath::Lerp(Box.Min.Z, Box.Max.Z, R3.Z));
|
||||
}
|
||||
|
||||
/// Random value in a range (inclusive)
|
||||
float RandRange(float Min, float Max) const
|
||||
{
|
||||
return FMath::Lerp(Min, Max, Rand());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current seed.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user