Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
PointLightComponent.cpp
Go to the documentation of this file.
1
2
4
9
10namespace Divide {
11
12PointLightComponent::PointLightComponent(SceneGraphNode* sgn, PlatformContext& context)
13 : BaseComponentType<PointLightComponent, ComponentType::POINT_LIGHT>(sgn, context),
14 Light(sgn, 20.0f, LightType::POINT, *sgn->sceneGraph()->parentScene().lightPool())
15{
16 _shadowProperties._lightDetails.z = 0.025f;
17
18 registerFields(editorComponent());
19
20 BoundingBox bb = {};
21 bb.setMin(-10.0f);
22 bb.setMax(10.0f);
23 Attorney::SceneNodeLightComponent::setBounds(sgn->getNode(), bb);
24
25 _directionCache.set(VECTOR3_ZERO);
26}
27
28void PointLightComponent::OnData(const ECS::CustomEvent& data) {
29 SGNComponent::OnData(data);
30
32 updateCache(data);
34 const SceneGraphNode::Flags flag = static_cast<SceneGraphNode::Flags>(data._flag);
35 if (flag == SceneGraphNode::Flags::SELECTED) {
36 _drawImpostor = data._dataPair._first == 1u;
37 }
38 }
39}
40
41} //namespace Divide
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
SGNComponent::Registrar< T, C > BaseComponentType
Definition: SGNComponent.h:207
LightType
The different types of lights supported.
DataPair _dataPair
Definition: SGNComponent.h:77
Divide::U32 _flag
Definition: SGNComponent.h:67