7#include "translate2.hpp"
11namespace hi {
inline namespace v1 {
14[[nodiscard]]
constexpr point3 operator*(translate3
const& lhs, point3
const& rhs)
noexcept;
19 using array_type = simd<float, 4>;
20 using value_type = array_type::value_type;
27 [[nodiscard]]
constexpr translate3() noexcept : _v(0.0f, 0.0f, 0.0f, 0.0f) {}
29 [[nodiscard]]
constexpr explicit operator array_type()
const noexcept
40 _v(
static_cast<array_type
>(get<0>(
other)).xy00())
45 : _v(
static_cast<array_type
>(get<0>(
other)).xy00())
59 [[nodiscard]]
constexpr explicit operator translate2()
const noexcept
67 : _v(
static_cast<array_type
>(
other))
71 [[nodiscard]]
constexpr explicit translate3(point3
const&
other) noexcept
72 : _v(
static_cast<array_type
>(
other).xyz0())
76 [[nodiscard]]
constexpr translate3(
float x,
float y,
float z = 0.0f) noexcept
81 [[nodiscard]]
constexpr float x()
const noexcept
86 [[nodiscard]]
constexpr float y()
const noexcept
91 [[nodiscard]]
constexpr float z()
const noexcept
96 [[nodiscard]]
constexpr float& x()
noexcept
101 [[nodiscard]]
constexpr float& y()
noexcept
106 [[nodiscard]]
constexpr float& z()
noexcept
124 x = dst_rectangle.left();
127 x = dst_rectangle.right() - src_rectangle.width();
130 x = dst_rectangle.center() - src_rectangle.width() * 0.5f;
138 y = dst_rectangle.bottom();
141 y = dst_rectangle.top() - src_rectangle.height();
144 y = dst_rectangle.middle() - src_rectangle.height() * 0.5f;
150 return translate3{x - src_rectangle.left(), y - src_rectangle.bottom()};
153 [[nodiscard]]
constexpr friend bool operator==(
translate3 const& lhs,
translate3 const& rhs)
noexcept
155 return equal(lhs._v, rhs._v);
158 [[nodiscard]]
constexpr translate3 operator~() const noexcept
163 [[nodiscard]]
constexpr bool holds_invariant() const noexcept
165 return _v.w() == 0.0f;
168 [[nodiscard]]
friend constexpr translate3 round(translate3
const& rhs)
noexcept
170 return translate3{round(rhs._v)};
177[[nodiscard]]
constexpr translate3 translate_z(
float z)
noexcept
179 return translate3{0.0f, 0.0f, z};
#define hi_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:279
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
@ middle
Align to the vertical-middle.
@ bottom
Align to the bottom.
@ right
Align the text to the right side.
@ left
Align the text to the left side.
@ center
Align the text in the center.
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:26
Horizontal/Vertical alignment combination.
Definition alignment.hpp:239
Definition translate2.hpp:13
Definition translate3.hpp:17
static constexpr translate3 align(aarectangle src_rectangle, aarectangle dst_rectangle, alignment alignment) noexcept
Align a rectangle within another rectangle.
Definition translate3.hpp:117
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector3.hpp:19