#include <Geometry.h>
Public Member Functions | |
kt_double | Distance (const Vector2 &rOther) const |
const T & | GetX () const |
const T & | GetY () const |
kt_double | Length () const |
void | MakeCeil (const Vector2 &rOther) |
void | MakeFloor (const Vector2 &rOther) |
kt_bool | operator!= (const Vector2 &rOther) const |
kt_double | operator* (const Vector2 &rOther) const |
const Vector2 | operator* (T scalar) const |
void | operator*= (T scalar) |
const Vector2 | operator+ (const Vector2 &rOther) const |
void | operator+= (const Vector2 &rOther) |
const Vector2 | operator- (const Vector2 &rOther) const |
const Vector2 | operator- (T scalar) const |
void | operator-= (const Vector2 &rOther) |
const Vector2 | operator/ (T scalar) const |
void | operator/= (T scalar) |
kt_bool | operator< (const Vector2 &rOther) const |
kt_bool | operator== (const Vector2 &rOther) const |
void | SetX (const T &x) |
void | SetY (const T &y) |
kt_double | SquaredDistance (const Vector2 &rOther) const |
kt_double | SquaredLength () const |
const String | ToString () const |
Vector2 () | |
Vector2 (T x, T y) | |
Private Attributes | |
T | m_Values [2] |
Friends | |
KARTO_FORCEINLINE std::ostream & | operator<< (std::ostream &rStream, const Vector2 &rVector) |
Represents a 2-dimensional vector (x, y)
Definition at line 323 of file Geometry.h.
karto::Vector2< T >::Vector2 | ( | ) | [inline] |
Vector at the origin
Definition at line 329 of file Geometry.h.
karto::Vector2< T >::Vector2 | ( | T | x, |
T | y | ||
) | [inline] |
kt_double karto::Vector2< T >::Distance | ( | const Vector2< T > & | rOther | ) | const [inline] |
Gets the distance to the given vector
rOther | vector |
Definition at line 443 of file Geometry.h.
const T& karto::Vector2< T >::GetX | ( | ) | const [inline] |
Gets the x-coordinate of this vector
Definition at line 351 of file Geometry.h.
const T& karto::Vector2< T >::GetY | ( | ) | const [inline] |
Gets the y-coordinate of this vector
Definition at line 369 of file Geometry.h.
kt_double karto::Vector2< T >::Length | ( | ) | const [inline] |
Returns the length of the vector
Definition at line 423 of file Geometry.h.
void karto::Vector2< T >::MakeCeil | ( | const Vector2< T > & | rOther | ) | [inline] |
void karto::Vector2< T >::MakeFloor | ( | const Vector2< T > & | rOther | ) | [inline] |
kt_bool karto::Vector2< T >::operator!= | ( | const Vector2< T > & | rOther | ) | const [inline] |
Inequality operator
Definition at line 557 of file Geometry.h.
kt_double karto::Vector2< T >::operator* | ( | const Vector2< T > & | rOther | ) | const [inline] |
Vector dot-product
Definition at line 516 of file Geometry.h.
const Vector2 karto::Vector2< T >::operator* | ( | T | scalar | ) | const [inline] |
Scales the vector by the given scalar
Definition at line 524 of file Geometry.h.
void karto::Vector2< T >::operator*= | ( | T | scalar | ) | [inline] |
In-place scalar multiplication
Definition at line 540 of file Geometry.h.
const Vector2 karto::Vector2< T >::operator+ | ( | const Vector2< T > & | rOther | ) | const [inline] |
Vector addition
Definition at line 483 of file Geometry.h.
void karto::Vector2< T >::operator+= | ( | const Vector2< T > & | rOther | ) | [inline] |
In-place vector addition
Definition at line 465 of file Geometry.h.
const Vector2 karto::Vector2< T >::operator- | ( | const Vector2< T > & | rOther | ) | const [inline] |
Vector subtraction
Definition at line 491 of file Geometry.h.
const Vector2 karto::Vector2< T >::operator- | ( | T | scalar | ) | const [inline] |
Subtract the vector by the given scalar
Definition at line 532 of file Geometry.h.
void karto::Vector2< T >::operator-= | ( | const Vector2< T > & | rOther | ) | [inline] |
In-place vector subtraction
Definition at line 474 of file Geometry.h.
const Vector2 karto::Vector2< T >::operator/ | ( | T | scalar | ) | const [inline] |
Divides a vector by the scalar
Definition at line 508 of file Geometry.h.
void karto::Vector2< T >::operator/= | ( | T | scalar | ) | [inline] |
In-place scalar division
Definition at line 499 of file Geometry.h.
kt_bool karto::Vector2< T >::operator< | ( | const Vector2< T > & | rOther | ) | const [inline] |
Less than operator
rOther | vector |
Definition at line 568 of file Geometry.h.
kt_bool karto::Vector2< T >::operator== | ( | const Vector2< T > & | rOther | ) | const [inline] |
Equality operator
Definition at line 549 of file Geometry.h.
void karto::Vector2< T >::SetX | ( | const T & | x | ) | [inline] |
Sets the x-coordinate of this vector
x | the x-coordinate of the vector |
Definition at line 360 of file Geometry.h.
void karto::Vector2< T >::SetY | ( | const T & | y | ) | [inline] |
Sets the y-coordinate of this vector
y | the y-coordinate of the vector |
Definition at line 378 of file Geometry.h.
kt_double karto::Vector2< T >::SquaredDistance | ( | const Vector2< T > & | rOther | ) | const [inline] |
Returns the square of the distance to the given vector
rOther | vector |
Definition at line 433 of file Geometry.h.
kt_double karto::Vector2< T >::SquaredLength | ( | ) | const [inline] |
Returns the square of the length of the vector
Definition at line 414 of file Geometry.h.
const String karto::Vector2< T >::ToString | ( | ) | const [inline] |
Returns a string representation of this vector
Reimplemented in karto::gps::PointGps.
Definition at line 452 of file Geometry.h.
KARTO_FORCEINLINE std::ostream& operator<< | ( | std::ostream & | rStream, |
const Vector2< T > & | rVector | ||
) | [friend] |
Write vector onto output stream
Definition at line 587 of file Geometry.h.
T karto::Vector2< T >::m_Values[2] [private] |
Definition at line 594 of file Geometry.h.