aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src
diff options
context:
space:
mode:
Diffstat (limited to 'stockton-levels/src')
-rw-r--r--stockton-levels/src/features.rs7
-rw-r--r--stockton-levels/src/parts/faces.rs2
-rw-r--r--stockton-levels/src/parts/vertices.rs2
-rw-r--r--stockton-levels/src/parts/visdata.rs6
4 files changed, 10 insertions, 7 deletions
diff --git a/stockton-levels/src/features.rs b/stockton-levels/src/features.rs
index f748bd0..b4ddb99 100644
--- a/stockton-levels/src/features.rs
+++ b/stockton-levels/src/features.rs
@@ -14,5 +14,8 @@
use crate::parts::*;
-pub trait MinRenderFeatures: HasFaces + HasTextures + Send + Sync {}
-impl<T> MinRenderFeatures for T where T: HasFaces + HasTextures + Send + Sync {}
+pub trait MinRenderFeatures<'a>: HasFaces + HasTextures + HasVisData<'a> + Send + Sync {}
+impl<'a, T> MinRenderFeatures<'a> for T where
+ T: HasFaces + HasTextures + HasVisData<'a> + Send + Sync
+{
+}
diff --git a/stockton-levels/src/parts/faces.rs b/stockton-levels/src/parts/faces.rs
index 0168cd8..1023af7 100644
--- a/stockton-levels/src/parts/faces.rs
+++ b/stockton-levels/src/parts/faces.rs
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
pub type FaceRef = u32;
-#[derive(Debug, Clone, Serialize, Deserialize)]
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum Geometry {
Vertices(Vertex, Vertex, Vertex),
}
diff --git a/stockton-levels/src/parts/vertices.rs b/stockton-levels/src/parts/vertices.rs
index 0b7dfd6..f2f5a2d 100644
--- a/stockton-levels/src/parts/vertices.rs
+++ b/stockton-levels/src/parts/vertices.rs
@@ -42,7 +42,7 @@ impl<'de> Deserialize<'de> for Vertex {
TexV,
Color,
}
- const FIELDS: &'static [&'static str] =
+ const FIELDS: &[&str] =
&["pos_x", "pos_y", "pos_z", "tex_x", "tex_y", "color"];
struct VertexVisitor;
diff --git a/stockton-levels/src/parts/visdata.rs b/stockton-levels/src/parts/visdata.rs
index f311bf7..aa2ec3d 100644
--- a/stockton-levels/src/parts/visdata.rs
+++ b/stockton-levels/src/parts/visdata.rs
@@ -1,8 +1,8 @@
use super::faces::FaceRef;
-use na::Vector3;
use std::iter::Iterator;
+use stockton_types::components::{CameraSettings, Transform};
-pub trait HasVisData {
+pub trait HasVisData<'a> {
type Faces: Iterator<Item = FaceRef>;
- fn get_visible(pos: Vector3<f32>, rot: Vector3<f32>) -> Self::Faces;
+ fn get_visible(&'a self, transform: &Transform, settings: &CameraSettings) -> Self::Faces;
}