31 #include "Utilities/Math/Math.h" 38 Vector3 Min = MakeVector3(0.0f);
39 Vector3 Max = MakeVector3(0.0f);
41 constexpr Vector3 Length()
const 46 constexpr Vector3 GetCenter()
const 48 return (Max + Min) * 0.5f;
52 inline constexpr
AABB operator*(
const AABB& box,
const Vector3& scale)
54 return AABB{ box.Min * scale, box.Max * scale };
57 inline constexpr
AABB operator/(
const AABB& box,
const Vector3& scale)
59 return AABB{ box.Min / scale, box.Max / scale };
62 inline constexpr
AABB operator+(
const AABB& box,
const Vector3& translate)
64 return AABB{ box.Min + translate, box.Max + translate };
67 inline constexpr
AABB operator-(
const AABB& box,
const Vector3& translate)
69 return AABB{ box.Min - translate, box.Max - translate };
72 inline AABB operator*(
const AABB& box,
const Matrix4x4& matrix)
74 std::array<Vector3, 8> vecs;
77 matrix * MakeVector4(box.Min.x, box.Min.y, box.Min.z, 1.0f),
78 matrix * MakeVector4(box.Min.x, box.Min.y, box.Max.z, 1.0f),
79 matrix * MakeVector4(box.Min.x, box.Max.y, box.Min.z, 1.0f),
80 matrix * MakeVector4(box.Min.x, box.Max.y, box.Max.z, 1.0f),
81 matrix * MakeVector4(box.Max.x, box.Min.y, box.Min.z, 1.0f),
82 matrix * MakeVector4(box.Max.x, box.Min.y, box.Max.z, 1.0f),
83 matrix * MakeVector4(box.Max.x, box.Max.y, box.Min.z, 1.0f),
84 matrix * MakeVector4(box.Max.x, box.Max.y, box.Max.z, 1.0f),
87 return AABB{ minmax.first, minmax.second };
std::pair< Vector3, Vector3 > MinMaxComponents(Vector3 *verteces, size_t size)
Definition: Math.h:575
Definition: Application.cpp:49