This page has been translated automatically.
编程
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
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Unigine::vec3 Struct

Header:#include <UnigineMathLib.h>

Vector of 3 float components.

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

vec3 Class

Members


vec3(const __m128 & v)

Arguments

  • const __m128 & v

vec3(const hvec3 & v)

Arguments

  • const hvec3 & v

vec3()

Default constructor that produces a zero vector.

vec3(const vec3 & v)

Initialization by a vector.

Arguments

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

vec3(const vec2 & v, float z)

Initialization by a vector and a scalar.

Arguments

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

vec3(float x, float y, float z)

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.

explicit vec3(float v)

Initialization by a scalar: x=v, y=v, z=v.

Arguments

  • float v - The value of the vector.

explicit vec3(const vec2 & v)

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

Arguments

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

explicit vec3(const vec4 & v)

Initialization by a four component vector: x=v.x, y=v.y, z=v.z.

Arguments

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

explicit vec3(const dvec3 & v)

Initialization by a vector of double components.

Arguments

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

explicit vec3(const ivec3 & v)

Initialization by a vector of integer components.

Arguments

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

explicit vec3(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_)

Set vector.

Arguments

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

void set(const float * val)

Set vector.

Arguments

  • const float * val - Pointer to the vector.

void set(const vec4 & v)

Arguments

  • const vec4 & v

void set(const vec2 & val, float z_)

Arguments

  • const vec2 & val
  • float z_

void set(const vec3 & val)

Arguments

  • const vec3 & val

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()

vec3 & normalize()

vec3 & normalizeFast()

__m128 operator __m128()

const float * operator const float *()

const void * operator const void *()

float * operator float *()

void * operator void *()

vec3 & operator*=(float val)

Scalar multiplication.

Arguments

  • float val - The value of the scalar.

Return value

The resulting vector.

vec3 & operator*=(const vec3 & val)

Vector multiplication.

Arguments

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

Return value

The resulting vector.

vec3 & operator+=(const vec3 & val)

Vector addition.

Arguments

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

Return value

The resulting vector.

vec3 operator-() const

Vector negation.

Return value

The resulting vector.

vec3 & operator-=(const vec3 & val)

Vector subtraction.

Arguments

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

Return value

The resulting vector.

vec3 & operator/=(const vec3 & val)

Arguments

  • const vec3 & val

vec3 & operator/=(float val)

Arguments

  • float val

vec3 & operator=(const vec3 & val)

Arguments

  • const vec3 & val

vec3 & operator=(const __m128 & val)

Arguments

  • const __m128 & 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 BACK

int DOWN

int EPS

int FORWARD

int INF

int LEFT

int ONE

int RIGHT

int UP

int ZERO

Last update: 2017-07-03
Build: ()