MOS
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mos::gfx::Environment_light Class Referencefinal

Environment light, based on a cube map. More...

#include <environment_light.hpp>

Public Member Functions

 Environment_light (const glm::vec3 &position=glm::vec3(0.0f, 0.0f, 1.0f), const glm::vec3 &extent=glm::vec3(50.0f), float strength=0.0f, float falloff=0.1f, float near=0.1f)
 
auto position (const glm::vec3 &position) -> void
 Set position. More...
 
auto position () const -> glm::vec3
 Get position. More...
 
auto extent (const glm::vec3 &extent) -> void
 Set extent and recalculate cube camera projections. More...
 
auto extent () const -> glm::vec3
 Get extent. More...
 
auto inside (const glm::vec3 &point) const -> bool
 Check if a point is inside the environment light box. More...
 
auto camera (size_t index) const -> Camera
 Get one of the six cube cameras, for rendering. More...
 

Static Public Member Functions

static auto load (const std::string &directory, const std::string &path, const glm::mat4 &parent_transform=glm::mat4(1.0f)) -> Environment_light
 

Public Attributes

float strength {0.0f}
 Strength. More...
 
float falloff {0.1f}
 Falloff. More...
 

Detailed Description

Environment light, based on a cube map.

Constructor & Destructor Documentation

◆ Environment_light()

mos::gfx::Environment_light::Environment_light ( const glm::vec3 &  position = glm::vec3(0.0f, 0.0f, 1.0f),
const glm::vec3 &  extent = glm::vec3(50.0f),
float  strength = 0.0f,
float  falloff = 0.1f,
float  near = 0.1f 
)
explicit
Parameters
extentDescribes how big the environment is, for parallax/box correction.

Member Function Documentation

◆ camera()

auto mos::gfx::Environment_light::camera ( size_t  index) const -> Camera

Get one of the six cube cameras, for rendering.

◆ extent() [1/2]

auto mos::gfx::Environment_light::extent ( const glm::vec3 &  extent) -> void

Set extent and recalculate cube camera projections.

◆ extent() [2/2]

auto mos::gfx::Environment_light::extent ( ) const -> glm::vec3

Get extent.

◆ inside()

auto mos::gfx::Environment_light::inside ( const glm::vec3 &  point) const -> bool

Check if a point is inside the environment light box.

◆ position() [1/2]

auto mos::gfx::Environment_light::position ( const glm::vec3 &  position) -> void

Set position.

◆ position() [2/2]

auto mos::gfx::Environment_light::position ( ) const -> glm::vec3

Get position.

Member Data Documentation

◆ falloff

float mos::gfx::Environment_light::falloff {0.1f}

Falloff.

◆ strength

float mos::gfx::Environment_light::strength {0.0f}

Strength.


The documentation for this class was generated from the following file: