Graphics/SkyboxBackground: Add movement scaler
Former-commit-id: 02682210b2b3d4b0cf27c6dd8cf171a025a92701
This commit is contained in:
@@ -32,11 +32,15 @@ namespace Nz
|
||||
|
||||
void Draw(const AbstractViewer* viewer) const;
|
||||
|
||||
BackgroundType GetBackgroundType() const;
|
||||
BackgroundType GetBackgroundType() const override;
|
||||
inline const Vector3f& GetMovementOffset() const;
|
||||
inline float GetMovementScale() const;
|
||||
inline const TextureRef& GetTexture() const;
|
||||
inline TextureSampler& GetTextureSampler();
|
||||
inline const TextureSampler& GetTextureSampler() const;
|
||||
|
||||
inline void SetMovementOffset(const Vector3f& offset);
|
||||
inline void SetMovementScale(float scale);
|
||||
inline void SetTexture(TextureRef cubemapTexture);
|
||||
inline void SetTextureSampler(const TextureSampler& sampler);
|
||||
|
||||
@@ -48,6 +52,8 @@ namespace Nz
|
||||
|
||||
TextureRef m_texture;
|
||||
TextureSampler m_sampler;
|
||||
Vector3f m_movementOffset;
|
||||
float m_movementScale;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline const Vector3f& Nz::SkyboxBackground::GetMovementOffset() const
|
||||
{
|
||||
return m_movementOffset;
|
||||
}
|
||||
|
||||
inline float SkyboxBackground::GetMovementScale() const
|
||||
{
|
||||
return m_movementScale;
|
||||
}
|
||||
|
||||
inline const TextureRef& SkyboxBackground::GetTexture() const
|
||||
{
|
||||
return m_texture;
|
||||
@@ -22,6 +32,20 @@ namespace Nz
|
||||
return m_sampler;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
inline void SkyboxBackground::SetMovementScale(float scale)
|
||||
{
|
||||
NazaraAssert(std::isfinite(scale), "Scale must be a finite value");
|
||||
|
||||
m_movementScale = scale;
|
||||
}
|
||||
|
||||
inline void SkyboxBackground::SetTexture(TextureRef cubemapTexture)
|
||||
{
|
||||
NazaraAssert(!cubemapTexture || cubemapTexture->IsValid(), "Invalid texture");
|
||||
|
||||
Reference in New Issue
Block a user