nngn
Loading...
Searching...
No Matches
nngn::Light Struct Reference

#include <light.h>

Collaboration diagram for nngn::Light:

Public Types

enum  Type : uint8_t { POINT , DIR , POINT , DIR }
 
enum  Type : uint8_t { POINT , DIR , POINT , DIR }
 

Public Member Functions

constexpr Light ()=default
 
constexpr Light (Type t) noexcept
 
void set_pos (const vec3 &p)
 
void set_dir (const vec3 &p)
 
void set_color (const vec4 &c)
 
void set_att (lua_State *L)
 
void set_spec (float v)
 
void set_cutoff (float v)
 
float range () const
 
vec3 ortho_view_pos (float far) const
 
mat4 ortho_view (float far) const
 
mat4 persp_view (int face, bool zsprites) const
 
void write_to_ubo_dir (LightsUBO *ubo, size_t i, float far, const mat4 &proj) const
 
void write_to_ubo_point (LightsUBO *ubo, size_t i, bool zsprites) const
 
constexpr Light ()=default
 
constexpr Light (Type t) noexcept
 
void set_pos (const vec3 &p)
 
void set_dir (const vec3 &p)
 
void set_color (const vec4 &c)
 
void set_att (lua_State *L)
 
void set_spec (float v)
 
void set_cutoff (float v)
 
float range () const
 
vec3 ortho_view_pos (float far) const
 
mat4 ortho_view (float far) const
 
mat4 persp_view (int face, bool zsprites) const
 
void write_to_ubo_dir (LightsUBO *ubo, size_t i, float far, const mat4 &proj) const
 
void write_to_ubo_point (LightsUBO *ubo, size_t i, bool zsprites) const
 

Static Public Member Functions

static constexpr vec3 att_for_range (float r)
 
static constexpr vec3 att_for_range (float r)
 

Public Attributes

Type type = POINT
 
Entitye = nullptr
 
vec3 pos = {}
 
vec3 dir = {}
 
vec4 color = {}
 
vec3 att = {1, 0, 0}
 
float spec = 1.0f
 
float cutoff = 0.0f
 
bool updated = true
 

Member Enumeration Documentation

◆ Type [1/2]

enum nngn::Light::Type : uint8_t
Enumerator
POINT 
DIR 
POINT 
DIR 

◆ Type [2/2]

enum nngn::Light::Type : uint8_t
Enumerator
POINT 
DIR 
POINT 
DIR 

Constructor & Destructor Documentation

◆ Light() [1/4]

constexpr nngn::Light::Light ( )
constexprdefault

◆ Light() [2/4]

constexpr nngn::Light::Light ( Type  t)
inlineexplicitconstexprnoexcept

◆ Light() [3/4]

constexpr nngn::Light::Light ( )
constexprdefault

◆ Light() [4/4]

constexpr nngn::Light::Light ( Type  t)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ att_for_range() [1/2]

static constexpr vec3 nngn::Light::att_for_range ( float  r)
inlinestaticconstexpr
Here is the caller graph for this function:

◆ att_for_range() [2/2]

static constexpr vec3 nngn::Light::att_for_range ( float  r)
inlinestaticconstexpr

◆ ortho_view() [1/2]

mat4 nngn::Light::ortho_view ( float  far) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ortho_view() [2/2]

mat4 nngn::Light::ortho_view ( float  far) const

◆ ortho_view_pos() [1/2]

vec3 nngn::Light::ortho_view_pos ( float  far) const
Here is the caller graph for this function:

◆ ortho_view_pos() [2/2]

vec3 nngn::Light::ortho_view_pos ( float  far) const

◆ persp_view() [1/2]

mat4 nngn::Light::persp_view ( int  face,
bool  zsprites 
) const
Here is the call graph for this function:

◆ persp_view() [2/2]

mat4 nngn::Light::persp_view ( int  face,
bool  zsprites 
) const

◆ range() [1/2]

float nngn::Light::range ( ) const
inline

◆ range() [2/2]

float nngn::Light::range ( ) const
inline

◆ set_att() [1/2]

void nngn::Light::set_att ( lua_State *  L)
Here is the call graph for this function:

◆ set_att() [2/2]

void nngn::Light::set_att ( lua_State *  L)

◆ set_color() [1/2]

void nngn::Light::set_color ( const vec4 c)

◆ set_color() [2/2]

void nngn::Light::set_color ( const vec4 c)

◆ set_cutoff() [1/2]

void nngn::Light::set_cutoff ( float  v)
Here is the caller graph for this function:

◆ set_cutoff() [2/2]

void nngn::Light::set_cutoff ( float  v)

◆ set_dir() [1/2]

void nngn::Light::set_dir ( const vec3 p)
Here is the caller graph for this function:

◆ set_dir() [2/2]

void nngn::Light::set_dir ( const vec3 p)

◆ set_pos() [1/2]

void nngn::Light::set_pos ( const vec3 p)

◆ set_pos() [2/2]

void nngn::Light::set_pos ( const vec3 p)

◆ set_spec() [1/2]

void nngn::Light::set_spec ( float  v)
Here is the caller graph for this function:

◆ set_spec() [2/2]

void nngn::Light::set_spec ( float  v)

◆ write_to_ubo_dir() [1/2]

void nngn::Light::write_to_ubo_dir ( LightsUBO ubo,
size_t  i,
float  far,
const mat4 proj 
) const
Here is the call graph for this function:

◆ write_to_ubo_dir() [2/2]

void nngn::Light::write_to_ubo_dir ( LightsUBO ubo,
size_t  i,
float  far,
const mat4 proj 
) const

◆ write_to_ubo_point() [1/2]

void nngn::Light::write_to_ubo_point ( LightsUBO ubo,
size_t  i,
bool  zsprites 
) const
Here is the call graph for this function:

◆ write_to_ubo_point() [2/2]

void nngn::Light::write_to_ubo_point ( LightsUBO ubo,
size_t  i,
bool  zsprites 
) const

Member Data Documentation

◆ att

vec3 nngn::Light::att = {1, 0, 0}

◆ color

vec4 nngn::Light::color = {}

◆ cutoff

float nngn::Light::cutoff = 0.0f

◆ dir

vec3 nngn::Light::dir = {}

◆ e

Entity * nngn::Light::e = nullptr

◆ pos

vec3 nngn::Light::pos = {}

◆ spec

float nngn::Light::spec = 1.0f

◆ type

Type nngn::Light::type = POINT

◆ updated

bool nngn::Light::updated = true

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