![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <MathVectors.h>
Public Member Functions | |
vec2 () noexcept | |
vec2 (T value) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec2 (U value) noexcept | |
vec2 (T xIn, T yIn) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec2 (U xIn, U yIn) noexcept | |
template<typename U , typename V > requires std::is_pod_v<U> && std::is_pod_v<U> | |
vec2 (U xIn, V yIn) noexcept | |
vec2 (const T *_v) noexcept | |
vec2 (const vec3< T > &_v) noexcept | |
vec2 (const vec4< T > &_v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec2 (const vec2< U > &v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec2 (const vec3< U > &v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec2 (const vec4< U > &v) noexcept | |
bool | operator> (const vec2 &v) const noexcept |
bool | operator< (const vec2 &v) const noexcept |
bool | operator<= (const vec2 &v) const noexcept |
bool | operator>= (const vec2 &v) const noexcept |
bool | operator== (const vec2 &v) const noexcept |
bool | operator!= (const vec2 &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
bool | operator!= (const vec2< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
bool | operator== (const vec2< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator- (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator+ (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator* (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator/ (U _i) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator+ (const vec2< U > v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator- (const vec2< U > v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 | operator* (const vec2< U > v) const noexcept |
vec2 | operator- () const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator+= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator-= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator*= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator/= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator*= (const vec2< U > v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator+= (const vec2< U > v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator-= (const vec2< U > v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec2 & | operator/= (const vec2< U > v) noexcept |
template<typename U > requires std::is_unsigned_v<U> | |
T & | operator[] (U i) noexcept |
template<typename U > requires std::is_unsigned_v<U> | |
const T & | operator[] (U i) const noexcept |
vec2 | operator/ (const vec2 &v) const noexcept |
operator T* () noexcept | |
operator const T * () const noexcept | |
void | swap (vec2 *iv) noexcept |
swap the components of this vector with that of the specified one | |
void | swap (vec2 &iv) noexcept |
swap the components of this vector with that of the specified one | |
void | set (const T *v) noexcept |
set the 2 components of the vector manually using a source pointer to a (large enough) array | |
void | set (T value) noexcept |
set the 2 components of the vector manually | |
void | set (T xIn, T yIn) noexcept |
set the 2 components of the vector manually | |
template<typename U > requires std::is_pod_v<U> | |
void | set (U xIn, U yIn) noexcept |
void | set (const vec2 &v) noexcept |
set the 2 components of the vector using a source vector | |
void | set (const vec3< T > &v) noexcept |
set the 2 components of the vector using the first 2 components of the source vector | |
void | set (const vec4< T > &v) noexcept |
set the 2 components of the vector using the first 2 components of the source vector | |
void | reset () |
set the 2 components of the vector back to 0 | |
T | length () const noexcept |
return the vector's length | |
T | lengthSquared () const noexcept |
return the squared distance of the vector | |
T | angle () const |
return the angle defined by the 2 components | |
T | angle (const vec2 &v) const |
return the angle defined by the 2 components | |
T | distance (const vec2 &v) const |
compute the vector's distance to another specified vector | |
T | distanceSquared (const vec2 &v) const noexcept |
compute the vector's squared distance to another specified vector | |
vec2 & | normalize () noexcept |
convert the vector to unit length | |
T | minComponent () const noexcept |
get the smallest value of X or Y | |
T | maxComponent () const noexcept |
get the largest value of X or Y | |
void | round () |
round both values | |
void | lerp (const vec2 &v, T factor) noexcept |
lerp between this and the specified vector by the specified amount | |
void | lerp (const vec2 &v, const vec2 &factor) noexcept |
lerp between this and the specified vector by the specified amount for each component | |
T | dot (const vec2 &v) const noexcept |
calculate the dot product between this vector and the specified one | |
T | projectionOnLine (const vec2 &vA, const vec2 &vB) const |
project this vector on the line defined by the 2 points(A, B) | |
vec2 | closestPointOnLine (const vec2 &vA, const vec2 &vB) |
return the closest point on the line defined by the 2 points (A, B) and this vector | |
vec2 | closestPointOnSegment (const vec2 &vA, const vec2 &vB) |
return the closest point on the line segment defined between the 2 points (A, B) and this vector | |
template<typename U > requires std::is_pod_v<U> | |
bool | compare (vec2< U > v) const noexcept |
compare 2 vectors | |
template<typename U > requires std::is_pod_v<U> | |
bool | compare (vec2< U > v, U epsi) const noexcept |
compare 2 vectors within the specified tolerance | |
void | get (T *v) const |
export the vector's components in the first 2 positions of the specified array | |
template<typename U > requires std::is_pod_v<U> | |
FORCE_INLINE bool | compare (const vec2< U > v) const noexcept |
compare 2 vectors | |
template<typename U > requires std::is_pod_v<U> | |
FORCE_INLINE bool | compare (const vec2< U > v, U epsi) const noexcept |
compare 2 vectors using the given tolerance | |
Public Attributes | |
union { | |
struct { | |
T x | |
T y | |
} | |
struct { | |
T s | |
T t | |
} | |
struct { | |
T width | |
T height | |
} | |
struct { | |
T min | |
T max | |
} | |
struct { | |
T offset | |
T count | |
} | |
T _v [2] = {T{0}, T{0} } | |
}; | |
Definition at line 129 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 134 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 136 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 140 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 143 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 147 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 151 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 154 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 157 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 160 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 164 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 168 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 172 of file MathVectors.h.
|
inline |
return the angle defined by the 2 components
Definition at line 381 of file MathVectors.h.
|
inline |
return the angle defined by the 2 components
Definition at line 386 of file MathVectors.h.
FORCE_INLINE vec2< T > Divide::vec2< T >::closestPointOnLine | ( | const vec2< T > & | vA, |
const vec2< T > & | vB | ||
) |
return the closest point on the line defined by the 2 points (A, B) and this vector
return the coordinates of the closest point from *this to the line determined by points vA and vB
Definition at line 424 of file MathVectors.inl.
FORCE_INLINE vec2< T > Divide::vec2< T >::closestPointOnSegment | ( | const vec2< T > & | vA, |
const vec2< T > & | vB | ||
) |
return the closest point on the line segment defined between the 2 points (A, B) and this vector
return the coordinates of the closest point from *this to the segment determined by points vA and vB
Definition at line 432 of file MathVectors.inl.
|
noexcept |
compare 2 vectors
Definition at line 374 of file MathVectors.inl.
|
noexcept |
compare 2 vectors using the given tolerance
Definition at line 383 of file MathVectors.inl.
|
noexcept |
compare 2 vectors
|
noexcept |
compare 2 vectors within the specified tolerance
FORCE_INLINE T Divide::vec2< T >::distance | ( | const vec2< T > & | v | ) | const |
compute the vector's distance to another specified vector
Definition at line 331 of file MathVectors.inl.
|
noexcept |
compute the vector's squared distance to another specified vector
Definition at line 338 of file MathVectors.inl.
|
noexcept |
calculate the dot product between this vector and the specified one
get the dot product between this vector and the specified one
Definition at line 400 of file MathVectors.inl.
FORCE_INLINE void Divide::vec2< T >::get | ( | T * | v | ) | const |
export the vector's components in the first 2 positions of the specified array
export the vector's components in the first 2 positions of the specified array
Definition at line 415 of file MathVectors.inl.
|
inlinenoexcept |
return the vector's length
Definition at line 375 of file MathVectors.h.
|
noexcept |
return the squared distance of the vector
Definition at line 324 of file MathVectors.inl.
|
noexcept |
lerp between this and the specified vector by the specified amount for each component
Definition at line 451 of file MathVectors.inl.
|
noexcept |
lerp between this and the specified vector by the specified amount
Definition at line 444 of file MathVectors.inl.
|
noexcept |
get the largest value of X or Y
Definition at line 366 of file MathVectors.inl.
|
noexcept |
get the smallest value of X or Y
Definition at line 360 of file MathVectors.inl.
|
noexcept |
convert the vector to unit length
Definition at line 346 of file MathVectors.inl.
|
inlinenoexcept |
Definition at line 319 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 315 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 196 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 201 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 246 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 222 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 278 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 267 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 236 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 217 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 283 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 257 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 251 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 241 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 212 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 288 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 262 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 309 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 227 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 293 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 272 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 180 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 184 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 192 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 206 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 176 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 188 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 304 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 299 of file MathVectors.h.
FORCE_INLINE T Divide::vec2< T >::projectionOnLine | ( | const vec2< T > & | vA, |
const vec2< T > & | vB | ||
) | const |
project this vector on the line defined by the 2 points(A, B)
return the projection factor from *this to the line determined by points vA and vB
Definition at line 392 of file MathVectors.inl.
|
inline |
set the 2 components of the vector back to 0
Definition at line 370 of file MathVectors.h.
FORCE_INLINE void Divide::vec2< T >::round |
round both values
Definition at line 407 of file MathVectors.inl.
|
inlinenoexcept |
set the 2 components of the vector manually using a source pointer to a (large enough) array
Definition at line 335 of file MathVectors.h.
|
inlinenoexcept |
set the 2 components of the vector using a source vector
Definition at line 355 of file MathVectors.h.
|
inlinenoexcept |
set the 2 components of the vector using the first 2 components of the source vector
Definition at line 360 of file MathVectors.h.
|
inlinenoexcept |
set the 2 components of the vector using the first 2 components of the source vector
Definition at line 365 of file MathVectors.h.
|
inlinenoexcept |
set the 2 components of the vector manually
Definition at line 340 of file MathVectors.h.
|
inlinenoexcept |
set the 2 components of the vector manually
Definition at line 345 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 350 of file MathVectors.h.
|
inlinenoexcept |
swap the components of this vector with that of the specified one
Definition at line 330 of file MathVectors.h.
|
inlinenoexcept |
swap the components of this vector with that of the specified one
Definition at line 325 of file MathVectors.h.
union { ... } Divide::vec2< T >::@13 |
T Divide::vec2< T >::_v[2] = {T{0}, T{0} } |
Definition at line 446 of file MathVectors.h.
T Divide::vec2< T >::count |
Definition at line 443 of file MathVectors.h.
T Divide::vec2< T >::height |
Definition at line 435 of file MathVectors.h.
T Divide::vec2< T >::max |
Definition at line 439 of file MathVectors.h.
T Divide::vec2< T >::min |
Definition at line 439 of file MathVectors.h.
T Divide::vec2< T >::offset |
Definition at line 443 of file MathVectors.h.
T Divide::vec2< T >::s |
Definition at line 431 of file MathVectors.h.
T Divide::vec2< T >::t |
Definition at line 431 of file MathVectors.h.
T Divide::vec2< T >::width |
Definition at line 435 of file MathVectors.h.
T Divide::vec2< T >::x |
Definition at line 427 of file MathVectors.h.
T Divide::vec2< T >::y |
Definition at line 427 of file MathVectors.h.