Vectors

Vectors are represented by the cer::Vector2, cer::Vector3 and cer::Vector4 structures.

Vector2
struct Vector2 {
    constexpr Vector2();
    constexpr explicit Vector2(float xy);
    constexpr Vector2(float x, float y);

    float x = 0.0f;
    float y = 0.0f;
};
Vector3
struct Vector3 {
    constexpr Vector3();
    constexpr explicit Vector3(float xyz);
    constexpr Vector3(float x, float y, float z);

    float x = 0.0f;
    float y = 0.0f;
};
Vector4
struct Vector4 {
    constexpr Vector4();
    constexpr explicit Vector4(float xyzw);
    constexpr Vector4(float x, float y, float z, float w);
    constexpr Vector4(Vector2 xy, Vector2 zw);
    constexpr Vector4(Vector2 xy, float z, float w);
    constexpr Vector4(Vector3 xyz, float w);

    float x = 0.0f;
    float y = 0.0f;
    float z = 0.0f;
    float w = 0.0f;
};

All vector types are supported by free-standing functions that operate on them, such as cer::dot(), cer::normalize() and cer::length().