From 1d31e14ad96b697d711aead25a6115879ee78895 Mon Sep 17 00:00:00 2001 From: Aevyrie Roessler Date: Sun, 29 Jan 2023 01:10:49 -0800 Subject: [PATCH] make polyline optional --- Cargo.toml | 6 +++++- src/lib.rs | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 96365aa..4433ae8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" [dependencies] bevy = { version = "0.9", default_features = false } -bevy_polyline = "0.4" +bevy_polyline = { version = "0.4", optional = true } [dev-dependencies] bevy = { version = "0.9", default_features = false, features = [ @@ -17,3 +17,7 @@ bevy = { version = "0.9", default_features = false, features = [ "bevy_winit", "x11", ] } + +[features] +default = ["debug"] +debug = ["bevy_polyline"] diff --git a/src/lib.rs b/src/lib.rs index 0cf29ab..01ffd42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,9 +90,11 @@ use bevy::{math::DVec3, prelude::*, transform::TransformSystem}; use std::marker::PhantomData; pub mod camera; -pub mod debug; pub mod precision; +#[cfg(feature = "debug")] +pub mod debug; + use precision::*; /// Add this plugin to your [`App`] to for floating origin functionality. @@ -264,7 +266,7 @@ pub struct FloatingSpatialBundle { pub grid_position: GridCell

, } -/// Defines the grid cell this entity's [`Transform`] is relative to. +/// Defines the grid cell this entity's `Transform` is relative to. /// /// This component is generic over a few integer types to allow you to select the grid size you /// need. These correspond to a total usable volume of a cube with the following edge lengths: @@ -272,7 +274,7 @@ pub struct FloatingSpatialBundle { /// **Assuming you are using a grid cell edge length of 10,000 meters, and `1.0` == 1 meter** /// /// - i8: 2,560 km = 74% of the diameter of the Moon -/// - i16 655,350 km = 85% of the diameter of the Moon's orbit around Earth +/// - i16: 655,350 km = 85% of the diameter of the Moon's orbit around Earth /// - i32: 0.0045 light years = ~4 times the width of the solar system /// - i64: 19.5 million light years = ~100 times the width of the milky way galaxy /// - i128: 3.6e+26 light years = ~3.9e+15 times the width of the observable universe