Jump to content

µGFX Development

  • entries
    45
  • comments
    13
  • views
    3,006

Contributors to this blog

Polygon hit test function

Joel Bodenmann

177 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


Recommended 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...

×   Pasted as rich text.   Paste as plain text instead

  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

×   You cannot paste images directly. Upload or insert images from URL.

×