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 }
 

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
 

Static Public Member Functions

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

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

Constructor & Destructor Documentation

◆ Light() [1/2]

nngn::Light::Light ( )
constexprdefault

◆ Light() [2/2]

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

Member Function Documentation

◆ att_for_range()

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

◆ ortho_view()

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_pos()

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

◆ persp_view()

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

◆ range()

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

◆ set_att()

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

◆ set_color()

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

◆ set_cutoff()

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

◆ set_dir()

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

◆ set_pos()

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

◆ set_spec()

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

◆ write_to_ubo_dir()

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_point()

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

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: