17 _instances.push_back(
this);
22 const auto it = std::find(_instances.begin(), _instances.end(),
this);
23 if (it != _instances.end()) {
34 _light = std::make_unique<Light>(
nullptr,
false);
40 void LightComponent::syncToLight()
const
45 _light->setType(_type);
47 _light->setVisibleThisFrame(
true);
48 _light->setCastShadows(_castShadows);
49 _light->setMask(
static_cast<MaskType>(_mask));
50 _light->setShadowDistance(_shadowDistance);
51 _light->setShadowResolution(_shadowResolution);
52 _light->setNumCascades(_numCascades);
53 _light->setCascadeDistribution(_cascadeDistribution);
54 _light->setCascadeBlend(_cascadeBlend);
55 _light->setShadowBias(_shadowBias);
56 _light->setNormalBias(_shadowNormalBias);
57 _light->setShadowIntensity(_shadowStrength);
58 _light->setRange(_range);
59 _light->setOuterConeAngle(_outerConeAngle);
76 _intensity = src->_intensity;
78 _innerConeAngle = src->_innerConeAngle;
79 _outerConeAngle = src->_outerConeAngle;
80 _falloffMode = src->_falloffMode;
82 _castShadows = src->_castShadows;
83 _shadowBias = src->_shadowBias;
84 _shadowNormalBias = src->_shadowNormalBias;
85 _shadowStrength = src->_shadowStrength;
86 _shadowDistance = src->_shadowDistance;
87 _shadowResolution = src->_shadowResolution;
88 _numCascades = src->_numCascades;
89 _cascadeDistribution = src->_cascadeDistribution;
90 _cascadeBlend = src->_cascadeBlend;
91 _areaWidth = src->_areaWidth;
92 _areaHeight = src->_areaHeight;
93 _layers = src->_layers;
100 return Vector3(0.0f, -1.0f, 0.0f);
103 const auto& world =
_entity->worldTransform();
108 return Vector3(0.0f, -1.0f, 0.0f);
virtual bool enabled() const
Component(IComponentSystem *system, Entity *entity)
virtual void setEnabled(bool value)
IComponentSystem * system() const
ECS entity — a GraphNode that hosts components defining its behavior.
LightComponent(IComponentSystem *system, Entity *entity)
void cloneFrom(const Component *source) override
~LightComponent() override
Vector3 direction() const
Directional, point, spot, or area light with shadow mapping and cookie projection.
3D vector for positions, directions, and normals with multi-backend SIMD acceleration.
Vector3 normalized() const
float lengthSquared() const