19 requires std::is_floating_point_v<T>
32 if (!std::isfinite(
center.X()) || !std::isfinite(
center.Y()) ||
95 HalfExtents_.X() +
margin &&
97 HalfExtents_.Y() +
margin &&
109 : -HalfExtents_.X()) +
111 : -HalfExtents_.Y()) +
113 : -HalfExtents_.Z());
121 return {Center_ -
x -
y -
z, Center_ +
x -
y -
z,
122 Center_ -
x +
y -
z, Center_ +
x +
y -
z,
123 Center_ -
x -
y +
z, Center_ +
x -
y +
z,
124 Center_ -
x +
y +
z, Center_ +
x +
y +
z};
131 left.HalfExtents_ ==
right.HalfExtents_ &&
140 Obb3(
const Point3<T>& center,
141 const Vec3<T>& halfExtents,
142 const Rotation3<T>& orientation,
143 UncheckedTag) noexcept :
145 HalfExtents_(halfExtents),
146 Orientation_(orientation)
151 Vec3<T> HalfExtents_{};
152 Rotation3<T> Orientation_{};
158 template <
typename T>
167 template <
typename T>
171 std::array<Point3<T>, 8>
corners =
box.Corners();
182static_assert(std::is_trivially_copyable_v<mv::math::Obb3f>);
183static_assert(std::is_standard_layout_v<mv::math::Obb3f>);
186static_assert(std::is_trivially_copyable_v<mv::math::Obb3d>);
187static_assert(std::is_standard_layout_v<mv::math::Obb3d>);
static std::optional< Aabb3 > TryFromPoints(std::span< const Point3< T > > points) noexcept
static std::optional< Obb3 > TryFromCenterHalfExtents(const Point3< T > ¢er, const Vec3< T > &halfExtents, const Rotation3< T > &orientation=Rotation3< T >::Identity()) noexcept
bool Contains(const Point3< T > &point, T tolerance=T(0)) const noexcept
Point3< T > Support(const Vec3< T > &direction) const noexcept
Point3< T > ClosestPoint(const Point3< T > &point) const noexcept
std::array< Point3< T >, 8 > Corners() const noexcept
Direction3< T > AxisZ() const noexcept
Direction3< T > AxisY() const noexcept
Direction3< T > AxisX() const noexcept
const Vec3< T > & HalfExtents() const noexcept
friend bool operator==(const Obb3 &left, const Obb3 &right) noexcept
const Rotation3< T > & Orientation() const noexcept
const Point3< T > & Center() const noexcept
constexpr T Dot(const Quat< T > &left, const Quat< T > &right) noexcept
std::optional< Aabb3< T > > TryTransformConservativeAabb(const AffineTransform3< T > &transform, const Obb3< T > &box) noexcept
Vec3< T > TransformPoint(const AffineTransform3< T > &transform, const Vec3< T > &point) noexcept
Vec3< T > Rotate(const Rotation3< T > &rotation, const Vec3< T > &vector) noexcept
Obb3< T > TransformObb(const RigidTransform3< T > &transform, const Obb3< T > &box) noexcept