Files
NazaraEngine/src/Nazara/Noise/MappedNoiseBase.cpp
Lynix ea8d683624 Updated copyright year
(532 files, wow)


Former-commit-id: cbb31f1124a86720bd3a54fe589a0f849a87b434
2015-01-21 20:53:01 +01:00

54 lines
1.1 KiB
C++

// Copyright (C) 2015 Rémi Bèges
// This file is part of the "Nazara Engine".
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/StringStream.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Math/Algorithm.hpp>
#include <Nazara/Noise/Config.hpp>
#include <stdexcept>
#include <Nazara/Noise/MappedNoiseBase.hpp>
#include <Nazara/Noise/Debug.hpp>
NzMappedNoiseBase::NzMappedNoiseBase() : m_gain(1.f), m_offset(0.f), m_resolution(30.f)
{
}
float NzMappedNoiseBase::GetGain() const
{
return m_gain;
}
float NzMappedNoiseBase::GetOffset() const
{
return m_offset;
}
float NzMappedNoiseBase::GetResolution() const
{
return m_resolution;
}
void NzMappedNoiseBase::SetGain(float gain)
{
m_gain = gain;
}
void NzMappedNoiseBase::SetOffset(float offset)
{
m_offset = offset;
}
void NzMappedNoiseBase::SetResolution(float resolution)
{
if (NzNumberEquals(resolution, 0.f))
{
NzStringStream ss;
ss << __FILE__ << ':' << __LINE__ << " : resolution cannot be 0.0f";
throw std::domain_error(ss.ToString());
}
m_resolution = resolution;
}