Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Float2.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10class [[nodiscard]] Float2
11{
12public:
14
15 Float2() = default;
16 Float2(const Float2 &inRHS) = default;
17 Float2(float inX, float inY) : x(inX), y(inY) { }
18
19 bool operator == (const Float2 &inRHS) const { return x == inRHS.x && y == inRHS.y; }
20 bool operator != (const Float2 &inRHS) const { return x != inRHS.x || y != inRHS.y; }
21
23 friend ostream & operator << (ostream &inStream, const Float2 &inV)
24 {
25 inStream << inV.x << ", " << inV.y;
26 return inStream;
27 }
28
29 float x;
30 float y;
31};
32
33static_assert(is_trivial<Float2>(), "Is supposed to be a trivial type!");
34
#define JPH_NAMESPACE_END
Definition: Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:29
Class that holds 2 floats, used as a storage class mainly.
Definition: Float2.h:11
Float2(const Float2 &inRHS)=default
JPH_OVERRIDE_NEW_DELETE Float2()=default
Intentionally not initialized for performance reasons.
float y
Definition: Float2.h:30
float x
Definition: Float2.h:29
Float2(float inX, float inY)
Definition: Float2.h:17