2020-04-18 10:22:42 +00:00
|
|
|
/*
|
2021-05-29 10:38:28 +00:00
|
|
|
* Copyright (c) 2020, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
2022-01-07 02:36:07 +00:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-04-18 10:22:42 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-18 10:22:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-01-07 02:36:07 +00:00
|
|
|
#include "VectorN.h"
|
2020-04-18 10:22:42 +00:00
|
|
|
|
2022-01-07 02:36:07 +00:00
|
|
|
#include <AK/Error.h>
|
|
|
|
#include <AK/Format.h>
|
|
|
|
#include <AK/StringView.h>
|
2020-04-18 10:22:42 +00:00
|
|
|
|
2022-01-07 02:36:07 +00:00
|
|
|
namespace Gfx {
|
2020-04-18 10:22:42 +00:00
|
|
|
|
2022-01-07 02:36:07 +00:00
|
|
|
template<class T>
|
|
|
|
using Vector3 = VectorN<3, T>;
|
|
|
|
using DoubleVector3 = Vector3<double>;
|
2022-04-29 13:07:59 +00:00
|
|
|
using FloatVector3 = Vector3<float>;
|
|
|
|
using IntVector3 = Vector3<int>;
|
2020-04-18 10:22:42 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-05-14 23:31:28 +00:00
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct Formatter<Gfx::Vector3<T>> : Formatter<StringView> {
|
2021-11-16 00:15:21 +00:00
|
|
|
ErrorOr<void> format(FormatBuilder& builder, Gfx::Vector3<T> const& value)
|
2021-05-14 23:31:28 +00:00
|
|
|
{
|
2023-12-16 14:19:34 +00:00
|
|
|
return Formatter<StringView>::format(builder, value.to_byte_string());
|
2021-05-14 23:31:28 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-04-18 10:22:42 +00:00
|
|
|
using Gfx::DoubleVector3;
|
|
|
|
using Gfx::FloatVector3;
|
2022-04-29 13:07:59 +00:00
|
|
|
using Gfx::IntVector3;
|
2020-04-18 10:22:42 +00:00
|
|
|
using Gfx::Vector3;
|