3#include "pixelbullet/serialization/glm_node.h"
10 glm::vec3 color = glm::vec3(1.0f);
11 float intensity = 1.0f;
12 bool shadow_enabled =
false;
13 float shadow_strength = 1.0f;
14 float shadow_bias = 0.0015f;
15 float shadow_normal_bias = 0.02f;
16 float shadow_distance = 24.0f;
21 node[
"enabled"] << light.enabled;
22 node[
"color"] << light.color;
23 node[
"intensity"] << light.intensity;
24 node[
"shadowEnabled"] << light.shadow_enabled;
25 node[
"shadowStrength"] << light.shadow_strength;
26 node[
"shadowBias"] << light.shadow_bias;
27 node[
"shadowNormalBias"] << light.shadow_normal_bias;
28 node[
"shadowDistance"] << light.shadow_distance;
32inline const Node& operator>>(
const Node& node, DirectionalLightComponent& light)
34 node[
"enabled"] >> light.enabled;
35 node[
"color"] >> light.color;
36 node[
"intensity"] >> light.intensity;
37 if (node.HasProperty(
"shadowEnabled"))
39 node[
"shadowEnabled"] >> light.shadow_enabled;
41 if (node.HasProperty(
"shadowStrength"))
43 node[
"shadowStrength"] >> light.shadow_strength;
45 if (node.HasProperty(
"shadowBias"))
47 node[
"shadowBias"] >> light.shadow_bias;
49 if (node.HasProperty(
"shadowNormalBias"))
51 node[
"shadowNormalBias"] >> light.shadow_normal_bias;
53 if (node.HasProperty(
"shadowDistance"))
55 node[
"shadowDistance"] >> light.shadow_distance;
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:45
Definition directional_light_component.h:8