@ Pure public static boolean intersectsCapsuleAlignedBox ( double mx1 , double my1 , double mz1 , double mx2 , double my2 , double mz2 , double radius , double minx , double miny , double minz , double maxx , double maxy , double maxz ) { Point3f closest1 = AlignedBox3f . computeClosestPoint ( minx , miny , minz , maxx , maxy , maxz , mx1 , my1 , mz1 ) ; Point3f closest2 = AlignedBox3f . computeClosestPoint ( minx , miny , minz , maxx , maxy , maxz , mx2 , my2 , mz2 ) ; double sq = AbstractSegment3F . distanceSquaredSegmentSegment ( mx1 , my1 , mz1 , mx2 , my2 , mz2 , closest1 . getX ( ) , closest1 . getY ( ) , closest1 . getZ ( ) , closest2 . getX ( ) , closest2 . getY ( ) , closest2 . getZ ( ) ) ; return ( sq <= ( radius * radius ) ) ; }
Replies if the capsule intersects the aligned box .