Skip to content

Commit

Permalink
Reduce typo count. (#225)
Browse files Browse the repository at this point in the history
This changes one publicly visible field member as detailed in
the `CHANGELOG.md`.
  • Loading branch information
waywardmonkeys authored Jul 18, 2024
1 parent f305467 commit d227066
Show file tree
Hide file tree
Showing 28 changed files with 70 additions and 68 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Modified

- `TypedShape::Custom(u32)` is now `TypedShape::Custom(&dyn Shape)`.
- `AabbSetsInterferencesCollector::tolerence` is now spelled correctly as `tolerance`.
- `Real` is now exposed through a `use` statement,
so that an indirection is removed in documentation:
previous occurrences of `Real` now show `f32` or `f64`.
Expand Down Expand Up @@ -176,7 +177,7 @@ This version was yanked. See the release notes for 0.13.3 instead.
### Modified

- About `rkyv` support: most POD structs (`Aabb`, `Ball`, `Cuboid`, etc.) are now archived as themselves instead of
being archived as different types (for example `Aabb` is archived as `Aabb` itself istead of `ArchivedAabb`).
being archived as different types (for example `Aabb` is archived as `Aabb` itself instead of `ArchivedAabb`).

### Added

Expand Down Expand Up @@ -456,4 +457,4 @@ This version was yanked. See the release notes for 0.13.3 instead.
### Fixed

- Fix a bug causing making some ball/convex shape contact manifold computation
fail when they are penetrating deeply.
fail when they are penetrating deeply.
2 changes: 1 addition & 1 deletion crates/parry2d/tests/geometry/ray_cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn collinear_raycast_starting_above_segment() {
}

#[test]
fn perpendicular_raycast_starting_behind_sement() {
fn perpendicular_raycast_starting_behind_segment() {
let segment = Segment::new(Point2::new(0.0f32, -10.0), Point2::new(0.0, 10.0));
let ray = Ray::new(Point2::new(-1.0, 0.0), Vector2::new(1.0, 0.0));
assert!(segment.intersects_local_ray(&ray, std::f32::MAX));
Expand Down
8 changes: 4 additions & 4 deletions crates/parry3d/tests/geometry/trimesh_intersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn trimesh_plane_edge_intersection() {
assert!(matches!(result, IntersectResult::Intersect(_)));

if let IntersectResult::Intersect(line) = result {
// Need to check points individually since order is not garunteed
// Need to check points individually since order is not guaranteed
let vertices = line.vertices();
assert_eq!(vertices.len(), 3);
assert!(vertices.contains(&Point3::new(-1.5, -0.75, 0.5)));
Expand All @@ -52,7 +52,7 @@ fn trimesh_plane_vertex_intersection() {
assert!(matches!(result, IntersectResult::Intersect(_)));

if let IntersectResult::Intersect(line) = result {
// Need to check points individually since order is not garunteed
// Need to check points individually since order is not guaranteed
let vertices = line.vertices();
assert_eq!(vertices.len(), 3);
assert!(vertices.contains(&Point3::new(-2.0, -1.0, 0.0)));
Expand All @@ -70,7 +70,7 @@ fn trimesh_plane_mixed_intersection() {
assert!(matches!(result, IntersectResult::Intersect(_)));

if let IntersectResult::Intersect(line) = result {
// Need to check points individually since order is not garunteed
// Need to check points individually since order is not guaranteed
let vertices = line.vertices();
assert_eq!(vertices.len(), 4);
assert!(vertices.contains(&Point3::new(0.0, 2.0, 0.0)));
Expand All @@ -90,7 +90,7 @@ fn trimesh_plane_multi_intersection() {
assert!(matches!(result, IntersectResult::Intersect(_)));

if let IntersectResult::Intersect(line) = result {
// Need to check points individually since order is not garunteed
// Need to check points individually since order is not guaranteed
let vertices = line.vertices();
assert_eq!(vertices.len(), 6);

Expand Down
9 changes: 5 additions & 4 deletions src/bounding_volume/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ impl Aabb {
/// new smaller Aabbs.
///
/// # Return
/// This returns a pair where the first item are the new Aabbs and the the second item is
/// the sequance of cuts applied to `self` to obtain the new Aabbs. Each cut is performed
/// This returns a pair where the first item are the new Aabbs and the second item is
/// the sequence of cuts applied to `self` to obtain the new Aabbs. Each cut is performed
/// along one axis identified by `-1, -2, -3` for `-X, -Y, -Z` and `1, 2, 3` for `+X, +Y, +Z`, and
/// the plane’s bias.
/// The cuts are applied sequancially. For example, if `result.1[0]` contains `1`, then it means
///
/// The cuts are applied sequentially. For example, if `result.1[0]` contains `1`, then it means
/// that `result.0[0]` is equal to the piece of `self` lying in the negative half-space delimited
/// by the plane with outward normal `+X`. Then, the other piece of `self` generated by this cut
/// (i.e. the piece of `self` lying in the positive half-space delimited by the plane with outward
Expand Down Expand Up @@ -438,7 +439,7 @@ impl Aabb {

// NOTE: we construct the rotation matrix explicitly here instead
// of using `Rotation2::new()` because we will use similar
// formulaes on the interval methods.
// formulas on the interval methods.
let (sin, cos) = angle.sin_cos();
let rotmat = na::Matrix2::new(cos, -sin, sin, cos);

Expand Down
4 changes: 2 additions & 2 deletions src/partitioning/qbvh/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait QbvhDataSplitter<LeafData> {
/// along the split axis.
pub struct CenterDataSplitter {
/// If all the Aabb centers have the same coordinate values along the splitting axis
/// setting this to `true` will allow the spliter to split the Aabb set into two
/// setting this to `true` will allow the splitter to split the Aabb set into two
/// subsets arbitrarily.
pub enable_fallback_split: bool,
}
Expand Down Expand Up @@ -135,7 +135,7 @@ where
indices_workspace: &'idx mut Vec<usize>,
mut proxies: BuilderProxies<LeafData>,
) -> [&'idx mut [usize]; 4] {
// 1. Snap the spliting point to one fo the Aabb min/max,
// 1. Snap the splitting point to one of the Aabb min/max,
// such that at least one Aabb isn’t split along each dimension.
let mut split_pt = Point::from(Vector::repeat(-Real::MAX));
let mut split_pt_right = Point::from(Vector::repeat(Real::MAX));
Expand Down
6 changes: 3 additions & 3 deletions src/partitioning/qbvh/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<LeafData: IndexedData> Qbvh<LeafData> {
///
/// # Return
///
/// Returns `false` if the traversal exitted early, and `true` otherwise.
/// Returns `false` if the traversal exited early, and `true` otherwise.
pub fn traverse_depth_first(&self, visitor: &mut impl SimdVisitor<LeafData, SimdAabb>) -> bool {
self.traverse_depth_first_node(visitor, 0)
}
Expand All @@ -36,7 +36,7 @@ impl<LeafData: IndexedData> Qbvh<LeafData> {
///
/// # Return
///
/// Returns `false` if the traversal exitted early, and `true` otherwise.
/// Returns `false` if the traversal exited early, and `true` otherwise.
pub fn traverse_depth_first_node(
&self,
visitor: &mut impl SimdVisitor<LeafData, SimdAabb>,
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<LeafData: IndexedData> Qbvh<LeafData> {
///
/// # Return
///
/// Returns `false` if the traversal exitted early, and `true` otherwise.
/// Returns `false` if the traversal exited early, and `true` otherwise.
pub fn traverse_depth_first_with_context<Context: Clone>(
&self,
visitor: &mut impl SimdVisitorWithContext<LeafData, SimdAabb, Context>,
Expand Down
2 changes: 1 addition & 1 deletion src/query/epa/epa3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl EPA {
.map(|(p, _, _)| p)
}

/// Projects the origin on a shape unsing the EPA algorithm.
/// Projects the origin on a shape using the EPA algorithm.
///
/// The origin is assumed to be located inside of the shape.
/// Returns `None` if the EPA fails to converge or if `g1` and `g2` are not penetrating.
Expand Down
6 changes: 3 additions & 3 deletions src/query/gjk/gjk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ pub enum GJKResult {
Proximity(Unit<Vector<Real>>),
/// Result of the GJK algorithm when the origin is too far away from the polytope.
///
/// The returned vector is expressed in the local-space of the first geomety involved in the
/// The returned vector is expressed in the local-space of the first geometry involved in the
/// GJK execution.
NoIntersection(Unit<Vector<Real>>),
}

/// The absolute tolerence used by the GJK algorithm.
/// The absolute tolerance used by the GJK algorithm.
pub fn eps_tol() -> Real {
let _eps = crate::math::DEFAULT_EPSILON;
_eps * 10.0
Expand Down Expand Up @@ -342,7 +342,7 @@ where
// some castes.
// TODO: I feel like we should always return `Some` in
// this case, even with floating-point numbers. Though it
// has not been sufficinetly tested with floats yet to be sure.
// has not been sufficiently tested with floats yet to be sure.
if cfg!(feature = "improved_fixed_point_support") {
return Some((ltoi / ray_length, ldir));
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/query/gjk/voronoi_simplex2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ impl VoronoiSimplex {
self.prev_proj[i]
}

/// The i-th point of the simplex before the last call to `projet_origin_and_reduce`.
/// The i-th point of the simplex before the last call to `project_origin_and_reduce`.
pub fn prev_point(&self, i: usize) -> &CSOPoint {
assert!(i <= self.prev_dim, "Index out of bounds.");
&self.vertices[self.prev_vertices[i]]
}

/// Projets the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin.
/// Projects the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin.
///
/// Retruns the result of the projection or Point::origin() if the origin lies inside of the simplex.
/// The state of the samplex before projection is saved, and can be retrieved using the methods prefixed
/// Returns the result of the projection or Point::origin() if the origin lies inside of the simplex.
/// The state of the simplex before projection is saved, and can be retrieved using the methods prefixed
/// by `prev_`.
pub fn project_origin_and_reduce(&mut self) -> Point<Real> {
if self.dim == 0 {
Expand Down
8 changes: 4 additions & 4 deletions src/query/gjk/voronoi_simplex3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ impl VoronoiSimplex {
self.prev_proj[i]
}

/// The i-th point of the simplex before the last call to `projet_origin_and_reduce`.
/// The i-th point of the simplex before the last call to `project_origin_and_reduce`.
pub fn prev_point(&self, i: usize) -> &CSOPoint {
assert!(i <= self.prev_dim, "Index out of bounds.");
&self.vertices[self.prev_vertices[i]]
}

/// Projets the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin.
/// Projects the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin.
///
/// Retruns the result of the projection or Point::origin() if the origin lies inside of the simplex.
/// The state of the samplex before projection is saved, and can be retrieved using the methods prefixed
/// Returns the result of the projection or `Point::origin()` if the origin lies inside of the simplex.
/// The state of the simplex before projection is saved, and can be retrieved using the methods prefixed
/// by `prev_`.
pub fn project_origin_and_reduce(&mut self) -> Point<Real> {
if self.dim == 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ where
SM1: ?Sized + SupportMap,
SM2: ?Sized + SupportMap,
{
// Because we are doing non-linear CCD, we need an iterative methode here.
// Because we are doing non-linear CCD, we need an iterative method here.
// First we need to check if the `time_of_impact = start_time` is legitimate, i.e.,
// if tunnelling will happen if we don't clamp the motion.
//
Expand Down
2 changes: 1 addition & 1 deletion src/query/shape_cast/shape_cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl ShapeCastHit {
pub struct ShapeCastOptions {
/// The maximum time-of-impacts that can be computed.
///
/// Any impact ocurring after this time will be ignored.
/// Any impact occurring after this time will be ignored.
pub max_time_of_impact: Real,
/// The shapes will be considered as impacting as soon as their distance is smaller or
/// equal to this target distance. Must be positive or zero.
Expand Down
8 changes: 4 additions & 4 deletions src/query/visitors/aabb_sets_interferences_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct AabbSetsInterferencesCollector<'a, T: 'a> {
/// A tolerance applied to the interference tests.
///
/// Aabb pairs closer than `tolerance` will be reported as intersecting.
pub tolerence: Real,
pub tolerance: Real,
/// The data contained by the nodes with bounding volumes intersecting `self.bv`.
pub collector: &'a mut Vec<(T, T)>,
}
Expand All @@ -20,13 +20,13 @@ impl<'a, T> AabbSetsInterferencesCollector<'a, T> {
/// Creates a new `AabbSetsInterferencesCollector`.
#[inline]
pub fn new(
tolerence: Real,
tolerance: Real,
ls_m2: &'a Isometry<Real>,
ls_m2_abs_rot: &'a Matrix<Real>,
collector: &'a mut Vec<(T, T)>,
) -> AabbSetsInterferencesCollector<'a, T> {
AabbSetsInterferencesCollector {
tolerence,
tolerance,
ls_m2,
ls_m2_abs_rot,
collector,
Expand All @@ -45,7 +45,7 @@ impl<'a, T> AabbSetsInterferencesCollector<'a, T> {
// ) -> VisitStatus {
// let ls_right_bv = Aabb::from_half_extents(
// self.ls_m2 * right_bv.center(),
// self.ls_m2_abs_rot * right_bv.half_extents() + Vector::repeat(self.tolerence),
// self.ls_m2_abs_rot * right_bv.half_extents() + Vector::repeat(self.tolerance),
// );
//
// if left_bv.intersects(&ls_right_bv) {
Expand Down
4 changes: 2 additions & 2 deletions src/shape/convex_polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl ConvexPolygon {
}

// Second, find vertices that can be removed because
// of collinearity of adjascent faces.
// of collinearity of adjacent faces.
for i2 in 1..points.len() {
let i1 = i2 - 1;
if normals[i1].dot(&*normals[i2]) > 1.0 - eps {
Expand Down Expand Up @@ -260,7 +260,7 @@ impl ConvexPolyhedron for ConvexPolygon {
out: &mut ConvexPolygonalFeature,
) {
out.clear();
// TODO: actualy find the support feature.
// TODO: actually find the support feature.
self.support_face_toward(transform, dir, out)
}
Expand Down
16 changes: 8 additions & 8 deletions src/shape/convex_polyhedron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ pub struct ConvexPolyhedron {
vertices: Vec<Vertex>,
faces: Vec<Face>,
edges: Vec<Edge>,
// Faces adjascent to a vertex.
// Faces adjacent to a vertex.
faces_adj_to_vertex: Vec<u32>,
// Edges adjascent to a vertex.
// Edges adjacent to a vertex.
edges_adj_to_vertex: Vec<u32>,
// Edges adjascent to a face.
// Edges adjacent to a face.
edges_adj_to_face: Vec<u32>,
// Vertices adjascent to a face.
// Vertices adjacent to a face.
vertices_adj_to_face: Vec<u32>,
}

Expand All @@ -128,7 +128,7 @@ impl ConvexPolyhedron {
///
/// # Return
///
/// Retruns `None` if he given solid is not manifold (contains t-junctions, not closed, etc.)
/// Returns `None` if the given solid is not manifold (contains t-junctions, not closed, etc.)
pub fn from_convex_mesh(
points: Vec<Point<Real>>,
indices: &[[u32; DIM]],
Expand Down Expand Up @@ -337,9 +337,9 @@ impl ConvexPolyhedron {
faces_adj_to_vertex.resize(total_num_adj_faces as usize, 0);
edges_adj_to_vertex.resize(total_num_adj_faces as usize, 0);

// Reset the number of adjascent faces.
// It will be set againt to the right value as
// the adjascent face list is filled.
// Reset the number of adjacent faces.
// It will be set again to the right value as
// the adjacent face list is filled.
for v in &mut vertices {
v.num_adj_faces_or_edge = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shape/cylinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use rkyv::{bytecheck, CheckBytes};
pub struct Cylinder {
/// The half-height of the cylinder.
pub half_height: Real,
/// The radius fo the cylinder.
/// The radius of the cylinder.
pub radius: Real,
}

Expand Down
4 changes: 2 additions & 2 deletions src/shape/heightfield2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl HeightField {
}
}

/// Height of the heightfield a the given point after vertical projection on the heightfield surface.
/// Height of the heightfield at the given point after vertical projection on the heightfield surface.
pub fn height_at_point(&self, pt: &Point2<Real>) -> Option<Real> {
let cell = self.cell_at_point(pt)?;
let seg = self.segment_at(cell)?;
Expand All @@ -162,7 +162,7 @@ impl HeightField {

/// Iterator through all the segments of this heightfield.
pub fn segments(&self) -> impl Iterator<Item = Segment> + '_ {
// TODO: this is not very efficient since this wil
// TODO: this is not very efficient since this will
// recompute shared points twice.
(0..self.num_cells()).filter_map(move |i| self.segment_at(i))
}
Expand Down
2 changes: 1 addition & 1 deletion src/shape/heightfield3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ impl<'a> HeightFieldRadialTriangles<'a> {
///
/// Returns `None` no triangle closest than `max_dist` remain
/// to be yielded. The `max_dist` can be modified at each iteration
/// as long as the the new value is smaller or equal to the previous value.
/// as long as the new value is smaller or equal to the previous value.
pub fn next(&mut self, max_dist: Real) -> Option<Triangle> {
let max_rad = if max_dist == Real::MAX {
usize::MAX
Expand Down
2 changes: 1 addition & 1 deletion src/shape/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl Debug for TypedShape<'_> {

#[cfg(feature = "serde-serialize")]
#[derive(Deserialize)]
// NOTE: tha this enum MUST match the `TypedShape` enum.
// NOTE: This enum MUST match the `TypedShape` enum.
/// Enum representing the shape with its actual type
pub(crate) enum DeserializableTypedShape {
/// A ball shape.
Expand Down
6 changes: 3 additions & 3 deletions src/shape/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum TrianglePointLocation {
/// The 1-st edge is the segment BC.
/// The 2-nd edge is the segment AC.
// XXX: it appears the conversion of edge indexing here does not match the
// convension of edge indexing for the `fn edge` method (from the ConvexPolyhedron impl).
// convention of edge indexing for the `fn edge` method (from the ConvexPolyhedron impl).
OnEdge(u32, [Real; 2]),
/// The point lies on the triangle interior.
///
Expand Down Expand Up @@ -101,9 +101,9 @@ impl TrianglePointLocation {
/// Orientation of a triangle.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum TriangleOrientation {
/// Orientation with a clockwise orientaiton, i.e., with a positive signed area.
/// Orientation with a clockwise orientation, i.e., with a positive signed area.
Clockwise,
/// Orientation with a clockwise orientaiton, i.e., with a negative signed area.
/// Orientation with a clockwise orientation, i.e., with a negative signed area.
CounterClockwise,
/// Degenerate triangle.
Degenerate,
Expand Down
2 changes: 1 addition & 1 deletion src/shape/trimesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl TriMesh {
/// - Be manifold (closed, no t-junctions, etc.)
/// - Be oriented with outward normals.
///
/// If the the trimesh is correctly oriented, but is manifold everywhere except at its boundaries,
/// If the trimesh is correctly oriented, but is manifold everywhere except at its boundaries,
/// then the computed pseudo-normals will provide correct point-containment test results except
/// for points closest to the boundary of the mesh.
///
Expand Down
Loading

0 comments on commit d227066

Please sign in to comment.