Removed hardcoded values for DebugColor in various places (#774)

This commit is contained in:
legendofa
2025-01-13 09:09:21 +01:00
committed by GitHub
parent 4867586c8c
commit b0e72bb79d
4 changed files with 26 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ use bevy::gizmos::gizmos::Gizmos;
use bevy::prelude::*;
use rapier::math::{Point, Real};
use rapier::pipeline::{
DebugRenderBackend, DebugRenderMode, DebugRenderObject, DebugRenderPipeline,
DebugColor, DebugRenderBackend, DebugRenderMode, DebugRenderObject, DebugRenderPipeline,
};
#[derive(Resource)]
@@ -36,7 +36,13 @@ struct BevyLinesRenderBackend<'w, 's> {
impl<'w, 's> DebugRenderBackend for BevyLinesRenderBackend<'w, 's> {
#[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: DebugColor,
) {
self.gizmos.line(
[a.x as f32, a.y as f32, 1.0e-8].into(),
[b.x as f32, b.y as f32, 1.0e-8].into(),
@@ -44,7 +50,13 @@ impl<'w, 's> DebugRenderBackend for BevyLinesRenderBackend<'w, 's> {
)
}
#[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: DebugColor,
) {
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(),