Back to class index
| float2::MinAreaRectInPlaceSyntaxfloat float2::MinAreaRectInPlace(float2 *pointArray, int numPoints, float2 ¢er, float2 &uDir, float2 &vDir, float &minU, float &maxU, float &minV, float &maxV); [77 lines of code]Computes the minimum-area rectangle that bounds the given point set. [noscript]. Implementation adapted from Christer Ericson's Real-time Collision Detection, p.111. Note This algorithm runs in O(n^2) time to the number of points in the input. For best performance, the input point array should contain only the points in the convex hull of the point set. This algorithm does not compute the convex hull for you. Parametersfloat2 *pointArray [in]A pointer to an array of points to process.intnumPointsThe number of elements in the array pointed to by pointArray. float2 ¢er [out]This variable will receive the center point of the rectangle.float2 &uDir [out]This variable will receive a normalized direction vector pointing one of the side directionss of the rectangle.float2 &vDir [out]This variable will receive a normalized direction vector pointing the other side direction of the rectangle.float &minU [out]Receives the minimum extent of the processed point set along the u direction.float &maxU [out]Receives the maximum extent of the processed point set along the u direction.float &minV [out]Receives the minimum extent of the processed point set along the v direction.float &maxV [out]Receives the maximum extent of the processed point set along the v direction. Return ValueThe area of the resulting rectangle. |