Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
inthar-raven committed Apr 26, 2024
1 parent c48f136 commit 6b32c29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions client/src/graphics/voxels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use crate::{
};
use common::{
dodeca::Vertex,
dodeca::BOUNDING_SPHERE_RADIUS,
graph::NodeId,
lru_slab::SlotId,
math,
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions common/src/dodeca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 6b32c29

Please sign in to comment.