mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
VstdLib: CGaussianRandomStream constification
This commit is contained in:
parent
31eac6bcc4
commit
0ab2b3f800
@ -175,7 +175,7 @@ int CUniformRandomStream::RandomShortMax()
|
||||
// gaussian-distributed numbers at once)
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* pUniformStream)
|
||||
CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* const pUniformStream)
|
||||
{
|
||||
AttachToStream(pUniformStream);
|
||||
}
|
||||
@ -184,7 +184,7 @@ CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* pUniformStrea
|
||||
//-----------------------------------------------------------------------------
|
||||
// Attaches to a random uniform stream
|
||||
//-----------------------------------------------------------------------------
|
||||
void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream)
|
||||
void CGaussianRandomStream::AttachToStream(IUniformRandomStream* const pUniformStream)
|
||||
{
|
||||
AUTO_LOCK( m_mutex );
|
||||
|
||||
@ -196,7 +196,7 @@ void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Generates random numbers
|
||||
//-----------------------------------------------------------------------------
|
||||
float CGaussianRandomStream::RandomFloat(float flMean, float flStdDev)
|
||||
float CGaussianRandomStream::RandomFloat(const float flMean, const float flStdDev)
|
||||
{
|
||||
AUTO_LOCK( m_mutex );
|
||||
|
||||
|
@ -72,13 +72,13 @@ class CGaussianRandomStream
|
||||
public:
|
||||
// Passing in NULL will cause the gaussian stream to use the
|
||||
// installed global random number generator
|
||||
CGaussianRandomStream(IUniformRandomStream* pUniformStream = NULL);
|
||||
CGaussianRandomStream(IUniformRandomStream* const pUniformStream = NULL);
|
||||
|
||||
// Attaches to a random uniform stream
|
||||
void AttachToStream(IUniformRandomStream* pUniformStream = NULL);
|
||||
void AttachToStream(IUniformRandomStream* const pUniformStream = NULL);
|
||||
|
||||
// Generates random numbers
|
||||
float RandomFloat(float flMean = 0.0f, float flStdDev = 1.0f);
|
||||
float RandomFloat(const float flMean = 0.0f, const float flStdDev = 1.0f);
|
||||
|
||||
private:
|
||||
IUniformRandomStream* m_pUniformStream;
|
||||
|
Loading…
x
Reference in New Issue
Block a user