TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ OnRender()

void HeightmapNode::OnRender ( )
virtual

Implements NodeEditorNode.

Definition at line 175 of file HeightmapNode.cpp.

176{
177 DrawHeader("Heightmap");
178 inputPins[0]->Render();
179 ImGui::Text("X");
180 ImGui::SameLine();
181 ImGui::Dummy(ImVec2(150, 10));
182 ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
183 ImGui::Text("Height");
184 ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
185 outputPins[0]->Render();
186 inputPins[1]->Render();
187 ImGui::Text("Y");
188 inputPins[2]->Render();
189
190 if (inputPins[2]->IsLinked())
191 {
192 ImGui::Text("Scale");
193 }
194
195 else
196 {
197 ImGui::PushItemWidth(100);
198 ImGui::DragFloat(("Scale##" + std::to_string(inputPins[1]->id)).c_str(), &scale, 0.01f);
199 ImGui::PopItemWidth();
200 }
201
202 ImGui::Checkbox(("Auto Tiled##tild" + std::to_string(id)).c_str(), &autoTiled);
203 ImGui::Checkbox(("Interpolated##intrp" + std::to_string(id)).c_str(), &interpolated);
204 ImGui::Checkbox(("Inverted##tinv" + std::to_string(id)).c_str(), &inv);
205 ImGui::Checkbox(("Scale -1 To 1##tnpsc" + std::to_string(id)).c_str(), &npScale);
206
207 if(!autoTiled)
208 {
209 ImGui::PushItemWidth(100);
210 ImGui::DragFloat(("Num Tiles##nmtl" + std::to_string(id)).c_str(), &numTiles, 0.01f);
211 ImGui::PopItemWidth();
212 }
213 ImGui::DragFloat2(("Position##posi" + std::to_string(id)).c_str(), posi, 0.01f);
214 ImGui::PushItemWidth(100);
215 ImGui::DragFloat(("Rotation##rota" + std::to_string(id)).c_str(), &rota, 0.1f);
216 ImGui::PopItemWidth();
217 ImGui::NewLine();
218
219 if (ImGui::ImageButton((void*) heightmap->GetRendererID(), ImVec2(200, 200)))
220 {
221 ChangeHeightmap();
222 }
223
224 if (ImGui::Button(MAKE_IMGUI_LABEL(id, "Change Heightmap")))
225 {
226 ChangeHeightmap();
227 }
228}