Cleanup octree and get started on chunk system

This commit is contained in:
2024-11-03 12:27:43 -05:00
parent 6439b1cbf2
commit 46464fa6d2
16 changed files with 284 additions and 90 deletions

View File

@@ -194,21 +194,23 @@ namespace fgl::engine::gui
static GameObject* selected_object { nullptr };
void itterateGameObjectNode( FrameInfo& info, const OctTreeNode& node )
void itterateGameObjectNode( FrameInfo& info, OctTreeNode& node )
{
if ( node.isLeaf() )
{
if ( node.itemCount() == 0 ) return;
const auto& objects { node.getLeaf() };
for ( const GameObject& object : objects )
auto& objects { node.getLeaf() };
for ( GameObject& object : objects )
{
ImGui::PushID( object.getId() );
debug::drawLine( object.getPosition(), node.getFitCenter() );
if ( ImGui::TreeNodeEx( object.getName().c_str(), ImGuiTreeNodeFlags_Leaf ) )
{
if ( ImGui::IsItemClicked() )
{
selected_object = &object;
}
ImGui::TreePop();
}
ImGui::PopID();

View File

@@ -51,7 +51,7 @@ namespace fgl::engine::gui
Model::createModel( data->path, info.model_vertex_buffer, info.model_index_buffer )
};
obj.addFlag( IS_ENTITY | IS_VISIBLE );
obj.addFlag( IsEntity | IsVisible );
auto component {
std::make_unique< ModelComponent >( std::move( model ) )