#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 | ) |
|
Definition at line 18 of file vector2d.cc.
18 {
19 x_ = base::ClampAdd(other.x_, x_);
20 y_ = base::ClampAdd(other.y_, y_);
21}
◆ IsZero()
bool gfx::Vector2d::IsZero |
( |
| ) |
const |
Definition at line 14 of file vector2d.cc.
14 {
15 return x_ == 0 && y_ == 0;
16}
◆ Length()
float gfx::Vector2d::Length |
( |
| ) |
const |
Definition at line 32 of file vector2d.cc.
32 {
34}
int64_t LengthSquared() const
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
◆ 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}
◆ operator Vector2dF()
Definition at line 66 of file vector2d.h.
66 {
67 return Vector2dF(
static_cast<float>(
x()),
static_cast<float>(
y()));
68 }
◆ 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 }
◆ 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 }
◆ 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 |
Definition at line 36 of file vector2d.cc.
36 {
38}
std::string StringPrintf(const std::string &format, Args... args)
◆ 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: