![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <RandomStream.h>
Public Member Functions | |
| FRandomStream () | |
| FRandomStream (int32 InSeed) | |
| FRandomStream (FName InName) | |
| void | Initialize (int32 InSeed) |
| void | Initialize (FName InName) |
| void | Reset () const |
| int32 | GetInitialSeed () const |
| void | GenerateNewSeed () |
| float | GetFraction () const |
| uint32 | GetUnsignedInt () const |
| FVector | GetUnitVector () const |
| int32 | GetCurrentSeed () const |
| UE_FORCEINLINE_HINT float | FRand () const |
| UE_FORCEINLINE_HINT int32 | RandHelper (int32 A) const |
| int32 | RandRange (int32 Min, int32 Max) const |
| UE_FORCEINLINE_HINT FVector::FReal | FRandRange (FVector::FReal InMin, FVector::FReal InMax) const |
| UE_FORCEINLINE_HINT FVector | VRand () const |
| FVector | RandPointInBox (const FBox &Box) const |
| FVector | VRandCone (FVector const &Dir, float ConeHalfAngleRad) const |
| FVector | VRandCone (FVector const &Dir, float HorizontalConeHalfAngleRad, float VerticalConeHalfAngleRad) const |
| FString | ToString () const |
Protected Member Functions | |
| void | MutateSeed () const |
Friends | |
| struct | Z_Construct_UScriptStruct_FRandomStream_Statics |
Implements a thread-safe SRand based RNG.
Very bad quality in the lower bits. Don't use the modulus (%) operator.
|
inline |
Default constructor.
The seed should be set prior to use.
|
inline |
Creates and initializes a new random stream from the specified seed value.
| InSeed | The seed value. |
|
inline |
Creates and initializes a new random stream from the specified name.
| InName | The name value from which the stream will be initialized. |
|
inline |
Mirrors the random number API in FMath
|
inline |
Helper function for rand implementations.
|
inline |
Generates a new random seed.
|
inline |
Gets the current seed.
|
inline |
Returns a random float number in the range [0, 1).
|
inline |
|
inline |
Returns a random vector of unit size.
|
inline |
Returns a random number between 0 and MAXUINT.
Initializes this random stream using the specified name.
| InName | The name value from which the stream will be initialized. |
Initializes this random stream with the specified seed value.
| InSeed | The seed value. |
|
inlineprotected |
Mutates the current seed into the next seed.
|
inline |
Helper function for rand implementations.
Helper function for rand implementations.
|
inline |
Resets this random stream to the initial seed value.
|
inline |
Get a textual representation of the RandomStream.
|
inline |
Returns a random vector of unit size.
Returns a random unit vector, uniformly distributed, within the specified cone.
| Dir | The center direction of the cone |
| ConeHalfAngleRad | Half-angle of cone, in radians. |
|
inline |
Returns a random unit vector, uniformly distributed, within the specified cone.
| Dir | The center direction of the cone |
| HorizontalConeHalfAngleRad | Horizontal half-angle of cone, in radians. |
| VerticalConeHalfAngleRad | Vertical half-angle of cone, in radians. |