diff --git a/client/src/graphics/voxels/mod.rs b/client/src/graphics/voxels/mod.rs index 1e7de329..b139ddd7 100644 --- a/client/src/graphics/voxels/mod.rs +++ b/client/src/graphics/voxels/mod.rs @@ -17,7 +17,6 @@ use crate::{ }; use common::{ dodeca::Vertex, - dodeca::BOUNDING_SPHERE_RADIUS, graph::NodeId, lru_slab::SlotId, math, @@ -142,7 +141,7 @@ impl Voxels { for &(node, ref node_transform) in &nodes { let node_to_view = local_to_view * node_transform; let origin = node_to_view * math::origin(); - if !frustum_planes.contain(&origin, BOUNDING_SPHERE_RADIUS) { + if !frustum_planes.contain(&origin, common::dodeca::BOUNDING_SPHERE_RADIUS) { // Don't bother generating or drawing chunks from nodes that are wholly outside the // frustum. continue; diff --git a/common/src/dodeca.rs b/common/src/dodeca.rs index 43c16114..6df0b310 100644 --- a/common/src/dodeca.rs +++ b/common/src/dodeca.rs @@ -3,11 +3,6 @@ use serde::{Deserialize, Serialize}; use crate::dodeca::data::*; -pub const VERTEX_COUNT: usize = 20; -pub const SIDE_COUNT: usize = 12; -pub const BOUNDING_SPHERE_RADIUS_F64: f64 = 1.2264568712514068; -pub const BOUNDING_SPHERE_RADIUS: f32 = BOUNDING_SPHERE_RADIUS_F64 as f32; - /// Sides of a right dodecahedron #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Side { @@ -226,6 +221,11 @@ impl Vertex { } } +pub const VERTEX_COUNT: usize = 20; +pub const SIDE_COUNT: usize = 12; +pub const BOUNDING_SPHERE_RADIUS_F64: f64 = 1.2264568712514068; +pub const BOUNDING_SPHERE_RADIUS: f32 = BOUNDING_SPHERE_RADIUS_F64 as f32; + mod data { use std::sync::OnceLock;