Navigation
Unreal Engine C++ API Reference > Runtime > Core > Math
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Math/RandomStream.h |
Include | #include "Math/RandomStream.h" |
Syntax
struct FRandomStream
Remarks
Implements a thread-safe SRand based RNG.
Very bad quality in the lower bits. Don't use the modulus (%) operator.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Default constructor.The seed should be set prior to use. | ||
![]() |
FRandomStream
(
int32 InSeed |
Creates and initializes a new random stream from the specified seed value. | |
![]() |
FRandomStream
(
FName InName |
Creates and initializes a new random stream from the specified name. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
float | FRand () |
Mirrors the random number API in FMath |
![]() ![]() |
FVector::FReal | FRandRange
(
FVector::FReal InMin, |
Helper function for rand implementations. |
![]() |
void | Generates a new random seed. | |
![]() ![]() |
int32 | Gets the current seed. | |
![]() ![]() |
float | GetFraction () |
Returns a random float number in the range [0, 1). |
![]() ![]() |
int32 | ||
![]() ![]() |
FVector | Returns a random vector of unit size. | |
![]() ![]() |
uint32 | Returns a random number between 0 and MAXUINT. | |
![]() |
void | Initialize
(
FName InName |
Initializes this random stream using the specified name. |
![]() |
void | Initialize
(
int32 InSeed |
Initializes this random stream with the specified seed value. |
![]() ![]() |
void | MutateSeed () |
Mutates the current seed into the next seed. |
![]() ![]() |
int32 | RandHelper
(
int32 A |
Helper function for rand implementations. |
![]() ![]() |
FVector | RandPointInBox
(
const FBox& Box |
|
![]() ![]() |
int32 | RandRange
(
int32 Min, |
Helper function for rand implementations. |
![]() ![]() |
void | Reset () |
Resets this random stream to the initial seed value. |
![]() ![]() |
FString | ToString () |
Get a textual representation of the RandomStream. |
![]() ![]() |
FVector | VRand () |
Returns a random vector of unit size. |
![]() ![]() |
FVector | VRandCone
(
FVector const& Dir, |
Returns a random unit vector, uniformly distributed, within the specified cone. |
![]() ![]() |
FVector | VRandCone
(
FVector const& Dir, |
Returns a random unit vector, uniformly distributed, within the specified cone. |