docs: Fix minor typos and tweaks (#696)
--------- Co-authored-by: Thierry Berger <contact@thierryberger.com>
This commit is contained in:
@@ -398,7 +398,7 @@ impl CCDSolver {
|
|||||||
|
|
||||||
let start_time = toi.toi;
|
let start_time = toi.toi;
|
||||||
|
|
||||||
// NOTE: the 1 and 2 indices (e.g., `ch1`, `ch2`) bellow are unrelated to the
|
// NOTE: the 1 and 2 indices (e.g., `ch1`, `ch2`) below are unrelated to the
|
||||||
// ones we used above.
|
// ones we used above.
|
||||||
for ch1 in &colliders_to_check {
|
for ch1 in &colliders_to_check {
|
||||||
let co1 = &colliders[*ch1];
|
let co1 = &colliders[*ch1];
|
||||||
|
|||||||
@@ -1000,12 +1000,12 @@ impl RigidBodyDominance {
|
|||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
pub struct RigidBodyActivation {
|
pub struct RigidBodyActivation {
|
||||||
/// The threshold linear velocity bellow which the body can fall asleep.
|
/// The threshold linear velocity below which the body can fall asleep.
|
||||||
///
|
///
|
||||||
/// The value is "normalized", i.e., the actual threshold applied by the physics engine
|
/// The value is "normalized", i.e., the actual threshold applied by the physics engine
|
||||||
/// is equal to this value multiplied by [`IntegrationParameters::length_unit`].
|
/// is equal to this value multiplied by [`IntegrationParameters::length_unit`].
|
||||||
pub normalized_linear_threshold: Real,
|
pub normalized_linear_threshold: Real,
|
||||||
/// The angular linear velocity bellow which the body can fall asleep.
|
/// The angular linear velocity below which the body can fall asleep.
|
||||||
pub angular_threshold: Real,
|
pub angular_threshold: Real,
|
||||||
/// The amount of time the rigid-body must remain below the thresholds to be put to sleep.
|
/// The amount of time the rigid-body must remain below the thresholds to be put to sleep.
|
||||||
pub time_until_sleep: Real,
|
pub time_until_sleep: Real,
|
||||||
@@ -1022,17 +1022,17 @@ impl Default for RigidBodyActivation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RigidBodyActivation {
|
impl RigidBodyActivation {
|
||||||
/// The default linear velocity bellow which a body can be put to sleep.
|
/// The default linear velocity below which a body can be put to sleep.
|
||||||
pub fn default_normalized_linear_threshold() -> Real {
|
pub fn default_normalized_linear_threshold() -> Real {
|
||||||
0.4
|
0.4
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The default angular velocity bellow which a body can be put to sleep.
|
/// The default angular velocity below which a body can be put to sleep.
|
||||||
pub fn default_angular_threshold() -> Real {
|
pub fn default_angular_threshold() -> Real {
|
||||||
0.5
|
0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The amount of time the rigid-body must remain bellow it’s linear and angular velocity
|
/// The amount of time the rigid-body must remain below it’s linear and angular velocity
|
||||||
/// threshold before falling to sleep.
|
/// threshold before falling to sleep.
|
||||||
pub fn default_time_until_sleep() -> Real {
|
pub fn default_time_until_sleep() -> Real {
|
||||||
2.0
|
2.0
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ pub(crate) fn region_width(depth: i8) -> Real {
|
|||||||
(REGION_WIDTH_BASE * REGION_WIDTH_POWER_BASIS.powi(depth as i32)).min(MAX_AABB_EXTENT)
|
(REGION_WIDTH_BASE * REGION_WIDTH_POWER_BASIS.powi(depth as i32)).min(MAX_AABB_EXTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the depth of the layer the given Aabb should be part of.
|
/// Computes the depth of the layer the given [`Aabb`] should be part of.
|
||||||
///
|
///
|
||||||
/// The idea here is that an Aabb should be part of a layer which has
|
/// The idea here is that an [`Aabb`] should be part of a layer which has
|
||||||
/// regions large enough so that one Aabb doesn't crosses too many
|
/// regions large enough so that one [`Aabb`] doesn't crosses too many
|
||||||
/// regions. But the regions must also not be too large, otherwise
|
/// regions. But the regions must also not be too large, otherwise
|
||||||
/// we are loosing the benefits of Multi-SAP.
|
/// we are loosing the benefits of Multi-SAP.
|
||||||
///
|
///
|
||||||
/// If the code bellow, we select a layer such that each region can
|
/// If the code below, we select a layer such that each region can
|
||||||
/// contain at least a chain of 10 contiguous objects with that Aabb.
|
/// contain at least a chain of 10 contiguous objects with that [`Aabb`].
|
||||||
pub(crate) fn layer_containing_aabb(aabb: &Aabb) -> i8 {
|
pub(crate) fn layer_containing_aabb(aabb: &Aabb) -> i8 {
|
||||||
// Max number of elements of this size we would like one region to be able to contain.
|
// Max number of elements of this size we would like one region to be able to contain.
|
||||||
const NUM_ELEMENTS_PER_DIMENSION: Real = 10.0;
|
const NUM_ELEMENTS_PER_DIMENSION: Real = 10.0;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ pub trait DebugRenderBackend {
|
|||||||
color: [f32; 4],
|
color: [f32; 4],
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Draws a set of line.
|
/// Draws a set of lines.
|
||||||
fn draw_polyline(
|
fn draw_polyline(
|
||||||
&mut self,
|
&mut self,
|
||||||
object: DebugRenderObject,
|
object: DebugRenderObject,
|
||||||
@@ -63,7 +63,7 @@ pub trait DebugRenderBackend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws a chain of line.
|
/// Draws a chain of lines.
|
||||||
fn draw_line_strip(
|
fn draw_line_strip(
|
||||||
&mut self,
|
&mut self,
|
||||||
object: DebugRenderObject,
|
object: DebugRenderObject,
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ pub type DebugColor = [f32; 4];
|
|||||||
/// Style used for computing colors when rendering the scene.
|
/// Style used for computing colors when rendering the scene.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
pub struct DebugRenderStyle {
|
pub struct DebugRenderStyle {
|
||||||
/// The number of subdivision used to approximate the curved
|
/// The number of subdivisions used to approximate the curved
|
||||||
/// parts of a shape with smooth faces.
|
/// parts of a shape with smooth faces.
|
||||||
pub subdivisions: u32,
|
pub subdivisions: u32,
|
||||||
/// The number of subdivision used to approimate the curved
|
/// The number of subdivisions used to approximate the curved
|
||||||
/// borders of round shapes.
|
/// borders of round shapes.
|
||||||
pub border_subdivisions: u32,
|
pub border_subdivisions: u32,
|
||||||
/// The color of colliders attached to dynamic rigid-bodies.
|
/// The color of colliders attached to dynamic rigid-bodies.
|
||||||
@@ -42,13 +42,13 @@ pub struct DebugRenderStyle {
|
|||||||
pub disabled_color_multiplier: [f32; 4],
|
pub disabled_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: Real,
|
pub rigid_body_axes_length: Real,
|
||||||
/// The collor for the segments joining the two contact points.
|
/// The color for the segments joining the two contact points.
|
||||||
pub contact_depth_color: DebugColor,
|
pub contact_depth_color: DebugColor,
|
||||||
/// The color of the contact normals.
|
/// The color of the contact normals.
|
||||||
pub contact_normal_color: DebugColor,
|
pub contact_normal_color: DebugColor,
|
||||||
/// The length of the contact normals.
|
/// The length of the contact normals.
|
||||||
pub contact_normal_length: Real,
|
pub contact_normal_length: Real,
|
||||||
/// The color of the colliders Aabbs.
|
/// The color of the colliders' [`Aabb`]s.
|
||||||
pub collider_aabb_color: DebugColor,
|
pub collider_aabb_color: DebugColor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ impl PhysicsPipeline {
|
|||||||
// integration of external forces.
|
// integration of external forces.
|
||||||
//
|
//
|
||||||
// If there is only one or zero CCD substep, there is no need
|
// If there is only one or zero CCD substep, there is no need
|
||||||
// to split the timetsep interval. So we can just skip this part.
|
// to split the timestep interval. So we can just skip this part.
|
||||||
if ccd_is_enabled && remaining_substeps > 1 {
|
if ccd_is_enabled && remaining_substeps > 1 {
|
||||||
// NOTE: Take forces into account when updating the bodies CCD activation flags
|
// NOTE: Take forces into account when updating the bodies CCD activation flags
|
||||||
// these forces have not been integrated to the body's velocity yet.
|
// these forces have not been integrated to the body's velocity yet.
|
||||||
@@ -725,7 +725,7 @@ mod test {
|
|||||||
|
|
||||||
// Check that removing the body right after inserting it works.
|
// Check that removing the body right after inserting it works.
|
||||||
// We add two dynamic bodies, one kinematic body and one fixed body before removing
|
// We add two dynamic bodies, one kinematic body and one fixed body before removing
|
||||||
// them. This include a non-regression test where deleting a kimenatic body crashes.
|
// them. This include a non-regression test where deleting a kinematic body crashes.
|
||||||
let rb = RigidBodyBuilder::dynamic().build();
|
let rb = RigidBodyBuilder::dynamic().build();
|
||||||
let h1 = bodies.insert(rb.clone());
|
let h1 = bodies.insert(rb.clone());
|
||||||
let h2 = bodies.insert(rb.clone());
|
let h2 = bodies.insert(rb.clone());
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ impl QueryPipeline {
|
|||||||
self.qbvh.clear_and_rebuild(mode, self.dilation_factor);
|
self.qbvh.clear_and_rebuild(mode, self.dilation_factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find the closest intersection between a ray and a set of collider.
|
/// Find the closest intersection between a ray and a set of colliders.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `colliders` - The set of colliders taking part in this pipeline.
|
/// * `colliders` - The set of colliders taking part in this pipeline.
|
||||||
@@ -384,7 +384,7 @@ impl QueryPipeline {
|
|||||||
self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1)
|
self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find the closest intersection between a ray and a set of collider.
|
/// Find the closest intersection between a ray and a set of colliders.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `colliders` - The set of colliders taking part in this pipeline.
|
/// * `colliders` - The set of colliders taking part in this pipeline.
|
||||||
@@ -415,7 +415,7 @@ impl QueryPipeline {
|
|||||||
self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1)
|
self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find the all intersections between a ray and a set of collider and passes them to a callback.
|
/// Find the all intersections between a ray and a set of colliders and passes them to a callback.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `colliders` - The set of colliders taking part in this pipeline.
|
/// * `colliders` - The set of colliders taking part in this pipeline.
|
||||||
@@ -577,7 +577,7 @@ impl QueryPipeline {
|
|||||||
.map(|h| (h.1 .1 .0, h.1 .0, h.1 .1 .1))
|
.map(|h| (h.1 .1 .0, h.1 .0, h.1 .1 .1))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds all handles of all the colliders with an Aabb intersecting the given Aabb.
|
/// Finds all handles of all the colliders with an [`Aabb`] intersecting the given [`Aabb`].
|
||||||
pub fn colliders_with_aabb_intersecting_aabb(
|
pub fn colliders_with_aabb_intersecting_aabb(
|
||||||
&self,
|
&self,
|
||||||
aabb: &Aabb,
|
aabb: &Aabb,
|
||||||
|
|||||||
Reference in New Issue
Block a user