Open Search
    PseudoRandom< FLOAT > Class Template Reference

    #include <lib_math.h>

    Detailed Description

    template<typename FLOAT>
    class maxon::PseudoRandom< FLOAT >

    Pseudo random value generator. Only left in for compatibility. The class will always produce the same output if the initialization seed was matching.

    Public Member Functions

     PseudoRandom ()
     
    void Init (UInt32 seed)
     
    FLOAT Get01 ()
     
    FLOAT Get11 ()
     
    Int32 GetRaw () const
     

    Private Attributes

    UInt32 seed
     

    Constructor & Destructor Documentation

    ◆ PseudoRandom()

    Member Function Documentation

    ◆ Init()

    void Init ( UInt32  seed)

    Initialize the random class with a custom seed value.

    Parameters
    [in]seedSeed value.

    ◆ Get01()

    FLOAT Get01 ( )

    Returns the next random value in the range of 0..1.

    ◆ Get11()

    FLOAT Get11 ( )

    Returns the next random value in the range of -1..1.

    ◆ GetRaw()

    Int32 GetRaw ( ) const

    Returns the current seed value. Note that this is no longer the same value that the class was initialized with

    Member Data Documentation

    ◆ seed

    UInt32 seed
    private