Vectors
Types
-
2D vector type with f32 components.
-
A generalized version of 2D vector. This vector type does not have specific alignment requirement.
-
3D vector type with f32 components.
-
A generalized version of 3D vector. This vector type does not have specific alignment requirement.
-
4D vector type with f32 components.
-
A generalized version of 4D vector. This vector type does not have specific alignment requirement.
Alias types
-
Unaligned 2D floating-point vector type.
-
Unaligned 2D signed integer vector type.
-
Unaligned 2D unsigned integer vector type.
-
Unaligned 3D floating-point vector type.
-
Unaligned 3D signed integer vector type.
-
Unaligned 3D unsigned integer vector type.
-
Unaligned 4D floating-point vector type.
-
Unaligned 4D signed integer vector type.
-
Unaligned 4D unsigned integer vector type.
Functions
-
Float2 operator+(const Float2 &v1, const Float2 &v2)
Adds two vectors.
-
Float2 operator-(const Float2 &v1, const Float2 &v2)
Subtracts two vectors.
-
Float2 operator*(const Float2 &v1, const Float2 &v2)
Multiplies two vectors.
-
Float2 operator/(const Float2 &v1, const Float2 &v2)
Divides two vectors.
-
Float2 operator+(const Float2 &v, f32 s)
Adds one vector with one scalar.
-
Float2 operator+(f32 s, const Float2 &v)
Adds one vector with one scalar.
-
Float2 operator-(const Float2 &v, f32 s)
Subtracts one vector with one scalar.
-
Float2 operator-(f32 s, const Float2 &v1)
Subtracts one scalar with one vector.
-
Float2 operator*(const Float2 &v, f32 s)
Multiplies one vector with one scalar.
-
Float2 operator*(f32 s, const Float2 &v)
Multiplies one vector with one scalar.
-
Float2 operator/(const Float2 &v, f32 s)
Divides one vector with one scalar.
-
Float2 operator/(f32 s, const Float2 &v)
Divides one scalar with one vector.
-
bool in_bounds(const Float2 &point, const Float2 &min_bound, const Float2 &max_bound)
Checks whether the point is in the specified boundary.
-
Computes the length of the vector.
-
f32 length_squared(const Float2 &vec)
Computes the squared length of the vector.
-
f32 dot(const Float2 &v1, const Float2 &v2)
Computes the dot product of two vectors.
-
Float2 cross(const Float2 &v1, const Float2 &v2)
Computes the cross product of two vectors.
-
Float2 normalize(const Float2 &vec)
Normalizes the vector so that the length of the vector is 1.
-
Float2 clamp(const Float2 &vec, const Float2 &vec_min, const Float2 &vec_max)
Clamps the vector to the specified range.
-
f32 distance(const Float2 &v1, const Float2 &v2)
Computes the distance between two points.
-
f32 distance_squared(const Float2 &v1, const Float2 &v2)
Computes the squared distance between two points.
-
Float2 min(const Float2 &v1, const Float2 &v2)
Computes the minimum value of two vectors.
-
Float2 max(const Float2 &v1, const Float2 &v2)
Computes the maximum value of two vectors.
-
Float2 lerp(const Float2 &v1, const Float2 &v2, f32 t)
Performs linear interpolation between two vectors.
-
Float2 smoothstep(const Float2 &v1, const Float2 &v2, f32 t)
Performs smoothstep interpolation between two vectors.
-
Float2 barycentric(const Float2 &v1, const Float2 &v2, const Float2 &v3, f32 f, f32 g)
Performs barycentric interpolation between three vectors.
-
Float2 catmull_rom(const Float2 &v1, const Float2 &v2, const Float2 &v3, const Float2 &v4, f32 t)
Performs centripetal Catmull–Rom spline interpolation.
-
Float2 hermite(const Float2 &v1, const Float2 &t1, const Float2 &v2, const Float2 &t2, f32 t)
Performs Hermite spline interpolation.
-
Float2 reflect(const Float2 &ivec, const Float2 &nvec)
Computes the reflected vector of the input vector.
-
Float2 refract(const Float2 &ivec, const Float2 &nvec, f32 refraction_index)
Computes the refracted vector of the input vector.
-
Float3 operator+(const Float3 &v1, const Float3 &v2)
Adds two vectors.
-
Float3 operator-(const Float3 &v1, const Float3 &v2)
Subtracts two vectors.
-
Float3 operator*(const Float3 &v1, const Float3 &v2)
Multiplies two vectors.
-
Float3 operator/(const Float3 &v1, const Float3 &v2)
Divides two vectors.
-
Float3 operator+(const Float3 &v, f32 s)
Adds one vector with one scalar.
-
Float3 operator+(f32 s, const Float3 &v)
Adds one vector with one scalar.
-
Float3 operator-(const Float3 &v, f32 s)
Subtracts one vector with one scalar.
-
Float3 operator-(f32 s, const Float3 &v)
Subtracts one scalar with one vector.
-
Float3 operator*(const Float3 &v, f32 s)
Multiplies one vector with one scalar.
-
Float3 operator*(f32 s, const Float3 &v)
Multiplies one vector with one scalar.
-
Float3 operator/(const Float3 &v, f32 s)
Divides one vector with one scalar.
-
Float3 operator/(f32 s, const Float3 &v)
Divides one scalar with one vector.
-
bool in_bounds(const Float3 &point, const Float3 &min_bound, const Float3 &max_bound)
Checks whether the point is in the specified boundary.
-
Computes the length of the vector.
-
f32 length_squared(const Float3 &vec)
Computes the squared length of the vector.
-
f32 dot(const Float3 &v1, const Float3 &v2)
Computes the dot product of two vectors.
-
Float3 cross(const Float3 &v1, const Float3 &v2)
Computes the cross product of two vectors.
-
Float3 normalize(const Float3 &vec)
Normalizes the vector so that the length of the vector is 1.
-
Float3 clamp(const Float3 &vec, const Float3 &vec_min, const Float3 &vec_max)
Clamps the vector to the specified range.
-
f32 distance(const Float3 &v1, const Float3 &v2)
Computes the distance between two points.
-
f32 distance_squared(const Float3 &v1, const Float3 &v2)
Computes the squared distance between two points.
-
Float3 min(const Float3 &v1, const Float3 &v2)
Computes the minimum value of two vectors.
-
Float3 max(const Float3 &v1, const Float3 &v2)
Computes the maximum value of two vectors.
-
Float3 lerp(const Float3 &v1, const Float3 &v2, f32 t)
Performs linear interpolation between two vectors.
-
Float3 smoothstep(const Float3 &v1, const Float3 &v2, f32 t)
Performs smoothstep interpolation between two vectors.
-
Float3 barycentric(const Float3 &v1, const Float3 &v2, const Float3 &vec3, f32 f, f32 g)
Performs barycentric interpolation between three vectors.
-
Performs centripetal Catmull–Rom spline interpolation.
-
Float3 hermite(const Float3 &v1, const Float3 &t1, const Float3 &v2, const Float3 &t2, f32 t)
Performs Hermite spline interpolation.
-
Float3 reflect(const Float3 &ivec, const Float3 &nvec)
Computes the reflected vector of the input vector.
-
Float3 refract(const Float3 &ivec, const Float3 &nvec, f32 refraction_index)
Computes the refracted vector of the input vector.
-
Float4 operator+(const Float4 &v1, const Float4 &v2)
Adds two vectors.
-
Float4 operator-(const Float4 &v1, const Float4 &v2)
Subtracts two vectors.
-
Float4 operator*(const Float4 &v1, const Float4 &v2)
Multiplies two vectors.
-
Float4 operator/(const Float4 &v1, const Float4 &v2)
Divides two vectors.
-
Float4 operator+(const Float4 &v, f32 s)
Adds one vector with one scalar.
-
Float4 operator+(f32 s, const Float4 &v)
Adds one vector with one scalar.
-
Float4 operator-(const Float4 &v, f32 s)
Subtracts one vector with one scalar.
-
Float4 operator-(f32 s, const Float4 &v)
Subtracts one scalar with one vector.
-
Float4 operator*(const Float4 &v, f32 s)
Multiplies one vector with one scalar.
-
Float4 operator*(f32 s, const Float4 &v)
Multiplies one vector with one scalar.
-
Float4 operator/(const Float4 &v, f32 s)
Divides one vector with one scalar.
-
Float4 operator/(f32 s, const Float4 &v)
Divides one scalar with one vector.
-
bool in_bounds(const Float4 &point, const Float4 &min_bound, const Float4 &max_bound)
Checks whether the point is in the specified boundary.
-
Computes the length of the vector.
-
f32 length_squared(const Float4 &vec)
Computes the squared length of the vector.
-
f32 dot(const Float4 &v1, const Float4 &v2)
Computes the dot product of two vectors.
-
Float4 cross(const Float4 &v1, const Float4 &v2, const Float4 &v3)
Computes the cross product of two vectors.
-
Float4 normalize(const Float4 &vec)
Normalizes the vector so that the length of the vector is 1.
-
Float4 clamp(const Float4 &vec, const Float4 &vec_min, const Float4 &vec_max)
Clamps the vector to the specified range.
-
f32 distance(const Float4 &v1, const Float4 &v2)
Computes the distance between two points.
-
f32 distance_squared(const Float4 &v1, const Float4 &v2)
Computes the squared distance between two points.
-
Float4 min(const Float4 &v1, const Float4 &v2)
Computes the minimum value of two vectors.
-
Float4 max(const Float4 &v1, const Float4 &v2)
Computes the maximum value of two vectors.
-
Float4 lerp(const Float4 &v1, const Float4 &v2, f32 t)
Performs linear interpolation between two vectors.
-
Float4 smoothstep(const Float4 &v1, const Float4 &v2, f32 t)
Performs smoothstep interpolation between two vectors.
-
Float4 barycentric(const Float4 &v1, const Float4 &v2, const Float4 &vec3, f32 f, f32 g)
Performs barycentric interpolation between three vectors.
-
Performs centripetal Catmull–Rom spline interpolation.
-
Float4 hermite(const Float4 &v1, const Float4 &t1, const Float4 &v2, const Float4 &t2, f32 t)
Performs Hermite spline interpolation.
-
Float4 reflect(const Float4 &ivec, const Float4 &nvec)
Computes the reflected vector of the input vector.
-
Float4 refract(const Float4 &ivec, const Float4 &nvec, f32 refraction_index)
Computes the refracted vector of the input vector.
-
Gets the type object of Float2.
-
Gets the type object of Float3.
-
Gets the type object of Float4.
-
Gets the type object of Vec2U. The type object is a generic structure type that should be instanced before use.
-
Gets the type object of Vec3U. The type object is a generic structure type that should be instanced before use.
-
Gets the type object of Vec4U. The type object is a generic structure type that should be instanced before use.