Compare commits
2 Commits
23b5a2aa0e
...
a303e50395
| Author | SHA1 | Date | |
|---|---|---|---|
| a303e50395 | |||
| 63a228946e |
@ -29,6 +29,7 @@ __m128 Norm<E>::eval() const noexcept
|
||||
}
|
||||
|
||||
template<vector_expression E>
|
||||
TNVX_INLINE
|
||||
Norm<E> norm(const Expr<E>& e) noexcept
|
||||
{
|
||||
return { e.self() };
|
||||
|
||||
@ -28,10 +28,10 @@ struct alignas(16) vec4 : Expr<vec4>
|
||||
__m128 eval() const noexcept;
|
||||
|
||||
[[nodiscard]] inline
|
||||
float magnitude() const noexcept;
|
||||
auto magnitude() const noexcept;
|
||||
|
||||
[[nodiscard]] inline
|
||||
vec4 norm() const noexcept;
|
||||
auto norm() const noexcept;
|
||||
|
||||
[[nodiscard]] inline
|
||||
float x() const noexcept;
|
||||
|
||||
@ -35,17 +35,29 @@ __m128 vec4::eval() const noexcept
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
float vec4::x() const noexcept
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user