Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor change, added a comment and improved formatting for utils/colli…

…sion/collision_circle_rect
  • Loading branch information...
commit 1b6e24a65cf07512a74f141656f5e9f48a91de99 1 parent d4febea
@gummikana authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 source/utils/collision/collision_circle_rect.h
View
6 source/utils/collision/collision_circle_rect.h
@@ -88,9 +88,11 @@ VectorT CircleRectResolveByPushingCircle( const VectorT& circle_p, float circle_
VectorT delta = circle_p - closest_point;
delta = ( delta.Normalize() * ( circle_r + extra_push ) );
- if(ceng::math::IsPointInsideAABB(circle_p, rect_p[ 0 ], rect_p[ 2 ])){
+
+ // to fix it so that if the point is inside the box it's pushed outside
+ if( ceng::math::IsPointInsideAABB( circle_p, rect_p[ 0 ], rect_p[ 2 ] ) )
delta = -delta;
- }
+
return closest_point + delta;
}
Please sign in to comment.
Something went wrong with that request. Please try again.