Checkpoint workspace changes
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
|
||||
#include "Scene/EditorSceneBackend.h"
|
||||
|
||||
#include <XCEngine/Components/GameObject.h>
|
||||
#include <XCEngine/Scene/Scene.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
@@ -141,28 +138,6 @@ void BuildTreeItemsRecursive(
|
||||
}
|
||||
}
|
||||
|
||||
HierarchyNode BuildSceneNodeRecursive(
|
||||
const ::XCEngine::Components::GameObject& gameObject) {
|
||||
HierarchyNode node = {};
|
||||
node.nodeId = MakeEditorGameObjectItemId(gameObject.GetID());
|
||||
node.label = gameObject.GetName().empty()
|
||||
? std::string("GameObject")
|
||||
: gameObject.GetName();
|
||||
node.children.reserve(gameObject.GetChildCount());
|
||||
for (std::size_t childIndex = 0u;
|
||||
childIndex < gameObject.GetChildCount();
|
||||
++childIndex) {
|
||||
const auto* child = gameObject.GetChild(childIndex);
|
||||
if (child == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
node.children.push_back(BuildSceneNodeRecursive(*child));
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
HierarchyNode BuildSnapshotNodeRecursive(
|
||||
const EditorSceneHierarchyNode& snapshotNode) {
|
||||
HierarchyNode node = {};
|
||||
@@ -179,25 +154,6 @@ HierarchyNode BuildSnapshotNodeRecursive(
|
||||
|
||||
} // namespace
|
||||
|
||||
HierarchyModel HierarchyModel::BuildFromScene(
|
||||
const ::XCEngine::Components::Scene* scene) {
|
||||
HierarchyModel model = {};
|
||||
if (scene == nullptr) {
|
||||
return model;
|
||||
}
|
||||
|
||||
const auto roots = scene->GetRootGameObjects();
|
||||
model.m_roots.reserve(roots.size());
|
||||
for (const auto* root : roots) {
|
||||
if (root == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
model.m_roots.push_back(BuildSceneNodeRecursive(*root));
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
HierarchyModel HierarchyModel::BuildFromSnapshot(
|
||||
const EditorSceneHierarchySnapshot& snapshot) {
|
||||
HierarchyModel model = {};
|
||||
|
||||
Reference in New Issue
Block a user