Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes

Unigine::Unigine::vec4 Struct

Header:#include <UnigineMathLib.h>

Vector of 4 float components.

To use this structure, include the UnigineMathLib.h file.

vec4 Class

Members


vec4(const __m128 & v)

Arguments

  • const __m128 & v

vec4(const quat & q)

Arguments

  • const quat & q

vec4(const hvec4 & v)

Arguments

  • const hvec4 & v

vec4()

Default constructor that produces a zero vector.

vec4(const vec4 & v)

Initialization by a vector.

Arguments

  • const vec4 & v - The value of the vector.

vec4(const vec2 & v, float z, float w)

Initialization by a vector and two scalars.

Arguments

  • const vec2 & v - The value of the vector.
  • float z - Z component of the vector.
  • float w - W component of the vector.

vec4(const vec3 & v, float w)

Initialization by a vector and a scalar.

Arguments

  • const vec3 & v - The value of the vector.
  • float w - W component of the vector.

vec4(float x, float y, float z, float w)

Initialization by scalars.

Arguments

  • float x - X component of the vector.
  • float y - Y component of the vector.
  • float z - Z component of the vector.
  • float w - W component of the vector.

explicit vec4(float v)

Initialization by a scalar.

Arguments

  • float v - The value of the scalar.

explicit vec4(const vec2 & v)

Initialization by a two component vector: x=v.x, y=v.y, z=0.0f, w=1.0f.

Arguments

  • const vec2 & v - The value of the vector.

explicit vec4(const vec3 & v)

Initialization by a three component vector: x=v.x, y=v.y, z=v.z, w=1.0f.

Arguments

  • const vec3 & v - The value of the vector.

explicit vec4(const dvec4 & v)

Initialization by a vector of double components.

Arguments

  • const dvec4 & v - The value of the vector.

explicit vec4(const ivec4 & v)

Initialization by a vector of integer components.

Arguments

  • const ivec4 & v - The value of the vector.

explicit vec4(const bvec4 & v)

Initialization by a vector of byte components.

Arguments

  • const bvec4 & v - The value of the vector.

explicit vec4(const float * v)

Initialization by a pointer to the vector.

Arguments

  • const float * v - Pointer to the vector.

void set(float x_, float y_, float z_, float w_)

Set vector.

Arguments

  • float x_ - X component of the vector.
  • float y_ - Y component of the vector.
  • float z_ - Z component of the vector.
  • float w_ - W component of the vector.

void set(const float * val)

Set vector.

Arguments

  • const float * val - Pointer to the vector.

void set(const vec4 & val)

Arguments

  • const vec4 & val

void set(const vec2 & val, float z_, float w_)

Arguments

  • const vec2 & val
  • float z_
  • float w_

void set(const vec3 & val, float w_)

Arguments

  • const vec3 & val
  • float w_

void set(const quat & q)

Arguments

  • const quat & q

void set(float val)

Arguments

  • float val

void get(float * val) const

Get vector.

Arguments

  • float * val - Pointer to the vector.

float * get()

Get a pointer to the vector.

Return value

Pointer to the vector.

const float * get() const

Get a constant pointer to the vector.

Return value

Pointer to the vector.

float length()

float length2()

vec4 & normalize()

vec4 & normalize3()

vec4 & normalizeFast()

vec4 & normalizeFast3()

__m128 operator __m128()

const float * operator const float *()

const void * operator const void *()

float * operator float *()

void * operator void *()

vec4 & operator*=(float val)

Scalar multiplication.

Arguments

  • float val - The value of the scalar.

Return value

The resulting vector.

vec4 & operator*=(const vec4 & val)

Vector multiplication.

Arguments

  • const vec4 & val - The value of the vector.

Return value

The resulting vector.

vec4 & operator+=(const vec4 & val)

Vector addition.

Arguments

  • const vec4 & val - The value of the vector.

Return value

The resulting vector.

vec4 operator-() const

Vector negation.

Return value

The resulting vector.

vec4 & operator-=(const vec4 & val)

Vector subtraction.

Arguments

  • const vec4 & val - The value of the vector.

Return value

The resulting vector.

vec4 & operator/=(float val)

Arguments

  • float val

vec4 & operator/=(const vec4 & val)

Arguments

  • const vec4 & val

vec4 & operator=(const __m128 & val)

Arguments

  • const __m128 & val

vec4 & operator=(const vec4 & val)

Arguments

  • const vec4 & val

float & operator[](int i)

Array access.

Arguments

  • int i - Array item index.

Return value

The array item.

float operator[](int i) const

Constant array access.

Arguments

  • int i - Array item index.

Return value

The array item.

__m128 sse()

void sse(const __m128 & val)

Arguments

  • const __m128 & val

int EPS

int INF

int ONE

int ZERO

Last update: 2017-07-03