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, $( I vt ))

  1. this(Args args)
    struct Vector(type, int dim)
    @safe pure nothrow
    this
    (
    Args...
    )
    (
    Args args
    )
    if (
    (dim >= 2) &&
    (dim <= 4)
    )
  2. this(V vec)
  3. this(valueType value)

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