![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <MathVectors.h>
Public Member Functions | |
vec3 () noexcept | |
vec3 (T value) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec3 (U value) noexcept | |
vec3 (T xIn, T yIn, T zIn) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec3 (U xIn, U yIn, U zIn) noexcept | |
template<typename U , typename V > | |
vec3 (U xIn, U yIn, V zIn) noexcept | |
template<typename U , typename V > | |
vec3 (U xIn, V yIn, V zIn) noexcept | |
template<typename U , typename V , typename W > | |
vec3 (U xIn, V yIn, W zIn) noexcept | |
vec3 (const T *v) noexcept | |
vec3 (const vec2< T > v) noexcept | |
vec3 (const vec2< T > v, T zIn) noexcept | |
vec3 (const vec4< T > &v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec3 (const vec2< U > v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec3 (const vec3< U > &v) noexcept | |
template<typename U > requires std::is_pod_v<U> | |
vec3 (const vec4< U > &v) noexcept | |
bool | operator> (const vec3 &v) const noexcept |
bool | operator< (const vec3 &v) const noexcept |
bool | operator<= (const vec3 &v) const noexcept |
bool | operator>= (const vec3 &v) const noexcept |
bool | operator!= (const vec3 &v) const noexcept |
bool | operator== (const vec3 &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
bool | operator!= (const vec3< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
bool | operator== (const vec3< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator+ (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator- (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator* (U _f) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator/ (U _f) const noexcept |
vec3 | operator- () const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator+ (const vec3< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator- (const vec3< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator* (const vec3< U > &v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator+= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator-= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator*= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator/= (U _f) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator*= (const vec3< U > &v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator+= (const vec3< U > &v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator-= (const vec3< U > &v) noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 & | operator/= (const vec3< U > &v) noexcept |
template<typename U > requires std::is_unsigned_v<U> | |
T & | operator[] (const U i) noexcept |
template<typename U > requires std::is_unsigned_v<U> | |
const T & | operator[] (const U i) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
vec3 | operator/ (const vec3< U > &v) const noexcept |
operator T* () noexcept | |
operator const T * () const noexcept | |
vec2< T > | rb () const noexcept |
GLSL like accessors (const to prevent erroneous usage like .xy() += n) | |
vec2< T > | xz () const noexcept |
void | rb (const vec2< T > rb) noexcept |
void | xz (const vec2< T > xz) noexcept |
void | set (const T *v) noexcept |
set the 3 components of the vector manually using a source pointer to a (large enough) array | |
void | set (T value) noexcept |
set the 3 components of the vector manually | |
void | set (T xIn, T yIn, T zIn) noexcept |
set the 3 components of the vector manually | |
template<typename U > requires std::is_pod_v<U> | |
void | set (U xIn, U yIn, U zIn) noexcept |
void | set (const vec2< T > v) noexcept |
set the 3 components of the vector using a smaller source vector | |
void | set (const vec3 &v) noexcept |
set the 3 components of the vector using a source vector | |
void | set (const vec4< T > &v) noexcept |
set the 3 components of the vector using the first 3 components of the source vector | |
void | reset () noexcept |
set all the components back to 0 | |
T | length () const noexcept |
return the vector's length | |
bool | isZeroLength () const noexcept |
return true if length is zero | |
template<typename U > requires std::is_pod_v<U> | |
bool | compare (const vec3< U > &v) const noexcept |
compare 2 vectors | |
template<typename U > requires std::is_pod_v<U> | |
bool | compare (const vec3< U > &v, U epsi) const noexcept |
compare 2 vectors within the specified tolerance | |
bool | isUniform (F32 tolerance=0.0001f) const noexcept |
uniform vector: x = y = z | |
template<typename U > requires std::is_pod_v<U> | |
bool | isPerpendicular (const vec3< U > &other, F32 epsilon=EPSILON_F32) const noexcept |
The current vector is perpendicular to the specified one within epsilon. | |
T | lengthSquared () const noexcept |
return the squared distance of the vector | |
T | dot (const vec3 &v) const noexcept |
calculate the dot product between this vector and the specified one | |
T | angle (vec3 &v) const |
returns the angle in radians between '*this' and 'v' | |
T | distance (const vec3 &v) const noexcept |
compute the vector's distance to another specified vector | |
T | distanceSquared (const vec3 &v) const noexcept |
compute the vector's squared distance to another specified vector | |
vec3 & | normalize () noexcept |
transform the vector to unit length | |
T | minComponent () const noexcept |
get the smallest value of X,Y or Z | |
T | maxComponent () const noexcept |
get the largest value of X,Y or Z | |
void | round () |
round all three values | |
T | projectionOnLine (const vec3 &vA, const vec3 &vB) const |
project this vector on the line defined by the 2 points(A, B) | |
vec3 | closestPointOnLine (const vec3 &vA, const vec3 &vB) |
vec3 | closestPointOnSegment (const vec3 &vA, const vec3 &vB) |
vec3 | direction (const vec3 &u) const noexcept |
get the direction vector to the specified point | |
vec3 | projectToNorm (const vec3< T > &direction) noexcept |
project this vector onto the given direction | |
void | lerp (const vec3 &v, T factor) noexcept |
lerp between this and the specified vector by the specified amount | |
void | lerp (const vec3 &v, const vec3 &factor) noexcept |
vec3 | vector (const vec3 &vp1, const vec3 &vp2) const noexcept |
void | cross (const vec3 &v1, const vec3 &v2) noexcept |
set this vector to be equal to the cross of the 2 specified vectors | |
void | cross (const vec3 &v2) noexcept |
set this vector to be equal to the cross between itself and the specified vector | |
void | rotateX (D64 radians) |
rotate this vector on the X axis | |
void | rotateY (D64 radians) |
rotate this vector on the Y axis | |
void | rotateZ (D64 radians) |
rotate this vector on the Z axis | |
void | swap (vec3 &iv) noexcept |
swap the components of this vector with that of the specified one | |
void | swap (vec3 *iv) noexcept |
swap the components of this vector with that of the specified one | |
void | get (T *v) const noexcept |
template<typename U > requires std::is_pod_v<U> | |
FORCE_INLINE bool | compare (const vec3< U > &v) const noexcept |
compare 2 vectors | |
template<typename U > requires std::is_pod_v<U> | |
FORCE_INLINE bool | compare (const vec3< U > &v, U epsi) const noexcept |
compare 2 vectors within the specified tolerance | |
template<typename U > requires std::is_pod_v<U> | |
FORCE_INLINE bool | isPerpendicular (const vec3< U > &other, const F32 epsilon) const noexcept |
Public Attributes | |
union { | |
struct { | |
T x | |
T y | |
T z | |
} | |
struct { | |
T s | |
T t | |
T p | |
} | |
struct { | |
T r | |
T g | |
T b | |
} | |
struct { | |
T pitch | |
T yaw | |
T roll | |
} | |
struct { | |
T turn | |
T move | |
T zoom | |
} | |
struct { | |
T width | |
T height | |
T depth | |
} | |
struct { | |
vec2< T > xy | |
T _z | |
} | |
struct { | |
vec2< T > rg | |
T _b | |
} | |
struct { | |
T _r | |
vec2< T > gb | |
} | |
T _v [3] = {T{0}, T{0}, T{0}} | |
}; | |
Definition at line 479 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 484 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 486 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 490 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 493 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 497 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 501 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 505 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 509 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 512 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 515 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 518 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 521 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 525 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 529 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 533 of file MathVectors.h.
FORCE_INLINE T Divide::vec3< T >::angle | ( | vec3< T > & | v | ) | const |
returns the angle in radians between '*this' and 'v'
Definition at line 583 of file MathVectors.inl.
FORCE_INLINE vec3< T > Divide::vec3< T >::closestPointOnLine | ( | const vec3< T > & | vA, |
const vec3< T > & | vB | ||
) |
return the closest point on the line defined by the 2 points (A, B) and this vector
Definition at line 703 of file MathVectors.inl.
FORCE_INLINE vec3< T > Divide::vec3< T >::closestPointOnSegment | ( | const vec3< T > & | vA, |
const vec3< T > & | vB | ||
) |
return the closest point on the line segment created between the 2 points (A, B) and this vector
Definition at line 711 of file MathVectors.inl.
|
noexcept |
compare 2 vectors
|
noexcept |
compare 2 vectors
Definition at line 477 of file MathVectors.inl.
|
noexcept |
compare 2 vectors within the specified tolerance
|
noexcept |
compare 2 vectors within the specified tolerance
Definition at line 487 of file MathVectors.inl.
|
noexcept |
set this vector to be equal to the cross of the 2 specified vectors
Definition at line 545 of file MathVectors.inl.
|
noexcept |
set this vector to be equal to the cross between itself and the specified vector
set this vector to be equal to the cross between itself and the specified vector
Definition at line 554 of file MathVectors.inl.
|
noexcept |
get the direction vector to the specified point
Definition at line 591 of file MathVectors.inl.
|
noexcept |
compute the vector's distance to another specified vector
Definition at line 568 of file MathVectors.inl.
|
noexcept |
compute the vector's squared distance to another specified vector
Definition at line 575 of file MathVectors.inl.
|
noexcept |
calculate the dot product between this vector and the specified one
Definition at line 561 of file MathVectors.inl.
|
noexcept |
export the vector's components in the first 3 positions of the specified array
Definition at line 685 of file MathVectors.inl.
|
noexcept |
Definition at line 503 of file MathVectors.inl.
|
noexcept |
The current vector is perpendicular to the specified one within epsilon.
|
noexcept |
uniform vector: x = y = z
Definition at line 496 of file MathVectors.inl.
|
inlinenoexcept |
return true if length is zero
Definition at line 752 of file MathVectors.h.
|
inlinenoexcept |
return the vector's length
Definition at line 747 of file MathVectors.h.
|
noexcept |
return the squared distance of the vector
Definition at line 509 of file MathVectors.inl.
|
noexcept |
lerp between this and the specified vector by the specified amount for each component
Definition at line 620 of file MathVectors.inl.
|
noexcept |
lerp between this and the specified vector by the specified amount
Definition at line 612 of file MathVectors.inl.
|
noexcept |
get the largest value of X,Y or Z
get the largest value of X, Y or Z
Definition at line 538 of file MathVectors.inl.
|
noexcept |
get the smallest value of X,Y or Z
get the smallest value of X, Y or Z
Definition at line 531 of file MathVectors.inl.
|
noexcept |
transform the vector to unit length
Definition at line 516 of file MathVectors.inl.
|
inlinenoexcept |
Definition at line 682 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 678 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 553 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 562 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 612 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 583 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 639 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 628 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 602 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 573 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 644 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 618 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 596 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 607 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 578 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 649 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 623 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 671 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 588 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 654 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 633 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 541 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 545 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 557 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 567 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 537 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 549 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 665 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 660 of file MathVectors.h.
FORCE_INLINE T Divide::vec3< T >::projectionOnLine | ( | const vec3< T > & | vA, |
const vec3< T > & | vB | ||
) | const |
project this vector on the line defined by the 2 points(A, B)
Definition at line 604 of file MathVectors.inl.
|
noexcept |
project this vector onto the given direction
Definition at line 597 of file MathVectors.inl.
|
inlinenoexcept |
GLSL like accessors (const to prevent erroneous usage like .xy() += n)
Definition at line 688 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 697 of file MathVectors.h.
|
inlinenoexcept |
set all the components back to 0
Definition at line 742 of file MathVectors.h.
FORCE_INLINE void Divide::vec3< T >::rotateX | ( | D64 | radians | ) |
rotate this vector on the X axis
Definition at line 627 of file MathVectors.inl.
FORCE_INLINE void Divide::vec3< T >::rotateY | ( | D64 | radians | ) |
rotate this vector on the Y axis
Definition at line 637 of file MathVectors.inl.
FORCE_INLINE void Divide::vec3< T >::rotateZ | ( | D64 | radians | ) |
rotate this vector on the Z axis
Definition at line 647 of file MathVectors.inl.
FORCE_INLINE void Divide::vec3< T >::round |
round all three values
Definition at line 657 of file MathVectors.inl.
|
inlinenoexcept |
set the 3 components of the vector manually using a source pointer to a (large enough) array
Definition at line 707 of file MathVectors.h.
|
inlinenoexcept |
set the 3 components of the vector using a smaller source vector
Definition at line 727 of file MathVectors.h.
|
inlinenoexcept |
set the 3 components of the vector using a source vector
Definition at line 732 of file MathVectors.h.
|
inlinenoexcept |
set the 3 components of the vector using the first 3 components of the source vector
Definition at line 737 of file MathVectors.h.
|
inlinenoexcept |
set the 3 components of the vector manually
Definition at line 712 of file MathVectors.h.
|
inlinenoexcept |
set the 3 components of the vector manually
Definition at line 717 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 722 of file MathVectors.h.
|
noexcept |
swap the components of this vector with that of the specified one
Definition at line 666 of file MathVectors.inl.
|
noexcept |
swap the components of this vector with that of the specified one
Definition at line 675 of file MathVectors.inl.
|
noexcept |
this calculates a vector between the two specified points and returns the result
Definition at line 695 of file MathVectors.inl.
|
inlinenoexcept |
Definition at line 692 of file MathVectors.h.
|
inlinenoexcept |
Definition at line 701 of file MathVectors.h.
union { ... } Divide::vec3< T >::@25 |
T Divide::vec3< T >::_b |
Definition at line 856 of file MathVectors.h.
T Divide::vec3< T >::_r |
Definition at line 860 of file MathVectors.h.
T Divide::vec3< T >::_v[3] = {T{0}, T{0}, T{0}} |
Definition at line 863 of file MathVectors.h.
T Divide::vec3< T >::_z |
Definition at line 852 of file MathVectors.h.
T Divide::vec3< T >::b |
Definition at line 836 of file MathVectors.h.
T Divide::vec3< T >::depth |
Definition at line 848 of file MathVectors.h.
T Divide::vec3< T >::g |
Definition at line 836 of file MathVectors.h.
vec2<T> Divide::vec3< T >::gb |
Definition at line 860 of file MathVectors.h.
T Divide::vec3< T >::height |
Definition at line 848 of file MathVectors.h.
T Divide::vec3< T >::move |
Definition at line 844 of file MathVectors.h.
T Divide::vec3< T >::p |
Definition at line 832 of file MathVectors.h.
T Divide::vec3< T >::pitch |
Definition at line 840 of file MathVectors.h.
T Divide::vec3< T >::r |
Definition at line 836 of file MathVectors.h.
vec2<T> Divide::vec3< T >::rg |
Definition at line 856 of file MathVectors.h.
T Divide::vec3< T >::roll |
Definition at line 840 of file MathVectors.h.
T Divide::vec3< T >::s |
Definition at line 832 of file MathVectors.h.
T Divide::vec3< T >::t |
Definition at line 832 of file MathVectors.h.
T Divide::vec3< T >::turn |
Definition at line 844 of file MathVectors.h.
T Divide::vec3< T >::width |
Definition at line 848 of file MathVectors.h.
T Divide::vec3< T >::x |
Definition at line 828 of file MathVectors.h.
vec2<T> Divide::vec3< T >::xy |
Definition at line 852 of file MathVectors.h.
T Divide::vec3< T >::y |
Definition at line 828 of file MathVectors.h.
T Divide::vec3< T >::yaw |
Definition at line 840 of file MathVectors.h.
T Divide::vec3< T >::z |
Definition at line 828 of file MathVectors.h.
T Divide::vec3< T >::zoom |
Definition at line 844 of file MathVectors.h.