From c31aa3a708cafebe82f6b23f0f1dca1144ea8e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Thu, 8 Aug 2024 00:41:16 +0200 Subject: [PATCH] tests for features --- src/layers.rs | 3 +++ src/lib.rs | 2 +- src/stitching.rs | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/layers.rs b/src/layers.rs index e79e83f..259272f 100644 --- a/src/layers.rs +++ b/src/layers.rs @@ -4,6 +4,9 @@ use tracing::instrument; use bvh2d::bvh2d::BVH2d; use glam::{vec2, Vec2}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + use crate::{helpers::Vec2Helper, instance::EdgeSide, BoundedPolygon, MeshError, Polygon, Vertex}; /// Layer of a NavMesh diff --git a/src/lib.rs b/src/lib.rs index 901661f..5d41272 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -250,7 +250,7 @@ impl Mesh { "{};{};0;0;0;0;0;{}", self.scenarios.get(), start.elapsed().as_secs_f32() * 1_000_000.0, - from.distance(to), + from.pos.distance(to.pos), ); self.scenarios.set(self.scenarios.get() + 1); } diff --git a/src/stitching.rs b/src/stitching.rs index e84286a..7823e1a 100644 --- a/src/stitching.rs +++ b/src/stitching.rs @@ -688,7 +688,9 @@ mod tests { path, Path { length: 1.0, - path: vec![vec2(1.5, 0.5)] + path: vec![vec2(1.5, 0.5)], + #[cfg(feature = "detailed-layers")] + path_with_layers: vec![(vec2(1.0, 0.5), 1), (vec2(1.5, 0.5), 1)], } ) }