mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Suggest vector access methods to be inlined
This commit is contained in:
parent
dbcd749ae7
commit
5c6b29705a
|
@ -29,7 +29,7 @@ namespace Math
|
||||||
float bounce(const float _delayTime, const float _scrollTime, const float _currentTime, const float _scrollLength);
|
float bounce(const float _delayTime, const float _scrollTime, const float _currentTime, const float _scrollLength);
|
||||||
float loop (const float _delayTime, const float _scrollTime, const float _currentTime, const float _scrollLength);
|
float loop (const float _delayTime, const float _scrollTime, const float _currentTime, const float _scrollLength);
|
||||||
|
|
||||||
} // Math::Scroll::
|
} // Scroll::
|
||||||
|
|
||||||
} // Math::
|
} // Math::
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ public:
|
||||||
float& operator[](const int _index) { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
float& operator[](const int _index) { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
||||||
const float& operator[](const int _index) const { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
const float& operator[](const int _index) const { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
||||||
|
|
||||||
float& x() { return mX; }
|
inline float& x() { return mX; }
|
||||||
float& y() { return mY; }
|
inline float& y() { return mY; }
|
||||||
const float& x() const { return mX; }
|
inline const float& x() const { return mX; }
|
||||||
const float& y() const { return mY; }
|
inline const float& y() const { return mY; }
|
||||||
|
|
||||||
Vector2f& round();
|
Vector2f& round();
|
||||||
Vector2f& lerp (const Vector2f& _start, const Vector2f& _end, const float _fraction);
|
Vector2f& lerp (const Vector2f& _start, const Vector2f& _end, const float _fraction);
|
||||||
|
|
|
@ -40,10 +40,10 @@ public:
|
||||||
int& operator[](const int _index) { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
int& operator[](const int _index) { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
||||||
const int& operator[](const int _index) const { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
const int& operator[](const int _index) const { assert(_index < 2 && "index out of range"); return (&mX)[_index]; }
|
||||||
|
|
||||||
int& x() { return mX; }
|
inline int& x() { return mX; }
|
||||||
int& y() { return mY; }
|
inline int& y() { return mY; }
|
||||||
const int& x() const { return mX; }
|
inline const int& x() const { return mX; }
|
||||||
const int& y() const { return mY; }
|
inline const int& y() const { return mY; }
|
||||||
|
|
||||||
static const Vector2i Zero () { return { 0, 0 }; }
|
static const Vector2i Zero () { return { 0, 0 }; }
|
||||||
static const Vector2i UnitX() { return { 1, 0 }; }
|
static const Vector2i UnitX() { return { 1, 0 }; }
|
||||||
|
|
|
@ -47,12 +47,12 @@ public:
|
||||||
float& operator[](const int _index) { assert(_index < 3 && "index out of range"); return (&mX)[_index]; }
|
float& operator[](const int _index) { assert(_index < 3 && "index out of range"); return (&mX)[_index]; }
|
||||||
const float& operator[](const int _index) const { assert(_index < 3 && "index out of range"); return (&mX)[_index]; }
|
const float& operator[](const int _index) const { assert(_index < 3 && "index out of range"); return (&mX)[_index]; }
|
||||||
|
|
||||||
float& x() { return mX; }
|
inline float& x() { return mX; }
|
||||||
float& y() { return mY; }
|
inline float& y() { return mY; }
|
||||||
float& z() { return mZ; }
|
inline float& z() { return mZ; }
|
||||||
const float& x() const { return mX; }
|
inline const float& x() const { return mX; }
|
||||||
const float& y() const { return mY; }
|
inline const float& y() const { return mY; }
|
||||||
const float& z() const { return mZ; }
|
inline const float& z() const { return mZ; }
|
||||||
|
|
||||||
inline Vector2f& v2() { return *(Vector2f*)this; }
|
inline Vector2f& v2() { return *(Vector2f*)this; }
|
||||||
inline const Vector2f& v2() const { return *(Vector2f*)this; }
|
inline const Vector2f& v2() const { return *(Vector2f*)this; }
|
||||||
|
|
|
@ -49,14 +49,14 @@ public:
|
||||||
float& operator[](const int _index) { assert(_index < 4 && "index out of range"); return (&mX)[_index]; }
|
float& operator[](const int _index) { assert(_index < 4 && "index out of range"); return (&mX)[_index]; }
|
||||||
const float& operator[](const int _index) const { assert(_index < 4 && "index out of range"); return (&mX)[_index]; }
|
const float& operator[](const int _index) const { assert(_index < 4 && "index out of range"); return (&mX)[_index]; }
|
||||||
|
|
||||||
float& x() { return mX; }
|
inline float& x() { return mX; }
|
||||||
float& y() { return mY; }
|
inline float& y() { return mY; }
|
||||||
float& z() { return mZ; }
|
inline float& z() { return mZ; }
|
||||||
float& w() { return mW; }
|
inline float& w() { return mW; }
|
||||||
const float& x() const { return mX; }
|
inline const float& x() const { return mX; }
|
||||||
const float& y() const { return mY; }
|
inline const float& y() const { return mY; }
|
||||||
const float& z() const { return mZ; }
|
inline const float& z() const { return mZ; }
|
||||||
const float& w() const { return mW; }
|
inline const float& w() const { return mW; }
|
||||||
|
|
||||||
inline Vector2f& v2() { return *(Vector2f*)this; }
|
inline Vector2f& v2() { return *(Vector2f*)this; }
|
||||||
inline const Vector2f& v2() const { return *(Vector2f*)this; }
|
inline const Vector2f& v2() const { return *(Vector2f*)this; }
|
||||||
|
|
Loading…
Reference in a new issue