Unittest: Construct a Vector from another Vector
auto v4 = vec4( 1.0f, 2, 3, 4 ); auto v3 = vec3( v4 ); assert( v3 == [ 1, 2, 3 ] ); auto v2 = vec2( v4 ); assert( v2 == [ 1, 2 ] ); /// Different valueTypes auto v4i = vec4i( 1, 2, 3, 4 ); auto v3d = vec3d( v4i ); assert( v3d == [ 1, 2, 3 ] ); v3d.y = 3.9; auto v2i = vec2i( v3d ); assert( v2i == [ 1, 3 ] );
Construct a Vector from another Vector