41#include <IconsForkAwesome.h>
42#include <imgui_internal.h>
64 g_framerateBufferCont.reserve(g_maxEntryCount);
68 if (camera ==
nullptr) {
72 constexpr ImGuiTreeNodeFlags node_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_SpanAvailWidth;
73 if (
_filter.PassFilter(camera->resourceName().c_str())) {
74 if (ImGui::TreeNodeEx((
void*)(intptr_t)camera->
getGUID(), node_flags,
"%s %s", ICON_FK_CAMERA, camera->resourceName().c_str())) {
75 if (ImGui::IsItemClicked()) {
91 if (ImGui::BeginPopupContextItem(
"Context menu")) {
94 const bool isRoot = sgn->parent() ==
nullptr;
101 if (ImGui::Selectable(ICON_FK_USERS
" Change Parent")) {
107 if (ImGui::IsItemHovered()) {
108 ImGui::SetTooltip(
"Can't re-parent sub-meshes!");
111 if (ImGui::Selectable(ICON_FK_CHILD
" Add Child")) {
112 g_particleEmitterData.reset();
113 g_particleSource.reset();
115 g_nodeDescriptor = {};
123 if (ImGui::Selectable(ICON_FK_LOCATION_ARROW
" Go To")) {
128 if (ImGui::Selectable(ICON_FK_FLOPPY_O
" Save Changes")) {
131 if (ImGui::Selectable(ICON_FK_FILE
" Load from file")) {
139 if (ImGui::Selectable(ICON_FK_TRASH
" Remove")) {
144 if (ImGui::IsItemHovered()) {
145 ImGui::SetTooltip(
"Can't remove the root node!");
156 for (
U32 i = 0u; i < childCount; ++i) {
171 const bool secondaryView,
172 const bool modifierPressed)
174 ImGuiTreeNodeFlags node_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_SpanAvailWidth;
185 node_flags |= ImGuiTreeNodeFlags_DefaultOpen;
188 node_flags |= ImGuiTreeNodeFlags_Selected;
192 node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet;
195 const auto printNode = [&](
const char* icon) {
203 const bool isRoot = sgn->parent() ==
nullptr;
204 const bool nodeOpen = ImGui::TreeNodeEx((
void*)(intptr_t)sgn->
getGUID(),
207 icon ==
nullptr ? ICON_FK_QUESTION : icon,
210 (modifierPressed && !isRoot) ? ICON_FK_CHECK_SQUARE_O :
"",
211 (wasSelected ? ICON_FK_CHEVRON_CIRCLE_LEFT : isHovered ? ICON_FK_CHEVRON_LEFT :
""));
213 if (!secondaryView && wasSelected) {
217 if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen()) {
224 if (modifierPressed || projectManager->
resetSelection(0,
false)) {
225 if (!wasSelected || parentSelected || childrenSelected) {
226 projectManager->
setSelected(0, { sgn }, wasSelected);
232 if (!secondaryView && ImGui::IsMouseDoubleClicked(0) && ImGui::IsItemHovered(ImGuiHoveredFlags_None)) {
243 for (
U32 i = 0u; i < childCount; ++i) {
249 bool nodeOpen =
false;
250 if (
_filter.PassFilter(sgn->name().c_str())) {
256 for (
U32 i = 0u; i < childCount; ++i) {
270 Scene* activeScene = projectManager->activeProject()->getActiveScene();
278 const bool modifierPressed = imguiContext.IO.KeyShift;
283 ImGui::AlignTextToFramePadding();
284 ImGui::Text(ICON_FK_SEARCH
" Find node: ");
286 ImGui::PushID(
"GraphSearchFilter");
290 ImGui::Checkbox(ICON_FK_EYE, &s_onlyVisibleNodes);
291 if (ImGui::IsItemHovered())
293 ImGui::SetTooltip(
"Only visible nodes");
295 ImGui::BeginChild(
"SceneGraph", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetWindowHeight() * .5f),
true, 0);
297 if (ImGui::TreeNodeEx(activeScene->resourceName().c_str(), ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_SpanAvailWidth,
"%s%s", ICON_FK_HOME, activeScene->resourceName().c_str()))
302 ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, ImGui::GetFontSize() * 3);
316 ImGui::PopStyleVar();
328 static F32 max_ms_per_frame = 0;
330 static F32 ms_per_frame[g_maxEntryCount] = { 0 };
331 static I32 ms_per_frame_idx = 0;
332 static F32 ms_per_frame_accum = 0.0f;
333 ms_per_frame_accum -= ms_per_frame[ms_per_frame_idx];
334 ms_per_frame[ms_per_frame_idx] = ImGui::GetIO().DeltaTime * 1000.0f;
335 ms_per_frame_accum += ms_per_frame[ms_per_frame_idx];
336 ms_per_frame_idx = (ms_per_frame_idx + 1) % g_maxEntryCount;
337 const F32 ms_per_frame_avg = ms_per_frame_accum / g_maxEntryCount;
343 g_framerateBuffer.push_back(ms_per_frame_avg);
344 if (g_framerateBuffer.size() > g_maxEntryCount)
346 g_framerateBuffer.pop_front();
349 g_framerateBufferCont.insert(cbegin(g_framerateBufferCont),
350 cbegin(g_framerateBuffer),
351 cend(g_framerateBuffer));
352 ImGui::PushItemWidth(-1);
354 ImGui::PlotHistogram(
"",
355 g_framerateBufferCont.data(),
356 to_I32(g_framerateBufferCont.size()),
358 Util::StringFormat(
"{:.3f} ms/frame ({:.1f} FPS)", ms_per_frame_avg, ms_per_frame_avg > 0.01f ? 1000.0f / ms_per_frame_avg : 0.0f).c_str(),
363 ImGui::PopItemWidth();
365 static bool performanceStatsWereEnabled =
false;
366 static U32 s_maxLocksInFlight = 0u;
367 if (ImGui::CollapsingHeader(ICON_FK_TACHOMETER
" Performance Stats"))
370 bool limit = fpsLimit > 0;
371 if (ImGui::Checkbox(
"Limit FPS", &limit))
380 if (ImGui::SliderInt(
"FPS limit", &fpsLimit, 10, 320))
390 performanceStatsWereEnabled =
context().
gfx().queryPerformanceStats();
398 crtDrawCallCount[i] = rpm->drawCallCount(
static_cast<RenderStage>(i));
406 perfMetrics._verticesSubmitted =
to_U64(perfMetrics._verticesSubmitted * 0.99f + perfMetricsSource.
_verticesSubmitted * 0.01f);
407 perfMetrics._primitivesGenerated =
to_U64(perfMetrics._primitivesGenerated * 0.99f + perfMetricsSource.
_primitivesGenerated * 0.01f);
408 perfMetrics._tessellationPatches =
to_U64(perfMetrics._tessellationPatches * 0.99f + perfMetricsSource.
_tessellationPatches * 0.01f);
423 static U32 cachedSyncCount[3]{};
424 static U32 cachedCamWrites[2]{};
425 if (ms_per_frame_idx % 2 == 0)
427 std::memcpy(cachedSyncCount, perfMetrics._syncObjectsInFlight, 3 *
sizeof(
U32));
428 std::memcpy(cachedCamWrites, perfMetrics._scratchBufferQueueUsage, 2 *
sizeof(
U32));
429 s_maxLocksInFlight = std::max(cachedSyncCount[0], s_maxLocksInFlight);
436 ImGui::Text(
"Data"); ImGui::NextColumn();
437 ImGui::Text(
"Display"); ImGui::NextColumn();
438 ImGui::Text(
"Shadows"); ImGui::NextColumn();
439 ImGui::Text(
"Reflections"); ImGui::NextColumn();
440 ImGui::Text(
"Refractions"); ImGui::NextColumn();
443 static bool maxCalls =
false;
446 ImGui::Text(ICON_FK_PENCIL
" (Max)");
450 ImGui::Text(ICON_FK_PENCIL);
452 if (ImGui::IsItemHovered())
454 ImGui::SetTooltip(
"Draw Calls. Click to toggle between Max Calls and Current Calls");
456 if (ImGui::IsItemClicked())
458 maxCalls = !maxCalls;
464 ImGui::Text(
"%d", maxCalls ? maxDrawCallCount[i] : crtDrawCallCount[i]);
465 if (ImGui::IsItemHovered())
469 ImGui::SetTooltip(
"Current calls: %d", crtDrawCallCount[i]);
473 ImGui::SetTooltip(
"Max calls: %d", maxDrawCallCount[i]);
479 ImGui::Text(ICON_FK_EYE);
480 if (ImGui::IsItemHovered())
482 ImGui::SetTooltip(
"Visible Nodes");
488 ImGui::Text(
"%d", rpm->getLastTotalBinSize(
static_cast<RenderStage>(i)));
495 bool enableHiZ =
context().
gfx().enableOcclusionCulling();
496 ImGui::PushID(
"ToggleHiZCheckBox");
497 if (ImGui::Checkbox(
"", &enableHiZ))
499 context().
gfx().enableOcclusionCulling(enableHiZ);
501 if (ImGui::IsItemHovered())
503 ImGui::SetTooltip(
"Enable / Disable GPU Hi-Z occlusion culling");
507 ImGui::Text(
"HiZ Cull Counts: %d | %d | %d | %d", cullCount.
x, cullCount.
y, cullCount.
z, cullCount.
w);
510 ImGui::Text(
"GPU Frame Time: %.2f ms", perfMetrics._gpuTimeInMS);
512 ImGui::Text(
"Submitted Vertices: %s",
Util::commaprint(perfMetrics._verticesSubmitted));
514 ImGui::Text(
"Primitves Generated: %s",
Util::commaprint(perfMetrics._primitivesGenerated));
516 ImGui::Text(
"Tessellation Patches: %s",
Util::commaprint(perfMetrics._tessellationPatches));
518 ImGui::Text(
"Tessellation Invocations: %s",
Util::commaprint(perfMetrics._tessellationInvocations));
520 ImGui::Text(
"Generated Render Targets: %d", perfMetrics._generatedRenderTargetCount);
522 ImGui::Text(
"Queued GPU Frames: %d", perfMetrics._queuedGPUFrames);
524 ImGui::Text(
"Per Frame shader uniforms VRAM usage: %.2f Kb", (perfMetrics._uniformBufferVRAMUsage / 1024.f));
526 ImGui::Text(
"Total buffers VRAM usage: %.2f Mb", (perfMetrics._bufferVRAMUsage / 1024.f / 1024.f));
528 ImGui::Text(
"Sync objects in flight : %d / %d / %d Max: %d", cachedSyncCount[0], cachedSyncCount[1], cachedSyncCount[2], s_maxLocksInFlight);
530 if (ImGui::IsItemHovered())
532 ImGui::SetTooltip(
"[ Current Frame - 2 ] / [ Current Frame - 1] / [ Current Frame ]");
535 ImGui::Text(
"Cam Buffer Writes: %d | Render Buffer Writes: %d", cachedCamWrites[0], cachedCamWrites[1]);
542 maxDrawCallCount[i] = std::max(rpm->drawCallCount(
static_cast<RenderStage>(i)), maxDrawCallCount[i]);
547 if (!performanceStatsWereEnabled &&
context().gfx().queryPerformanceStats())
551 s_maxLocksInFlight = 0u;
554 if (ImGui::CollapsingHeader( ICON_FK_SUN_O
" / " ICON_FK_MOON_O
" Day/Night Settings", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_SpanAvailWidth))
556 bool dayNightEnabled = activeScene->dayNightCycleEnabled();
557 if (ImGui::Checkbox(
"Enable day/night cycle", &dayNightEnabled))
559 activeScene->dayNightCycleEnabled(dayNightEnabled);
562 ImGui::Text(ICON_FK_CLOCK_O
" Time of Day:");
566 constexpr U8 min = 0u;
567 constexpr U8 maxHour = 24u;
568 constexpr U8 maxMinute = 59u;
570 const bool hourChanged = ImGui::SliderScalar(
"Hour", ImGuiDataType_U8, &time.
_hour, &min, &maxHour,
"%02d");
571 const bool minutesChanged = ImGui::SliderScalar(
"Minute", ImGuiDataType_U8, &time.
_minutes, &min, &maxMinute,
"%02d");
572 if (hourChanged || minutesChanged)
577 if (ImGui::InputFloat(
"Time factor", &timeFactor))
582 ImGui::Text(ICON_FK_GLOBE_W
" Global positioning:");
583 const bool latitudeChanged = ImGui::SliderFloat(
"Latitude", &location.
_latitude, -90.f, 90.f,
"%.6f");
584 const bool longitudeChanged = ImGui::SliderFloat(
"Longitude", &location.
_longitude, -180.f, 180.f,
"%.6f");
585 if (latitudeChanged || longitudeChanged)
590 if ( ImGui::CollapsingHeader(
"Day/Night details", ImGuiTreeNodeFlags_SpanAvailWidth ) )
601 const bool isNight = sunAltitude < twilightDegrees;
603 const bool isDawn = isTwilight && sunAzimuth < sunriseAzimuth;
604 const bool isDusk = isTwilight && sunAzimuth > sunsetAzimuth;
607 ImGui::Text( ICON_FK_CLOCK_O ); ImGui::SameLine();
609 ImGui::SameLine(); ImGui::Text(
" | "); ImGui::SameLine();
611 ImGui::SameLine(); ImGui::Text(
" | "); ImGui::SameLine();
615 ImGui::Text( ICON_FK_SUN_O ); ImGui::SameLine();
616 ImGui::Text(
"Sun Pos|Dir: (%1.2f, %1.2f, %1.2f) | (%1.2f, %1.2f, %1.2f)", sunPosition.
x, sunPosition.
y, sunPosition.
z, sunDirection.
x, sunDirection.
y, sunDirection.
z);
619 ImGui::Text( ICON_FK_SUN_O ); ImGui::SameLine();
620 ImGui::Text(
"Sun altitude | Max altitude : (%3.2f | %3.2f) degrees", sunAltitude, sun.
altitudeMax );
623 ImGui::Text( ICON_FK_SUN_O ); ImGui::SameLine();
624 ImGui::Text(
"Sun azimuth | Declination : (%3.2f | %3.2f) degrees", sun.
azimuth, sun.
declination );
627 ImGui::Text( ICON_FK_MOON_O ); ImGui::SameLine();
628 ImGui::Text(
"Time of day: %s", isNight ?
"Night" : isDawn ?
"Dawn" : isDusk ?
"Dusk" :
"Day" );
648 if (ImGui::BeginPopupModal(
"Confirm Remove",
nullptr, ImGuiWindowFlags_AlwaysAutoResize))
650 ImGui::Text(
"Are you sure you want remove the selected node [ %zu ]?",
_nodeToRemove);
653 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
655 ImGui::CloseCurrentPopup();
658 ImGui::SetItemDefaultFocus();
660 if (ImGui::Button(
"Yes", ImVec2(120, 0)))
663 ImGui::CloseCurrentPopup();
680 if (ImGui::BeginPopupModal(
"Confirm Re-parent",
nullptr, ImGuiWindowFlags_AlwaysAutoResize))
682 ImGui::Text(
"Are you sure you want change the selected node's [ %s ] parent?",
_childNode->name().c_str());
683 ImGui::Text(
"Old Parent [ %s ] | New Parent [ %s ]",
_childNode->parent()->name().c_str(),
_tempParent->name().c_str());
686 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
688 ImGui::CloseCurrentPopup();
691 ImGui::SetItemDefaultFocus();
693 if (ImGui::Button(
"Yes", ImVec2(120, 0)))
699 ImGui::CloseCurrentPopup();
715 if (ImGui::BeginPopupModal(
"Create New Node",
nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
717 ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
718 ImGui::BeginChild(
"Node Properties", ImVec2(0, 400),
true, 0);
721 ImGui::Text(
"Name:" ); ImGui::SameLine();
722 if (ImGui::InputText(
"##Name:", &buf[0], 61))
724 g_nodeDescriptor.
_name = buf;
728 if (ImGui::BeginCombo(
"Node Type", currentType, ImGuiComboFlags_PopupAlignLeft))
733 const bool isSelected = g_currentNodeType == type;
738 if (ImGui::Selectable(
Names::sceneNodeType[t], isSelected, valid ? 0 : ImGuiSelectableFlags_Disabled))
740 g_currentNodeType = type;
745 ImGui::BeginChild(
"Components", ImVec2(0, 260),
true, 0);
766 const U32 componentBit = 1 << i;
773 required = required ||
790 if (required || invalid)
795 bool componentEnabled = componentMask & componentBit;
797 if (ImGui::Checkbox(compLabel, &componentEnabled))
799 componentMask |= componentBit;
801 if (ImGui::IsItemHovered())
805 ImGui::SetTooltip(
"Required component for current node type!");
809 ImGui::SetTooltip(
"Component type not (yet) supported!");
812 if (required || invalid)
821 if (ImGui::Checkbox(
"Dynamic", &nodeDynamic))
825 if (ImGui::IsItemHovered())
827 ImGui::SetTooltip(
"Static or dynamic node? Affects navigation, collision detection and other systems.");
830 ImGui::Checkbox(
"Serializable", &g_nodeDescriptor.
_serialize);
831 if (ImGui::IsItemHovered())
833 ImGui::SetTooltip(
"State is saved and loaded to and from external files?");
836 ImGui::PopStyleVar();
840 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
842 ImGui::CloseCurrentPopup();
845 ImGui::SetItemDefaultFocus();
848 if (ImGui::Button(
"Yes", ImVec2(120, 0)))
853 ImGui::CloseCurrentPopup();
865 ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
866 ImGui::BeginChild(
"Type Specific Properties", ImVec2(0, 200),
true, 0);
867 if (g_particleEmitterData ==
nullptr)
869 constexpr U32 options =
875 g_particleEmitterData = std::make_shared<ParticleData>(
context().gfx(), 1000, options);
876 g_particleSource = std::make_shared<ParticleSource>(
context().gfx(), 250.f);
878 g_particleEmitterData->_textureFileName =
"particle.DDS";
880 std::shared_ptr<ParticleBoxGenerator> boxGenerator = std::make_shared<ParticleBoxGenerator>();
881 boxGenerator->halfExtent({ 0.3f, 0.0f, 0.3f });
882 g_particleSource->addGenerator(boxGenerator);
884 std::shared_ptr<ParticleColourGenerator> colGenerator = std::make_shared<ParticleColourGenerator>();
885 colGenerator->_minStartCol.set(g_particleStartColour);
886 colGenerator->_maxStartCol.set(g_particleStartColour);
887 colGenerator->_minEndCol.set(g_particleEndColour);
888 colGenerator->_maxEndCol.set(g_particleEndColour);
889 g_particleSource->addGenerator(colGenerator);
891 std::shared_ptr<ParticleVelocityGenerator> velGenerator = std::make_shared<ParticleVelocityGenerator>();
892 velGenerator->_minStartVel = { -1.0f, 0.22f, -1.0f };
893 velGenerator->_maxStartVel = { 1.0f, 3.45f, 1.0f };
894 g_particleSource->addGenerator(velGenerator);
896 const std::shared_ptr<ParticleTimeGenerator> timeGenerator = std::make_shared<ParticleTimeGenerator>();
897 timeGenerator->_minTime = 8.5f;
898 timeGenerator->_maxTime = 20.5f;
899 g_particleSource->addGenerator(timeGenerator);
903 ImGui::Text(
"Texture File Name:" ); ImGui::SameLine();
904 ImGui::InputText(
"##Texture File Name:", g_particleEmitterData->_textureFileName.data(), 128);
907 U32 componentMask = g_particleEmitterData->optionsMask();
908 U32 particleCount = g_particleEmitterData->totalCount();
909 ImGui::Text(
"Particle Count:" ); ImGui::SameLine();
910 if (ImGui::InputScalar(
"##Particle Count:", ImGuiDataType_U32, &particleCount))
912 if (particleCount == 0)
916 g_particleEmitterData->generateParticles(particleCount, componentMask);
919 F32 emitRate = g_particleSource->emitRate();
920 ImGui::Text(
"Emit rate:" ); ImGui::SameLine();
921 if (ImGui::InputFloat(
"##Emit rate:", &emitRate))
927 g_particleSource->updateEmitRate(emitRate);
932 const U32 componentBit = 1 << i;
933 bool componentEnabled = componentMask & componentBit;
935 if (ImGui::Checkbox(compLabel, &componentEnabled))
937 componentMask |= componentBit;
938 g_particleEmitterData->generateParticles(particleCount, componentMask);
943 ImGui::PopStyleVar();
964 switch ( g_currentNodeType )
970 if ( handle == INVALID_HANDLE<ParticleEmitter>)
978 if ( emitter->initData( g_particleEmitterData ) )
980 emitter->addSource( g_particleSource );
982 std::shared_ptr<ParticleEulerUpdater> eulerUpdater = std::make_shared<ParticleEulerUpdater>(
context() );
983 eulerUpdater->_globalAcceleration.set( g_particleAcceleration );
984 emitter->addUpdater( eulerUpdater );
985 const std::shared_ptr<ParticleFloorUpdater> floorUpdater = std::make_shared<ParticleFloorUpdater>(
context() );
986 floorUpdater->_bounceFactor = g_particleBounceFactor;
987 emitter->addUpdater( floorUpdater );
988 emitter->addUpdater( std::make_shared<ParticleBasicTimeUpdater>(
context() ) );
989 emitter->addUpdater( std::make_shared<ParticleBasicColourUpdater>(
context() ) );
995 g_particleEmitterData.reset();
996 g_particleSource.reset();
1023 if (ImGui::BeginPopupModal(
"Select New Parent",
nullptr, ImGuiWindowFlags_AlwaysAutoResize))
1026 SceneGraphNode* root = projectManager->activeProject()->getActiveScene()->sceneGraph()->getRoot();
1030 if (ImGui::BeginChild(
"SceneGraph", ImVec2(0, 400),
true, 0))
1032 ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, ImGui::GetFontSize() * 3);
1034 ImGui::PopStyleVar();
1039 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
1044 ImGui::CloseCurrentPopup();
1049 if (ImGui::Button(
"Done", ImVec2(120, 0)))
1053 ImGui::CloseCurrentPopup();
#define PROFILE_SCOPE_AUTO(CATEGORY)
#define PROFILE_SCOPE(NAME, CATEGORY)
static void queueRemoveNode(Editor &editor, const I64 nodeGUID)
static BoundingSphere teleportToNode(const Editor &editor, Camera *camera, const SceneGraphNode *targetNode)
static void saveNode(const Editor &editor, const SceneGraphNode *targetNode)
static void setSelectedCamera(Editor &editor, Camera *camera) noexcept
static bool lockSolutionExplorer(const Editor &editor)
static bool isNodeInView(const Editor &editor, const SceneGraphNode &node)
static void loadNode(const Editor &editor, SceneGraphNode *targetNode)
static const Camera * getSelectedCamera(const Editor &editor) noexcept
static Camera * playerCamera(const Divide::ProjectManager *mgr, const bool skipOverride=false) noexcept
const Descriptor & descriptor() const noexcept
const char * getIconForNode(const SceneGraphNode *sgn) noexcept
PerformanceMetrics & getPerformanceMetrics() noexcept
FORCE_INLINE I64 getGUID() const noexcept
PlatformContext & context() noexcept
PlatformContext & _context
Kernel & kernel() noexcept
Editor & editor() noexcept
GFXDevice & gfx() noexcept
Configuration & config() noexcept
void setSelected(PlayerIndex idx, const vector< SceneGraphNode * > &SGNs, bool recursive)
bool resetSelection(PlayerIndex idx, const bool resetIfLocked)
ResourceState getState() const noexcept
void setParent(SceneGraphNode *parent, bool defer=false)
Changing a node's parent means removing this node from the current parent's child list and appending ...
SceneGraphNode * addChildNode(const SceneGraphNodeDescriptor &descriptor)
Add child node increments the node's ref counter if the node was already added to the scene graph.
bool hasFlag(const Flags flag) const noexcept
Returns true only if the current node has the specified flag. Does not check children!
ChildContainer & getChildren() noexcept
vec3< F32 > getSunPosition() const
const SimpleTime & getTimeOfDay() const noexcept
vec3< F32 > getSunDirection() const
const SimpleLocation & getGeographicLocation() const noexcept
void setTimeOfDay(const SimpleTime &time) noexcept
void setGeographicLocation(const SimpleLocation &location) noexcept
SunInfo getCurrentSunDetails() const noexcept
void setDayNightCycleTimeFactor(F32 factor) noexcept
Negative values should work.
F32 getDayNightCycleTimeFactor() const noexcept
SceneGraphNode * _tempParent
void drawRemoveNodeDialog()
void printCameraNode(ProjectManager *projectManager, Camera *const camera) const
void drawChangeParentWindow()
void saveNode(const SceneGraphNode *sgn) const
SceneGraphNode * _childNode
void drawContextMenu(SceneGraphNode *sgn)
bool _reparentSelectRequested
Used when changing parents.
void loadNode(SceneGraphNode *sgn) const
void goToNode(const SceneGraphNode *sgn) const
void drawInternal() override
bool nodeHasChildrenInView(const SceneGraphNode *sgn) const
void drawReparentNodeDialog()
bool _reparentConfirmRequested
void drawNodeParametersChildWindow()
void printSceneGraphNode(ProjectManager *projectManager, SceneGraphNode *sgn, I32 nodeIDX, bool open, bool secondaryView, bool modifierPressed)
SolutionExplorerWindow(Editor &parent, PlatformContext &context, const Descriptor &descriptor)
SceneGraphNode * _parentNode
Used for adding child nodes.
constexpr T RadiansToDegrees(T angleRadians) noexcept
Return the degree equivalent of the given radian value.
constexpr U16 TARGET_FRAME_RATE
Application desired framerate for physics and input simulations.
constexpr U8 MAX_LOCAL_PLAYER_COUNT
Maximum number of players we support locally. We store per-player data such as key-bindings,...
FColour4 WHITE
Random stuff added for convenience.
const char * sceneNodeType[to_base(SceneNodeType::COUNT)+1u]
static const char * particleDataProperties[]
constexpr Optick::Category::Type GUI
const char * ComponentTypeToString(const ComponentType compType) noexcept
Str StringFormat(const char *fmt, Args &&...args)
void OpenCenteredPopup(const char *name, ImGui::ImGuiPopupFlags popup_flags=0)
char * commaprint(U64 number) noexcept
constexpr U8 g_maxEntryCount
F32 g_particleBounceFactor
eastl::deque< F32 > g_framerateBuffer
SceneNodeType g_currentNodeType
std::shared_ptr< ParticleData > g_particleEmitterData
vector< F32 > g_framerateBufferCont
FColour4 g_particleEndColour
vec3< F32 > g_particleAcceleration
SceneGraphNodeDescriptor g_nodeDescriptor
std::shared_ptr< ParticleSource > g_particleSource
FColour4 g_particleStartColour
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
constexpr U64 to_U64(const T value)
bool IS_IN_RANGE_INCLUSIVE(const T x, const U min, const U max) noexcept
void PushReadOnly(const bool fade)
@ RES_LOADED
The resource is available for usage.
SceneNodeType
ToDo: Move particle emitter to components (it will make them way more dynamic) - Ionut.
constexpr F32 EPSILON_F32
eastl::vector< Type > vector
std::shared_lock< mutex > SharedLock
FORCE_INLINE Handle< T > CreateResource(const ResourceDescriptor< T > &descriptor, bool &wasInCache, std::atomic_uint &taskCounter)
void efficient_clear(eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator > &fixed_vector)
constexpr U8 to_U8(const T value)
::value constexpr T CLAMPED(T n, T min, T max) noexcept
constexpr I16 to_I16(const T value)
FORCE_INLINE constexpr bool Is3DObject(const SceneNodeType type) noexcept
SceneNodeHandle FromHandle(const Handle< T > handle)
constexpr I32 to_I32(const T value)
FORCE_INLINE T * Get(const Handle< T > handle)
constexpr auto to_base(const Type value) -> Type
struct Divide::Configuration::Runtime runtime
SceneGraphNode * getChild(const U32 idx)
Return a specific child by index. Does not recurse.
eastl::fixed_vector< SceneGraphNode *, 32, true > _data
SceneNodeHandle _nodeHandle
NodeUsageContext _usageContext
Angle::RADIANS< F32 > azimuth
Angle::DEGREES< F32 > declination
Angle::RADIANS< F32 > altitude
Angle::DEGREES< F32 > altitudeMax