aboutsummaryrefslogtreecommitdiff
path: root/stockton-render
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:22 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:22 +0100
commitfff14bd55be2f1c98a03fc4e68bc08f065a3d4ca (patch)
tree3acb22848494725dbde5e01ab15a7e3c7a81e371 /stockton-render
parentcde43cfd5c285dc213895cebc305d9ba7f094d1a (diff)
fix(render): render everything when invalid camera position
Diffstat (limited to 'stockton-render')
-rw-r--r--stockton-render/src/culling.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/stockton-render/src/culling.rs b/stockton-render/src/culling.rs
index f8366e6..8ee2877 100644
--- a/stockton-render/src/culling.rs
+++ b/stockton-render/src/culling.rs
@@ -27,12 +27,17 @@ use stockton_types::Vector3;
pub fn get_visible_faces<X: CoordSystem, T: MinBSPFeatures<X>>(pos: Vector3, file: &T) -> Vec<u32> {
let vis_cluster = get_cluster_id(pos, file);
+ let mut visible = Vec::with_capacity(file.faces_len() as usize);
if (vis_cluster & 0x80000000) != 0 {
// Negative = Invalid camera position
- return vec![];
+ // For now just render everything
+ for face_idx in 0..file.faces_len() {
+ visible.push(face_idx);
+ }
+
+ return visible;
}
- let mut visible = Vec::with_capacity(file.faces_len() as usize);
walk_bsp_tree(file.get_bsp_root(), vis_cluster, &mut visible, file);
visible