Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
Sky Class Referencefinal

Represent a background environment with atmospheric scattering. The sun direction can be animated. More...

#include <Sky.hpp>

Classes

struct  AtmosphereParameters
 Atmosphere parameters. Default values correspond to Earth-like atmosphere. More...
 

Public Member Functions

 Sky (Storage options)
 
void update (double fullTime, double frameTime) override
 
bool decode (const KeyValues &params, Storage options) override
 
KeyValues encode () const override
 
const glm::vec3 & direction () const
 
- Public Member Functions inherited from Object
 Object ()=default
 
 Object (const Mesh *mesh, bool castShadows)
 
void addAnimation (const std::shared_ptr< Animation > &anim)
 
void set (const glm::mat4 &model)
 
virtual void update (double fullTime, double frameTime)
 
const BoundingBoxboundingBox () const
 
const Meshmesh () const
 
const glm::mat4 & model () const
 
bool castsShadow () const
 
bool useTexCoords () const
 
bool animated () const
 
void setMaterial (const Material *material)
 
const Materialmaterial () const
 
const std::string & materialName () const
 
virtual bool decode (const KeyValues &params, Storage options)
 
virtual KeyValues encode () const
 
virtual ~Object ()=default
 
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=default
 
Objectoperator= (Object &&)=default
 

Private Attributes

Animated< glm::vec3 > _sunDirection { glm::vec3(0.0f, 1.0f, 0.0f) }
 The sun direction.
 

Additional Inherited Members

- Protected Attributes inherited from Object
const Mesh_mesh = nullptr
 Geometry of the object.
 
std::string _materialName
 Material name.
 
const Material_material = nullptr
 Material.
 
std::vector< std::shared_ptr< Animation > > _animations
 Animations list (applied in order).
 
Animated< glm::mat4 > _model { glm::mat4(1.0f) }
 The transformation matrix of the 3D model, updated by the animations.
 
BoundingBox _bbox
 The world space object bounding box.
 
bool _castShadow = true
 Can the object casts shadows.
 
bool _skipUVs = false
 The object doesn't use UV coordinates.
 
bool _dirtyBbox = true
 Has the bounding box been updated following an animation update.
 

Detailed Description

Represent a background environment with atmospheric scattering. The sun direction can be animated.

See also
Atmospheric scattering

Inherits Object.

Constructor & Destructor Documentation

◆ Sky()

Sky::Sky ( Storage  options)
explicit

Constructor.

Parameters
optionsdata loading and storage options

Member Function Documentation

◆ decode()

bool Sky::decode ( const KeyValues params,
Storage  options 
)
overridevirtual

Setup a sky environment parameters from a list of key-value tuples. The following keywords will be searched for:

bgsky:
    direction: X,Y,Z
    animations:
        ...
Parameters
paramsthe parameters tuple
optionsdata loading and storage options
Returns
decoding status

Reimplemented from Object.

◆ direction()

const glm::vec3 & Sky::direction ( ) const
inline

Reference to the sun direction.

Returns
the normalized sun direction

◆ encode()

KeyValues Sky::encode ( ) const
overridevirtual

Generate a key-values representation of the object. See decode for the keywords and layout.

Returns
a tuple representing the object.

Reimplemented from Object.

◆ update()

void Sky::update ( double  fullTime,
double  frameTime 
)
overridevirtual

Apply the animations for a frame duration.

Parameters
fullTimethe time since the launch of the application
frameTimethe time elapsed since the last frame

Reimplemented from Object.


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