Add comments for the debug-renderer

This commit is contained in:
Sébastien Crozet
2022-04-28 17:30:35 +02:00
parent 5063fa4203
commit 65824e74f3
8 changed files with 70 additions and 18 deletions

View File

@@ -3,19 +3,38 @@
/// The default colors are provided in HSLA (Hue Saturation Lightness Alpha) format.
pub type DebugColor = [f32; 4];
/// Style used for computing colors when rendering the scene.
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct DebugRenderStyle {
/// The number of subdivision used to approximate the curved
/// parts of a shape with smooth faces.
pub subdivisions: u32,
/// The number of subdivision used to approimate the curved
/// borders of round shapes.
pub border_subdivisions: u32,
/// The color of colliders attached to dynamic rigid-bodies.
pub collider_dynamic_color: DebugColor,
/// The color of colliders attached to fixed rigid-bodies.
pub collider_fixed_color: DebugColor,
/// The color of colliders attached to kinematic rigid-bodies.
pub collider_kinematic_color: DebugColor,
/// The color of colliders not attached to any rigid-body.
pub collider_parentless_color: DebugColor,
/// The color of the line between a rigid-bodys center-of-mass and the
/// anchors of its attached impulse joints.
pub impulse_joint_anchor_color: DebugColor,
/// The color of the line between the two anchors of an impulse joint.
pub impulse_joint_separation_color: DebugColor,
/// The color of the line between a rigid-bodys center-of-mass and the
/// anchors of its attached multibody joints.
pub multibody_joint_anchor_color: DebugColor,
/// The color of the line between the two anchors of a multibody joint.
pub multibody_joint_separation_color: DebugColor,
/// If a rigid-body is sleeping, its attached entities will have their colors
/// multiplied by this array. (For a joint, both attached rigid-bodies must be sleeping
/// or non-dynamic for this multiplier to be applied).
pub sleep_color_multiplier: [f32; 4],
/// The length of the local coordinate axes rendered for a rigid-body.
pub rigid_body_axes_length: f32,
}