Skip to content

Commit 1eba41e

Browse files
committed
spelling fix: hemicircle -> semicircle
typos doesn't like the former even though it is technically correct. Semicircle is more widely known tho so I don't really get why we need to be so elitist...
1 parent fa1eeb9 commit 1eba41e

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

crates/bevy_math/src/ray_cast/dim2/capsule.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ impl PrimitiveRayCast2d for Capsule2d {
2727
let is_inside_rect_horizontal = c < 0.0;
2828
let is_inside_rect_vertical = ops::abs(ray.origin.y) < self.half_length;
2929
let intersects_hemisphere = is_inside_rect_horizontal && {
30-
// The ray origin intersects one of the hemicircles if the distance
31-
// between the ray origin and hemicircle center is negative.
30+
// The ray origin intersects one of the semicircles if the distance
31+
// between the ray origin and semicircle center is negative.
3232
Vec2::new(ray.origin.x, self.half_length - ops::abs(ray.origin.y)).length_squared()
3333
< radius_squared
3434
};
@@ -59,10 +59,10 @@ impl PrimitiveRayCast2d for Capsule2d {
5959
return Some(RayHit2d::new(t, normal));
6060
}
6161

62-
// Next, we check the hemicircles for intersections.
63-
// It's enough to only check one hemicircle and just take the side into account.
62+
// Next, we check the semicircles for intersections.
63+
// It's enough to only check one semicircle and just take the side into account.
6464

65-
// Offset between the ray origin and the center of the hit hemicircle.
65+
// Offset between the ray origin and the center of the hit semicircle.
6666
let offset_ray = Ray2d {
6767
origin: if y <= 0.0 {
6868
oa
@@ -151,7 +151,7 @@ mod tests {
151151
assert_eq!(hit, Some(RayHit2d::new(0.0, Dir2::NEG_X)));
152152

153153
// Ray origin is inside of the hollow capsule.
154-
// Test three cases: inside the rectangle, inside the top hemicircle, and inside the bottom hemicircle.
154+
// Test three cases: inside the rectangle, inside the top semicircle, and inside the bottom semicircle.
155155

156156
// Inside the rectangle.
157157
let ray = Ray2d::new(Vec2::ZERO, Dir2::X);
@@ -162,7 +162,7 @@ mod tests {
162162
let hit = capsule.local_ray_cast(ray, f32::MAX, false);
163163
assert_eq!(hit, Some(RayHit2d::new(2.0, Dir2::NEG_Y)));
164164

165-
// Inside the top hemicircle.
165+
// Inside the top semicircle.
166166
let ray = Ray2d::new(Vec2::new(0.0, 1.0), Dir2::NORTH_EAST);
167167
let hit = capsule.local_ray_cast(ray, f32::MAX, false).unwrap();
168168
assert_eq!(hit.distance, 1.0);
@@ -172,7 +172,7 @@ mod tests {
172172
let hit = capsule.local_ray_cast(ray, f32::MAX, false);
173173
assert_eq!(hit, Some(RayHit2d::new(3.0, Dir2::Y)));
174174

175-
// Inside the bottom hemicircle.
175+
// Inside the bottom semicircle.
176176
let ray = Ray2d::new(Vec2::new(0.0, -1.0), Dir2::SOUTH_WEST);
177177
let hit = capsule.local_ray_cast(ray, f32::MAX, false).unwrap();
178178
assert_eq!(hit.distance, 1.0);

crates/bevy_mesh/src/primitives/dim2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ impl From<Rectangle> for Mesh {
11231123
pub struct Capsule2dMeshBuilder {
11241124
/// The [`Capsule2d`] shape.
11251125
pub capsule: Capsule2d,
1126-
/// The number of vertices used for one hemicircle.
1126+
/// The number of vertices used for one semicircle.
11271127
/// The total number of vertices for the capsule mesh will be two times the resolution.
11281128
///
11291129
/// The default is `16`.
@@ -1141,7 +1141,7 @@ impl Default for Capsule2dMeshBuilder {
11411141

11421142
impl Capsule2dMeshBuilder {
11431143
/// Creates a new [`Capsule2dMeshBuilder`] from a given radius, length, and the number of vertices
1144-
/// used for one hemicircle. The total number of vertices for the capsule mesh will be two times the resolution.
1144+
/// used for one semicircle. The total number of vertices for the capsule mesh will be two times the resolution.
11451145
#[inline]
11461146
pub fn new(radius: f32, length: f32, resolution: u32) -> Self {
11471147
Self {
@@ -1150,7 +1150,7 @@ impl Capsule2dMeshBuilder {
11501150
}
11511151
}
11521152

1153-
/// Sets the number of vertices used for one hemicircle.
1153+
/// Sets the number of vertices used for one semicircle.
11541154
/// The total number of vertices for the capsule mesh will be two times the resolution.
11551155
#[inline]
11561156
pub const fn resolution(mut self, resolution: u32) -> Self {
@@ -1182,7 +1182,7 @@ impl MeshBuilder for Capsule2dMeshBuilder {
11821182
0.0
11831183
};
11841184

1185-
// How much the hemicircle radius is of the total half-height of the capsule.
1185+
// How much the semicircle radius is of the total half-height of the capsule.
11861186
// This is used to prevent the UVs from stretching between the semicircles.
11871187
let radius_frac = self.capsule.radius / (self.capsule.half_length + self.capsule.radius);
11881188

crates/bevy_mesh/src/primitives/extrusion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl ExtrusionBuilder<Annulus> {
165165
}
166166

167167
impl ExtrusionBuilder<Capsule2d> {
168-
/// Sets the number of vertices used for each hemicircle at the ends of the extrusion.
168+
/// Sets the number of vertices used for each semicircle at the ends of the extrusion.
169169
pub fn resolution(mut self, resolution: u32) -> Self {
170170
self.base_builder.resolution = resolution;
171171
self

0 commit comments

Comments
 (0)