diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-04-22 15:45:53 +0200 |
|---|---|---|
| committer | Sébastien Crozet <developer@crozet.re> | 2022-04-22 16:11:23 +0200 |
| commit | bc2ae4b512b8bc7a2b61dd24d9685289453681c5 (patch) | |
| tree | 576d950ee18b0a3a2e69a48db5fd2ba14f7bcd39 /src/pipeline/debug_render_pipeline/debug_render_style.rs | |
| parent | 21a31bc1026d17d30b3a5ac35e6bb716dc66be6e (diff) | |
| download | rapier-bc2ae4b512b8bc7a2b61dd24d9685289453681c5.tar.gz rapier-bc2ae4b512b8bc7a2b61dd24d9685289453681c5.tar.bz2 rapier-bc2ae4b512b8bc7a2b61dd24d9685289453681c5.zip | |
Add a basic lines-based debug-renderer
Diffstat (limited to 'src/pipeline/debug_render_pipeline/debug_render_style.rs')
| -rw-r--r-- | src/pipeline/debug_render_pipeline/debug_render_style.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/pipeline/debug_render_pipeline/debug_render_style.rs b/src/pipeline/debug_render_pipeline/debug_render_style.rs new file mode 100644 index 0000000..9d4b6cc --- /dev/null +++ b/src/pipeline/debug_render_pipeline/debug_render_style.rs @@ -0,0 +1,37 @@ +/// A color for debug-rendering. +/// +/// The default colors are provided in HSLA (Hue Saturation Lightness Alpha) format. +pub type DebugColor = [f32; 4]; + +#[derive(Clone, Debug, PartialEq)] +pub struct DebugRenderStyle { + pub subdivisions: u32, + pub collider_dynamic_color: DebugColor, + pub collider_fixed_color: DebugColor, + pub collider_kinematic_color: DebugColor, + pub collider_parentless_color: DebugColor, + pub impulse_joint_anchor_color: DebugColor, + pub impulse_joint_separation_color: DebugColor, + pub multibody_joint_anchor_color: DebugColor, + pub multibody_joint_separation_color: DebugColor, + pub sleep_color_multiplier: [f32; 4], + pub rigid_body_axes_length: f32, +} + +impl Default for DebugRenderStyle { + fn default() -> Self { + Self { + subdivisions: 20, + collider_dynamic_color: [340.0, 1.0, 0.3, 1.0], + collider_kinematic_color: [20.0, 1.0, 0.3, 1.0], + collider_fixed_color: [30.0, 1.0, 0.4, 1.0], + collider_parentless_color: [30.0, 1.0, 0.4, 1.0], + impulse_joint_anchor_color: [240.0, 0.5, 0.4, 1.0], + impulse_joint_separation_color: [0.0, 0.5, 0.4, 1.0], + multibody_joint_anchor_color: [300.0, 1.0, 0.4, 1.0], + multibody_joint_separation_color: [0.0, 1.0, 0.4, 1.0], + sleep_color_multiplier: [1.0, 1.0, 0.2, 1.0], + rigid_body_axes_length: 0.5, + } + } +} |
