Releases: Megospc/vecpp
Releases · Megospc/vecpp
v1.7.3
New features
- children vectors
- some bugs fixed
Example
vec4 vector = vec4(1.0, -0.3, 0.0, 2.0);
vec3 child = vector.ywz(); // Get child vector
// child.x = myVec4.y
// child.y = myVec4.w
// child.z = myVec4.z
vec2 value = vec2(0.3, -1.0); // Set child vector
vector.xw(value);
// vector.x = value.x
// vector.w = value.yv1.3.0
New features
- bvec (boolean vector)
- comparing of vectors
- all, any
Example
bvec4 vector = bvec4(false, true, true, false); // bvec
// all, any
if (any(vector)) std::cout << "vector has one or more true bases" << std::endl;
if (all(vector)) std::cout << "all vector bases are true" << std::endl;
// comparing of vectors
vec2 vector1 = vec2(1.0, 1.0);
vec2 vector2 = vec2(0.1, 1.0);
bvec2 comparing = vector2 < vector1; // The same as bvec2(true, false)