cesium-native 0.63.0
Loading...
Searching...
No Matches
Light.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Library.h>
6#include <CesiumGltf/NamedObject.h>
7#include <CesiumGltf/Spotlight.h>
8
9#include <optional>
10#include <string>
11#include <vector>
12
13namespace CesiumGltf {
17struct CESIUMGLTF_API Light final : public CesiumGltf::NamedObject {
21 static constexpr const char* TypeName = "Light";
22
26 struct Type {
34 inline static const std::string directional = "directional";
35
43 inline static const std::string point = "point";
44
55 inline static const std::string spot = "spot";
56 };
57
61 std::vector<double> color = {1, 1, 1};
62
68 double intensity = 1;
69
73 std::optional<CesiumGltf::Spotlight> spot;
74
81 std::string type = Type::directional;
82
87 std::optional<double> range;
88
95 int64_t getSizeBytes() const {
96 int64_t accum = 0;
97 accum += int64_t(sizeof(Light));
99 int64_t(sizeof(CesiumGltf::NamedObject));
100 accum += int64_t(sizeof(double) * this->color.capacity());
101 if (this->spot) {
102 accum +=
103 this->spot->getSizeBytes() - int64_t(sizeof(CesiumGltf::Spotlight));
104 }
105 return accum;
106 }
107};
108} // namespace CesiumGltf
Classes for working with glTF models.
Known values for Specifies the light type.
Definition Light.h:26
static const std::string point
Point lights emit light in all directions from their position in space; rotation and scale are ignore...
Definition Light.h:43
static const std::string spot
Spot lights emit light in a cone in the direction of the local -z axis. The angle and falloff of the ...
Definition Light.h:55
static const std::string directional
Directional lights act as though they are infinitely far away and emit light in the direction of the ...
Definition Light.h:34
A directional, point, or spot light.
Definition Light.h:17
std::optional< CesiumGltf::Spotlight > spot
spot
Definition Light.h:73
std::string type
Specifies the light type.
Definition Light.h:81
std::vector< double > color
Color of the light source.
Definition Light.h:61
double intensity
Intensity of the light source. point and spot lights use luminous intensity in candela (lm/sr) while ...
Definition Light.h:68
static constexpr const char * TypeName
The original name of this type.
Definition Light.h:21
std::optional< double > range
A distance cutoff at which the light's intensity may be considered to have reached zero.
Definition Light.h:87
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Light.h:95
The base class for objects in a glTF that have a name.
Definition NamedObject.h:14
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition NamedObject.h:28
KHR_lights_punctual Light Spot Properties.
Definition Spotlight.h:12