#include <vector2d_f.h>
Definition at line 21 of file vector2d_f.h.
◆ Vector2dF() [1/2]
constexpr gfx::Vector2dF::Vector2dF |
( |
| ) |
|
|
inlineconstexpr |
◆ Vector2dF() [2/2]
constexpr gfx::Vector2dF::Vector2dF |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inlineconstexpr |
Definition at line 24 of file vector2d_f.h.
constexpr float y() const
constexpr float x() const
◆ Add()
void gfx::Vector2dF::Add |
( |
const Vector2dF & |
other | ) |
|
Definition at line 21 of file vector2d_f.cc.
21 {
22 x_ += other.x_;
23 y_ += other.y_;
24}
◆ IsZero()
bool gfx::Vector2dF::IsZero |
( |
| ) |
const |
Definition at line 17 of file vector2d_f.cc.
17 {
18 return x_ == 0 && y_ == 0;
19}
◆ Length()
float gfx::Vector2dF::Length |
( |
| ) |
const |
Definition at line 35 of file vector2d_f.cc.
35 {
37}
double LengthSquared() const
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
◆ LengthSquared()
double gfx::Vector2dF::LengthSquared |
( |
| ) |
const |
Definition at line 31 of file vector2d_f.cc.
31 {
32 return static_cast<double>(x_) * x_ + static_cast<double>(y_) * y_;
33}
◆ operator+=()
void gfx::Vector2dF::operator+= |
( |
const Vector2dF & |
other | ) |
|
|
inline |
Definition at line 40 of file vector2d_f.h.
void Add(const Vector2dF &other)
◆ operator-=()
void gfx::Vector2dF::operator-= |
( |
const Vector2dF & |
other | ) |
|
|
inline |
Definition at line 41 of file vector2d_f.h.
void Subtract(const Vector2dF &other)
◆ Scale() [1/2]
void gfx::Vector2dF::Scale |
( |
float |
scale | ) |
|
|
inline |
◆ Scale() [2/2]
void gfx::Vector2dF::Scale |
( |
float |
x_scale, |
|
|
float |
y_scale |
|
) |
| |
Definition at line 39 of file vector2d_f.cc.
39 {
40 x_ *= x_scale;
41 y_ *= y_scale;
42}
◆ set_x()
void gfx::Vector2dF::set_x |
( |
float |
x | ) |
|
|
inline |
◆ set_y()
void gfx::Vector2dF::set_y |
( |
float |
y | ) |
|
|
inline |
◆ SetToMax()
void gfx::Vector2dF::SetToMax |
( |
const Vector2dF & |
other | ) |
|
|
inline |
Definition at line 48 of file vector2d_f.h.
48 {
49 x_ = x_ >= other.x_ ? x_ : other.x_;
50 y_ = y_ >= other.y_ ? y_ : other.y_;
51 }
◆ SetToMin()
void gfx::Vector2dF::SetToMin |
( |
const Vector2dF & |
other | ) |
|
|
inline |
Definition at line 43 of file vector2d_f.h.
43 {
44 x_ = x_ <= other.x_ ? x_ : other.x_;
45 y_ = y_ <= other.y_ ? y_ : other.y_;
46 }
◆ Subtract()
void gfx::Vector2dF::Subtract |
( |
const Vector2dF & |
other | ) |
|
Definition at line 26 of file vector2d_f.cc.
26 {
27 x_ -= other.x_;
28 y_ -= other.y_;
29}
◆ ToString()
std::string gfx::Vector2dF::ToString |
( |
| ) |
const |
Definition at line 13 of file vector2d_f.cc.
13 {
15}
std::string StringPrintf(const std::string &format, Args... args)
◆ x()
constexpr float gfx::Vector2dF::x |
( |
| ) |
const |
|
inlineconstexpr |
◆ y()
constexpr float gfx::Vector2dF::y |
( |
| ) |
const |
|
inlineconstexpr |
The documentation for this class was generated from the following files: