This interface defines how to draw this component to property panel.
26 {
28
29 ImGui::Spacing();
30 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2{ 0, 3.0f });
32
33 {
35
37
39
40 {
42 ImGui::PushID("PointLightComponent Color R");
43
44 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
45 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.9f, 0.2f, 0.2f, 1.0f });
46 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.8f, 0.1f, 0.15f, 1.0f });
48 ImGui::PopStyleColor(3);
49 ImGui::SameLine();
50 ImGui::PushItemWidth(itemWidth);
51 if(ImGui::SliderFloat(
"##R", &
m_PointLight.color.x, 0.0f, 1.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
52 {
54 }
55 ImGui::PopItemWidth();
56 ImGui::SameLine();
58 {
61 }
62 ImGui::SameLine();
63 ImGui::PopID();
64 }
65
66 {
68 ImGui::PushID("PointLightComponent Color G");
69
70 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
71 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.3f, 0.8f, 0.3f, 1.0f });
72 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.2f, 0.7f, 0.2f, 1.0f });
74 ImGui::PopStyleColor(3);
75 ImGui::SameLine();
76 ImGui::PushItemWidth(itemWidth);
77 if(ImGui::SliderFloat(
"##G", &
m_PointLight.color.y, 0.0f, 1.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
78 {
80 }
81 ImGui::PopItemWidth();
82 ImGui::SameLine();
84 {
87 }
88 ImGui::SameLine();
89 ImGui::PopID();
90 }
91
92 {
94 ImGui::PushID("PointLightComponent Color B");
95
96 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
97 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4{ 0.2f, 0.35f, 0.9f, 1.0f });
98 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4{ 0.1f, 0.25f, 0.8f, 1.0f });
100 ImGui::PopStyleColor(3);
101 ImGui::SameLine();
102 ImGui::PushItemWidth(itemWidth);
103 if(ImGui::SliderFloat(
"##B", &
m_PointLight.color.z, 0.0f, 1.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
104 {
106 }
107 ImGui::PopItemWidth();
108 ImGui::SameLine();
110 {
113 }
114 ImGui::SameLine();
115 ImGui::PopID();
116 }
117
118 {
120 ImGui::PushID("PointLightComponent Color Picker");
121
122 ImGui::PushStyleColor(ImGuiCol_FrameBg, ImGui::GetStyle().Colors[ImGuiCol_WindowBg]);
123 if(ImGui::ColorEdit3(
"##", glm::value_ptr(
m_PointLight.color), ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_PickerHueBar))
124 {
126 }
127 ImGui::SameLine();
129 {
132 }
133 ImGui::PopStyleColor();
134 ImGui::PopID();
135 }
136 });
137 }
138
139 {
141
144 if(ImGui::DragFloat(
"##", &
m_PointLight.intensity, 0.1f, 0.0f, 10000.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
145 {
147 }
148 ImGui::PopItemWidth();
149 ImGui::SameLine();
151 {
154 }
155 });
156 }
157
158 {
160
163 if(ImGui::DragFloat(
"##", &
m_PointLight.constantf, 0.1f, 0.0f, 10000.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
164 {
166 }
167 ImGui::PopItemWidth();
168 ImGui::SameLine();
170 {
173 }
174 });
175 }
176
177 {
179
182 if(ImGui::DragFloat(
"##", &
m_PointLight.linear, 0.1f, 0.0f, 10000.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
183 {
185 }
186 ImGui::PopItemWidth();
187 ImGui::SameLine();
189 {
192 }
193 });
194 }
195
196 {
198
201 if(ImGui::DragFloat(
"##", &
m_PointLight.quadratic, 0.1f, 0.0f, 10000.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
202 {
204 }
205 ImGui::PopItemWidth();
206 ImGui::SameLine();
208 {
211 }
212 });
213 }
214
215 ImGui::PopStyleVar();
216 ImGui::Spacing();
217 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static FrameInfo & Get()
Get FrameInfo.
std::shared_ptr< World > m_World
The shared pointer of specific world.
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.
SpicesShader::PointLight m_PointLight
This PointLight data this component handled.