Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::video::SLight Class Reference

class for holding data describing a dynamic point light. More...

#include <nirtcpp/core/engine/SLight.hpp>

Collaboration diagram for nirt::video::SLight:
Collaboration graph

Public Attributes

SColorf AmbientColor
 Ambient color emitted by the light.
 
SColorf DiffuseColor
 Diffuse color emitted by the light.
 
SColorf SpecularColor
 Specular color emitted by the light.
 
core::vector3df Attenuation
 Attenuation factors (constant, linear, quadratic)
 
f32 OuterCone
 The angle of the spot's outer cone. Ignored for other lights.
 
f32 InnerCone
 The angle of the spot's inner cone. Ignored for other lights.
 
f32 Falloff
 The light strength's decrease between Outer and Inner cone. Only for spot lights.
 
core::vector3df Position
 Read-ONLY! Position of the light.
 
core::vector3df Direction
 Read-ONLY! Direction of the light.
 
f32 Radius
 Read-ONLY! Radius of light. Everything within this radius will be lighted.
 
E_LIGHT_TYPE Type
 Read-ONLY! Type of the light. Default: ELT_POINT.
 
bool CastShadows:1
 Read-ONLY! Does the light cast shadows?
 

Detailed Description

class for holding data describing a dynamic point light.

Nirtcpp supports point lights, spot lights, and directional lights.

Member Data Documentation

◆ Attenuation

core::vector3df nirt::video::SLight::Attenuation

Attenuation factors (constant, linear, quadratic)

Changes the light strength fading over distance. Can also be altered by setting the radius, Attenuation will change to (0,1.f/radius,0). Can be overridden after radius was set.

◆ DiffuseColor

SColorf nirt::video::SLight::DiffuseColor

Diffuse color emitted by the light.

This is the primary color you want to set.

◆ Direction

core::vector3df nirt::video::SLight::Direction

Read-ONLY! Direction of the light.

If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation.

◆ Position

core::vector3df nirt::video::SLight::Position

Read-ONLY! Position of the light.

If Type is ELT_DIRECTIONAL, it is ignored. Changed via light scene node's position.

◆ Radius

f32 nirt::video::SLight::Radius

Read-ONLY! Radius of light. Everything within this radius will be lighted.

On OpenGL light doesn't stop at radius. To get same light as in OpenGL in other drivers do set the radius to a large value like sqrt(FLT_MAX) and then set the Attenuation afterwards.

◆ SpecularColor

SColorf nirt::video::SLight::SpecularColor

Specular color emitted by the light.

For details how to use specular highlights, see SMaterial::Shininess


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

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print