Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::Rect< T > Class Template Reference

#include <MathVectors.h>

+ Inheritance diagram for Divide::Rect< T >:

Public Member Functions

template<typename U >
requires std::is_pod_v<U>
bool contains (U xIn, U yIn) const noexcept
 
bool contains (const vec2< T > coords) const noexcept
 
bool contains (T xIn, T yIn) const noexcept
 
vec2< T > clamp (T xIn, T yIn) const noexcept
 
vec2< T > clamp (const vec2< T > coords) const noexcept
 
- Public Member Functions inherited from Divide::vec4< T >
 vec4 () noexcept
 
 vec4 (T xIn, T yIn, T zIn, T wIn) noexcept
 
 vec4 (T xIn, T yIn, T zIn) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (U xIn, U yIn, U zIn, U wIn) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (U xIn, U yIn, U zIn) noexcept
 
 vec4 (__m128 reg) noexcept
 
 vec4 (const SimdVector< T > &reg) noexcept
 
 vec4 (T value) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (U value) noexcept
 
 vec4 (const T *v) noexcept
 
 vec4 (const vec2< T > v) noexcept
 
 vec4 (const vec2< T > v, T zIn) noexcept
 
 vec4 (const vec2< T > v, T zIn, T wIn) noexcept
 
 vec4 (const vec3< T > &v) noexcept
 
 vec4 (const vec3< T > &v, T wIn) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (const vec2< U > v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (const vec3< U > &v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
 vec4 (const vec4< U > &v) noexcept
 
bool operator> (const vec4 &v) const noexcept
 
bool operator< (const vec4 &v) const noexcept
 
bool operator<= (const vec4 &v) const noexcept
 
bool operator>= (const vec4 &v) const noexcept
 
bool operator== (const vec4 &v) const noexcept
 
bool operator!= (const vec4 &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
bool operator!= (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
bool operator== (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator- (U _f) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator+ (U _f) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator* (U _f) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator/ (U _f) const noexcept
 
vec4 operator- () const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator+ (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator- (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator* (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4 operator/ (const vec4< U > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator+= (U _f) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator-= (U _f) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator*= (U _f) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator/= (U _f) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator*= (const vec4< U > &v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator/= (const vec4< U > &v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator+= (const vec4< U > &v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
vec4operator-= (const vec4< U > &v) noexcept
 
 operator T* () noexcept
 
 operator const T * () const 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< T > rb () const noexcept
 GLSL like accessors (const to prevent erroneous usage like .xyz() += n)
 
vec2< T > xz () const noexcept
 
vec2< T > ra () const noexcept
 
vec2< T > xw () const noexcept
 
vec2< T > ga () const noexcept
 
vec2< T > yw () const noexcept
 
vec3< T > bgr () const noexcept
 
vec3< T > zyx () const noexcept
 
vec3< T > rga () const noexcept
 
vec3< T > xyw () const noexcept
 
void rb (const vec2< T > rb) noexcept
 
void xz (const vec2< T > xz) noexcept
 
void xz (T xIn, T zIn) noexcept
 
void ra (const vec2< T > ra) noexcept
 
void xw (const vec2< T > xw) noexcept
 
void xw (T xIn, T wIn) noexcept
 
void ga (const vec2< T > ga) noexcept
 
void yw (const vec2< T > yw) noexcept
 
void yw (T yIn, T wIn) noexcept
 
void bgr (const vec3< T > &bgr) noexcept
 
void zyx (const vec3< T > &zyx) noexcept
 
void rga (const vec3< T > &rga) noexcept
 
void xyw (const vec3< T > &xyw) noexcept
 
void xyw (T xIn, T yIn, T wIn) noexcept
 
void xzw (T xIn, T zIn, T wIn) noexcept
 
void set (const T *v) noexcept
 set the 4 components of the vector manually using a source pointer to a (large enough) array
 
void set (T value) noexcept
 set the 4 components of the vector manually
 
void set (T xIn, T yIn, T zIn, T wIn) noexcept
 set the 4 components of the vector manually
 
template<typename U >
requires std::is_pod_v<U>
void set (U xIn, U yIn, U zIn, U wIn) noexcept
 
void set (const vec4 &v) noexcept
 set the 4 components of the vector using a source vector
 
void set (const vec3< T > &v) noexcept
 set the 4 components of the vector using a smaller source vector
 
void set (const vec3< T > &v, T wIn) noexcept
 set the 4 components of the vector using a smaller source vector
 
void set (const vec2< T > v) noexcept
 set the 4 components of the vector using a smaller source vector
 
void set (const vec2< T > v1, const vec2< T > v2) noexcept
 set the 4 components of the vector using smaller source vectors
 
void reset () noexcept
 set all the components back to 0
 
template<typename U >
requires std::is_pod_v<U>
bool compare (const vec4< U > &v) const noexcept
 compare 2 vectors
 
template<typename U >
requires std::is_pod_v<U>
bool compare (const vec4< U > &v, U epsi) const noexcept
 compare 2 vectors within the specified tolerance
 
void swap (vec4 *iv) noexcept
 swap the components of this vector with that of the specified one
 
void swap (vec4 &iv) noexcept
 swap the components of this vector with that of the specified one
 
vec4normalize () noexcept
 transform the vector to unit length
 
template<typename U >
requires std::is_pod_v<U>
bool isPerpendicular (const vec4< U > &other, F32 epsilon=EPSILON_F32) const noexcept
 The current vector is perpendicular to the specified one within epsilon.
 
minComponent () const noexcept
 get the smallest value of X,Y,Z or W
 
maxComponent () const noexcept
 get the largest value of X,Y,Z or W
 
dot (const vec4 &v) const noexcept
 calculate the dot product between this vector and the specified one
 
length () const noexcept
 return the vector's length
 
lengthSquared () const noexcept
 return the squared distance of the vector
 
vec4 projectToNorm (const vec4< T > &direction)
 project this vector onto the given direction
 
void round () noexcept
 round all four values
 
void lerp (const vec4 &v, T factor) noexcept
 lerp between this and the specified vector by the specified amount
 
void lerp (const vec4 &v, const vec4 &factor) noexcept
 lerp between this and the specified vector by the specified amount for each component
 
FORCE_INLINE vec4< F32operator- (const F32 _f) const noexcept
 
FORCE_INLINE vec4< F32 > & operator-= (const F32 _f) noexcept
 
FORCE_INLINE vec4< F32operator+ (const F32 _f) const noexcept
 
FORCE_INLINE vec4< F32 > & operator+= (const F32 _f) noexcept
 
FORCE_INLINE vec4< F32operator* (const F32 _f) const noexcept
 
FORCE_INLINE vec4< F32 > & operator*= (const F32 _f) noexcept
 
FORCE_INLINE vec4< F32operator/ (const F32 _f) const noexcept
 
FORCE_INLINE vec4< F32 > & operator/= (const F32 _f) noexcept
 
FORCE_INLINE vec4< F32operator+ (const vec4< F32 > &v) const noexcept
 
FORCE_INLINE vec4< F32 > & operator+= (const vec4< F32 > &v) noexcept
 
FORCE_INLINE vec4< F32operator- (const vec4< F32 > &v) const noexcept
 
FORCE_INLINE vec4< F32 > & operator-= (const vec4< F32 > &v) noexcept
 
FORCE_INLINE vec4< F32operator/ (const vec4< F32 > &v) const noexcept
 
FORCE_INLINE vec4< F32 > & operator/= (const vec4< F32 > &v) noexcept
 
FORCE_INLINE vec4< F32operator* (const vec4< F32 > &v) const noexcept
 
FORCE_INLINE vec4< F32 > & operator*= (const vec4< F32 > &v) noexcept
 
template<typename U >
requires std::is_pod_v<U>
FORCE_INLINE bool compare (const vec4< U > &v) const noexcept
 compare 2 vectors
 
FORCE_INLINE bool compare (const vec4< F32 > &v) const noexcept
 
template<typename U >
requires std::is_pod_v<U>
FORCE_INLINE bool compare (const vec4< U > &v, const U epsi) const noexcept
 compare this vector with the one specified and see if they match within the specified amount
 
FORCE_INLINE void swap (vec4< F32 > *iv) noexcept
 
FORCE_INLINE F32 length () const noexcept
 
FORCE_INLINE vec4< F32 > & normalize () noexcept
 
template<typename U >
requires std::is_pod_v<U>
FORCE_INLINE bool isPerpendicular (const vec4< U > &other, const F32 epsilon) const noexcept
 The current vector is perpendicular to the specified one within epsilon.
 

Additional Inherited Members

- Public Attributes inherited from Divide::vec4< T >
union {
   struct {
      T   x
 
      T   y
 
      T   z
 
      T   w
 
   } 
 
   struct {
      T   s
 
      T   t
 
      T   p
 
      T   q
 
   } 
 
   struct {
      T   r
 
      T   g
 
      T   b
 
      T   a
 
   } 
 
   struct {
      T   pitch
 
      T   yaw
 
      T   roll
 
      T   _pad0
 
   } 
 
   struct {
      T   turn
 
      T   move
 
      T   zoom
 
      T   _pad1
 
   } 
 
   struct {
      T   left
 
      T   right
 
      T   bottom
 
      T   top
 
   } 
 
   struct {
      T   fov
 
      T   ratio
 
      T   zNear
 
      T   zFar
 
   } 
 
   struct {
      T   width
 
      T   height
 
      T   depth
 
      T   key
 
   } 
 
   struct {
      T   offsetX
 
      T   offsetY
 
      T   sizeX
 
      T   sizeY
 
   } 
 
   struct {
      vec2< T >   xy
 
      vec2< T >   zw
 
   } 
 
   struct {
      vec2< T >   rg
 
      vec2< T >   ba
 
   } 
 
   struct {
      vec3< T >   xyz
 
      T   _w
 
   } 
 
   struct {
      vec3< T >   rgb
 
      T   _a
 
   } 
 
   struct {
      T   _x
 
      vec3< T >   yzw
 
   } 
 
   struct {
      T   _r
 
      vec3< T >   gba
 
   } 
 
   struct {
      T   _x1
 
      vec2< T >   yz
 
      T   _w1
 
   } 
 
   struct {
      T   _r1
 
      vec2< T >   gb
 
      T   _a1
 
   } 
 
   T   _v [4] = {T{0}, T{0}, T{0}, T{1}}
 
   SimdVector< T >   _reg
 
}; 
 

Detailed Description

template<typename T>
class Divide::Rect< T >

Definition at line 1459 of file MathVectors.h.

Member Function Documentation

◆ clamp() [1/2]

template<typename T >
vec2< T > Divide::Rect< T >::clamp ( const vec2< T >  coords) const
inlinenoexcept

Definition at line 1481 of file MathVectors.h.

◆ clamp() [2/2]

template<typename T >
vec2< T > Divide::Rect< T >::clamp ( xIn,
yIn 
) const
inlinenoexcept

Definition at line 1477 of file MathVectors.h.

◆ contains() [1/3]

template<typename T >
bool Divide::Rect< T >::contains ( const vec2< T >  coords) const
inlinenoexcept

Definition at line 1469 of file MathVectors.h.

◆ contains() [2/3]

template<typename T >
bool Divide::Rect< T >::contains ( xIn,
yIn 
) const
inlinenoexcept

Definition at line 1473 of file MathVectors.h.

◆ contains() [3/3]

template<typename T >
template<typename U >
requires std::is_pod_v<U>
bool Divide::Rect< T >::contains ( xIn,
yIn 
) const
inlinenoexcept

Definition at line 1465 of file MathVectors.h.


The documentation for this class was generated from the following files: