| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
JPH_NAMESPACE_BEGIN |
| 8 |
|
| 9 |
|
| 10 |
class [[nodiscard]] Float2 |
| 11 |
{ |
| 12 |
public: |
| 13 |
JPH_OVERRIDE_NEW_DELETE |
| 14 |
|
| 15 |
Float2() = default; |
| 16 |
Float2(const Float2 &inRHS) = default; |
| 17 |
Float2 & operator = (const Float2 &inRHS) = default; |
| 18 |
Float2(float inX, float inY) : x(inX), y(inY) { } |
| 19 |
|
| 20 |
bool operator == (const Float2 &inRHS) const { return x == inRHS.x && y == inRHS.y; } |
| 21 |
bool operator != (const Float2 &inRHS) const { return x != inRHS.x || y != inRHS.y; } |
| 22 |
|
| 23 |
|
| 24 |
friend ostream & operator << (ostream &inStream, const Float2 &inV) |
| 25 |
{ |
| 26 |
inStream << inV.x << ", " << inV.y; |
| 27 |
return inStream; |
| 28 |
} |
| 29 |
|
| 30 |
float x; |
| 31 |
float y; |
| 32 |
}; |
| 33 |
|
| 34 |
static_assert(std::is_trivial<Float2>(), "Is supposed to be a trivial type!"); |
| 35 |
|
| 36 |
JPH_NAMESPACE_END |