GRRLIB_collision.h File Reference
Inline functions for collision detection.
More...
Functions |
INLINE bool | GRRLIB_PtInRect (const int hotx, const int hoty, const int hotw, const int hoth, const int wpadx, const int wpady) |
| Determine whether the specified point lies within the specified rectangle.
|
INLINE bool | GRRLIB_RectInRect (const int rect1x, const int rect1y, const int rect1w, const int rect1h, const int rect2x, const int rect2y, const int rect2w, const int rect2h) |
| Determine whether a specified rectangle lies within another rectangle.
|
INLINE bool | GRRLIB_RectOnRect (const int rect1x, const int rect1y, const int rect1w, const int rect1h, const int rect2x, const int rect2y, const int rect2w, const int rect2h) |
| Determine whether a part of a specified rectangle lies on another rectangle.
|
Detailed Description
Inline functions for collision detection.
Function Documentation
INLINE bool GRRLIB_PtInRect |
( |
const int |
hotx, |
|
|
const int |
hoty, |
|
|
const int |
hotw, |
|
|
const int |
hoth, |
|
|
const int |
wpadx, |
|
|
const int |
wpady | |
|
) |
| | |
Determine whether the specified point lies within the specified rectangle.
- Parameters:
-
| hotx | Specifies the x-coordinate of the upper-left corner of the rectangle. |
| hoty | Specifies the y-coordinate of the upper-left corner of the rectangle. |
| hotw | The width of the rectangle. |
| hoth | The height of the rectangle. |
| wpadx | Specifies the x-coordinate of the point. |
| wpady | Specifies the y-coordinate of the point. |
- Returns:
- If the specified point lies within the rectangle, the return value is true otherwise it's false.
INLINE bool GRRLIB_RectInRect |
( |
const int |
rect1x, |
|
|
const int |
rect1y, |
|
|
const int |
rect1w, |
|
|
const int |
rect1h, |
|
|
const int |
rect2x, |
|
|
const int |
rect2y, |
|
|
const int |
rect2w, |
|
|
const int |
rect2h | |
|
) |
| | |
Determine whether a specified rectangle lies within another rectangle.
- Parameters:
-
| rect1x | Specifies the x-coordinate of the upper-left corner of the rectangle. |
| rect1y | Specifies the y-coordinate of the upper-left corner of the rectangle. |
| rect1w | Specifies the width of the rectangle. |
| rect1h | Specifies the height of the rectangle. |
| rect2x | Specifies the x-coordinate of the upper-left corner of the rectangle. |
| rect2y | Specifies the y-coordinate of the upper-left corner of the rectangle. |
| rect2w | Specifies the width of the rectangle. |
| rect2h | Specifies the height of the rectangle. |
- Returns:
- If the specified rectangle lies within the other rectangle, the return value is true otherwise it's false.
INLINE bool GRRLIB_RectOnRect |
( |
const int |
rect1x, |
|
|
const int |
rect1y, |
|
|
const int |
rect1w, |
|
|
const int |
rect1h, |
|
|
const int |
rect2x, |
|
|
const int |
rect2y, |
|
|
const int |
rect2w, |
|
|
const int |
rect2h | |
|
) |
| | |
Determine whether a part of a specified rectangle lies on another rectangle.
- Parameters:
-
| rect1x | Specifies the x-coordinate of the upper-left corner of the first rectangle. |
| rect1y | Specifies the y-coordinate of the upper-left corner of the first rectangle. |
| rect1w | Specifies the width of the first rectangle. |
| rect1h | Specifies the height of the first rectangle. |
| rect2x | Specifies the x-coordinate of the upper-left corner of the second rectangle. |
| rect2y | Specifies the y-coordinate of the upper-left corner of the second rectangle. |
| rect2w | Specifies the width of the second rectangle. |
| rect2h | Specifies the height of the second rectangle. |
- Returns:
- If the specified rectangle lies on the other rectangle, the return value is true otherwise it's false.