Implement viewport culling (#667)

* culling is working

* fixed tests

* Ready for review

* cleanup

* code review

* Fix import

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mfish33
2022-06-10 14:38:42 -07:00
committed by Keavon Chambers
parent 4f968385c5
commit be717b3bd4
12 changed files with 47 additions and 27 deletions

View File

@@ -6,6 +6,8 @@ use crate::message_prelude::*;
#[doc(inline)]
pub use graphene::DocumentResponse;
use glam::DVec2;
#[derive(Debug, Default)]
pub struct InputPreprocessorMessageHandler {
pub keyboard: KeyStates,
@@ -152,4 +154,9 @@ impl InputPreprocessorMessageHandler {
responses.push_back(InputMapperMessage::KeyDown(key).into());
}
}
pub fn document_bounds(&self) -> [DVec2; 2] {
// ipp bounds are relative to the entire screen
[(0., 0.).into(), self.viewport_bounds.bottom_right - self.viewport_bounds.top_left]
}
}