#include <vector2d.h>
Definition at line 22 of file vector2d.h.
◆ Vector2d() [1/2]
| constexpr gfx::Vector2d::Vector2d |
( |
| ) |
|
|
inlineconstexpr |
◆ Vector2d() [2/2]
| constexpr gfx::Vector2d::Vector2d |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inlineconstexpr |
◆ Add()
| void gfx::Vector2d::Add |
( |
const Vector2d & |
other | ) |
|
◆ IsZero()
| bool gfx::Vector2d::IsZero |
( |
| ) |
const |
◆ Length()
| float gfx::Vector2d::Length |
( |
| ) |
const |
◆ LengthSquared()
| int64_t gfx::Vector2d::LengthSquared |
( |
| ) |
const |
Definition at line 28 of file vector2d.cc.
28 {
29 return static_cast<int64_t>(x_) * x_ + static_cast<int64_t>(y_) * y_;
30}
Referenced by Length(), and gfx::TEST().
◆ operator Vector2dF()
Definition at line 66 of file vector2d.h.
66 {
67 return Vector2dF(
static_cast<float>(
x()),
static_cast<float>(
y()));
68 }
References x, and y.
◆ operator+=()
| void gfx::Vector2d::operator+= |
( |
const Vector2d & |
other | ) |
|
|
inline |
Definition at line 44 of file vector2d.h.
void Add(const Vector2d &other)
◆ operator-=()
| void gfx::Vector2d::operator-= |
( |
const Vector2d & |
other | ) |
|
|
inline |
Definition at line 45 of file vector2d.h.
void Subtract(const Vector2d &other)
◆ operator==()
| constexpr bool gfx::Vector2d::operator== |
( |
const Vector2d & |
other | ) |
const |
|
inlineconstexpr |
Definition at line 41 of file vector2d.h.
41 {
42 return x_ == other.x_ && y_ == other.y_;
43 }
◆ set_x()
| void gfx::Vector2d::set_x |
( |
int |
x | ) |
|
|
inline |
◆ set_y()
| void gfx::Vector2d::set_y |
( |
int |
y | ) |
|
|
inline |
◆ SetToMax()
| void gfx::Vector2d::SetToMax |
( |
const Vector2d & |
other | ) |
|
|
inline |
Definition at line 52 of file vector2d.h.
52 {
53 x_ = x_ >= other.x_ ? x_ : other.x_;
54 y_ = y_ >= other.y_ ? y_ : other.y_;
55 }
Referenced by gfx::TEST().
◆ SetToMin()
| void gfx::Vector2d::SetToMin |
( |
const Vector2d & |
other | ) |
|
|
inline |
Definition at line 47 of file vector2d.h.
47 {
48 x_ = x_ <= other.x_ ? x_ : other.x_;
49 y_ = y_ <= other.y_ ? y_ : other.y_;
50 }
Referenced by gfx::TEST().
◆ Subtract()
| void gfx::Vector2d::Subtract |
( |
const Vector2d & |
other | ) |
|
Definition at line 23 of file vector2d.cc.
23 {
24 x_ = base::ClampSub(x_, other.x_);
25 y_ = base::ClampSub(y_, other.y_);
26}
◆ ToString()
| std::string gfx::Vector2d::ToString |
( |
| ) |
const |
◆ x()
| constexpr int gfx::Vector2d::x |
( |
| ) |
const |
|
inlineconstexpr |
◆ y()
| constexpr int gfx::Vector2d::y |
( |
| ) |
const |
|
inlineconstexpr |
The documentation for this class was generated from the following files: