This reverts commit db2ef3e90c3871290d114a9e6437b412e96c65aa [formerly a3f6ff88a25e63374eb6ce5b18269da2ba743b06] [formerly cfa12604fbb0da76fc27288b210ee1254a8b3a38 [formerly dee6ce858398e2de38ef1af00c1c630fd0126e09]] [formerly 1a23f0fddcd80ac33030061b7a00a3cfd43cb7fe [formerly d3cb17069c71449ae3f1cba6de55ea70f509e7a4] [formerly b2f8f82e9f3427310204f2e8a61d7bdfd96202d2 [formerly 5d117720d08d6d6243b3428d4b3f8aea1abef845]]]. Former-commit-id: fcbfc6cb2fac86f6f10ff5def148cc5635082c83 [formerly 6bcf746c9b6f35aff6786da950001da11cedfc48] [formerly 9d219f350ddebbfa60eaa9c382d8d811d963ac15 [formerly 75f534e850802526877b811e8f6ca510bb7f2c16]] Former-commit-id: b5ca8fa1bde036ccb4f7be17a98ef8275ab5cf2a [formerly ee166858dad5c8cd00249894266b13e8ce1a153e] Former-commit-id: 2a601076664aebc1107654dd80f3b53f7acbc044
129 lines
2.8 KiB
C++
129 lines
2.8 KiB
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Graphics module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#include <memory>
|
|
#include <Nazara/Graphics/Debug.hpp>
|
|
|
|
namespace Nz
|
|
{
|
|
/*!
|
|
* \brief Gets the movement offset
|
|
* \return Offset of the movement
|
|
*/
|
|
|
|
inline const Vector3f& Nz::SkyboxBackground::GetMovementOffset() const
|
|
{
|
|
return m_movementOffset;
|
|
}
|
|
|
|
/*!
|
|
* \brief Gets the movement scale
|
|
* \return Scale of the movement
|
|
*/
|
|
|
|
inline float SkyboxBackground::GetMovementScale() const
|
|
{
|
|
return m_movementScale;
|
|
}
|
|
|
|
/*!
|
|
* \brief Gets the texture of the background
|
|
* \return Texture of the background
|
|
*/
|
|
|
|
inline const TextureRef& SkyboxBackground::GetTexture() const
|
|
{
|
|
return m_texture;
|
|
}
|
|
|
|
/*!
|
|
* \brief Gets the texture sampler of the background
|
|
* \return A reference to the texture sampler of the background
|
|
*/
|
|
|
|
inline TextureSampler& SkyboxBackground::GetTextureSampler()
|
|
{
|
|
return m_sampler;
|
|
}
|
|
|
|
/*!
|
|
* \brief Gets the texture sampler of the background
|
|
* \return A constant reference to the texture sampler of the background
|
|
*/
|
|
|
|
inline const TextureSampler& SkyboxBackground::GetTextureSampler() const
|
|
{
|
|
return m_sampler;
|
|
}
|
|
|
|
/*!
|
|
* \brief Sets the movement offset
|
|
*
|
|
* \param offset Offset of the movement
|
|
*/
|
|
|
|
inline void SkyboxBackground::SetMovementOffset(const Vector3f& offset)
|
|
{
|
|
NazaraAssert(std::isfinite(offset.x) && std::isfinite(offset.y) && std::isfinite(offset.z), "Offset must be a finite vector");
|
|
|
|
m_movementOffset = offset;
|
|
}
|
|
|
|
/*!
|
|
* \brief Sets the movement scale
|
|
*
|
|
* \param scale Scale of the movement
|
|
*/
|
|
|
|
inline void SkyboxBackground::SetMovementScale(float scale)
|
|
{
|
|
NazaraAssert(std::isfinite(scale), "Scale must be a finite value");
|
|
|
|
m_movementScale = scale;
|
|
}
|
|
|
|
/*!
|
|
* \brief Sets the texture of the background
|
|
*
|
|
* \param cubemapTexture Texture of the background
|
|
*/
|
|
|
|
inline void SkyboxBackground::SetTexture(TextureRef cubemapTexture)
|
|
{
|
|
NazaraAssert(!cubemapTexture || cubemapTexture->IsValid(), "Invalid texture");
|
|
NazaraAssert(!cubemapTexture || cubemapTexture->IsCubemap(), "Texture must be a cubemap");
|
|
|
|
m_texture = std::move(cubemapTexture);
|
|
}
|
|
|
|
/*!
|
|
* \brief Sets the texture sampler of the background
|
|
*
|
|
* \param sampler Texture sampler of the background
|
|
*/
|
|
|
|
void SkyboxBackground::SetTextureSampler(const TextureSampler& sampler)
|
|
{
|
|
m_sampler = sampler;
|
|
}
|
|
|
|
/*!
|
|
* \brief Creates a new skybox background from the arguments
|
|
* \return A reference to the newly created skybox background
|
|
*
|
|
* \param args Arguments for the skybox background
|
|
*/
|
|
|
|
template<typename... Args>
|
|
SkyboxBackgroundRef SkyboxBackground::New(Args&&... args)
|
|
{
|
|
std::unique_ptr<SkyboxBackground> object(new SkyboxBackground(std::forward<Args>(args)...));
|
|
object->SetPersistent(false);
|
|
|
|
return object.release();
|
|
}
|
|
}
|
|
|
|
#include <Nazara/Graphics/DebugOff.hpp>
|