Commit 10021133 authored by hybrid's avatar hybrid

Fix docs.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1667 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 37950db9
......@@ -18,6 +18,9 @@ namespace core
/** Mostly used by 2D GUI elements and for 2D drawing methods.
It has 2 positions instead of position and dimension and a fast
method for collision detection with other rectangles and points.
Coordinates are (0,0) for top-left corner, and increasing to the right
and to the bottom.
*/
template <class T>
class rect
......@@ -88,8 +91,8 @@ namespace core
}
//! Returns if a 2d point is within this rectangle.
//! \param pos: Position to test if it lies within this rectangle.
//! \return Returns true if the position is within the rectangle, false if not.
/** \param pos Position to test if it lies within this rectangle.
\return True if the position is within the rectangle, false if not. */
bool isPointInside(const position2d<T>& pos) const
{
return (UpperLeftCorner.X <= pos.X &&
......@@ -128,7 +131,7 @@ namespace core
}
//! Moves this rectangle to fit inside another one.
//! \return: returns true on success, false if not possible
/** \return True on success, false if not possible */
bool constrainTo(const rect<T>& other)
{
if (other.getWidth() < getWidth() || other.getHeight() < getHeight())
......@@ -177,8 +180,7 @@ namespace core
return LowerRightCorner.Y - UpperLeftCorner.Y;
}
//! If the lower right corner of the rect is smaller then the
//! upper left, the points are swapped.
//! If the lower right corner of the rect is smaller then the upper left, the points are swapped.
void repair()
{
if (LowerRightCorner.X < UpperLeftCorner.X)
......@@ -196,9 +198,9 @@ namespace core
}
}
//! Returns if the rect is valid to draw. It could be invalid
//! if the UpperLeftCorner is lower or more right than the
//! LowerRightCorner, or if any dimension is 0.
//! Returns if the rect is valid to draw.
/** It would be invalid if the UpperLeftCorner is lower or more
right than the LowerRightCorner. */
bool isValid() const
{
return ((LowerRightCorner.X >= UpperLeftCorner.X) &&
......@@ -208,7 +210,8 @@ namespace core
//! Returns the center of the rectangle
position2d<T> getCenter() const
{
return position2d<T>((UpperLeftCorner.X + LowerRightCorner.X) / 2,
return position2d<T>(
(UpperLeftCorner.X + LowerRightCorner.X) / 2,
(UpperLeftCorner.Y + LowerRightCorner.Y) / 2);
}
......@@ -219,18 +222,19 @@ namespace core
}
//! Adds a point to the rectangle, causing it to grow bigger,
//! if point is outside of the box
//! \param p: Point to add into the box.
//! Adds a point to the rectangle
/** Cause the rectangle to grow bigger, if point is outside of
the box
\param p Point to add into the box. */
void addInternalPoint(const position2d<T>& p)
{
addInternalPoint(p.X, p.Y);
}
//! Adds a point to the bounding rectangle, causing it to grow bigger,
//! if point is outside of the box.
//! \param x: X Coordinate of the point to add to this box.
//! \param y: Y Coordinate of the point to add to this box.
//! Adds a point to the bounding rectangle
/** Cause the rectangle to grow bigger, if point is outside of
\param x X Coordinate of the point to add to this box.
\param y Y Coordinate of the point to add to this box. */
void addInternalPoint(T x, T y)
{
if (x>LowerRightCorner.X)
......@@ -244,7 +248,6 @@ namespace core
UpperLeftCorner.Y = y;
}
position2d<T> UpperLeftCorner;
position2d<T> LowerRightCorner;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment