Urho3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Urho3D::Rect Class Reference

Two-dimensional bounding rectangle. More...

#include </home/runner/work/rurho3d.github.io/rurho3d.github.io/urho3d_repo/Source/Urho3D/Math/Rect.h>

Public Member Functions

 Rect () noexcept
 Construct an undefined rect.
 
 Rect (const Vector2 &min, const Vector2 &max) noexcept
 Construct from minimum and maximum vectors.
 
 Rect (float left, float top, float right, float bottom) noexcept
 Construct from coordinates.
 
 Rect (const Vector4 &vector) noexcept
 Construct from a Vector4.
 
 Rect (const float *data) noexcept
 Construct from a float array.
 
 Rect (const Rect &rect) noexcept=default
 Copy-construct from another rect.
 
Rectoperator= (const Rect &rhs) noexcept=default
 Assign from another rect.
 
bool operator== (const Rect &rhs) const
 Test for equality with another rect.
 
bool operator!= (const Rect &rhs) const
 Test for inequality with another rect.
 
Rectoperator+= (const Rect &rhs)
 Add another rect to this one inplace.
 
Rectoperator-= (const Rect &rhs)
 Subtract another rect from this one inplace.
 
Rectoperator/= (float value)
 Divide by scalar inplace.
 
Rectoperator*= (float value)
 Multiply by scalar inplace.
 
Rect operator/ (float value) const
 Divide by scalar.
 
Rect operator* (float value) const
 Multiply by scalar.
 
Rect operator+ (const Rect &rhs) const
 Add another rect.
 
Rect operator- (const Rect &rhs) const
 Subtract another rect.
 
void Define (const Rect &rect)
 Define from another rect.
 
void Define (const Vector2 &min, const Vector2 &max)
 Define from minimum and maximum vectors.
 
void Define (const Vector2 &point)
 Define from a point.
 
void Merge (const Vector2 &point)
 Merge a point.
 
void Merge (const Rect &rect)
 Merge a rect.
 
void Clear ()
 Clear to undefined state.
 
void Clip (const Rect &rect)
 Clip with another rect.
 
bool Defined () const
 Return true if this rect is defined via a previous call to Define() or Merge().
 
Vector2 Center () const
 Return center.
 
Vector2 Size () const
 Return size.
 
Vector2 HalfSize () const
 Return half-size.
 
bool Equals (const Rect &rhs) const
 Test for equality with another rect with epsilon.
 
Intersection IsInside (const Vector2 &point) const
 Test whether a point is inside.
 
Intersection IsInside (const Rect &rect) const
 Test if another rect is inside, outside or intersects.
 
const float * Data () const
 Return float data.
 
Vector4 ToVector4 () const
 Return as a vector.
 
String ToString () const
 Return as string.
 
Vector2 Min () const
 Return left-top corner position.
 
Vector2 Max () const
 Return right-bottom corner position.
 
float Left () const
 Return left coordinate.
 
float Top () const
 Return top coordinate.
 
float Right () const
 Return right coordinate.
 
float Bottom () const
 Return bottom coordinate.
 

Public Attributes

Vector2 min_
 Minimum vector.
 
Vector2 max_
 Maximum vector.
 

Static Public Attributes

static const Rect FULL
 Rect in the range (-1, -1) - (1, 1).
 
static const Rect POSITIVE
 Rect in the range (0, 0) - (1, 1).
 
static const Rect ZERO
 Zero-sized rect.
 

Detailed Description

Two-dimensional bounding rectangle.


The documentation for this class was generated from the following files: