Vector.this

Constructs the vector. If a single value is passed the vector, the vector will be cleared with this value. If a vector with a higher dimension is passed the vector will hold the first values up to its dimension. If mixed types are passed they will be joined together (allowed types: vector, static array, vt).

  1. this(Args args)
  2. this(T vec)
  3. this(vt value)
    struct Vector(type, int dimension_)
    @safe pure nothrow
    this
    ()

Examples

vec4 v4 = vec4(1.0f, vec2(2.0f, 3.0f), 4.0f);
vec3 v3 = vec3(v4); // v3 = vec3(1.0f, 2.0f, 3.0f);
vec2 v2 = v3.xy; // swizzling returns a static array.
vec3 v3_2 = vec3(1.0f); // vec3 v3_2 = vec3(1.0f, 1.0f, 1.0f);

Meta