Implements a thread-safe SRand based RNG. 更多...
#include <RandomStream.h>
Public 成员函数 | |
| CORE_API bool | ExportTextItem (FString &ValueStr, FRandomStream const &DefaultValue, class UObject *Parent, int32 PortFlags, class UObject *ExportRootScope) const |
| Exports the RandomStreams value to a string. 更多... | |
| FORCEINLINE float | FRand () const |
| Mirrors the random number API in FMath 更多... | |
| FRandomStream () | |
| Default constructor. 更多... | |
| FRandomStream (FName InName) | |
| Creates and initializes a new random stream from the specified name. 更多... | |
| FRandomStream (int32 InSeed) | |
| Creates and initializes a new random stream from the specified seed value. 更多... | |
| FORCEINLINE float | FRandRange (float InMin, float InMax) const |
| Helper function for rand implementations. 更多... | |
| void | GenerateNewSeed () |
| Generates a new random seed. | |
| int32 | GetCurrentSeed () const |
| Gets the current seed. 更多... | |
| float | GetFraction () const |
| Returns a random float number in the range [0, 1). 更多... | |
| FVector | GetUnitVector () const |
| Returns a random vector of unit size. 更多... | |
| uint32 | GetUnsignedInt () const |
| 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. 更多... | |
| FORCEINLINE int32 | RandHelper (int32 A) const |
| Helper function for rand implementations. 更多... | |
| FORCEINLINE int32 | RandRange (int32 Min, int32 Max) const |
| Helper function for rand implementations. 更多... | |
| void | Reset () const |
| Resets this random stream to the initial seed value. | |
| FString | ToString () const |
| Get a textual representation of the RandomStream. 更多... | |
| FORCEINLINE FVector | VRand () const |
| Returns a random vector of unit size. 更多... | |
| FORCEINLINE FVector | VRandCone (FVector const &Dir, float ConeHalfAngleRad) const |
| Returns a random unit vector, uniformly distributed, within the specified cone. 更多... | |
| FORCEINLINE FVector | VRandCone (FVector const &Dir, float HorizontalConeHalfAngleRad, float VerticalConeHalfAngleRad) const |
| Returns a random unit vector, uniformly distributed, within the specified cone. 更多... | |
Protected 成员函数 | |
| void | MutateSeed () const |
| Mutates the current seed into the next seed. | |
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. |
| CORE_API bool FRandomStream::ExportTextItem | ( | FString & | ValueStr, |
| FRandomStream const & | DefaultValue, | ||
| class UObject * | Parent, | ||
| int32 | PortFlags, | ||
| class UObject * | ExportRootScope | ||
| ) | const |
Exports the RandomStreams value to a string.
| ValueStr | Will hold the string value. |
| DefaultValue | The default value. |
| Parent | Not used. |
| PortFlags | Not used. |
| ExportRootScope | Not used. |
|
inline |
Mirrors the random number API in FMath
|
inline |
Helper function for rand implementations.
|
inline |
Gets the current seed.
|
inline |
Returns a random float number in the range [0, 1).
|
inline |
Returns a random vector of unit size.
|
inline |
Returns a random number between 0 and MAXUINT.
|
inline |
Initializes this random stream using the specified name.
| InName | The name value from which the stream will be initialized. |
|
inline |
Initializes this random stream with the specified seed value.
| InSeed | The seed value. |
|
inline |
Helper function for rand implementations.
|
inline |
Helper function for rand implementations.
|
inline |
Get a textual representation of the RandomStream.
|
inline |
Returns a random vector of unit size.
|
inline |
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. |