mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Adds mat_scale function
Introduces a utility function to create a scaling matrix from a Vector3. This simplifies the creation of scale transformations, particularly useful for the GJK algorithm implementation.
This commit is contained in:
@@ -586,6 +586,17 @@ namespace omath
|
|||||||
{0, 0, 0, 1},
|
{0, 0, 0, 1},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||||
|
[[nodiscard]]
|
||||||
|
constexpr Mat<4, 4, Type, St> mat_scale(const Vector3<Type>& scale) noexcept
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
{scale.x, 0, 0, 0},
|
||||||
|
{0, scale.y, 0, 0},
|
||||||
|
{0, 0, scale.z, 0},
|
||||||
|
{0, 0, 0, 1},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR, class Angle>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
|
|||||||
Reference in New Issue
Block a user