Nebula
|
#include <vec4.h>
A 4D vector.
Inherited by Util::Colour.
Public Member Functions | |
vec4 ()=default | |
default constructor, NOTE: does NOT setup components! | |
vec4 (scalar x, scalar y, scalar z, scalar w) | |
construct from values | |
vec4 (scalar v) | |
construct from single value | |
vec4 (const vec4 &rhs)=default | |
copy constructor | |
vec4 (const vec3 &rhs, float w) | |
copy constructor from vec3 | |
vec4 (const __m128 &rhs) | |
construct from SSE 128 byte float array | |
void | operator= (const __m128 &rhs) |
assign an vmVector4 | |
void | operator+= (const vec4 &rhs) |
inplace add | |
void | operator-= (const vec4 &rhs) |
inplace sub | |
void | operator*= (scalar s) |
inplace scalar multiply | |
void | operator*= (const vec4 &rhs) |
muliply by a vector component-wise | |
void | operator/= (const vec4 &rhs) |
divide by a vector component-wise | |
bool | operator== (const vec4 &rhs) const |
equality operator | |
bool | operator!= (const vec4 &rhs) const |
inequality operator | |
void | load (const scalar *ptr) |
load content from 16-byte-aligned memory | |
void | loadu (const scalar *ptr) |
load content from unaligned memory | |
void | store (scalar *ptr) const |
write content to 16-byte-aligned memory through the write cache | |
void | storeu (scalar *ptr) const |
write content to unaligned memory through the write cache | |
void | store3 (scalar *ptr) const |
write content to 16-byte-aligned memory through the write cache | |
void | storeu3 (scalar *ptr) const |
write content to unaligned memory through the write cache | |
void | stream (scalar *ptr) const |
stream content to 16-byte-aligned memory circumventing the write-cache | |
void | load_float3 (const void *ptr, float w) |
load 3 floats into x,y,z from unaligned memory | |
void | load_ubyte4n (const void *ptr) |
load from UByte4N packed vector | |
void | load_byte4n (const void *ptr) |
load from Byte4N packed vector | |
void | set (scalar x, scalar y, scalar z, scalar w) |
set content | |
template<int X, int Y, int Z, int W> | |
vec4 | swizzle (const vec4 &v) |
swizzle vector | |
scalar & | operator[] (const int index) |
read-only access to indexed component | |
scalar | operator[] (const int index) const |
read-only access to indexed component | |
Public Attributes | ||
union { | ||
struct { | ||
float x | ||
float y | ||
float z | ||
float w | ||
} | ||
__m128 vec | ||
float v [4] | ||
}; | ||
|
default |
default constructor, NOTE: does NOT setup components!
|
explicit |
construct from single value
|
default |
copy constructor
__forceinline Math::vec4::vec4 | ( | const __m128 & | rhs | ) |
construct from SSE 128 byte float array
__forceinline void Math::vec4::load | ( | const scalar * | ptr | ) |
load content from 16-byte-aligned memory
Load 4 floats from 16-byte-aligned memory.
void Math::vec4::load_byte4n | ( | const void * | ptr | ) |
load from Byte4N packed vector
__forceinline void Math::vec4::load_float3 | ( | const void * | ptr, |
float | w ) |
load 3 floats into x,y,z from unaligned memory
void Math::vec4::load_ubyte4n | ( | const void * | ptr | ) |
load from UByte4N packed vector
__forceinline void Math::vec4::loadu | ( | const scalar * | ptr | ) |
load content from unaligned memory
Load 4 floats from unaligned memory.
__forceinline bool Math::vec4::operator!= | ( | const vec4 & | rhs | ) | const |
inequality operator
__forceinline void Math::vec4::operator*= | ( | const vec4 & | rhs | ) |
muliply by a vector component-wise
__forceinline void Math::vec4::operator*= | ( | scalar | s | ) |
inplace scalar multiply
__forceinline void Math::vec4::operator+= | ( | const vec4 & | rhs | ) |
inplace add
__forceinline void Math::vec4::operator-= | ( | const vec4 & | rhs | ) |
inplace sub
__forceinline void Math::vec4::operator/= | ( | const vec4 & | rhs | ) |
divide by a vector component-wise
__forceinline void Math::vec4::operator= | ( | const __m128 & | rhs | ) |
assign an vmVector4
__forceinline bool Math::vec4::operator== | ( | const vec4 & | rhs | ) | const |
equality operator
__forceinline scalar & Math::vec4::operator[] | ( | const int | index | ) |
read-only access to indexed component
__forceinline scalar Math::vec4::operator[] | ( | const int | index | ) | const |
read-only access to indexed component
__forceinline void Math::vec4::store | ( | scalar * | ptr | ) | const |
write content to 16-byte-aligned memory through the write cache
Store to 16-byte-aligned float pointer.
__forceinline void Math::vec4::store3 | ( | scalar * | ptr | ) | const |
write content to 16-byte-aligned memory through the write cache
__forceinline void Math::vec4::storeu | ( | scalar * | ptr | ) | const |
write content to unaligned memory through the write cache
Store to non-aligned float pointer.
__forceinline void Math::vec4::storeu3 | ( | scalar * | ptr | ) | const |
write content to unaligned memory through the write cache
__forceinline void Math::vec4::stream | ( | scalar * | ptr | ) | const |
stream content to 16-byte-aligned memory circumventing the write-cache
swizzle vector
union { ... } Math::vec4 |
float Math::vec4::v[4] |
__m128 Math::vec4::vec |
float Math::vec4::w |
float Math::vec4::x |
float Math::vec4::y |
float Math::vec4::z |