update Filament headers to v1.58.0

This commit is contained in:
Nick Fisher
2025-03-17 16:38:52 +08:00
parent 20ea43a809
commit f923b94b84
56 changed files with 3234 additions and 215 deletions

View File

@@ -259,7 +259,7 @@ public:
return normalize(lerp(d < 0 ? -p : p, q, t));
}
const T npq = std::sqrt(dot(p, p) * dot(q, q)); // ||p|| * ||q||
const T a = std::acos(filament::math::clamp(absd / npq, T(-1), T(1)));
const T a = std::acos(math::clamp(absd / npq, T(-1), T(1)));
const T a0 = a * (1 - t);
const T a1 = a * t;
const T sina = sin(a);

View File

@@ -50,7 +50,7 @@ constexpr T MATH_PURE cos(T x) noexcept {
// x between -pi and pi
template<typename T, typename = std::enable_if_t<std::is_floating_point<T>::value>>
constexpr T MATH_PURE sin(T x) noexcept {
return filament::math::fast::cos<T>(x - T(F_PI_2));
return fast::cos<T>(x - T(F_PI_2));
}
constexpr inline float MATH_PURE ilog2(float x) noexcept {

View File

@@ -164,7 +164,7 @@ inline constexpr half operator""_h(long double v) {
return half( static_cast<float>(v) );
}
template<> struct is_arithmetic<filament::math::half> : public std::true_type {};
template<> struct is_arithmetic<half> : public std::true_type {};
} // namespace math
} // namespace filament

View File

@@ -225,7 +225,7 @@ public:
* Rotate by radians in the 2D plane
*/
static TMat22<T> rotate(T radian) noexcept {
TMat22<T> r(TMat22<T>::NO_INIT);
TMat22<T> r(NO_INIT);
T c = std::cos(radian);
T s = std::sin(radian);
r[0][0] = c;

View File

@@ -256,7 +256,7 @@ public:
*/
friend inline
constexpr TMat33 orthogonalize(const TMat33& m) noexcept {
TMat33 ret(TMat33::NO_INIT);
TMat33 ret(NO_INIT);
ret[0] = normalize(m[0]);
ret[2] = normalize(cross(ret[0], m[1]));
ret[1] = normalize(cross(ret[2], ret[0]));

View File

@@ -498,10 +498,10 @@ constexpr TMat44<T> TMat44<T>::frustum(T left, T right, T bottom, T top, T near,
}
template<typename T>
TMat44<T> TMat44<T>::perspective(T fov, T aspect, T near, T far, TMat44::Fov direction) noexcept {
TMat44<T> TMat44<T>::perspective(T fov, T aspect, T near, T far, Fov direction) noexcept {
T h, w;
if (direction == TMat44::Fov::VERTICAL) {
if (direction == Fov::VERTICAL) {
h = std::tan(fov * F_PI / 360.0f) * near;
w = h * aspect;
} else {