diff --git a/CHANGELOG.md b/CHANGELOG.md index 918c0dc6c..8fd84ceb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Make `Wheel::friction_slip` public to customize the front friction applied to the vehicle controller’s wheels. - Add the `DebugRenderBackend::filter_object` predicate that can be implemented to apply custom filtering rules on the objects being rendered. +- Switch the testbed to `bevy 0.11` and use its new Gizmos API for rendering lines. ## v0.17.2 (26 Feb. 2023) ### Fix diff --git a/crates/rapier_testbed2d-f64/Cargo.toml b/crates/rapier_testbed2d-f64/Cargo.toml index 85a0a8278..23bac9fae 100644 --- a/crates/rapier_testbed2d-f64/Cargo.toml +++ b/crates/rapier_testbed2d-f64/Cargo.toml @@ -40,21 +40,24 @@ bincode = "1" Inflector = "0.11" md5 = "0.7" -bevy_egui = "0.18" -bevy_ecs = "0.9" +bevy_egui = "0.22" +bevy_ecs = "0.11" +bevy_core_pipeline = "0.11" +bevy_pbr = "0.11" +bevy_sprite = "0.11" #bevy_prototype_debug_lines = "0.7" # Dependencies for native only. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_asset", "bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_asset", "bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} #bevy_webgl2 = "0.5" [dependencies.rapier] package = "rapier2d-f64" path = "../rapier2d-f64" -version = "0.17.0" +version = "0.17.2" features = [ "serde-serialize", "debug-render", "profiler" ] diff --git a/crates/rapier_testbed2d/Cargo.toml b/crates/rapier_testbed2d/Cargo.toml index 776edaeaa..97fc6de3b 100644 --- a/crates/rapier_testbed2d/Cargo.toml +++ b/crates/rapier_testbed2d/Cargo.toml @@ -40,21 +40,24 @@ bincode = "1" Inflector = "0.11" md5 = "0.7" -bevy_egui = "0.18" -bevy_ecs = "0.9" +bevy_egui = "0.22" +bevy_ecs = "0.11" +bevy_core_pipeline = "0.11" +bevy_pbr = "0.11" +bevy_sprite = "0.11" #bevy_prototype_debug_lines = "0.7" # Dependencies for native only. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_sprite", "bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_sprite", "bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} #bevy_webgl2 = "0.5" [dependencies.rapier] package = "rapier2d" path = "../rapier2d" -version = "0.17.0" +version = "0.17.2" features = [ "serde-serialize", "debug-render", "profiler" ] diff --git a/crates/rapier_testbed3d-f64/Cargo.toml b/crates/rapier_testbed3d-f64/Cargo.toml index 17b29b481..40ae54fe2 100644 --- a/crates/rapier_testbed3d-f64/Cargo.toml +++ b/crates/rapier_testbed3d-f64/Cargo.toml @@ -39,21 +39,24 @@ md5 = "0.7" Inflector = "0.11" serde = { version = "1", features = [ "derive" ] } -bevy_egui = "0.18" -bevy_ecs = "0.9" +bevy_egui = "0.22" +bevy_ecs = "0.11" +bevy_core_pipeline = "0.11" +bevy_pbr = "0.11" +bevy_sprite = "0.11" #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } # Dependencies for native only. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} #bevy_webgl2 = "0.5" [dependencies.rapier] package = "rapier3d-f64" path = "../rapier3d-f64" -version = "0.17.0" +version = "0.17.2" features = [ "serde-serialize", "debug-render", "profiler" ] diff --git a/crates/rapier_testbed3d/Cargo.toml b/crates/rapier_testbed3d/Cargo.toml index 1f1005f19..fc52bc328 100644 --- a/crates/rapier_testbed3d/Cargo.toml +++ b/crates/rapier_testbed3d/Cargo.toml @@ -33,31 +33,34 @@ rand = "0.8" rand_pcg = "0.3" instant = { version = "0.1", features = [ "web-sys", "now" ]} bitflags = "1" -glam = { version = "0.20", optional = true } # For Physx +glam = { version = "0.24", optional = true } # For Physx num_cpus = { version = "1", optional = true } -physx = { version = "0.16", features = [ "glam" ], optional = true } -physx-sys = { version = "0.8", optional = true } +physx = { version = "0.19", features = [ "glam" ], optional = true } +physx-sys = { version = "0.11", optional = true } crossbeam = "0.8" bincode = "1" md5 = "0.7" Inflector = "0.11" serde = { version = "1", features = [ "derive" ] } -bevy_egui = "0.18" -bevy_ecs = "0.9" +bevy_egui = "0.22" +bevy_ecs = "0.11" +bevy_core_pipeline = "0.11" +bevy_pbr = "0.11" +bevy_sprite = "0.11" #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } # Dependencies for native only. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render", "x11"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_winit", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_winit", "render"]} +bevy = {version = "0.11", default-features = false, features = ["bevy_winit", "tonemapping_luts", "ktx2", "zstd", "bevy_render", "bevy_pbr", "bevy_gizmos"]} #bevy_webgl2 = "0.5" [dependencies.rapier] package = "rapier3d" path = "../rapier3d" -version = "0.17.0" +version = "0.17.2" features = [ "serde-serialize", "debug-render", "profiler" ] diff --git a/examples3d-f64/Cargo.toml b/examples3d-f64/Cargo.toml index 27a4491b3..45ffbd239 100644 --- a/examples3d-f64/Cargo.toml +++ b/examples3d-f64/Cargo.toml @@ -16,7 +16,7 @@ rand = "0.8" getrandom = { version = "0.2", features = [ "js" ] } Inflector = "0.11" wasm-bindgen = "0.2" -obj-rs = { version = "0.6", default-features = false } +obj-rs = { version = "0.7", default-features = false } bincode = "1" serde = "1" diff --git a/examples3d/Cargo.toml b/examples3d/Cargo.toml index c50dc9576..1e44b3d56 100644 --- a/examples3d/Cargo.toml +++ b/examples3d/Cargo.toml @@ -17,7 +17,7 @@ rand = "0.8" getrandom = { version = "0.2", features = [ "js" ] } Inflector = "0.11" wasm-bindgen = "0.2" -obj-rs = { version = "0.6", default-features = false } +obj-rs = { version = "0.7", default-features = false } serde = "1" bincode = "1" diff --git a/src_testbed/camera2d.rs b/src_testbed/camera2d.rs index ddac1ed30..2f4de6796 100644 --- a/src_testbed/camera2d.rs +++ b/src_testbed/camera2d.rs @@ -87,8 +87,8 @@ impl OrbitCameraPlugin { } impl Plugin for OrbitCameraPlugin { fn build(&self, app: &mut App) { - app.add_system(Self::mouse_motion_system) - .add_system(Self::zoom_system) - .add_system(Self::update_transform_system); + app.add_systems(Update, Self::mouse_motion_system) + .add_systems(Update, Self::zoom_system) + .add_systems(Update, Self::update_transform_system); } } diff --git a/src_testbed/camera3d.rs b/src_testbed/camera3d.rs index 12ee50835..7621c5053 100644 --- a/src_testbed/camera3d.rs +++ b/src_testbed/camera3d.rs @@ -113,8 +113,8 @@ impl OrbitCameraPlugin { } impl Plugin for OrbitCameraPlugin { fn build(&self, app: &mut App) { - app.add_system(Self::mouse_motion_system) - .add_system(Self::zoom_system) - .add_system(Self::update_transform_system); + app.add_systems(Update, Self::mouse_motion_system) + .add_systems(Update, Self::zoom_system) + .add_systems(Update, Self::update_transform_system); } } diff --git a/src_testbed/debug_render.rs b/src_testbed/debug_render.rs index 928b8ba3f..463386539 100644 --- a/src_testbed/debug_render.rs +++ b/src_testbed/debug_render.rs @@ -1,5 +1,5 @@ use crate::harness::Harness; -use crate::lines::DebugLines; +use bevy::gizmos::gizmos::Gizmos; use bevy::prelude::*; use rapier::math::{Point, Real}; use rapier::pipeline::{ @@ -7,70 +7,64 @@ use rapier::pipeline::{ }; #[derive(Resource)] -pub struct DebugRenderPipelineResource(pub DebugRenderPipeline); - -pub struct RapierDebugRenderPlugin { - depth_test: bool, +pub struct DebugRenderPipelineResource { + pub pipeline: DebugRenderPipeline, + pub enabled: bool, } -impl Default for RapierDebugRenderPlugin { - fn default() -> Self { - Self { - depth_test: cfg!(feature = "dim3"), - } - } -} +#[derive(Default)] +pub struct RapierDebugRenderPlugin {} impl Plugin for RapierDebugRenderPlugin { fn build(&self, app: &mut App) { - app.add_plugin(crate::lines::DebugLinesPlugin::with_depth_test( - self.depth_test, - )) - .insert_resource(DebugRenderPipelineResource(DebugRenderPipeline::new( - Default::default(), - !DebugRenderMode::RIGID_BODY_AXES & !DebugRenderMode::COLLIDER_AABBS, - ))) - .add_system_to_stage(CoreStage::Update, debug_render_scene); + app.insert_resource(DebugRenderPipelineResource { + pipeline: DebugRenderPipeline::new( + Default::default(), + !DebugRenderMode::RIGID_BODY_AXES & !DebugRenderMode::COLLIDER_AABBS, + ), + enabled: false, + }) + .add_systems(Update, debug_render_scene); } } struct BevyLinesRenderBackend<'a> { - lines: &'a mut DebugLines, + gizmos: Gizmos<'a>, } impl<'a> DebugRenderBackend for BevyLinesRenderBackend<'a> { #[cfg(feature = "dim2")] fn draw_line(&mut self, _: DebugRenderObject, a: Point, b: Point, color: [f32; 4]) { - self.lines.line_colored( + self.gizmos.line( [a.x as f32, a.y as f32, 1.0e-8 as f32].into(), [b.x as f32, b.y as f32, 1.0e-8 as f32].into(), - 0.0, Color::hsla(color[0], color[1], color[2], color[3]), ) } #[cfg(feature = "dim3")] fn draw_line(&mut self, _: DebugRenderObject, a: Point, b: Point, color: [f32; 4]) { - self.lines.line_colored( + self.gizmos.line( [a.x as f32, a.y as f32, a.z as f32].into(), [b.x as f32, b.y as f32, b.z as f32].into(), - 0.0, Color::hsla(color[0], color[1], color[2], color[3]), ) } } fn debug_render_scene( - mut pipeline: ResMut, + mut debug_render: ResMut, harness: NonSend, - mut lines: ResMut, + gizmos: Gizmos, ) { - let mut backend = BevyLinesRenderBackend { lines: &mut *lines }; - pipeline.0.render( - &mut backend, - &harness.physics.bodies, - &harness.physics.colliders, - &harness.physics.impulse_joints, - &harness.physics.multibody_joints, - &harness.physics.narrow_phase, - ); + if debug_render.enabled { + let mut backend = BevyLinesRenderBackend { gizmos }; + debug_render.pipeline.render( + &mut backend, + &harness.physics.bodies, + &harness.physics.colliders, + &harness.physics.impulse_joints, + &harness.physics.multibody_joints, + &harness.physics.narrow_phase, + ); + } } diff --git a/src_testbed/lib.rs b/src_testbed/lib.rs index 3c8745367..46364cbb3 100644 --- a/src_testbed/lib.rs +++ b/src_testbed/lib.rs @@ -22,7 +22,6 @@ mod camera3d; mod debug_render; mod graphics; pub mod harness; -mod lines; pub mod objects; pub mod physics; #[cfg(all(feature = "dim3", feature = "other-backends"))] diff --git a/src_testbed/lines/debuglines.wgsl b/src_testbed/lines/debuglines.wgsl deleted file mode 100644 index 364d9ac2b..000000000 --- a/src_testbed/lines/debuglines.wgsl +++ /dev/null @@ -1,53 +0,0 @@ -// This should work, but it's bugged right now so we have to use 2 shaders: https://github.com/bevyengine/bevy/issues/4011 -#ifdef LINES_3D - #import bevy_pbr::mesh_view_bind_group - //#import bevy_pbr::mesh_struct -#else - //#import bevy_sprite::mesh2d_view_bind_group -#endif - -struct Vertex { - [[location(0)]] pos: vec3; - [[location(1)]] color: u32; -}; - -struct VertexOutput { - [[builtin(position)]] clip_position: vec4; - [[location(0)]] color: vec4; -}; - -struct FragmentOutput { - [[builtin(frag_depth)]] depth: f32; - [[location(0)]] color: vec4; -}; - -[[stage(vertex)]] -fn vertex(vertex: Vertex) -> VertexOutput { - var out: VertexOutput; - out.clip_position = view.view_proj * vec4(vertex.pos, 1.0); - // https://github.com/bevyengine/bevy/blob/328c26d02c50de0bc77f0d24a376f43ba89517b1/examples/2d/mesh2d_manual.rs#L234 - // ... except the above doesn't seem to work in 3d. Not sure what's going on there. - var r = f32(vertex.color & 255u) / 255.0; - var g = f32(vertex.color >> 8u & 255u) / 255.0; - var b = f32(vertex.color >> 16u & 255u) / 255.0; - var a = f32(vertex.color >> 24u & 255u) / 255.0; - out.color = vec4(r, g, b, a); - - return out; -} - -[[stage(fragment)]] -fn fragment(in: VertexOutput) -> FragmentOutput { - var out: FragmentOutput; - -// This should be #ifdef DEPTH_TEST_ENABLED && LINES_3D, but the -// preprocessor doesn't support that yet. -// Luckily, DEPTH_TEST_ENABLED isn't set in 2d anyway. -#ifdef DEPTH_TEST_ENABLED - out.depth = in.clip_position.z; -#else - out.depth = 1.0; -#endif - out.color = in.color; - return out; -} diff --git a/src_testbed/lines/debuglines2d.wgsl b/src_testbed/lines/debuglines2d.wgsl deleted file mode 100644 index b722d8a0b..000000000 --- a/src_testbed/lines/debuglines2d.wgsl +++ /dev/null @@ -1,32 +0,0 @@ -#import bevy_sprite::mesh2d_view_bind_group -[[group(0), binding(0)]] -var view: View; - -struct Vertex { - //[[location(0)]] color: vec4; - [[location(0)]] place: vec3; - [[location(1)]] color: u32; -}; - -struct VertexOutput { - [[builtin(position)]] clip_position: vec4; - [[location(0)]] color: vec4; -}; - -[[stage(vertex)]] -fn vertex(vertex: Vertex) -> VertexOutput { - var out: VertexOutput; - out.clip_position = view.view_proj * vec4(vertex.place, 1.0); - var r = f32(vertex.color & 255u) / 255.0; - var g = f32(vertex.color >> 8u & 255u) / 255.0; - var b = f32(vertex.color >> 16u & 255u) / 255.0; - var a = f32(vertex.color >> 24u & 255u) / 255.0; - out.color = vec4(r, g, b, a); - - return out; -} - -[[stage(fragment)]] -fn fragment(in: VertexOutput) -> [[location(0)]] vec4 { - return in.color; -} diff --git a/src_testbed/lines/mod.rs b/src_testbed/lines/mod.rs deleted file mode 100644 index 60d809819..000000000 --- a/src_testbed/lines/mod.rs +++ /dev/null @@ -1,381 +0,0 @@ -#![allow(warnings)] -use bevy::render::mesh::MeshVertexAttribute; -use bevy::render::render_resource::VertexFormat; -use bevy::render::view::NoFrustumCulling; -use bevy::render::MainWorld; -/** - * - * NOTE: this module and its submodules are only temporary. It is a copy-paste of the bevy-debug-lines - * crate: https://github.com/Toqozz/bevy_debug_lines (MIT license) - * It has been partially updated to work with bevy 0.7, but hasn’t been released yet. - * So, in the mean time, we are keeping a version here that we will replace by the - * upstream dependency once: - * 1. The version compatible with bevy 0.7 is released to crates.io. - * 2. We find a way to make the 2D version work with our examples. The problem - * only happens when running our own examples because cargo’s unification of - * features will enable the `3d` feature of `bevy_debug_lines` when running - * a `2d` example. - * - */ -use bevy::{ - asset::{Assets, HandleUntyped}, - pbr::{NotShadowCaster, NotShadowReceiver}, - prelude::*, - reflect::TypeUuid, - render::{ - mesh::{/*Indices,*/ Mesh, VertexAttributeValues}, - render_phase::AddRenderCommand, - render_resource::PrimitiveTopology, - render_resource::Shader, - }, -}; - -mod render_dim; - -// This module exists to "isolate" the `#[cfg]` attributes to this part of the -// code. Otherwise, we would pollute the code with a lot of feature -// gates-specific code. -#[cfg(feature = "dim3")] -mod dim { - pub(crate) use super::render_dim::r3d::{queue, DebugLinePipeline, DrawDebugLines}; - pub(crate) use bevy::core_pipeline::core_3d::Opaque3d as Phase; - use bevy::{asset::Handle, render::mesh::Mesh}; - - pub(crate) type MeshHandle = Handle; - pub(crate) fn from_handle(from: &MeshHandle) -> &Handle { - from - } - pub(crate) fn into_handle(from: Handle) -> MeshHandle { - from - } - pub(crate) const SHADER_FILE: &str = include_str!("debuglines.wgsl"); - pub(crate) const DIMMENSION: &str = "3d"; -} -#[cfg(feature = "dim2")] -mod dim { - pub(crate) use super::render_dim::r2d::{queue, DebugLinePipeline, DrawDebugLines}; - pub(crate) use bevy::core_pipeline::core_2d::Transparent2d as Phase; - use bevy::{asset::Handle, render::mesh::Mesh, sprite::Mesh2dHandle}; - - pub(crate) type MeshHandle = Mesh2dHandle; - pub(crate) fn from_handle(from: &MeshHandle) -> &Handle { - &from.0 - } - pub(crate) fn into_handle(from: Handle) -> MeshHandle { - Mesh2dHandle(from) - } - pub(crate) const SHADER_FILE: &str = include_str!("debuglines2d.wgsl"); - pub(crate) const DIMMENSION: &str = "2d"; -} - -// See debuglines.wgsl for explanation on 2 shaders. -//pub(crate) const SHADER_FILE: &str = include_str!("debuglines.wgsl"); -pub(crate) const DEBUG_LINES_SHADER_HANDLE: HandleUntyped = - HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 17477439189930443325); - -#[derive(Resource)] -pub(crate) struct DebugLinesConfig { - depth_test: bool, -} - -/// Bevy plugin, for initializing stuff. -/// -/// # Usage -/// -/// ```.ignore -/// use bevy::prelude::*; -/// use bevy_prototype_debug_lines::*; -/// -/// App::new() -/// .add_plugins(DefaultPlugins) -/// .add_plugin(DebugLinesPlugin::default()) -/// .run(); -/// ``` -/// -/// Alternatively, you can initialize the plugin with depth testing, so that -/// debug lines cut through geometry. To do this, use [`DebugLinesPlugin::with_depth_test(true)`]. -/// ```.ignore -/// use bevy::prelude::*; -/// use bevy_prototype_debug_lines::*; -/// -/// App::new() -/// .add_plugins(DefaultPlugins) -/// .add_plugin(DebugLinesPlugin::with_depth_test(true)) -/// .run(); -/// ``` -#[derive(Debug, Default, Clone)] -pub struct DebugLinesPlugin { - depth_test: bool, -} - -impl DebugLinesPlugin { - /// Controls whether debug lines should be drawn with depth testing enabled - /// or disabled. - /// - /// # Arguments - /// - /// * `val` - True if lines should intersect with other geometry, or false - /// if lines should always draw on top be drawn on top (the default). - pub fn with_depth_test(val: bool) -> Self { - Self { depth_test: val } - } -} - -impl Plugin for DebugLinesPlugin { - fn build(&self, app: &mut App) { - use bevy::render::{render_resource::SpecializedMeshPipelines, RenderApp, RenderStage}; - let mut shaders = app.world.get_resource_mut::>().unwrap(); - shaders.set_untracked( - DEBUG_LINES_SHADER_HANDLE, - Shader::from_wgsl(dim::SHADER_FILE), - ); - app.init_resource::(); - app.add_startup_system(setup) - .add_system_to_stage(CoreStage::PostUpdate, update.label("draw_lines")); - app.sub_app_mut(RenderApp) - .add_render_command::() - .insert_resource(DebugLinesConfig { - depth_test: self.depth_test, - }) - .init_resource::() - .init_resource::>() - .add_system_to_stage(RenderStage::Extract, extract) - .add_system_to_stage(RenderStage::Queue, dim::queue); - - info!("Loaded {} debug lines plugin.", dim::DIMMENSION); - } -} - -// Number of meshes to separate line buffers into. -// We don't really do culling currently but this is a gateway to that. -const MESH_COUNT: usize = 4; -// Maximum number of points for each individual mesh. -const MAX_POINTS_PER_MESH: usize = 2_usize.pow(16); -const _MAX_LINES_PER_MESH: usize = MAX_POINTS_PER_MESH / 2; -/// Maximum number of points. -pub const MAX_POINTS: usize = MAX_POINTS_PER_MESH * MESH_COUNT; -/// Maximum number of unique lines to draw at once. -pub const MAX_LINES: usize = MAX_POINTS / 2; - -const ATTRIBUTE_COLOR: MeshVertexAttribute = - MeshVertexAttribute::new("Vertex_Color", 1, VertexFormat::Uint32); - -fn setup(mut cmds: Commands, mut meshes: ResMut>) { - // Spawn a bunch of meshes to use for lines. - for i in 0..MESH_COUNT { - // Create a new mesh with the number of vertices we need. - let mut mesh = Mesh::new(PrimitiveTopology::LineList); - mesh.insert_attribute( - Mesh::ATTRIBUTE_POSITION, - VertexAttributeValues::Float32x3(Vec::with_capacity(MAX_POINTS_PER_MESH)), - ); - mesh.insert_attribute( - ATTRIBUTE_COLOR, - VertexAttributeValues::Uint32(Vec::with_capacity(MAX_POINTS_PER_MESH)), - ); - // https://github.com/Toqozz/bevy_debug_lines/issues/16 - //mesh.set_indices(Some(Indices::U16(Vec::with_capacity(MAX_POINTS_PER_MESH)))); - - cmds.spawn_bundle(( - dim::into_handle(meshes.add(mesh)), - NotShadowCaster, - NotShadowReceiver, - NoFrustumCulling, - Transform::default(), - GlobalTransform::default(), - Visibility::default(), - ComputedVisibility::default(), - DebugLinesMesh(i), - )); - } -} - -fn update( - debug_line_meshes: Query<(&dim::MeshHandle, &DebugLinesMesh)>, - time: Res