update external headers
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_TMATHELPERS_H_
|
||||
#define MATH_TMATHELPERS_H_
|
||||
#ifndef TNT_MATH_TMATHELPERS_H
|
||||
#define TNT_MATH_TMATHELPERS_H
|
||||
|
||||
#include <math/compiler.h>
|
||||
#include <math/quat.h>
|
||||
@@ -804,4 +804,4 @@ public:
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_TMATHELPERS_H_
|
||||
#endif // TNT_MATH_TMATHELPERS_H
|
||||
|
||||
@@ -14,18 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MATH_TQUATHELPERS_H_
|
||||
#define MATH_TQUATHELPERS_H_
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef TNT_MATH_TQUATHELPERS_H
|
||||
#define TNT_MATH_TQUATHELPERS_H
|
||||
|
||||
#include <math/compiler.h>
|
||||
#include <math/scalar.h>
|
||||
#include <math/vec3.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace filament {
|
||||
namespace math {
|
||||
namespace details {
|
||||
@@ -289,4 +288,4 @@ public:
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_TQUATHELPERS_H_
|
||||
#endif // TNT_MATH_TQUATHELPERS_H
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_TVECHELPERS_H_
|
||||
#define MATH_TVECHELPERS_H_
|
||||
#ifndef TNT_MATH_TVECHELPERS_H
|
||||
#define TNT_MATH_TVECHELPERS_H
|
||||
|
||||
#include <math/compiler.h>
|
||||
|
||||
@@ -477,6 +477,13 @@ private:
|
||||
return v;
|
||||
}
|
||||
|
||||
friend inline VECTOR<T> MATH_PURE sign(VECTOR<T> v) {
|
||||
for (size_t i = 0; i < v.size(); i++) {
|
||||
v[i] = std::copysign(T(1), v[i]);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
friend inline VECTOR<T> MATH_PURE pow(VECTOR<T> v, T p) {
|
||||
for (size_t i = 0; i < v.size(); i++) {
|
||||
v[i] = std::pow(v[i], p);
|
||||
@@ -622,4 +629,4 @@ private:
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_TVECHELPERS_H_
|
||||
#endif // TNT_MATH_TVECHELPERS_H
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef TNT_MATH_COMPILER_H
|
||||
#define TNT_MATH_COMPILER_H
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
@@ -111,8 +112,7 @@
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
namespace filament {
|
||||
namespace math {
|
||||
namespace filament::math {
|
||||
|
||||
// MSVC 2019 16.4 doesn't seem to like it when we specialize std::is_arithmetic for
|
||||
// filament::math::half, so we're forced to create our own is_arithmetic here and specialize it
|
||||
@@ -122,5 +122,6 @@ struct is_arithmetic : std::integral_constant<bool,
|
||||
std::is_integral<T>::value || std::is_floating_point<T>::value> {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
} // filament::math
|
||||
|
||||
#endif // TNT_MATH_COMPILER_H
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
#ifndef TNT_MATH_FAST_H
|
||||
#define TNT_MATH_FAST_H
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
#include <math/compiler.h>
|
||||
#include <math/scalar.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __ARM_NEON
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
#ifndef TNT_MATH_HALF_H
|
||||
#define TNT_MATH_HALF_H
|
||||
|
||||
#include <math/compiler.h>
|
||||
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <math/compiler.h>
|
||||
|
||||
namespace filament {
|
||||
namespace math {
|
||||
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_MAT2_H_
|
||||
#define MATH_MAT2_H_
|
||||
#ifndef TNT_MATH_MAT2_H
|
||||
#define TNT_MATH_MAT2_H
|
||||
|
||||
#include <math/TMatHelpers.h>
|
||||
#include <math/vec2.h>
|
||||
#include <math/compiler.h>
|
||||
#include <math/vec2.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -358,4 +359,4 @@ constexpr void swap(filament::math::details::TMat22<T>& lhs,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MATH_MAT2_H_
|
||||
#endif // TNT_MATH_MAT2_H
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_MAT3_H_
|
||||
#define MATH_MAT3_H_
|
||||
#ifndef TNT_MATH_MAT3_H
|
||||
#define TNT_MATH_MAT3_H
|
||||
|
||||
#include <math/quat.h>
|
||||
#include <math/TMatHelpers.h>
|
||||
#include <math/vec3.h>
|
||||
#include <math/compiler.h>
|
||||
#include <math/quat.h>
|
||||
#include <math/vec3.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
@@ -487,4 +487,4 @@ constexpr void swap(filament::math::details::TMat33<T>& lhs,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MATH_MAT3_H_
|
||||
#endif // TNT_MATH_MAT3_H
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_MAT4_H_
|
||||
#define MATH_MAT4_H_
|
||||
#ifndef TNT_MATH_MAT4_H
|
||||
#define TNT_MATH_MAT4_H
|
||||
|
||||
#include <math/TMatHelpers.h>
|
||||
#include <math/compiler.h>
|
||||
#include <math/mat3.h>
|
||||
#include <math/quat.h>
|
||||
#include <math/scalar.h>
|
||||
#include <math/TMatHelpers.h>
|
||||
#include <math/vec3.h>
|
||||
#include <math/vec4.h>
|
||||
|
||||
@@ -557,6 +557,26 @@ constexpr typename TMat44<T>::col_type MATH_PURE operator*(const TMat44<T>& lhs,
|
||||
typedef details::TMat44<double> mat4;
|
||||
typedef details::TMat44<float> mat4f;
|
||||
|
||||
// mat4 * float4, with double precision intermediates
|
||||
constexpr float4 highPrecisionMultiply(mat4f const& lhs, float4 const& rhs) noexcept {
|
||||
double4 result{};
|
||||
result += lhs[0] * rhs[0];
|
||||
result += lhs[1] * rhs[1];
|
||||
result += lhs[2] * rhs[2];
|
||||
result += lhs[3] * rhs[3];
|
||||
return float4{ result };
|
||||
}
|
||||
|
||||
// mat4 * mat4, with double precision intermediates
|
||||
constexpr mat4f highPrecisionMultiply(mat4f const& lhs, mat4f const& rhs) noexcept {
|
||||
return {
|
||||
highPrecisionMultiply(lhs, rhs[0]),
|
||||
highPrecisionMultiply(lhs, rhs[1]),
|
||||
highPrecisionMultiply(lhs, rhs[2]),
|
||||
highPrecisionMultiply(lhs, rhs[3])
|
||||
};
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
@@ -628,4 +648,4 @@ constexpr void swap(filament::math::details::TMat44<T>& lhs,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MATH_MAT4_H_
|
||||
#endif // TNT_MATH_MAT4_H
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_MATHFWD_H_
|
||||
#define MATH_MATHFWD_H_
|
||||
#ifndef TNT_MATH_MATHFWD_H
|
||||
#define TNT_MATH_MATHFWD_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -91,4 +91,4 @@ using mat4f = details::TMat44<float>;
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#endif // MATH_MATHFWD_H_
|
||||
#endif // TNT_MATH_MATHFWD_H
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_QUAT_H_
|
||||
#define MATH_QUAT_H_
|
||||
#ifndef TNT_MATH_QUAT_H
|
||||
#define TNT_MATH_QUAT_H
|
||||
|
||||
#include <math/half.h>
|
||||
#include <math/TQuatHelpers.h>
|
||||
#include <math/compiler.h>
|
||||
#include <math/half.h>
|
||||
#include <math/vec3.h>
|
||||
#include <math/vec4.h>
|
||||
#include <math/compiler.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
@@ -164,4 +164,4 @@ constexpr inline quat operator "" _k(unsigned long long v) {
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_QUAT_H_
|
||||
#endif // TNT_MATH_QUAT_H
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_VEC2_H_
|
||||
#define MATH_VEC2_H_
|
||||
#ifndef TNT_MATH_VEC2_H
|
||||
#define TNT_MATH_VEC2_H
|
||||
|
||||
#include <math/TVecHelpers.h>
|
||||
#include <math/half.h>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
namespace filament {
|
||||
namespace math {
|
||||
@@ -110,4 +111,4 @@ using bool2 = vec2<bool>;
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_VEC2_H_
|
||||
#endif // TNT_MATH_VEC2_H
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_VEC3_H_
|
||||
#define MATH_VEC3_H_
|
||||
#ifndef TNT_MATH_VEC3_H
|
||||
#define TNT_MATH_VEC3_H
|
||||
|
||||
#include <math/vec2.h>
|
||||
#include <math/half.h>
|
||||
#include <math/vec2.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
namespace filament {
|
||||
namespace math {
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -130,4 +130,4 @@ using bool3 = vec3<bool>;
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_VEC3_H_
|
||||
#endif // TNT_MATH_VEC3_H
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MATH_VEC4_H_
|
||||
#define MATH_VEC4_H_
|
||||
#ifndef TNT_MATH_VEC4_H
|
||||
#define TNT_MATH_VEC4_H
|
||||
|
||||
#include <math/vec3.h>
|
||||
#include <math/half.h>
|
||||
#include <math/vec3.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -129,4 +130,4 @@ using bool4 = vec4<bool>;
|
||||
} // namespace math
|
||||
} // namespace filament
|
||||
|
||||
#endif // MATH_VEC4_H_
|
||||
#endif // TNT_MATH_VEC4_H
|
||||
|
||||
Reference in New Issue
Block a user