@@ -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 ) ;
0 commit comments