This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::dvec2 Struct

Vector of 2 double components.

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

Unigine::dvec2 Structure

Members


UNIGINE_DECLARE_USE_MEMORY UNIGINE_INLINE dvec2 ()

Default constructor that produces a zero vector.

UNIGINE_INLINE dvec2 (const dvec2 & v)

Initialization by a vector.

Arguments

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

UNIGINE_INLINE dvec2 (double x, double y)

Initialization by scalars.

Arguments

  • double x - X component of the vector.
  • double y - Y component of the vector.

explicit UNIGINE_INLINE dvec2 (double v)

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

Arguments

  • double v - The value of the vector.

explicit UNIGINE_INLINE dvec2 (const dvec3 & v)

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

Arguments

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

explicit UNIGINE_INLINE dvec2 (const dvec4 & v)

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

Arguments

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

explicit UNIGINE_INLINE dvec2 (const vec2 & v)

Initialization by a vector.

Arguments

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

explicit UNIGINE_INLINE dvec2 (const ivec2 & v)

Initialization by a vector of integer components.

Arguments

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

explicit UNIGINE_INLINE dvec2 (const double * v)

Initialization by a pointer to the vector.

Arguments

  • const double * v - Pointer to the vector.

UNIGINE_INLINE dvec2 operator- () const

Vector negation.

Return value

The resulting vector.

UNIGINE_INLINE dvec2 & operator*= (double v)

Scalar multiplication.

Arguments

  • double v - The value of the scalar.

Return value

The resulting vector.

UNIGINE_INLINE dvec2 & operator*= (const dvec2 & v)

Vector multiplication.

Arguments

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

Return value

The resulting vector.

UNIGINE_INLINE dvec2 & operator+= (const dvec2 & v)

Vector addition.

Arguments

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

Return value

The resulting vector.

UNIGINE_INLINE dvec2 & operator-= (const dvec2 & v)

Vector subtraction.

Arguments

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

Return value

The resulting vector.

UNIGINE_INLINE double & operator[] (int i)

Array access.

Arguments

  • int i - Array item index.

Return value

The array item.

UNIGINE_INLINE double operator[] (int i) const

Constant array access.

Arguments

  • int i - Array item index.

Return value

The array item.

UNIGINE_INLINE void set (double x_, double y_)

Set vector.

Arguments

  • double x_ - X component of the vector.
  • double y_ - Y component of the vector.

UNIGINE_INLINE void set (const double * v)

Set vector.

Arguments

  • const double * v - Pointer to the vector.

UNIGINE_INLINE void get (double * v) const

Get vector.

Arguments

  • double * v - Pointer to the vector.

UNIGINE_INLINE double * get ()

Get a pointer to the vector.

Return value

Pointer to the vector.

UNIGINE_INLINE const double * get () const

Get a constant pointer to the vector.

Return value

Pointer to the vector.

Unigine::dvec2:: Union

union {
struct {
double x;
double y;
};
double v[2];
};
Last update: 2017-07-03
Build: ()