µGFX Development

  • entries
    43
  • comments
    12
  • views
    2,395

Contributors to this blog

Polygon hit test function

Joel Bodenmann

143 views

A new function has been added to the GMISC module which allows testing whether a certain point is inside of a given polgyon:

/**
 * @brief	Check whether a point is inside or on the edge of a polygon
 * @pre		Requires GFX_USE_GMISC and GMISC_NEED_HITTEST_POLY
 *
 * @note	This function works both with convex and concave polygons
 *
 * @param[in] pntarray		The array of points that form the polygon
 * @param[in] cnt		The number of points in the point array @pntarray
 * @param[in] p			The point to test
 *
 * @return	@p TRUE if the point @p p is inside or on the edge of the polygon @p pntarray, @p FALSE otherwise.
 *
 * @api
 */
bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p);

 




0 Comments


There are no comments to display.

Guest
You are commenting as a guest. If you have an account, please sign in.
Add a comment...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor