|
ProtoBot
|
Custom Vector class that extends from BWAPI::Point, with added vector operations and functions. More...
#include <VectorPos.h>
Public Member Functions | |
| VectorPos (int _x, int _y) | |
| VectorPos (double _x, double _y) | |
| VectorPos (BWAPI::Position pos) | |
| VectorPos | normalized () |
Uses L^2 normalization
. | |
| double | dot (VectorPos other) |
| Returns dot product of this vector and another vector. | |
| double | getSqDistance () |
| Returns squared distance of vector from origin (0, 0). Used for performance optimization instead of getLength() since sqrt is expensive and we only need to compare distances, not get the actual distance. | |
| VectorPos & | operator= (const VectorPos &other) noexcept(true) |
| VectorPos & | operator= (const BWAPI::Point< int, 1 > other) noexcept(true) |
| VectorPos & | operator= (const BWAPI::Point< double, 1 > other) noexcept(true) |
| VectorPos | operator- (const VectorPos &rhs) const |
| VectorPos | operator+ (const VectorPos &rhs) const |
| VectorPos | operator* (const double &scalar) const |
| VectorPos | operator/ (const double &scalar) const |
| bool | operator== (const VectorPos &rhs) const |
| bool | operator!= (const VectorPos &rhs) const |
| std::ostream & | operator<< (std::ostream &out) |
Custom Vector class that extends from BWAPI::Point, with added vector operations and functions.
Since standard position classes such as BWAPI::Position and BWAPI::TilePosition automatically round values to integers, there is a loss of precision for vector calculations.
Extends from BWAPI::Point using a double template to allow for more precise calculations
Definition at line 10 of file VectorPos.h.
|
inline |
Definition at line 12 of file VectorPos.h.
|
inline |
Definition at line 16 of file VectorPos.h.
|
inline |
Definition at line 21 of file VectorPos.h.
|
inline |
Definition at line 26 of file VectorPos.h.
|
inline |
Returns dot product of this vector and another vector.
| other | Other VectorPos object |
Definition at line 50 of file VectorPos.h.
|
inline |
Returns squared distance of vector from origin (0, 0). Used for performance optimization instead of getLength() since sqrt is expensive and we only need to compare distances, not get the actual distance.
Definition at line 58 of file VectorPos.h.
|
inline |
Uses L^2 normalization
.
Definition at line 34 of file VectorPos.h.
|
inline |
Definition at line 93 of file VectorPos.h.
|
inline |
Definition at line 84 of file VectorPos.h.
Definition at line 81 of file VectorPos.h.
Definition at line 78 of file VectorPos.h.
|
inline |
Definition at line 87 of file VectorPos.h.
|
inline |
Definition at line 97 of file VectorPos.h.
|
inlinenoexcept |
Definition at line 72 of file VectorPos.h.
|
inlinenoexcept |
Definition at line 67 of file VectorPos.h.
Definition at line 62 of file VectorPos.h.
|
inline |
Definition at line 90 of file VectorPos.h.