vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::Environment Struct Reference

The scene's lighting environment: sky, night sky and fog. More...

#include <environment.h>

Public Member Functions

SkyAngles sunAngles () const
 Where the sun sits, straight off the authored fields.
SkyAngles moonAngles () const
 Where the moon sits: opposite the sun, tilted off that axis.
glm::vec3 sunDirection () const
 Direction TO the sun from the authored angles.
glm::vec3 moonDirection () const
 Direction TO the moon.

Static Public Member Functions

static glm::vec3 directionFromAngles (float elevationDeg, float azimuthDeg)
 Unit direction for an elevation/azimuth pair, both in degrees.

Detailed Description

The scene's lighting environment: sky, night sky and fog.

Scene-global, not a component: one per Scene (Scene::environment()), saved with it. The backend re-bakes the IBL whenever the sky changes.

Member Function Documentation

◆ sunAngles()

SkyAngles Vkm::Engine::Environment::sunAngles ( ) const
inline

Where the sun sits, straight off the authored fields.

Returns
Elevation/azimuth in degrees.

◆ moonAngles()

SkyAngles Vkm::Engine::Environment::moonAngles ( ) const
inline

Where the moon sits: opposite the sun, tilted off that axis.

Derived, so lowering the sun raises the moon by itself.

Returns
Elevation/azimuth in degrees.

◆ sunDirection()

glm::vec3 Vkm::Engine::Environment::sunDirection ( ) const
inline

Direction TO the sun from the authored angles.

Azimuth 0 is +Z by definition of the angles, not the engine's forward.

Returns
Unit direction pointing at the sun.

◆ moonDirection()

glm::vec3 Vkm::Engine::Environment::moonDirection ( ) const
inline

Direction TO the moon.

Returns
Unit direction pointing at the moon.

◆ directionFromAngles()

glm::vec3 Vkm::Engine::Environment::directionFromAngles ( float elevationDeg,
float azimuthDeg )
static

Unit direction for an elevation/azimuth pair, both in degrees.

Parameters
elevationDegDegrees above the horizon.
azimuthDegDegrees around the horizon, from +Z toward +X.
Returns
Unit direction.

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