Path: blob/master/thirdparty/jolt_physics/Jolt/Math/Float2.h
9913 views
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)1// SPDX-FileCopyrightText: 2021 Jorrit Rouwe2// SPDX-License-Identifier: MIT34#pragma once56JPH_NAMESPACE_BEGIN78/// Class that holds 2 floats, used as a storage class mainly.9class [[nodiscard]] Float210{11public:12JPH_OVERRIDE_NEW_DELETE1314Float2() = default; ///< Intentionally not initialized for performance reasons15Float2(const Float2 &inRHS) = default;16Float2 & operator = (const Float2 &inRHS) = default;17Float2(float inX, float inY) : x(inX), y(inY) { }1819bool operator == (const Float2 &inRHS) const { return x == inRHS.x && y == inRHS.y; }20bool operator != (const Float2 &inRHS) const { return x != inRHS.x || y != inRHS.y; }2122/// To String23friend ostream & operator << (ostream &inStream, const Float2 &inV)24{25inStream << inV.x << ", " << inV.y;26return inStream;27}2829float x;30float y;31};3233static_assert(std::is_trivial<Float2>(), "Is supposed to be a trivial type!");3435JPH_NAMESPACE_END363738