|
Colobot
|
2D Point with integer coords More...
#include <src/math/intpoint.h>
Public Member Functions | |
| IntPoint (int aX=0, int aY=0) | |
| bool | operator== (const IntPoint &p) const |
| bool | operator!= (const IntPoint &p) const |
| float | Length () const |
| void | LoadZero () |
| Sets the zero point: (0,0) More... | |
| int * | Array () |
Returns the struct cast to int* array; use with care! More... | |
| const int * | Array () const |
Returns the struct cast to const int* array; use with care! More... | |
| IntPoint | operator- () const |
| Returns the inverted point. More... | |
| const IntPoint & | operator+= (const IntPoint &right) |
| Adds the given point. More... | |
| const IntPoint & | operator-= (const IntPoint &right) |
| Subtracts the given point. More... | |
| const IntPoint & | operator*= (const float &right) |
| Multiplies by given scalar. More... | |
| const IntPoint & | operator/= (const float &right) |
| Divides by given scalar. More... | |
| std::string | ToString () const |
| Returns a string "[x, y]". More... | |
Public Attributes | |
| int | x |
| X coord. More... | |
| int | y |
| Y coord. More... | |
Friends | |
| const friend IntPoint | operator+ (const IntPoint &left, const IntPoint &right) |
| Adds two points. More... | |
| const friend IntPoint | operator- (const IntPoint &left, const IntPoint &right) |
| Subtracts two points. More... | |
| const friend IntPoint | operator* (const float &left, const IntPoint &right) |
| Multiplies point by scalar. More... | |
| const friend IntPoint | operator* (const IntPoint &left, const int &right) |
| Multiplies point by scalar. More... | |
| const friend IntPoint | operator/ (const IntPoint &left, const int &right) |
| Divides point by scalar. More... | |
2D Point with integer coords
Analog of WinAPI's POINT struct.
|
inline |
Sets the zero point: (0,0)
|
inline |
Returns the struct cast to int* array; use with care!
|
inline |
Returns the struct cast to const int* array; use with care!
|
inline |
Returns the inverted point.
Subtracts the given point.
|
inline |
Multiplies by given scalar.
|
inline |
Divides by given scalar.
|
inline |
Returns a string "[x, y]".
Adds two points.
Subtracts two points.
Multiplies point by scalar.
Multiplies point by scalar.
Divides point by scalar.
| int Math::IntPoint::x |
X coord.
| int Math::IntPoint::y |
Y coord.
1.8.16