![]() |
SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
4D vector template class for standard 4D vector algebra. More...
#include <SLVec4.h>
Public Member Functions | |
SLVec4 () | |
SLVec4 (const T V) | |
SLVec4 (const T X, const T Y, const T Z=0, const T W=1) | |
SLVec4 (const T v[4]) | |
SLVec4 (const SLVec2< T > &v) | |
SLVec4 (const SLVec3< T > &v) | |
SLVec4 (const SLVec4< T > &v) | |
SLVec4 (const SLstring &fourFloatsWithDelimiter) | |
void | set (const T X, const T Y, const T Z, const T W=1) |
void | set (const T xyz) |
void | set (const T v[4]) |
void | set (const SLVec2< T > &v) |
void | set (const SLVec3< T > &v) |
void | set (const SLVec4< T > &v) |
SLbool | operator== (const SLVec4 &v) const |
SLbool | operator!= (const SLVec4 &v) const |
SLbool | operator<= (const SLVec4 &v) const |
SLbool | operator>= (const SLVec4 &v) const |
SLbool | operator< (const SLVec4 &v) const |
SLbool | operator> (const SLVec4 &v) const |
SLbool | operator<= (const T v) const |
SLbool | operator>= (const T v) const |
SLbool | operator< (const T v) const |
SLbool | operator> (const T v) const |
SLVec4 | operator+ (const SLVec4 &v) const |
SLVec4 | operator- (const SLVec4 &v) const |
SLVec4 | operator- () const |
T | operator* (const SLVec4 &v) const |
SLVec4 | operator* (const T s) const |
SLVec4 | operator/ (const T s) const |
SLVec4 | operator& (const SLVec4 &v) const |
SLVec4 & | operator= (const SLVec2< T > &v) |
SLVec4 & | operator= (const SLVec3< T > &v) |
SLVec4 & | operator= (const SLVec4 &v) |
SLVec4 & | operator+= (const SLVec4 &v) |
SLVec4 & | operator+= (const SLVec3< T > &v) |
SLVec4 & | operator-= (const SLVec4 &v) |
SLVec4 & | operator-= (const SLVec3< T > &v) |
SLVec4 & | operator*= (const T s) |
SLVec4 & | operator/= (const T s) |
SLVec4 & | operator&= (const SLVec4 &v) |
SLVec4 & | operator&= (const SLVec3< T > &v) |
void | add (const SLVec4 &a, const SLVec4 &b) |
void | sub (const SLVec4 &a, const SLVec4 &b) |
void | scale (const T s) |
T | dot (const SLVec4 &v) |
void | cross (const SLVec4 &a, const SLVec4 &b) |
SLVec3< T > | vec3 () const |
SLVec2< T > | vec2 () const |
T | length () const |
T | lengthSqr () const |
SLVec4 & | normalize () |
void | wdiv () |
void | clampMinMax (const T min, const T max) |
T | diff (const SLVec4 &v) |
T | diffRGB (const SLVec4 &v) |
void | mix (const SLVec4 &a, const SLVec4 &b, const T factor_b) |
T | minXYZ () |
T | maxXYZ () |
T | minXYZW () |
T | maxXYZW () |
SLint | maxComp () |
SLint | minComp () |
SLbool | isZero () |
void | gammaCorrect (T oneOverGamma) |
Gamma correction. More... | |
void | print (const SLchar *str=nullptr) |
SLstring | toString (SLstring delimiter=", ") |
Conversion to string. More... | |
void | fromString (const SLstring &fourFloatsWithDelimiter, SLchar delimiter=',') |
Conversion from string. More... | |
void | hsva2rgba (const SLVec4 &hsva) |
HSVA to RGBA color conversion (http://www.rapidtables.com/convert/color/hsv-to-rgb.htm) More... | |
Public Attributes | |
union { | |
struct { | |
T x | |
T y | |
T z | |
T w | |
} | |
struct { | |
T r | |
T g | |
T b | |
T a | |
} | |
struct { | |
T comp [4] | |
} | |
}; | |
Static Public Attributes | |
static SLVec4 | ZERO = SLVec4<T>(0.0f, 0.0f, 0.0f, 1.0f) |
static SLVec4 | BLACK = SLVec4<T>(0.0f, 0.0f, 0.0f, 1.0f) |
static SLVec4 | GRAY = SLVec4<T>(0.5f, 0.5f, 0.5f, 1.0f) |
static SLVec4 | WHITE = SLVec4<T>(1.0f, 1.0f, 1.0f, 1.0f) |
static SLVec4 | RED = SLVec4<T>(1.0f, 0.0f, 0.0f, 1.0f) |
static SLVec4 | GREEN = SLVec4<T>(0.0f, 1.0f, 0.0f, 1.0f) |
static SLVec4 | BLUE = SLVec4<T>(0.0f, 0.0f, 1.0f, 1.0f) |
static SLVec4 | YELLOW = SLVec4<T>(1.0f, 1.0f, 0.0f, 1.0f) |
static SLVec4 | CYAN = SLVec4<T>(0.0f, 1.0f, 1.0f, 1.0f) |
static SLVec4 | MAGENTA = SLVec4<T>(1.0f, 0.0f, 1.0f, 1.0f) |
Friends | |
SLVec4 | operator* (T s, const SLVec4 &v) |
std::ostream & | operator<< (std::ostream &output, const SLVec4 &v) |
4D vector template class for standard 4D vector algebra.
4D vector template class with type definitions for 4D vectors and colors:
Use SLVec4f for a specific float type vector
Use SLVec4d for a specific double type vector
Use SLVec4r for a precision independent real type.
Definition at line 47 of file SLVec4.h.
|
inline |
Conversion from string.
Definition at line 181 of file SLVec4.h.
HSVA to RGBA color conversion (http://www.rapidtables.com/convert/color/hsv-to-rgb.htm)
Definition at line 191 of file SLVec4.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Conversion to string.
Definition at line 173 of file SLVec4.h.
|
friend |
union { ... } |