The structure that defines a point (using floating point values).
More...
|
| constexpr | FPoint (const FPointRaw &p={}) noexcept |
| | Wraps FPoint.
|
| constexpr | FPoint (float x, float y) noexcept |
| | Constructs from its fields.
|
| constexpr | FPoint (float v) noexcept |
| | Constructs from its fields.
|
| constexpr | operator bool () const noexcept |
| | Check if valid.
|
| constexpr float | GetX () const noexcept |
| | Get the x coordinate.
|
| constexpr FPoint & | SetX (float newX) noexcept |
| | Set the x coordinate.
|
| constexpr float | GetY () const noexcept |
| | Get the y coordinate.
|
| constexpr FPoint & | SetY (float newY) noexcept |
| | Set the y coordinate.
|
| bool | InRect (const FRectRaw &r) const |
| | Determine whether a point resides inside a floating point rectangle.
|
| constexpr FPoint | operator- () const |
| | Get point's memberwise negation.
|
| constexpr FPoint & | operator+= (const FPoint &other) |
| | Memberwise add another point.
|
| constexpr FPoint & | operator-= (const FPoint &other) |
| | Memberwise subtract another point.
|
| constexpr FPoint & | operator/= (const FPoint &other) |
| | Memberwise divide by another point.
|
| constexpr FPoint & | operator*= (const FPoint &other) |
| | Memberwise multiply by another point.
|
| constexpr FPoint | GetClamped (const FRect &rect) const |
| | Get a point with coordinates modified so it fits into a given rect.
|
| constexpr FPoint & | Clamp (const FRect &rect) |
| | Clamp point coordinates to make it fit into a given rect.
|
| constexpr FPoint | GetWrapped (const FRect &rect) const |
| | Get a point wrapped within a specified rect.
|
| constexpr FPoint & | Wrap (const FRect &rect) |
| | Wrap point coordinates within a specified rect.
|
The structure that defines a point (using floating point values).
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Wrap extending struct
- See also
- GetRectEnclosingPointsFloat
-
PointInRectFloat
◆ FPoint() [1/3]
| SDL::FPoint::FPoint |
( |
const FPointRaw & | p = {} | ) |
|
|
inlineconstexprnoexcept |
◆ FPoint() [2/3]
| SDL::FPoint::FPoint |
( |
float | x, |
|
|
float | y ) |
|
inlineconstexprnoexcept |
Constructs from its fields.
- Parameters
-
| x | the value for x. |
| y | the value for y. |
◆ FPoint() [3/3]
| SDL::FPoint::FPoint |
( |
float | v | ) |
|
|
inlineconstexprnoexcept |
Constructs from its fields.
- Parameters
-
◆ Clamp()
Clamp point coordinates to make it fit into a given rect.
- Parameters
-
| [in] | rect | Rectangle to clamp with |
- Returns
- Reference to self
◆ GetClamped()
| FPoint SDL::FPoint::GetClamped |
( |
const FRect & | rect | ) |
const |
|
constexpr |
Get a point with coordinates modified so it fits into a given rect.
- Parameters
-
| [in] | rect | Rectangle to clamp with |
- Returns
- Clamped point
◆ GetWrapped()
| FPoint SDL::FPoint::GetWrapped |
( |
const FRect & | rect | ) |
const |
|
constexpr |
Get a point wrapped within a specified rect.
- Parameters
-
| [in] | rect | Rectangle to wrap with |
- Returns
- Wrapped point
◆ GetX()
| float SDL::FPoint::GetX |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the x coordinate.
- Returns
- current x value.
◆ GetY()
| float SDL::FPoint::GetY |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the y coordinate.
- Returns
- current y coordinate.
◆ operator bool()
| SDL::FPoint::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Check if valid.
- Returns
- True if valid state, false otherwise.
◆ operator*=()
Memberwise multiply by another point.
- Parameters
-
- Returns
- Reference to self
◆ operator+=()
Memberwise add another point.
- Parameters
-
| [in] | other | Point to add to the current one |
- Returns
- Reference to self
◆ operator-()
| FPoint SDL::FPoint::operator- |
( |
| ) |
const |
|
inlineconstexpr |
Get point's memberwise negation.
- Returns
- New Point representing memberwise negation
◆ operator-=()
Memberwise subtract another point.
- Parameters
-
| [in] | other | Point to subtract from the current one |
- Returns
- Reference to self
◆ operator/=()
Memberwise divide by another point.
- Parameters
-
- Returns
- Reference to self
◆ SetX()
| FPoint & SDL::FPoint::SetX |
( |
float | newX | ) |
|
|
inlineconstexprnoexcept |
Set the x coordinate.
- Parameters
-
| newX | the new x coordinate. |
- Returns
- Reference to self.
◆ SetY()
| FPoint & SDL::FPoint::SetY |
( |
float | newY | ) |
|
|
inlineconstexprnoexcept |
Set the y coordinate.
- Parameters
-
| newY | the new y coordinate. |
- Returns
- Reference to self.
◆ Wrap()
Wrap point coordinates within a specified rect.
- Parameters
-
| [in] | rect | Rectangle to wrap with |
- Returns
- Reference to self
The documentation for this struct was generated from the following file: