Fix test build
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
use crate::math::Real;
|
||||||
|
|
||||||
/// A color for debug-rendering.
|
/// A color for debug-rendering.
|
||||||
///
|
///
|
||||||
/// The default colors are provided in HSLA (Hue Saturation Lightness Alpha) format.
|
/// The default colors are provided in HSLA (Hue Saturation Lightness Alpha) format.
|
||||||
@@ -35,7 +37,7 @@ pub struct DebugRenderStyle {
|
|||||||
/// or non-dynamic for this multiplier to be applied).
|
/// or non-dynamic for this multiplier to be applied).
|
||||||
pub sleep_color_multiplier: [f32; 4],
|
pub sleep_color_multiplier: [f32; 4],
|
||||||
/// The length of the local coordinate axes rendered for a rigid-body.
|
/// The length of the local coordinate axes rendered for a rigid-body.
|
||||||
pub rigid_body_axes_length: f32,
|
pub rigid_body_axes_length: Real,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for DebugRenderStyle {
|
impl Default for DebugRenderStyle {
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ impl<'a> DebugRenderBackend for BevyLinesRenderBackend<'a> {
|
|||||||
#[cfg(feature = "dim2")]
|
#[cfg(feature = "dim2")]
|
||||||
fn draw_line(&mut self, _: DebugRenderObject, a: Point<Real>, b: Point<Real>, color: [f32; 4]) {
|
fn draw_line(&mut self, _: DebugRenderObject, a: Point<Real>, b: Point<Real>, color: [f32; 4]) {
|
||||||
self.lines.line_colored(
|
self.lines.line_colored(
|
||||||
[a.x, a.y, 1.0e-8].into(),
|
[a.x as f32, a.y as f32, 1.0e-8 as f32].into(),
|
||||||
[b.x, b.y, 1.0e-8].into(),
|
[b.x as f32, b.y as f32, 1.0e-8 as f32].into(),
|
||||||
0.0,
|
0.0,
|
||||||
Color::hsla(color[0], color[1], color[2], color[3]),
|
Color::hsla(color[0], color[1], color[2], color[3]),
|
||||||
)
|
)
|
||||||
@@ -48,8 +48,8 @@ impl<'a> DebugRenderBackend for BevyLinesRenderBackend<'a> {
|
|||||||
#[cfg(feature = "dim3")]
|
#[cfg(feature = "dim3")]
|
||||||
fn draw_line(&mut self, _: DebugRenderObject, a: Point<Real>, b: Point<Real>, color: [f32; 4]) {
|
fn draw_line(&mut self, _: DebugRenderObject, a: Point<Real>, b: Point<Real>, color: [f32; 4]) {
|
||||||
self.lines.line_colored(
|
self.lines.line_colored(
|
||||||
[a.x, a.y, a.z].into(),
|
[a.x as f32, a.y as f32, a.z as f32].into(),
|
||||||
[b.x, b.y, b.z].into(),
|
[b.x as f32, b.y as f32, b.z as f32].into(),
|
||||||
0.0,
|
0.0,
|
||||||
Color::hsla(color[0], color[1], color[2], color[3]),
|
Color::hsla(color[0], color[1], color[2], color[3]),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
#![allow(warnings)]
|
#![allow(warnings)]
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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::{
|
use bevy::{
|
||||||
asset::{Assets, HandleUntyped},
|
asset::{Assets, HandleUntyped},
|
||||||
pbr::{NotShadowCaster, NotShadowReceiver},
|
pbr::{NotShadowCaster, NotShadowReceiver},
|
||||||
@@ -64,7 +77,7 @@ pub(crate) struct DebugLinesConfig {
|
|||||||
///
|
///
|
||||||
/// # Usage
|
/// # Usage
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```.ignore
|
||||||
/// use bevy::prelude::*;
|
/// use bevy::prelude::*;
|
||||||
/// use bevy_prototype_debug_lines::*;
|
/// use bevy_prototype_debug_lines::*;
|
||||||
///
|
///
|
||||||
@@ -76,7 +89,7 @@ pub(crate) struct DebugLinesConfig {
|
|||||||
///
|
///
|
||||||
/// Alternatively, you can initialize the plugin with depth testing, so that
|
/// 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)`].
|
/// debug lines cut through geometry. To do this, use [`DebugLinesPlugin::with_depth_test(true)`].
|
||||||
/// ```
|
/// ```.ignore
|
||||||
/// use bevy::prelude::*;
|
/// use bevy::prelude::*;
|
||||||
/// use bevy_prototype_debug_lines::*;
|
/// use bevy_prototype_debug_lines::*;
|
||||||
///
|
///
|
||||||
@@ -233,7 +246,7 @@ pub(crate) struct RenderDebugLinesMesh;
|
|||||||
/// Bevy resource providing facilities to draw lines.
|
/// Bevy resource providing facilities to draw lines.
|
||||||
///
|
///
|
||||||
/// # Usage
|
/// # Usage
|
||||||
/// ```
|
/// ```.ignore
|
||||||
/// use bevy::prelude::*;
|
/// use bevy::prelude::*;
|
||||||
/// use bevy_prototype_debug_lines::*;
|
/// use bevy_prototype_debug_lines::*;
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user