Defines a point in 2D space.
More...
#include <Point.h>
|
|
int | X |
| | The x-coordinate of the point.
|
| |
|
int | Y |
| | The y-coordinate of the point.
|
| |
Defines a point in 2D space.
◆ Point()
| KatanaEngine::Point::Point |
( |
const int |
x = 0, |
|
|
const int |
y = 0 |
|
) |
| |
Instantiates a new point object.
- Parameters
-
| x | The X component |
| y | The Y component |
◆ IsOrigin()
| bool KatanaEngine::Point::IsOrigin |
( |
| ) |
const |
|
inline |
Determines if the point is located at the origin.
- Returns
- Returns true if both components are zero, false otherwise.
◆ operator!=()
| bool KatanaEngine::Point::operator!= |
( |
const Point & |
point | ) |
const |
Determines if two points are not equal.
- Parameters
-
| point | The point to compare. |
- Returns
- Returns true if the points are not equal, false otherwise.
◆ operator+()
| const Point KatanaEngine::Point::operator+ |
( |
const Point & |
point | ) |
const |
Adds two points.
- Parameters
-
- Returns
- Returns the resulting point.
◆ operator+=()
| Point & KatanaEngine::Point::operator+= |
( |
const Point & |
point | ) |
|
Adds a point.
- Parameters
-
- Returns
- Returns the resulting point.
◆ operator-()
| const Point KatanaEngine::Point::operator- |
( |
const Point & |
point | ) |
const |
Subtracts a point from another.
- Parameters
-
| point | The point to subtract. |
- Returns
- Returns the resulting point.
◆ operator-=()
| Point & KatanaEngine::Point::operator-= |
( |
const Point & |
point | ) |
|
Subtracts a point.
- Parameters
-
| point | The point to subtract. |
- Returns
- Returns the resulting point.
◆ operator=()
| Point & KatanaEngine::Point::operator= |
( |
const Point & |
point | ) |
|
Assigns the reference of a point.
- Parameters
-
| point | The reference point. |
- Returns
- Returns the resulting point.
◆ operator==()
| bool KatanaEngine::Point::operator== |
( |
const Point & |
point | ) |
const |
Determines if two points are equal.
- Parameters
-
| point | The point to compare. |
- Returns
- Returns true if the points are equal, false otherwise.
◆ Set() [1/2]
| void KatanaEngine::Point::Set |
( |
const int |
x, |
|
|
const int |
y |
|
) |
| |
Sets the components of the point.
- Parameters
-
| x | The X component. |
| y | The Y component. |
◆ Set() [2/2]
| void KatanaEngine::Point::Set |
( |
const Point |
point | ) |
|
Sets the components of the vecpointtor.
- Parameters
-
| point | The point whose components to copy. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ ToString()
| std::string KatanaEngine::Point::ToString |
( |
| ) |
const |
Gets a string representation of the point.
- Returns
- Returns a string displaying the components of the point.
◆ ToVector2()
| const Vector2 KatanaEngine::Point::ToVector2 |
( |
| ) |
const |
Converts the point into a vector.
- Returns
- Returns a displacement vector to the point.
The documentation for this class was generated from the following files:
- KatanaEngine/Point.h
- KatanaEngine/Point.cpp