-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add occlusion culling for buildings (#30)
Also includes the cleanup of many building meshes that would crash the editor during occluder mesh generation.
- Loading branch information
Showing
186 changed files
with
29,295 additions
and
31,657 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
mod building_imports; | ||
|
||
use godot::{ | ||
builtin::Callable, | ||
engine::{notify::NodeNotification, EditorPlugin, IEditorPlugin}, | ||
obj::{Base, Gd, WithBaseField}, | ||
register::{godot_api, GodotClass}, | ||
}; | ||
|
||
use crate::util::logger; | ||
use building_imports::SetupBuildingImports; | ||
|
||
#[derive(GodotClass)] | ||
#[class(editor_plugin, tool, base=EditorPlugin)] | ||
struct EditorExtension { | ||
setup_building_imports: Gd<SetupBuildingImports>, | ||
base: Base<EditorPlugin>, | ||
} | ||
|
||
#[godot_api] | ||
impl IEditorPlugin for EditorExtension { | ||
fn init(base: Base<EditorPlugin>) -> Self { | ||
Self { | ||
setup_building_imports: SetupBuildingImports::new(base.to_gd().get_editor_interface()), | ||
base, | ||
} | ||
} | ||
|
||
fn enter_tree(&mut self) { | ||
let building_imports = self.setup_building_imports.clone(); | ||
|
||
self.base_mut().add_tool_menu_item( | ||
"Setup Building Imports...".into(), | ||
Callable::from_object_method(&building_imports, "start"), | ||
); | ||
} | ||
|
||
fn on_notification(&mut self, what: NodeNotification) { | ||
if what == NodeNotification::PREDELETE { | ||
logger::debug!("godots destructor was called for EditorExtension..."); | ||
self.setup_building_imports.clone().free(); | ||
} | ||
} | ||
} |
Oops, something went wrong.