36 point(
const __m128& rhs);
68 operator vec4()
const;
89 this->vec = _mm_setr_ps(0, 0, 0, 1);
98 this->vec = _mm_setr_ps(x, y, z, 1);
107 this->vec = _mm_setr_ps(v, v, v, 1);
127 n_assert(rhs.__w == 0.0f || rhs.__w == 1.0f);
129 this->vec = _mm_or_ps(rhs.vec, _id_w);
139 this->vec = _mm_or_ps(_mm_and_ps(rhs.vec, _mask_xyz), _id_w);
148 this->vec = _mm_insert_ps(rhs, _id_w, 0b11110000);
166 this->vec = _mm_insert_ps(rhs, _id_w, 0b11110000);
175 this->vec = _mm_add_ps(this->vec, rhs.vec);
184 this->vec = _mm_sub_ps(this->vec, rhs.vec);
194 this->vec = _mm_load_ps(ptr);
204 this->vec = _mm_loadu_ps(ptr);
214 _mm_store_ps(ptr, this->vec);
224 _mm_storeu_ps(ptr, this->vec);
234 __m128 v = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2));
235 _mm_storel_epi64(
reinterpret_cast<__m128i*
>(ptr), _mm_castps_si128(this->vec));
236 _mm_store_ss(&ptr[2], v);
246 __m128 t1 = _mm_permute_ps(this->vec, _MM_SHUFFLE(1, 1, 1, 1));
247 __m128 t2 = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2));
248 _mm_store_ss(&ptr[0], this->vec);
249 _mm_store_ss(&ptr[1], t1);
250 _mm_store_ss(&ptr[2], t2);
258 return _mm_add_ps(lhs.vec, rhs.vec);
267 return _mm_sub_ps(lhs.vec, rhs.vec);
276 return _mm_sub_ps(lhs.vec, rhs.vec);
285 __m128 vTemp = _mm_cmpeq_ps(this->vec, rhs.vec);
286 return ((_mm_movemask_ps(vTemp) == 0x0f) != 0);
295 __m128 vTemp = _mm_cmpeq_ps(this->vec, rhs.vec);
296 return ((_mm_movemask_ps(vTemp) == 0x0f) == 0);
306 return *((&this->x) + index);
316 return *((&this->x) + index);
325 return vec4(this->vec);
334 this->vec = _mm_setr_ps(x, y, z, 1);
343 return _mm_cvtss_f32(_mm_dp_ps(p0.vec, p1.vec, 0x71));
352 return _mm_cvtss_f32(_mm_dp_ps(v.vec, p.vec, 0x71));
361 return _mm_cvtss_f32(_mm_dp_ps(p.vec, v.vec, 0x71));
370 return _mm_max_ps(v0.vec, v1.vec);
379 return _mm_min_ps(v0.vec, v1.vec);
388 __m128 vTemp = _mm_cmpge_ps(v0.vec, v1.vec);
389 int res = _mm_movemask_ps(vTemp) & 7;
399 __m128 vTemp = _mm_cmpge_ps(v0.vec, v1.vec);
400 int res = _mm_movemask_ps(vTemp) & 7;
410 __m128 vTemp = _mm_cmpgt_ps(v0.vec, v1.vec);
411 int res = _mm_movemask_ps(vTemp) & 7;
421 __m128 vTemp = _mm_cmpgt_ps(v0.vec, v1.vec);
422 int res = _mm_movemask_ps(vTemp) & 7;
432 __m128 vTemp = _mm_cmpgt_ps(v0.vec, v1.vec);
433 int res = _mm_movemask_ps(vTemp) & 7;
443 __m128 vTemp = _mm_cmpgt_ps(v0.vec, v1.vec);
444 int res = _mm_movemask_ps(vTemp) & 7;
454 __m128 vTemp = _mm_cmpge_ps(v0.vec, v1.vec);
455 int res = _mm_movemask_ps(vTemp) & 7;
465 __m128 vTemp = _mm_cmpge_ps(v0.vec, v1.vec);
466 int res = _mm_movemask_ps(vTemp) & 7;
476 __m128 vTemp = _mm_cmpeq_ps(v0.vec, v1.vec);
477 int res = _mm_movemask_ps(vTemp) & 7;
487 __m128 eps = _mm_set1_ps(epsilon);
488 __m128 delta = _mm_sub_ps(v0.vec, v1.vec);
489 __m128 temp = _mm_setzero_ps();
490 temp = _mm_sub_ps(temp, delta);
491 temp = _mm_max_ps(temp, delta);
492 temp = _mm_cmple_ps(temp, eps);
493 temp = _mm_and_ps(temp, _mask_xyz);
494 return (_mm_movemask_ps(temp) == 0x7) != 0;
503 return _mm_min_ps(_mm_cmplt_ps(v0.vec, v1.vec), _plus1);
512 return _mm_min_ps(_mm_cmpgt_ps(v0.vec, v1.vec), _plus1);
521 return _mm_min_ps(_mm_cmpeq_ps(v0.vec, v1.vec), _plus1);
531 res.vec = _mm_and_ps(v.vec, _mask_xyz);
#define n_assert(exp)
Definition debug.h:58
Different curves.
Definition angularpfeedbackloop.h:17
__forceinline point less(const point &v0, const point &v1)
Definition point.h:501
__forceinline point maximize(const point &v0, const point &v1)
Definition point.h:368
__forceinline bool equal_any(const point &v0, const point &v1)
Definition point.h:474
__forceinline bool greaterequal_any(const point &v0, const point &v1)
Definition point.h:452
__forceinline point equal(const point &v0, const point &v1)
Definition point.h:519
__forceinline scalar dot(const plane &p, const vec4 &v1)
Definition plane.h:252
__forceinline bool greaterequal_all(const point &v0, const point &v1)
Definition point.h:463
__forceinline bool greater_any(const point &v0, const point &v1)
Definition point.h:430
half operator-(half one, half two)
Definition half.h:114
__forceinline bool less_any(const point &v0, const point &v1)
Definition point.h:386
__forceinline bool less_all(const point &v0, const point &v1)
Definition point.h:397
__forceinline bool lessequal_all(const point &v0, const point &v1)
Definition point.h:419
__forceinline point minimize(const point &v0, const point &v1)
Definition point.h:377
float scalar
Definition scalar.h:45
__forceinline point greater(const point &v0, const point &v1)
Definition point.h:510
half operator+(half one, half two)
Definition half.h:105
__forceinline bool greater_all(const point &v0, const point &v1)
Definition point.h:441
__forceinline bool nearequal(const point &v0, const point &v1, float epsilon)
Definition point.h:485
__forceinline bool lessequal_any(const point &v0, const point &v1)
Definition point.h:408
__forceinline vec3 xyz(const point &v)
Definition point.h:528
Represents a 3D point in space.
Definition point.h:22
void set(scalar x, scalar y, scalar z)
set content
Definition point.h:332
void operator=(const point &rhs)
assignment operator
Definition point.h:155
bool operator==(const point &rhs) const
equality operator
Definition point.h:283
void storeu(scalar *ptr) const
write content to unaligned memory through the write cache
Definition point.h:222
bool operator!=(const point &rhs) const
inequality operator
Definition point.h:293
void operator+=(const vector &rhs)
inplace add
Definition point.h:173
void store(scalar *ptr) const
write content to 16-byte-aligned memory through the write cache
Definition point.h:212
void store3(scalar *ptr) const
write content to 16-byte-aligned memory through the write cache
Definition point.h:232
void load(const scalar *ptr)
load content from 16-byte-aligned memory
Definition point.h:192
point()
default constructor
Definition point.h:87
void operator-=(const vector &rhs)
inplace sub
Definition point.h:182
void loadu(const scalar *ptr)
load content from unaligned memory
Definition point.h:202
void storeu3(scalar *ptr) const
write content to unaligned memory through the write cache
Definition point.h:244
float operator[](int index) const
Definition point.h:303
A 3D vector.
Definition vec3.h:37
A 4D vector.
Definition vec4.h:24
vec4()=default
default constructor, NOTE: does NOT setup components!
A vector is a 3D direction in space.
Definition vector.h:22
#define NEBULA_ALIGN16
Definition types.h:143