Merge branch 'fix/fix-ve4-magnitude-and-norm'
This commit is contained in:
commit
a303e50395
@ -29,6 +29,7 @@ __m128 Norm<E>::eval() const noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<vector_expression E>
|
template<vector_expression E>
|
||||||
|
TNVX_INLINE
|
||||||
Norm<E> norm(const Expr<E>& e) noexcept
|
Norm<E> norm(const Expr<E>& e) noexcept
|
||||||
{
|
{
|
||||||
return { e.self() };
|
return { e.self() };
|
||||||
|
|||||||
@ -28,10 +28,10 @@ struct alignas(16) vec4 : Expr<vec4>
|
|||||||
__m128 eval() const noexcept;
|
__m128 eval() const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] inline
|
[[nodiscard]] inline
|
||||||
float magnitude() const noexcept;
|
auto magnitude() const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] inline
|
[[nodiscard]] inline
|
||||||
vec4 norm() const noexcept;
|
auto norm() const noexcept;
|
||||||
|
|
||||||
[[nodiscard]] inline
|
[[nodiscard]] inline
|
||||||
float x() const noexcept;
|
float x() const noexcept;
|
||||||
|
|||||||
@ -35,17 +35,29 @@ __m128 vec4::eval() const noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
TNVX_INLINE
|
TNVX_INLINE
|
||||||
float vec4::magnitude() const noexcept
|
auto vec4::magnitude() const noexcept
|
||||||
{
|
{
|
||||||
return _mm_cvtss_f32(Magnitude<vec4>(*this).eval());
|
return Magnitude<vec4>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
TNVX_INLINE
|
TNVX_INLINE
|
||||||
vec4 vec4::norm() const noexcept
|
auto vec4::norm() const noexcept
|
||||||
{
|
{
|
||||||
return { Norm<vec4>(*this) };
|
return Norm<vec4>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TNVX_INLINE
|
||||||
|
//Magnitude<vec4> vec4::magnitude() const noexcept
|
||||||
|
//{
|
||||||
|
// return { *this };
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//TNVX_INLINE
|
||||||
|
//Norm<vec4> vec4::norm() const noexcept
|
||||||
|
//{
|
||||||
|
// return { *this };
|
||||||
|
//}
|
||||||
|
|
||||||
TNVX_INLINE
|
TNVX_INLINE
|
||||||
float vec4::x() const noexcept
|
float vec4::x() const noexcept
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user