Skip to content

Commit

Permalink
followup
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jul 7, 2024
1 parent b83d5ec commit 1e59e15
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions benches/baking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ fn baking(c: &mut Criterion) {
.unwrap();
c.bench_function(&"baking".to_string(), |b| {
b.iter(|| {
mesh.unbake();
mesh.bake();
mesh.layers[0].unbake();
mesh.layers[0].bake();
})
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/input/triangulation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::VecDeque, default};
use std::collections::VecDeque;

#[cfg(feature = "tracing")]
use tracing::instrument;
Expand Down
2 changes: 1 addition & 1 deletion src/input/trimesh.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Layer, Mesh, MeshError, Polygon, Vertex};
use glam::Vec2;
use std::cmp::Ordering;
use std::{default, iter};
use std::iter;

trait Triangle {
fn get_clockwise_neighbor(&self, index: usize) -> usize;
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub struct Path {
pub path: Vec<Vec2>,
}

/// Layer of a NavMesh
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Layer {
Expand All @@ -89,6 +90,7 @@ impl Default for Layer {
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Mesh {
/// Layers of the NavMesh
pub layers: Vec<Layer>,
delta: f32,
#[cfg(feature = "stats")]
Expand All @@ -107,6 +109,7 @@ impl Default for Mesh {
}

impl Mesh {
/// Create a new single layer NavMesh
pub fn new(vertices: Vec<Vertex>, polygons: Vec<Polygon>) -> Result<Self, MeshError> {
let layer = Layer::new(vertices, polygons)?;
Ok(Mesh {
Expand Down

0 comments on commit 1e59e15

Please sign in to comment.