aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src/parts
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit47a0c0317cc774c19b78582bec9b5b09d56f569a (patch)
treed03471ea4e084ace9b95a2c5b7febb780b45bb63 /stockton-levels/src/parts
parentfb996488aa651cb2e7f46abc083c4318b47e77cd (diff)
feat(render): draw passes
Diffstat (limited to 'stockton-levels/src/parts')
-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
3 files changed, 5 insertions, 5 deletions
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;
}