Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
SLight.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef S_LIGHT_HPP_INCLUDED
6#define S_LIGHT_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/SColor.hpp>
9#include <nirtcpp/core/engine/vector3d.hpp>
10
11namespace nirt
12{
13namespace video
14{
15
29
31const c8* const LightTypeNames[] =
32{
33 "Point",
34 "Spot",
35 "Directional",
36 0
37};
38
40
42class SLight
43{
44public:
45 SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f),
46 SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f),
47 OuterCone(45.f), InnerCone(0.f), Falloff(2.f),
48 Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f),
49 Radius(100.f), Type(ELT_POINT), CastShadows(true)
50 {}
51
52public:
55
57
59
61
63
65
69
72
75
78
80
82
84
86
88
92
95
98};
99
100} // end namespace video
101} // end namespace nirt
102
103#endif
Class representing a color with four floats.
Definition SColor.hpp:574
structure for holding data describing a dynamic point light.
Definition SLight.hpp:43
SColorf DiffuseColor
Diffuse color emitted by the light.
Definition SLight.hpp:58
core::vector3df Direction
Read-ONLY! Direction of the light.
Definition SLight.hpp:85
f32 Falloff
The light strength's decrease between Outer and Inner cone. Only for spot lights.
Definition SLight.hpp:77
SColorf AmbientColor
Ambient color emitted by the light.
Definition SLight.hpp:54
bool CastShadows
Read-ONLY! Does the light cast shadows?
Definition SLight.hpp:97
E_LIGHT_TYPE Type
Read-ONLY! Type of the light. Default: ELT_POINT.
Definition SLight.hpp:94
core::vector3df Attenuation
Attenuation factors (constant, linear, quadratic)
Definition SLight.hpp:68
SColorf SpecularColor
Specular color emitted by the light.
Definition SLight.hpp:62
core::vector3df Position
Read-ONLY! Position of the light.
Definition SLight.hpp:81
f32 OuterCone
The angle of the spot's outer cone. Ignored for other lights.
Definition SLight.hpp:71
f32 Radius
Read-ONLY! Radius of light. Everything within this radius will be lighted.
Definition SLight.hpp:91
f32 InnerCone
The angle of the spot's inner cone. Ignored for other lights.
Definition SLight.hpp:74
E_LIGHT_TYPE
Enumeration for different types of lights.
Definition SLight.hpp:18
@ ELT_DIRECTIONAL
directional light, coming from a direction from an infinite distance
Definition SLight.hpp:24
@ ELT_SPOT
spot light, it has a position in space, a direction, and a limited cone of influence
Definition SLight.hpp:22
@ ELT_COUNT
Only used for counting the elements of this enum.
Definition SLight.hpp:27
@ ELT_POINT
point light, it has a position in space and radiates light in all directions
Definition SLight.hpp:20
const c8 *const LightTypeNames[]
Names for light types.
Definition SLight.hpp:31
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
char c8
8 bit character variable.
Definition irrTypes.hpp:37
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print