|
Vecmat 0.2.3
C math and linear algebra library for 2D/3D graphics, physics, and science.
|
#include <math.h>#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | vector2 |
| struct | vector3 |
| struct | vector4 |
| struct | vector2i |
| struct | vector3i |
| struct | vector4i |
| struct | matrix2 |
| struct | matrix3 |
| struct | matrix4 |
| struct | matrix2i |
| struct | matrix3i |
| struct | matrix4i |
| struct | quaternion |
Macros | |
| #define | VECMAT_VERSION_MAJOR 0 |
| #define | VECMAT_VERSION_MINOR 2 |
| #define | VECMAT_VERSION_PATCH 3 |
| #define | VECMAT_STR_HELPER(x) |
| #define | VECMAT_STR(x) |
| #define | VECMAT_VERSION |
| #define | VEC_API |
| #define | M_E 2.71828182845904523536 |
| #define | M_LOG2E 1.44269504088896340736 |
| #define | M_LOG10E 0.434294481903251827651 |
| #define | M_LN2 0.693147180559945309417 |
| #define | M_LN10 2.30258509299404568402 |
| #define | M_PI 3.14159265358979323846 |
| #define | M_PI_2 1.57079632679489661923 |
| #define | M_PI_4 0.785398163397448309616 |
| #define | M_1_PI 0.318309886183790671538 |
| #define | M_2_PI 0.636619772367581343076 |
| #define | M_2_SQRTPI 1.12837916709551257390 |
| #define | M_SQRT2 1.41421356237309504880 |
| #define | M_SQRT1_2 0.707106781186547524401 |
| #define | VECMAT_FLT_MAX __FLT_MAX__ |
| #define | VECMAT_DBL_MAX __DBL_MAX__ |
| #define | VECMAT_FLT_MIN __FLT_MIN__ |
| #define | VECMAT_DBL_MIN __DBL_MIN__ |
| #define | VECMAT_VEC2_SIZE 2 |
| #define | VECMAT_VEC3_SIZE 3 |
| #define | VECMAT_VEC4_SIZE 4 |
| #define | VECMAT_MAT2_SIZE 4 |
| #define | VECMAT_MAT3_SIZE 9 |
| #define | VECMAT_MAT4_SIZE 16 |
| #define | VECMAT_QUAT_SIZE 4 |
| #define | VM_F(x) |
| #define | VEC_INT_MAX INT8_MAX |
| #define | VEC_INT_MIN INT8_MIN |
| #define | VECMAT_EPS_F32 1e-6f |
| #define | VECMAT_EPS_F64 1e-12 |
| #define | VECMAT_EPSILON VECMAT_EPS_F64 |
| #define | FLOAT_EQ(a, b, eps) |
| Checks if two floats are approximately equal within tolerance. | |
| #define | DOUBLE_EQ(a, b, eps) |
| Checks if two doubles are approximately equal within tolerance. | |
| #define | VECMAT_EQ(a, b, eps) |
| #define | VECMAT_FABS(x) |
| #define | VECMAT_SQRT(x) |
| #define | VECMAT_SIN(x) |
| #define | VECMAT_COS(x) |
| #define | VECMAT_TAN(x) |
| #define | VECMAT_ASIN(x) |
| #define | VECMAT_ACOS(x) |
| #define | VECMAT_ATAN(x) |
| #define | VECMAT_ATAN2(y, x) |
| #define | VECMAT_FMIN(a, b) |
| #define | VECMAT_FMAX(a, b) |
| #define | VECMAT_FLOOR(x) |
| #define | VECMAT_CEIL(x) |
| #define | VECMAT_ROUND(x) |
| #define | VECMAT_POW(x, y) |
| #define | VECMAT_COPYSIGN(x, y) |
Typedefs | |
| typedef double | vm_float_t |
| typedef int8_t | vm_int_t |
| typedef uint32_t | vm_cpu_features_t |
Enumerations | |
| enum | { VM_CPU_SCALAR = 1u << 0 , VM_CPU_AVX2 = 1u << 1 , VM_CPU_SVE = 1u << 2 , VM_CPU_AVX512 = 1u << 3 , VM_CPU_SVE2 = 1u << 4 , VM_CPU_AVX = 1u << 5 } |
Functions | |
| vm_cpu_features_t | vm_cpu_compiled_features (void) |
| vm_cpu_features_t | vm_cpu_runtime_features (void) |
| vm_cpu_features_t | vm_cpu_selected_features (void) |
| const char * | vm_cpu_name (vm_cpu_features_t features) |
| void | vm_cpu_init (void) |
| vector2 | vec2_add (vector2 a, vector2 b) |
| Adds two vectors component-wise. | |
| vector2 | vec2_sub (vector2 a, vector2 b) |
| Subtracts the second vector from the first component-wise. | |
| vector2 | vec2_mul_scalar (vector2 v, vm_float_t s) |
| Multiplies a vector by a scalar component-wise. | |
| vector2 | vec2_div_scalar (vector2 v, vm_float_t s) |
| Divides a vector by a scalar component-wise. | |
| vector2 | vec2_mul (vector2 a, vector2 b) |
| Multiplies two vectors component-wise (Hadamard product). | |
| vector2 | vec2_neg (vector2 v) |
| Negates the vector (multiplies each component by -1.0f). | |
| vector2 | vec2_abs (vector2 v) |
| Returns the absolute values of each component. | |
| vector2 | vec2_zero (void) |
| Returns a vector2 with both components set to 0.0f. | |
| vector2 | vec2_one (void) |
| Returns a vector2 with both components set to 1.0f. | |
| vector2 | vec2_x_axis (vm_float_t x) |
| Returns a vector2 along the x-axis (y = 0.0f). | |
| vector2 | vec2_y_axis (vm_float_t y) |
| Returns a vector2 along the y-axis (x = 0.0f). | |
| vector2 | vec2_x_scale (vm_float_t x) |
| Returns a vector2 representing x-axis scaling (y = 1.0f). | |
| vector2 | vec2_y_scale (vm_float_t y) |
| Returns a vector2 representing y-axis scaling (x = 1.0f). | |
| vector2 | vec2_scale (vector2 v, vm_float_t s) |
| Scales a vector by a scalar component-wise. | |
| vector2 | vec2_cross (vector2 a, vector2 b) |
| Computes the 2D cross-product as a vector. | |
| vector2 | vec2_normalize (vector2 v) |
| Normalizes the vector to unit length. | |
| vector2 | vec2_min (vector2 a, vector2 b) |
| Returns the component-wise minimum of two vectors. | |
| vector2 | vec2_max (vector2 a, vector2 b) |
| Returns the component-wise maximum of two vectors. | |
| vector2 | vec2_sign (vector2 v) |
| Returns the sign of each component (+1.0f, -1.0f, or 0.0f). | |
| vector2 | vec2_floor (vector2 v) |
| Applies floor to each component. | |
| vector2 | vec2_ceil (vector2 v) |
| Applies ceil to each component. | |
| vector2 | vec2_round (vector2 v) |
| Applies round to each component. | |
| vector2 | vec2_perpendicular (vector2 v) |
| Returns the perpendicular vector (90 degrees counterclockwise). | |
| vector2 | vec2_reflect (vector2 v, vector2 normal) |
| Reflects vector v across the normal, storing the result in res. | |
| vector2 | vec2_project (vector2 a, vector2 b) |
| Projects the first vector onto the second. | |
| vector2 | vec2_tangent (vector2 v) |
| Returns the tangent vector perpendicular to the input (90 degrees clockwise). | |
| vector2 | vec2_rotate (vector2 v, vm_float_t angle) |
| Rotates the input vector counterclockwise by the given angle (radians). | |
| vector2 | vec2_slide (vector2 v, vector2 normal) |
| Slides the input vector tangent to the normal (removes normal component). | |
| vector2 | vec2_clamp (vector2 v, vector2 min, vector2 max) |
| Clamps vector v component-wise between min and max. | |
| vector2 | vec2_lerp (vector2 a, vector2 b, vm_float_t t) |
| Linearly interpolates from a to b by t. | |
| vector2 | vec2_div (vector2 a, vector2 b) |
| Divides two vectors component-wise. | |
| vector2 | vec2_add_scalar (vector2 v, vm_float_t s) |
| Adds a scalar to each component. | |
| vector2 | vec2_sub_scalar (vector2 v, vm_float_t s) |
| Subtracts a scalar from each component. | |
| vector2 | vec2_clamp_scalar (vector2 v, vm_float_t min, vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| vector2 | vec2_saturate (vector2 v) |
| Clamps each component to the range [0, 1]. | |
| vector2 | vec2_fract (vector2 v) |
| Returns the fractional part of each component. | |
| vector2 | vec2_refract (vector2 incident, vector2 normal, vm_float_t eta) |
| Computes the refraction of incident across normal with ratio eta. | |
| vector2 | vec2_reject (vector2 a, vector2 b) |
| Returns the component of a orthogonal to b. | |
| vector2 | vec2_splat (vm_float_t s) |
| Returns a vector with every component set to s. | |
| vector2 | vec2_from_angle (vm_float_t angle) |
| Returns the unit vector at the given angle in radians. | |
| vector2 | vec2_rotate_around (vector2 v, vector2 pivot, vm_float_t angle) |
| Rotates v around pivot by angle radians. | |
| vector2 | vec2_move_toward (vector2 current, vector2 target, vm_float_t max_delta) |
| Moves current toward target by at most max_delta. | |
| vector2 | vec2_limit_length (vector2 v, vm_float_t max_len) |
| Clamps the vector length to max_len. | |
| vector3 | vec2_to_vec3 (vector2 v, vm_float_t z) |
| Converts a vector2 to a vector3 using z. | |
| vm_float_t | vec2_dot (vector2 a, vector2 b) |
| Computes the dot product of two vectors. | |
| vm_float_t | vec2_length (vector2 v) |
| Computes the length (magnitude) of the vector. | |
| vm_float_t | vec2_length_squared (vector2 v) |
| Returns the squared Euclidean length. | |
| vm_float_t | vec2_length_manhattan (vector2 v) |
| Returns the Manhattan (L1) length. | |
| vm_float_t | vec2_length_chebyshev (vector2 v) |
| Returns the Chebyshev (L-inf) length. | |
| vm_float_t | vec2_aspect_ratio (vector2 v) |
| Computes the aspect ratio of the vector (x / y). | |
| vm_float_t | vec2_distance (vector2 a, vector2 b) |
| Computes the Euclidean distance between two vectors (treated as points). | |
| vm_float_t | vec2_distance_squared (vector2 a, vector2 b) |
| Returns the squared Euclidean distance between a and b. | |
| vm_float_t | vec2_angle (vector2 a, vector2 b) |
| Computes the angle between two vectors (in radians, range [0, PI]). | |
| vm_float_t | vec2_cross_scalar (vector2 a, vector2 b) |
| Returns the 2D cross product as a scalar (a.x*b.y - a.y*b.x). | |
| vm_float_t | vec2_heading (vector2 v) |
| Returns the heading angle of the vector in radians. | |
| vm_float_t | vec2_min_component (vector2 v) |
| Returns the smallest component. | |
| vm_float_t | vec2_max_component (vector2 v) |
| Returns the largest component. | |
| vm_float_t | vec2_sum (vector2 v) |
| Returns the sum of all components. | |
| bool | vec2_is_zero (vector2 v) |
| Returns true if every component is zero. | |
| bool | vec2_is_normalized (vector2 v) |
| Returns true if the vector has unit length. | |
| bool | vec2_near (vector2 a, vector2 b, vm_float_t eps) |
| Returns true if a and b are within eps of each other. | |
| vector3 | vec3_add (vector3 a, vector3 b) |
| Component-wise addition of two vectors. | |
| vector3 | vec3_sub (vector3 a, vector3 b) |
| Component-wise subtraction of two vectors. | |
| vector3 | vec3_mul_scalar (vector3 v, vm_float_t s) |
| Component-wise multiplication of vector by scalar. | |
| vector3 | vec3_div_scalar (vector3 v, vm_float_t s) |
| Component-wise division of vector by scalar. | |
| vector3 | vec3_mul (vector3 a, vector3 b) |
| Component-wise multiplication of two vectors. | |
| vector3 | vec3_neg (vector3 v) |
| Negation of a vector. | |
| vector3 | vec3_abs (vector3 v) |
| Computes the absolute value per component of a vector3. | |
| vector3 | vec3_zero (void) |
| Returns a zero-initialized vector3. | |
| vector3 | vec3_one (void) |
| Returns a vector3 with all components set to 1.0f. | |
| vector3 | vec3_x_axis (vm_float_t x) |
| Returns a vector3 along the x-axis. | |
| vector3 | vec3_y_axis (vm_float_t y) |
| Returns a vector3 along the y-axis. | |
| vector3 | vec3_z_axis (vm_float_t z) |
| Returns a vector3 along the z-axis. | |
| vector3 | vec3_x_scale (vm_float_t x) |
| Returns a vector3 for scaling along the x-axis. | |
| vector3 | vec3_y_scale (vm_float_t y) |
| Returns a vector3 for scaling along the y-axis. | |
| vector3 | vec3_z_scale (vm_float_t z) |
| Returns a vector3 for scaling along the z-axis. | |
| vector3 | vec3_cross (vector3 a, vector3 b) |
| Computes the cross-product of two vector3. | |
| vector3 | vec3_normalize (vector3 v) |
| Normalizes a vector3 to unit length. | |
| vector3 | vec3_min (vector3 a, vector3 b) |
| Computes the component-wise minimum of two vector3. | |
| vector3 | vec3_max (vector3 a, vector3 b) |
| Computes the component-wise maximum of two vector3. | |
| vector3 | vec3_sign (vector3 v) |
| Computes the sign per component of a vector3 (-1, 0, or 1). | |
| vector3 | vec3_floor (vector3 v) |
| Applies the floor per component to a vector3. | |
| vector3 | vec3_ceil (vector3 v) |
| Applies ceil per component to a vector3. | |
| vector3 | vec3_round (vector3 v) |
| Applies round per component to a vector3. | |
| vector3 | vec3_reflect (vector3 incident, vector3 normal) |
| Reflects an incident vector over normal. | |
| vector3 | vec3_refract (vector3 incident, vector3 normal, vm_float_t eta) |
| Refracts an incident vector across an interface with a given normal and ratio of refraction eta. | |
| vector3 | vec3_lerp (vector3 a, vector3 b, vm_float_t t) |
| Linearly interpolates between two vector3. | |
| vector3 | vec3_clamp (vector3 v, vector3 min, vector3 max) |
| Clamps a vector3 between min and max per component. | |
| vector3 | vec3_scale (vector3 v, vm_float_t s) |
| Scales the vector by a scalar. | |
| vector3 | vec3_div (vector3 a, vector3 b) |
| Divides two vectors component-wise. | |
| vector3 | vec3_add_scalar (vector3 v, vm_float_t s) |
| Adds a scalar to each component. | |
| vector3 | vec3_sub_scalar (vector3 v, vm_float_t s) |
| Subtracts a scalar from each component. | |
| vector3 | vec3_clamp_scalar (vector3 v, vm_float_t min, vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| vector3 | vec3_saturate (vector3 v) |
| Clamps each component to the range [0, 1]. | |
| vector3 | vec3_fract (vector3 v) |
| Returns the fractional part of each component. | |
| vector3 | vec3_project (vector3 a, vector3 b) |
| Projects a onto b. | |
| vector3 | vec3_slide (vector3 v, vector3 normal) |
| Removes the component of v along normal. | |
| vector3 | vec3_reject (vector3 a, vector3 b) |
| Returns the component of a orthogonal to b. | |
| vector3 | vec3_rotate_axis (vector3 v, vector3 axis, vm_float_t angle) |
| Rotates v around axis by angle radians. | |
| vector3 | vec3_splat (vm_float_t s) |
| Returns a vector with every component set to s. | |
| vector3 | vec3_from_vec2 (vector2 v, vm_float_t z) |
| Builds a vector3 from a vector2 and z. | |
| vector3 | vec3_move_toward (vector3 current, vector3 target, vm_float_t max_delta) |
| Moves current toward target by at most max_delta. | |
| vector3 | vec3_limit_length (vector3 v, vm_float_t max_len) |
| Clamps the vector length to max_len. | |
| vector2 | vec3_xy (vector3 v) |
| Returns the x and y components as a 2D vector. | |
| void | vec3_orthonormal_basis (vector3 n, vector3 *t, vector3 *b) |
| Builds a tangent and bitangent orthonormal to n. | |
| vm_float_t | vec3_dot (vector3 a, vector3 b) |
| Computes the dot product of two vector3. | |
| vm_float_t | vec3_length (vector3 v) |
| Computes the length (magnitude) of a vector3. | |
| vm_float_t | vec3_length_squared (vector3 v) |
| Returns the squared Euclidean length. | |
| vm_float_t | vec3_length_manhattan (vector3 v) |
| Returns the Manhattan (L1) length. | |
| vm_float_t | vec3_length_chebyshev (vector3 v) |
| Returns the Chebyshev (L-inf) length. | |
| vm_float_t | vec3_distance (vector3 a, vector3 b) |
| Computes the Euclidean distance between two vector3. | |
| vm_float_t | vec3_distance_squared (vector3 a, vector3 b) |
| Returns the squared Euclidean distance between a and b. | |
| vm_float_t | vec3_angle (vector3 a, vector3 b) |
| Computes the angle between two non-zero vector3 in radians. | |
| vm_float_t | vec3_signed_angle (vector3 a, vector3 b, vector3 axis) |
| Returns the signed angle from a to b around axis. | |
| vm_float_t | vec3_min_component (vector3 v) |
| Returns the smallest component. | |
| vm_float_t | vec3_max_component (vector3 v) |
| Returns the largest component. | |
| vm_float_t | vec3_sum (vector3 v) |
| Returns the sum of all components. | |
| bool | vec3_is_zero (vector3 v) |
| Returns true if every component is zero. | |
| bool | vec3_is_normalized (vector3 v) |
| Returns true if the vector has unit length. | |
| bool | vec3_near (vector3 a, vector3 b, vm_float_t eps) |
| Returns true if a and b are within eps of each other. | |
| vector4 | vec4_add (vector4 a, vector4 b) |
| Component-wise addition of two vectors. | |
| vector4 | vec4_sub (vector4 a, vector4 b) |
| Component-wise subtraction of two vectors. | |
| vector4 | vec4_mul_scalar (vector4 v, vm_float_t s) |
| Component-wise multiplication of vector by scalar. | |
| vector4 | vec4_div_scalar (vector4 v, vm_float_t s) |
| Component-wise division of vector by scalar. | |
| vector4 | vec4_mul (vector4 a, vector4 b) |
| Component-wise multiplication of two vectors. | |
| vector4 | vec4_neg (vector4 v) |
| Negation of a vector. | |
| vector4 | vec4_abs (vector4 v) |
| Computes the absolute value per component of a vector4. | |
| vector4 | vec4_zero (void) |
| Returns a zero-initialized vector4. | |
| vector4 | vec4_one (void) |
| Returns a vector4 with all components set to 1.0f. | |
| vector4 | vec4_x_axis (vm_float_t x) |
| Returns a vector4 along the x-axis. | |
| vector4 | vec4_y_axis (vm_float_t y) |
| Returns a vector4 along the y-axis. | |
| vector4 | vec4_z_axis (vm_float_t z) |
| Returns a vector4 along the z-axis. | |
| vector4 | vec4_w_axis (vm_float_t w) |
| Returns a vector4 along the w-axis. | |
| vector4 | vec4_x_scale (vm_float_t x) |
| Returns avector4 for scaling along the x-axis. | |
| vector4 | vec4_y_scale (vm_float_t y) |
| Returns a vector4 for scaling along the y-axis. | |
| vector4 | vec4_z_scale (vm_float_t z) |
| Returns a vector4for scaling along the z-axis. | |
| vector4 | vec4_w_scale (vm_float_t w) |
| Returns a vector4 for scaling along the w-axis. | |
| vector4 | vec4_normalize (vector4 v) |
| Normalizes a vector4 to unit length. | |
| vector4 | vec4_min (vector4 a, vector4 b) |
| Computes the component-wise minimum of two vector4. | |
| vector4 | vec4_max (vector4 a, vector4 b) |
| Computes the component-wise maximum of two vector4. | |
| vector4 | vec4_sign (vector4 v) |
| Computes the sign per component of a vector4 (-1, 0, or 1). | |
| vector4 | vec4_floor (vector4 v) |
| Applies the floor per component to a vector4. | |
| vector4 | vec4_ceil (vector4 v) |
| Applies ceil per component to a vector4. | |
| vector4 | vec4_round (vector4 v) |
| Applies round per component to a vector4. | |
| vector4 | vec4_lerp (vector4 a, vector4 b, vm_float_t t) |
| Linearly interpolates between two vector4. | |
| vector4 | vec4_clamp (vector4 v, vector4 min, vector4 max) |
| Clamps a vector4 between min and max per component. | |
| vector4 | vec4_homogenize (vector4 v) |
| Homogenizes a vector4 (divides x, y, z by w). | |
| vector4 | vec4_div (vector4 a, vector4 b) |
| Divides two vectors component-wise. | |
| vector4 | vec4_add_scalar (vector4 v, vm_float_t s) |
| Adds a scalar to each component. | |
| vector4 | vec4_sub_scalar (vector4 v, vm_float_t s) |
| Subtracts a scalar from each component. | |
| vector4 | vec4_clamp_scalar (vector4 v, vm_float_t min, vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| vector4 | vec4_saturate (vector4 v) |
| Clamps each component to the range [0, 1]. | |
| vector4 | vec4_fract (vector4 v) |
| Returns the fractional part of each component. | |
| vector4 | vec4_project (vector4 a, vector4 b) |
| Projects a onto b. | |
| vector4 | vec4_reject (vector4 a, vector4 b) |
| Returns the component of a orthogonal to b. | |
| vector4 | vec4_slide (vector4 v, vector4 normal) |
| Removes the component of v along normal. | |
| vector4 | vec4_splat (vm_float_t s) |
| Returns a vector with every component set to s. | |
| vector3 | vec4_to_vec3 (vector4 v) |
| Converts a vector4 to a vector3 (discards the w component). | |
| vm_float_t | vec4_dot (vector4 a, vector4 b) |
| Computes the dot product of two vector4. | |
| vm_float_t | vec4_length (vector4 v) |
| Computes the length (magnitude) of a vector4. | |
| vm_float_t | vec4_length_squared (vector4 v) |
| Returns the squared Euclidean length. | |
| vm_float_t | vec4_distance (vector4 a, vector4 b) |
| Computes the Euclidean distance between two vector4. | |
| vm_float_t | vec4_distance_squared (vector4 a, vector4 b) |
| Returns the squared Euclidean distance between a and b. | |
| bool | vec4_is_zero (vector4 v) |
| Returns true if every component is zero. | |
| bool | vec4_is_normalized (vector4 v) |
| Returns true if the vector has unit length. | |
| bool | vec4_near (vector4 a, vector4 b, vm_float_t eps) |
| Returns true if a and b are within eps of each other. | |
| void | vec2_add_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Adds vectors a and b component-wise, storing the result in res. | |
| void | vec2_sub_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Subtracts vector b from vector a component-wise, storing the result in res. | |
| void | vec2_mul_scalar_ptr (vector2 *res, const vector2 *v, vm_float_t s) |
| Multiplies vector v by scalar s component-wise, storing the result in res. | |
| void | vec2_div_scalar_ptr (vector2 *res, const vector2 *v, vm_float_t s) |
| Divides vector v by scalar s component-wise, storing the result in res. | |
| void | vec2_mul_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Multiplies vectors a and b component-wise, storing the result in res. | |
| void | vec2_neg_ptr (vector2 *res, const vector2 *v) |
| Negates the components of vector v, storing the result in res. | |
| void | vec2_abs_ptr (vector2 *res, const vector2 *v) |
| Computes the absolute values of the components of vector v, storing the result in res. | |
| void | vec2_normalize_ptr (vector2 *res, const vector2 *v) |
| Normalizes vector v to unit length, storing the result in res. | |
| void | vec2_min_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Computes the component-wise minimum of vectors a and b, storing the result in res. | |
| void | vec2_max_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Computes the component-wise maximum of vectors a and b, storing the result in res. | |
| void | vec2_sign_ptr (vector2 *res, const vector2 *v) |
| Sets each component of res to the sign of the corresponding component in v (+1, -1). | |
| void | vec2_floor_ptr (vector2 *res, const vector2 *v) |
| Applies the floor function to each component of vector v, storing the result in res. | |
| void | vec2_ceil_ptr (vector2 *res, const vector2 *v) |
| Applies the ceil function to each component of vector v, storing the result in res. | |
| void | vec2_round_ptr (vector2 *res, const vector2 *v) |
| Applies the round function to each component of vector v, storing the result in res. | |
| void | vec2_perpendicular_ptr (vector2 *res, const vector2 *v) |
| Computes the perpendicular vector to v (90 degrees counterclockwise rotation), storing the result in res. | |
| void | vec2_scale_ptr (vector2 *res, const vector2 *v, vm_float_t s) |
| Scales a vector by a scalar component-wise, storing the result in res. | |
| void | vec2_cross_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Computes the 2D cross-product of a and b, storing the scalar value in res->x and 0 in res->y. | |
| void | vec2_reflect_ptr (vector2 *res, const vector2 *v, const vector2 *normal) |
| Reflects vector v across the normal, storing the result in res. | |
| void | vec2_project_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Projects vector a onto vector b (scalar projection scaled by b). | |
| void | vec2_tangent_ptr (vector2 *res, const vector2 *v) |
| Computes a tangent vector perpendicular to the input (90 degrees clockwise). | |
| void | vec2_rotate_ptr (vector2 *result, const vector2 *v, vm_float_t angle) |
| Rotates the input vector counterclockwise by the given angle (radians). | |
| void | vec2_slide_ptr (vector2 *result, const vector2 *v, const vector2 *normal) |
| Slides the input vector tangent to the normal (removes normal component). | |
| void | vec2_clamp_ptr (vector2 *res, const vector2 *v, const vector2 *min, const vector2 *max) |
| Clamps vector v component-wise between min and max. | |
| void | vec2_lerp_ptr (vector2 *res, const vector2 *a, const vector2 *b, vm_float_t t) |
| Linearly interpolates from a to b by t. | |
| void | vec2_div_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Divides two vectors component-wise. | |
| void | vec2_add_scalar_ptr (vector2 *res, const vector2 *v, vm_float_t s) |
| Adds a scalar to each component. | |
| void | vec2_sub_scalar_ptr (vector2 *res, const vector2 *v, vm_float_t s) |
| Subtracts a scalar from each component. | |
| void | vec2_clamp_scalar_ptr (vector2 *res, const vector2 *v, vm_float_t min, vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| void | vec2_saturate_ptr (vector2 *res, const vector2 *v) |
| Clamps each component to the range [0, 1]. | |
| void | vec2_fract_ptr (vector2 *res, const vector2 *v) |
| Returns the fractional part of each component. | |
| void | vec2_refract_ptr (vector2 *res, const vector2 *incident, const vector2 *normal, vm_float_t eta) |
| Computes the refraction of incident across normal with ratio eta. | |
| void | vec2_reject_ptr (vector2 *res, const vector2 *a, const vector2 *b) |
| Returns the component of a orthogonal to b. | |
| void | vec2_rotate_around_ptr (vector2 *res, const vector2 *v, const vector2 *pivot, vm_float_t angle) |
| Rotates v around pivot by angle radians. | |
| void | vec2_move_toward_ptr (vector2 *res, const vector2 *current, const vector2 *target, vm_float_t max_delta) |
| Moves current toward target by at most max_delta. | |
| void | vec2_limit_length_ptr (vector2 *res, const vector2 *v, vm_float_t max_len) |
| Clamps the vector length to max_len. | |
| void | vec2_to_vec3_ptr (vector3 *res, const vector2 *v, vm_float_t z) |
| Converts a vector2 to a vector3 with the given z. | |
| void | vec3_add_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Component-wise addition of two vectors. | |
| void | vec3_sub_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Component-wise subtraction of two vectors. | |
| void | vec3_mul_scalar_ptr (vector3 *res, const vector3 *v, vm_float_t s) |
| Component-wise multiplication of vector by scalar. | |
| void | vec3_div_scalar_ptr (vector3 *res, const vector3 *v, vm_float_t s) |
| Component-wise division of vector by scalar. | |
| void | vec3_mul_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Component-wise multiplication of two vectors. | |
| void | vec3_neg_ptr (vector3 *res, const vector3 *v) |
| Negation of a vector. | |
| void | vec3_abs_ptr (vector3 *res, const vector3 *v) |
| Computes the absolute value per component of a vector3. | |
| void | vec3_normalize_ptr (vector3 *res, const vector3 *v) |
| Normalize a vector to unit length. | |
| void | vec3_cross_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Compute cross-product of two vectors. | |
| void | vec3_min_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Component-wise minimum of two vectors. | |
| void | vec3_max_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Component-wise maximum of two vectors. | |
| void | vec3_sign_ptr (vector3 *res, const vector3 *v) |
| Component-wise sign of a vector. | |
| void | vec3_floor_ptr (vector3 *res, const vector3 *v) |
| Component-wise floor of a vector. | |
| void | vec3_ceil_ptr (vector3 *res, const vector3 *v) |
| Component-wise ceil of a vector. | |
| void | vec3_round_ptr (vector3 *res, const vector3 *v) |
| Component-wise round of a vector. | |
| void | vec3_reflect_ptr (vector3 *res, const vector3 *incident, const vector3 *normal) |
| Compute reflection of the incident vector over normal. | |
| void | vec3_refract_ptr (vector3 *res, const vector3 *incident, const vector3 *normal, vm_float_t eta) |
| Compute refraction of the incident vector through normal with eta. | |
| void | vec3_lerp_ptr (vector3 *res, const vector3 *a, const vector3 *b, vm_float_t t) |
| Linear interpolation between two vectors. | |
| void | vec3_clamp_ptr (vector3 *res, const vector3 *v, const vector3 *min, const vector3 *max) |
| Clamp vector components between min and max. | |
| void | vec3_scale_ptr (vector3 *res, const vector3 *v, vm_float_t s) |
| Scales the vector by a scalar. | |
| void | vec3_div_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Divides two vectors component-wise. | |
| void | vec3_add_scalar_ptr (vector3 *res, const vector3 *v, vm_float_t s) |
| Adds a scalar to each component. | |
| void | vec3_sub_scalar_ptr (vector3 *res, const vector3 *v, vm_float_t s) |
| Subtracts a scalar from each component. | |
| void | vec3_clamp_scalar_ptr (vector3 *res, const vector3 *v, vm_float_t min, vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| void | vec3_saturate_ptr (vector3 *res, const vector3 *v) |
| Clamps each component to the range [0, 1]. | |
| void | vec3_fract_ptr (vector3 *res, const vector3 *v) |
| Returns the fractional part of each component. | |
| void | vec3_project_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Projects a onto b. | |
| void | vec3_slide_ptr (vector3 *res, const vector3 *v, const vector3 *normal) |
| Removes the component of v along normal. | |
| void | vec3_reject_ptr (vector3 *res, const vector3 *a, const vector3 *b) |
| Returns the component of a orthogonal to b. | |
| void | vec3_rotate_axis_ptr (vector3 *res, const vector3 *v, const vector3 *axis, vm_float_t angle) |
| Rotates v around axis by angle radians. | |
| void | vec3_from_vec2_ptr (vector3 *res, const vector2 *v, vm_float_t z) |
| Builds a higher-dimension vector from a vector2. | |
| void | vec3_xy_ptr (vector2 *res, const vector3 *v) |
| Returns the x and y components as a 2D vector. | |
| void | vec3_move_toward_ptr (vector3 *res, const vector3 *current, const vector3 *target, vm_float_t max_delta) |
| Moves current toward target by at most max_delta. | |
| void | vec3_limit_length_ptr (vector3 *res, const vector3 *v, vm_float_t max_len) |
| Clamps the vector length to max_len. | |
| void | vec3_orthonormal_basis_ptr (const vector3 *n, vector3 *t, vector3 *b) |
| Builds a tangent and bitangent orthonormal to n. | |
| void | vec4_add_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_sub_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_mul_scalar_ptr (vector4 *res, const vector4 *v, vm_float_t s) |
| void | vec4_div_scalar_ptr (vector4 *res, const vector4 *v, vm_float_t s) |
| void | vec4_mul_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_neg_ptr (vector4 *res, const vector4 *v) |
| void | vec4_abs_ptr (vector4 *res, const vector4 *v) |
| void | vec4_normalize_ptr (vector4 *res, const vector4 *v) |
| void | vec4_min_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_max_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_sign_ptr (vector4 *res, const vector4 *v) |
| void | vec4_floor_ptr (vector4 *res, const vector4 *v) |
| void | vec4_ceil_ptr (vector4 *res, const vector4 *v) |
| void | vec4_round_ptr (vector4 *res, const vector4 *v) |
| void | vec4_lerp_ptr (vector4 *res, const vector4 *a, const vector4 *b, vm_float_t t) |
| void | vec4_clamp_ptr (vector4 *res, const vector4 *v, const vector4 *min, const vector4 *max) |
| void | vec4_homogenize_ptr (vector4 *res, const vector4 *v) |
| void | vec4_div_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_add_scalar_ptr (vector4 *res, const vector4 *v, vm_float_t s) |
| void | vec4_sub_scalar_ptr (vector4 *res, const vector4 *v, vm_float_t s) |
| void | vec4_clamp_scalar_ptr (vector4 *res, const vector4 *v, vm_float_t min, vm_float_t max) |
| void | vec4_saturate_ptr (vector4 *res, const vector4 *v) |
| void | vec4_fract_ptr (vector4 *res, const vector4 *v) |
| void | vec4_project_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| Projects a onto b. | |
| void | vec4_reject_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| Returns the component of a orthogonal to b. | |
| void | vec4_slide_ptr (vector4 *res, const vector4 *v, const vector4 *normal) |
| Removes the component of v along normal. | |
| void | vec4_to_vec3_ptr (vector3 *res, const vector4 *v) |
| Copies the x, y, z components from a vector4 to a vector3. | |
| vector2i | vec2i_add (vector2i a, vector2i b) |
| Adds two vectors component-wise. | |
| vector2i | vec2i_sub (vector2i a, vector2i b) |
| Subtracts the second vector from the first component-wise. | |
| vector2i | vec2i_mul_scalar (vector2i v, vm_int_t s) |
| Multiplies a vector by a scalar component-wise. | |
| vector2i | vec2i_div_scalar (vector2i v, vm_int_t s) |
| Divides a vector by a scalar component-wise (float division, truncated to int). | |
| vector2i | vec2i_mul (vector2i a, vector2i b) |
| Multiplies two vectors component-wise (Hadamard product). | |
| vector2i | vec2i_neg (vector2i v) |
| Negates the vector (multiplies each component by -1). | |
| vector2i | vec2i_abs (vector2i v) |
| Returns the absolute values of each component. | |
| vector2i | vec2i_zero (void) |
| Returns a vector2i with both components set to 0. | |
| vector2i | vec2i_one (void) |
| Returns a vector2i with both components set to 1. | |
| vector2i | vec2i_x_axis (vm_int_t x) |
| Returns a vector2i along the x-axis (y = 0). | |
| vector2i | vec2i_y_axis (vm_int_t y) |
| Returns a vector2i along the y-axis (x = 0). | |
| vector2i | vec2i_x_scale (vm_int_t x) |
| Returns a vector2i representing x-axis scaling (y = 1). | |
| vector2i | vec2i_y_scale (vm_int_t y) |
| Returns a vector2i representing y-axis scaling (x = 1). | |
| vector2i | vec2i_cross (vector2i a, vector2i b) |
| Computes the 2D cross-product as a vector. | |
| vector2i | vec2i_normalize (vector2i v) |
| Normalizes the vector to approximate unit length (float length, truncated to int). | |
| vector2i | vec2i_min (vector2i a, vector2i b) |
| Returns the component-wise minimum of two vectors. | |
| vector2i | vec2i_max (vector2i a, vector2i b) |
| Returns the component-wise maximum of two vectors. | |
| vector2i | vec2i_sign (vector2i v) |
| Returns the sign of each component (+1, -1, or 0). | |
| vector2i | vec2i_perpendicular (vector2i v) |
| Returns the perpendicular vector (90 degrees counterclockwise). | |
| vector2i | vec2i_lerp (vector2i a, vector2i b, vm_float_t t) |
| Linearly interpolates from a to b by t. | |
| vector2i | vec2i_clamp (vector2i v, vector2i min, vector2i max) |
| Clamps each component between min and max. | |
| vector2i | vec2i_div (vector2i a, vector2i b) |
| Divides two vectors component-wise. | |
| vector2i | vec2i_add_scalar (vector2i v, vm_int_t s) |
| Adds a scalar to each component. | |
| vector2i | vec2i_sub_scalar (vector2i v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| vector2i | vec2i_mod (vector2i a, vector2i b) |
| Component-wise floor modulo of a by b. | |
| vector2i | vec2i_div_floor (vector2i a, vector2i b) |
| Component-wise floored division of a by b. | |
| vector2i | vec2i_wrap (vector2i v, vector2i period) |
| Wraps each component of v into [0, period). | |
| vector2i | vec2i_splat (vm_int_t s) |
| Returns a vector with every component set to s. | |
| vector3i | vec2i_to_vec3i (vector2i v, vm_int_t z) |
| Converts a vector2i to a vector3i using z. | |
| vector2 | vec2i_normalize_to_vec2 (vector2i v) |
| Converts to a unit-length vector2. | |
| vm_int_t | vec2i_dot (vector2i a, vector2i b) |
| Computes the dot product of two vectors. | |
| vm_int_t | vec2i_cross_scalar (vector2i a, vector2i b) |
| Returns the 2D cross product as a scalar (a.x*b.y - a.y*b.x). | |
| vm_int_t | vec2i_length_squared (vector2i v) |
| Returns the squared Euclidean length. | |
| vm_int_t | vec2i_distance_squared (vector2i a, vector2i b) |
| Returns the squared Euclidean distance between a and b. | |
| vm_int_t | vec2i_length_manhattan (vector2i v) |
| Returns the Manhattan (L1) length. | |
| vm_int_t | vec2i_length_chebyshev (vector2i v) |
| Returns the Chebyshev (L-inf) length. | |
| vm_int_t | vec2i_min_component (vector2i v) |
| Returns the smallest component. | |
| vm_int_t | vec2i_max_component (vector2i v) |
| Returns the largest component. | |
| vm_int_t | vec2i_sum (vector2i v) |
| Returns the sum of all components. | |
| vm_float_t | vec2i_length (vector2i v) |
| Computes the length (magnitude) of the vector. | |
| vm_float_t | vec2i_distance (vector2i a, vector2i b) |
| Computes the Euclidean distance between two vectors (treated as points). | |
| vm_float_t | vec2i_angle (vector2i a, vector2i b) |
| Computes the signed angle between two vectors (in radians, range [-PI, PI]) using atan2(cross, dot). | |
| vm_float_t | vec2i_aspect_ratio (vector2i v) |
| Computes the aspect ratio of the vector (x / y). | |
| bool | vec2i_is_zero (vector2i v) |
| Returns true if every component is zero. | |
| vector3i | vec3i_add (vector3i a, vector3i b) |
| Component-wise addition of two vectors. | |
| vector3i | vec3i_sub (vector3i a, vector3i b) |
| Component-wise subtraction of two vectors. | |
| vector3i | vec3i_mul_scalar (vector3i v, vm_int_t s) |
| Component-wise multiplication of vector by scalar. | |
| vector3i | vec3i_div_scalar (vector3i v, vm_int_t s) |
| Component-wise division of vector by scalar. | |
| vector3i | vec3i_mul (vector3i a, vector3i b) |
| Component-wise multiplication of two vectors. | |
| vector3i | vec3i_neg (vector3i v) |
| Negation of a vector. | |
| vector3i | vec3i_abs (vector3i v) |
| Computes the absolute value per component of a vector3i. | |
| vector3i | vec3i_zero (void) |
| Returns a zero-initialized vector3i. | |
| vector3i | vec3i_one (void) |
| Returns a vector3i with all components set to 1. | |
| vector3i | vec3i_x_axis (vm_int_t x) |
| Returns a vector3i along the x-axis. | |
| vector3i | vec3i_y_axis (vm_int_t y) |
| Returns a vector3i along the y-axis. | |
| vector3i | vec3i_z_axis (vm_int_t z) |
| Returns a vector3i along the z-axis. | |
| vector3i | vec3i_x_scale (vm_int_t x) |
| Returns a vector3i for scaling along the x-axis. | |
| vector3i | vec3i_y_scale (vm_int_t y) |
| Returns a vector3i for scaling along the y-axis. | |
| vector3i | vec3i_z_scale (vm_int_t z) |
| Returns a vector3i for scaling along the z-axis. | |
| vector3i | vec3i_cross (vector3i a, vector3i b) |
| Computes the cross-product of two vector3i. | |
| vector3i | vec3i_normalize (vector3i v) |
| Normalizes a vector3i to unit length. | |
| vector3i | vec3i_min (vector3i a, vector3i b) |
| Computes the component-wise minimum of two vector3i. | |
| vector3i | vec3i_max (vector3i a, vector3i b) |
| Computes the component-wise maximum of two vector3i. | |
| vector3i | vec3i_sign (vector3i v) |
| Computes the sign per component of a vector3i (-1, 0, or 1). | |
| vector3i | vec3i_lerp (vector3i a, vector3i b, vm_float_t t) |
| Linearly interpolates between two vector3i. | |
| vector3i | vec3i_clamp (vector3i v, vector3i min, vector3i max) |
| Clamps a vector3i between min and max per component. | |
| vector3i | vec3i_div (vector3i a, vector3i b) |
| Divides two vectors component-wise. | |
| vector3i | vec3i_add_scalar (vector3i v, vm_int_t s) |
| Adds a scalar to each component. | |
| vector3i | vec3i_sub_scalar (vector3i v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| vector3i | vec3i_mod (vector3i a, vector3i b) |
| Component-wise floor modulo of a by b. | |
| vector3i | vec3i_div_floor (vector3i a, vector3i b) |
| Component-wise floored division of a by b. | |
| vector3i | vec3i_wrap (vector3i v, vector3i period) |
| Wraps each component of v into [0, period). | |
| vector3i | vec3i_splat (vm_int_t s) |
| Returns a vector with every component set to s. | |
| vector3i | vec3i_from_vec2i (vector2i v, vm_int_t z) |
| Builds a vector3i from a vector2i and z. | |
| vector2i | vec3i_xy (vector3i v) |
| Returns the x and y components as a 2D vector. | |
| vector3 | vec3i_normalize_to_vec3 (vector3i v) |
| Converts to a unit-length vector3. | |
| vm_int_t | vec3i_dot (vector3i a, vector3i b) |
| Computes the dot product of two vector3i. | |
| vm_int_t | vec3i_length_squared (vector3i v) |
| Returns the squared Euclidean length. | |
| vm_int_t | vec3i_distance_squared (vector3i a, vector3i b) |
| Returns the squared Euclidean distance between a and b. | |
| vm_int_t | vec3i_length_manhattan (vector3i v) |
| Returns the Manhattan (L1) length. | |
| vm_int_t | vec3i_length_chebyshev (vector3i v) |
| Returns the Chebyshev (L-inf) length. | |
| vm_int_t | vec3i_min_component (vector3i v) |
| Returns the smallest component. | |
| vm_int_t | vec3i_max_component (vector3i v) |
| Returns the largest component. | |
| vm_int_t | vec3i_sum (vector3i v) |
| Returns the sum of all components. | |
| vm_float_t | vec3i_length (vector3i v) |
| Computes the length (magnitude) of a vector3i. | |
| vm_float_t | vec3i_distance (vector3i a, vector3i b) |
| Computes the Euclidean distance between two vector3i. | |
| vm_float_t | vec3i_angle (vector3i a, vector3i b) |
| Computes the angle between two non-zero vector3i in radians. | |
| bool | vec3i_is_zero (vector3i v) |
| Returns true if every component is zero. | |
| vector4i | vec4i_add (vector4i a, vector4i b) |
| Component-wise addition of two vectors. | |
| vector4i | vec4i_sub (vector4i a, vector4i b) |
| Component-wise subtraction of two vectors. | |
| vector4i | vec4i_mul_scalar (vector4i v, vm_int_t s) |
| Component-wise multiplication of vector by scalar. | |
| vector4i | vec4i_div_scalar (vector4i v, vm_int_t s) |
| Component-wise division of vector by scalar. | |
| vector4i | vec4i_mul (vector4i a, vector4i b) |
| Component-wise multiplication of two vectors. | |
| vector4i | vec4i_neg (vector4i v) |
| Negation of a vector. | |
| vector4i | vec4i_abs (vector4i v) |
| Computes the absolute value per component of a vector4i. | |
| vector4i | vec4i_zero (void) |
| Returns a zero-initialized vector4i. | |
| vector4i | vec4i_one (void) |
| Returns a vector4i with all components set to 1. | |
| vector4i | vec4i_x_axis (vm_int_t x) |
| Returns a vector4i along the x-axis. | |
| vector4i | vec4i_y_axis (vm_int_t y) |
| Returns a vector4i along the y-axis. | |
| vector4i | vec4i_z_axis (vm_int_t z) |
| Returns a vector4i along the z-axis. | |
| vector4i | vec4i_w_axis (vm_int_t w) |
| Returns a vector4i along the w-axis. | |
| vector4i | vec4i_x_scale (vm_int_t x) |
| Returns a vector4i for scaling along the x-axis. | |
| vector4i | vec4i_y_scale (vm_int_t y) |
| Returns a vector4i for scaling along the y-axis. | |
| vector4i | vec4i_z_scale (vm_int_t z) |
| Returns a vector4i for scaling along the z-axis. | |
| vector4i | vec4i_w_scale (vm_int_t w) |
| Returns a vector4i for scaling along the w-axis. | |
| vector4i | vec4i_normalize (vector4i v) |
| Normalizes a vector4i to unit length. | |
| vector4i | vec4i_min (vector4i a, vector4i b) |
| Computes the component-wise minimum of two vector4i. | |
| vector4i | vec4i_max (vector4i a, vector4i b) |
| Computes the component-wise maximum of two vector4i. | |
| vector4i | vec4i_sign (vector4i v) |
| Computes the sign per component of a vector4i (-1, 0, or 1). | |
| vector4i | vec4i_lerp (vector4i a, vector4i b, vm_float_t t) |
| Linearly interpolates between two vector4i. | |
| vector4i | vec4i_clamp (vector4i v, vector4i min, vector4i max) |
| Clamps each component of the input vector to the range defined by the minimum and maximum vectors. | |
| vector4i | vec4i_div (vector4i a, vector4i b) |
| Divides two vectors component-wise. | |
| vector4i | vec4i_add_scalar (vector4i v, vm_int_t s) |
| Adds a scalar to each component. | |
| vector4i | vec4i_sub_scalar (vector4i v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| vector4i | vec4i_mod (vector4i a, vector4i b) |
| Component-wise floor modulo of a by b. | |
| vector4i | vec4i_div_floor (vector4i a, vector4i b) |
| Component-wise floored division of a by b. | |
| vector4i | vec4i_wrap (vector4i v, vector4i period) |
| Wraps each component of v into [0, period). | |
| vector4i | vec4i_splat (vm_int_t s) |
| Returns a vector with every component set to s. | |
| vector3i | vec4i_to_vec3i (vector4i v) |
| Converts a vector4i to a vector3i (discards the w component). | |
| vm_int_t | vec4i_dot (vector4i a, vector4i b) |
| Computes the dot product of two vector4i. | |
| vm_int_t | vec4i_length_squared (vector4i v) |
| Returns the squared Euclidean length. | |
| vm_int_t | vec4i_distance_squared (vector4i a, vector4i b) |
| Returns the squared Euclidean distance between a and b. | |
| vm_int_t | vec4i_length_manhattan (vector4i v) |
| Returns the Manhattan (L1) length. | |
| vm_int_t | vec4i_length_chebyshev (vector4i v) |
| Returns the Chebyshev (L-inf) length. | |
| vm_int_t | vec4i_min_component (vector4i v) |
| Returns the smallest component. | |
| vm_int_t | vec4i_max_component (vector4i v) |
| Returns the largest component. | |
| vm_int_t | vec4i_sum (vector4i v) |
| Returns the sum of all components. | |
| vm_float_t | vec4i_length (vector4i v) |
| Computes the length (magnitude) of a vector4i. | |
| vm_float_t | vec4i_distance (vector4i a, vector4i b) |
| Computes the Euclidean distance between two vector4i. | |
| bool | vec4i_is_zero (vector4i v) |
| Returns true if every component is zero. | |
| void | vec2i_add_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Adds vectors a and b component-wise, storing the result in res. | |
| void | vec2i_sub_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Subtracts vector b from vector a component-wise, storing the result in res. | |
| void | vec2i_mul_scalar_ptr (vector2i *res, const vector2i *v, vm_int_t s) |
| Multiplies vector v by scalar s component-wise, storing the result in res. | |
| void | vec2i_div_scalar_ptr (vector2i *res, const vector2i *v, vm_int_t s) |
| Divides vector v by scalar s component-wise (float division, truncated to int), storing the result in res. | |
| void | vec2i_mul_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Multiplies vectors a and b component-wise (Hadamard product), storing the result in res. | |
| void | vec2i_neg_ptr (vector2i *res, const vector2i *v) |
| Negates the components of vector v, storing the result in res. | |
| void | vec2i_abs_ptr (vector2i *res, const vector2i *v) |
| Computes the absolute values of the components of vector v (using int abs), storing the result in res. | |
| void | vec2i_normalize_ptr (vector2i *res, const vector2i *v) |
| Normalizes vector v to approximate unit length (float length computation, truncated to int), storing the result in res. | |
| void | vec2i_min_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Computes the component-wise minimum of vectors a and b, storing the result in res. | |
| void | vec2i_max_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Computes the component-wise maximum of vectors a and b, storing the result in res. | |
| void | vec2i_sign_ptr (vector2i *res, const vector2i *v) |
| Sets each component of res to the sign of the corresponding component in v (+1, -1, or 0). | |
| void | vec2i_perpendicular_ptr (vector2i *res, const vector2i *v) |
| Computes the perpendicular vector to v (90 degrees counterclockwise rotation), storing the result in res. | |
| void | vec2i_cross_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Computes the 2D cross-product of a and b, storing the scalar value in res->x and 0 in res->y. | |
| void | vec2i_lerp_ptr (vector2i *res, const vector2i *a, const vector2i *b, vm_float_t t) |
| Linearly interpolates from a to b by t. | |
| void | vec2i_clamp_ptr (vector2i *res, const vector2i *v, const vector2i *min, const vector2i *max) |
| Clamps each component between min and max. | |
| void | vec2i_div_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Divides two vectors component-wise. | |
| void | vec2i_add_scalar_ptr (vector2i *res, const vector2i *v, vm_int_t s) |
| Adds a scalar to each component. | |
| void | vec2i_sub_scalar_ptr (vector2i *res, const vector2i *v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| void | vec2i_mod_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Component-wise floor modulo of a by b. | |
| void | vec2i_div_floor_ptr (vector2i *res, const vector2i *a, const vector2i *b) |
| Component-wise floored division of a by b. | |
| void | vec2i_wrap_ptr (vector2i *res, const vector2i *v, const vector2i *period) |
| Wraps each component of v into [0, period). | |
| void | vec2i_to_vec3i_ptr (vector3i *res, const vector2i *v, vm_int_t z) |
| Converts a vector4i to a vector3i by dropping w. | |
| void | vec2i_normalize_to_vec2_ptr (vector2 *res, const vector2i *v) |
| Converts to a unit-length vector2. | |
| void | vec3i_add_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the component-wise sum of two vector3i. | |
| void | vec3i_sub_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the component-wise difference of two vector3i (a minus b). | |
| void | vec3i_mul_scalar_ptr (vector3i *res, const vector3i *v, vm_int_t s) |
| Scales a vector3i by an integer scalar. | |
| void | vec3i_div_scalar_ptr (vector3i *res, const vector3i *v, vm_int_t s) |
| Scales a vector3i by the inverse of an integer scalar. | |
| void | vec3i_mul_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the component-wise product (Hadamard) of two vector3i. | |
| void | vec3i_neg_ptr (vector3i *res, const vector3i *v) |
| Negates a vector3i (multiplies by -1). | |
| void | vec3i_abs_ptr (vector3i *res, const vector3i *v) |
| Computes the absolute value of each component of a vector3i. | |
| void | vec3i_normalize_ptr (vector3i *res, const vector3i *v) |
| Normalizes a vector3i to approximate unit length. | |
| void | vec3i_cross_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the cross-product of two vector3i. | |
| void | vec3i_min_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the component-wise minimum of two vector3i. | |
| void | vec3i_max_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Computes the component-wise maximum of two vector3i. | |
| void | vec3i_sign_ptr (vector3i *res, const vector3i *v) |
| Computes the sign of each component of a vector3i (-1, 0, or 1). | |
| void | vec3i_lerp_ptr (vector3i *res, const vector3i *a, const vector3i *b, vm_float_t t) |
| Performs linear interpolation between two vector3i. | |
| void | vec3i_clamp_ptr (vector3i *res, const vector3i *v, const vector3i *min, const vector3i *max) |
| Clamps each component of a vector3i between corresponding min and max values. | |
| void | vec3i_div_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Divides two vectors component-wise. | |
| void | vec3i_add_scalar_ptr (vector3i *res, const vector3i *v, vm_int_t s) |
| Adds a scalar to each component. | |
| void | vec3i_sub_scalar_ptr (vector3i *res, const vector3i *v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| void | vec3i_mod_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Component-wise floor modulo of a by b. | |
| void | vec3i_div_floor_ptr (vector3i *res, const vector3i *a, const vector3i *b) |
| Component-wise floored division of a by b. | |
| void | vec3i_wrap_ptr (vector3i *res, const vector3i *v, const vector3i *period) |
| Wraps each component of v into [0, period). | |
| void | vec3i_from_vec2i_ptr (vector3i *res, const vector2i *v, vm_int_t z) |
| Builds a vector3i from a vector2i and z. | |
| void | vec3i_xy_ptr (vector2i *res, const vector3i *v) |
| Returns the x and y components as a 2D vector. | |
| void | vec3i_normalize_to_vec3_ptr (vector3 *res, const vector3i *v) |
| Converts to a unit-length vector3. | |
| void | vec4i_add_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Adds the components of two vector4i and stores the result in res. | |
| void | vec4i_sub_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Subtracts the components of the second vector from the first vector4i and stores the result in res. | |
| void | vec4i_mul_scalar_ptr (vector4i *res, const vector4i *v, vm_int_t s) |
| Multiplies the components of a vector4i by a scalar and stores the result in res. | |
| void | vec4i_div_scalar_ptr (vector4i *res, const vector4i *v, vm_int_t s) |
| Divides the components of a vector4i by a scalar and stores the result in res. | |
| void | vec4i_mul_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Multiplies the components of two vector4i and stores the result in res. | |
| void | vec4i_neg_ptr (vector4i *res, const vector4i *v) |
| Negates the components of a vector4i and stores the result in res. | |
| void | vec4i_abs_ptr (vector4i *res, const vector4i *v) |
| Computes the absolute value of each component of a vector4i and stores the result in res. | |
| void | vec4i_normalize_ptr (vector4i *res, const vector4i *v) |
| Normalizes a vector4i by dividing its components by the vector length and stores the result in res. | |
| void | vec4i_min_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Takes the component-wise minimum of two vector4i and stores the result in res. | |
| void | vec4i_max_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Computes the component-wise maximum of two vector4i and stores the result in res. | |
| void | vec4i_sign_ptr (vector4i *res, const vector4i *v) |
| Computes the sign (-1, 0, or 1) of each component of a vector4i and stores the result in res. | |
| void | vec4i_lerp_ptr (vector4i *res, const vector4i *a, const vector4i *b, vm_float_t t) |
| Linearly interpolates between two vector4i using an interpolation factor t (clamped to [0,1]) and stores the result in res. | |
| void | vec4i_clamp_ptr (vector4i *res, const vector4i *v, const vector4i *min, const vector4i *max) |
| Clamps the components of a vector4i to the range [min, max] and stores the result in res. | |
| void | vec4i_div_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Divides two vectors component-wise. | |
| void | vec4i_add_scalar_ptr (vector4i *res, const vector4i *v, vm_int_t s) |
| Adds a scalar to each component. | |
| void | vec4i_sub_scalar_ptr (vector4i *res, const vector4i *v, vm_int_t s) |
| Subtracts a scalar from each component. | |
| void | vec4i_mod_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Component-wise floor modulo of a by b. | |
| void | vec4i_div_floor_ptr (vector4i *res, const vector4i *a, const vector4i *b) |
| Component-wise floored division of a by b. | |
| void | vec4i_wrap_ptr (vector4i *res, const vector4i *v, const vector4i *period) |
| Wraps each component of v into [0, period). | |
| void | vec4i_to_vec3i_ptr (vector3i *res, const vector4i *v) |
| Copies the x, y, z components of a vector4i and stores the result in a vector3i. | |
| matrix2 | mat2_identity (void) |
| Constructs the 2x2 identity matrix. | |
| matrix2 | mat2_mul (matrix2 a, matrix2 b) |
| Multiplies two 2x2 matrices (a * b). | |
| matrix2 | mat2_transpose (matrix2 m) |
| Computes the transpose of a 2x2 matrix. | |
| matrix2 | mat2_inverse (matrix2 m) |
| Computes the inverse of a 2x2 matrix. | |
| matrix2 | mat2_rotation_z (vm_float_t degrees) |
| Constructs a 2x2 Z-axis rotation matrix. | |
| matrix2 | mat2_scale (vector2 s) |
| Builds a 2x2 scaling matrix from a vector2. | |
| matrix2 | mat2_from_mat3 (matrix3 m) |
| Copies the upper-left 2x2 of a matrix3. | |
| vector2 | mat2_mul_vec2 (matrix2 m, vector2 v) |
| Multiplies a 2x2 matrix by a vector2. | |
| vm_float_t | mat2_determinant (matrix2 m) |
| Calculates the determinant of the given 2x2 matrix. | |
| matrix3 | mat3_identity (void) |
| Constructs the 3x3 identity matrix. | |
| matrix3 | mat3_mul (matrix3 a, matrix3 b) |
| Multiplies two 3x3 matrices. | |
| matrix3 | mat3_transpose (matrix3 m) |
| Computes the transpose of a 3x3 matrix. | |
| matrix3 | mat3_inverse (matrix3 m) |
| Computes the inverse of a 3x3 matrix. | |
| matrix3 | mat3_rotation_x (vm_float_t degrees) |
| Builds a 3x3 rotation matrix around the X axis (degrees). | |
| matrix3 | mat3_rotation_y (vm_float_t degrees) |
| Builds a 3x3 rotation matrix around the Y axis (degrees). | |
| matrix3 | mat3_rotation_z (vm_float_t degrees) |
| Constructs the 3x3 rotation matrix around the Z-axis. | |
| matrix3 | mat3_translate (vector2 t) |
| Builds a 3x3 2D translation matrix. | |
| matrix3 | mat3_scale (vector2 s) |
| Builds a 3x3 2D scaling matrix. | |
| matrix3 | mat3_from_mat4 (matrix4 m) |
| Copies the upper-left 3x3 of a matrix4. | |
| vector3 | mat3_mul_vec3 (matrix3 m, vector3 v) |
| Multiplies a 3x3 matrix by a vector3. | |
| vector2 | mat3_mul_vec2 (matrix3 m, vector2 v) |
| Applies a 3x3 affine transform to a vector2. | |
| vm_float_t | mat3_determinant (matrix3 m) |
| Computes the determinant of a 3x3 matrix. | |
| matrix4 | mat4_identity (void) |
| Constructs the 4x4 identity matrix. | |
| matrix4 | mat4_mul (matrix4 a, matrix4 b) |
| Multiplies two 4x4 matrices (a * b). | |
| matrix4 | mat4_transpose (matrix4 m) |
| Computes the transpose of a 4x4 matrix. | |
| matrix4 | mat4_inverse (matrix4 m) |
| Computes the inverse of a 4x4 matrix. | |
| matrix4 | mat4_translate (vector3 v) |
| Constructs a translation matrix from the given vector. | |
| matrix4 | mat4_scale (vector3 v) |
| Constructs a scaling matrix from the given scale vector. | |
| matrix4 | mat4_rotation (vector3 axis, vm_float_t angle) |
| Constructs a rotation matrix around the given axis by the specified angle (in radians). | |
| matrix4 | mat4_rotation_x (vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the X axis (degrees). | |
| matrix4 | mat4_rotation_y (vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the Y axis (degrees). | |
| matrix4 | mat4_rotation_z (vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the Z axis (degrees). | |
| matrix4 | mat4_trs (vector3 translation, quaternion rotation, vector3 scale) |
| Builds a 4x4 TRS matrix from translation, rotation, and scale. | |
| matrix4 | mat4_from_mat3 (matrix3 m) |
| Embeds a matrix3 into the upper-left of a matrix4. | |
| matrix4 | mat4_perspective (vm_float_t fov, vm_float_t aspect, vm_float_t near, vm_float_t far) |
| Constructs a perspective projection matrix. | |
| matrix4 | mat4_ortho (vm_float_t left, vm_float_t right, vm_float_t bottom, vm_float_t top, vm_float_t near, vm_float_t far) |
| Constructs an orthographic projection matrix. | |
| matrix4 | mat4_look_at (vector3 position, vector3 target, vector3 up) |
| Constructs a view matrix from eye position, target, and up vector. | |
| matrix4 | mat4_perspective_fov (vm_float_t fov, vm_float_t w, vm_float_t h, vm_float_t n, vm_float_t f) |
| Constructs a perspective projection matrix using FOV, width, and height. | |
| matrix4 | mat4_perspective_infinite (vm_float_t fov_y, vm_float_t aspect, vm_float_t n) |
| Constructs an infinite far-plane perspective projection matrix. | |
| vector3 | mat4_extract_translation (matrix4 m) |
| Extracts the translation vector from a matrix4. | |
| vector3 | mat4_extract_scale (matrix4 m) |
| Extracts the scale vector from a matrix4. | |
| vector3 | mat4_mul_vec3 (matrix4 m, vector3 v, vm_float_t w) |
| Transforms a vector3 by a 4x4 matrix using homogeneous w. | |
| vector4 | mat4_mul_vec4 (matrix4 m, vector4 v) |
| Multiplies a 4x4 matrix by a vector4. | |
| quaternion | mat4_extract_rotation (matrix4 m) |
| Extracts the rotation quaternion from a matrix4. | |
| vm_float_t | mat4_determinant (matrix4 m) |
| Calculates the determinant of the given 4x4 matrix. | |
| void | mat2_identity_ptr (matrix2 *res) |
| Initializes the 2x2 matrix to identity (diagonal 1.0, others 0.0). | |
| void | mat2_mul_ptr (matrix2 *res, const matrix2 *a, const matrix2 *b) |
| Multiplies two 2x2 matrices (a * b) in column-major / column-vector convention. | |
| void | mat2_transpose_ptr (matrix2 *res, const matrix2 *m) |
| Computes the transpose of the input 2x2 matrix and stores in res. | |
| void | mat2_inverse_ptr (matrix2 *res, const matrix2 *m) |
| Computes the inverse of the input 2x2 matrix using determinant and stores in res. | |
| void | mat2_rotation_z_ptr (matrix2 *res, vm_float_t degrees) |
| Sets res to a 2x2 rotation matrix for rotation around the Z-axis. | |
| void | mat2_scale_ptr (matrix2 *res, const vector2 *s) |
| Builds a 2x2 scaling matrix from a vector2. | |
| void | mat2_from_mat3_ptr (matrix2 *res, const matrix3 *m) |
| Copies the upper-left 2x2 of a matrix3. | |
| void | mat2_mul_vec2_ptr (vector2 *res, const matrix2 *m, const vector2 *v) |
| Multiplies a 2x2 matrix by a vector2. | |
| void | mat3_identity_ptr (matrix3 *res) |
| Initializes the 3x3 matrix to identity (diagonal 1.0, others 0.0). | |
| void | mat3_mul_ptr (matrix3 *res, const matrix3 *a, const matrix3 *b) |
| Multiplies two 3x3 matrices (a * b) in column-major / column-vector convention. | |
| void | mat3_transpose_ptr (matrix3 *res, const matrix3 *m) |
| Computes the transpose of the input 3x3 matrix and stores in res. | |
| void | mat3_inverse_ptr (matrix3 *res, const matrix3 *m) |
| Computes the inverse of the input 3x3 matrix using the adjugate method and stores in res. | |
| void | mat3_rotation_x_ptr (matrix3 *res, vm_float_t degrees) |
| Builds a 3x3 rotation matrix around the X axis (degrees). | |
| void | mat3_rotation_y_ptr (matrix3 *res, vm_float_t degrees) |
| Builds a 3x3 rotation matrix around the Y axis (degrees). | |
| void | mat3_rotation_z_ptr (matrix3 *res, vm_float_t degrees) |
| Sets the 3x3 matrix to a rotation around the Z-axis by the given angle in degrees. | |
| void | mat3_translate_ptr (matrix3 *res, const vector2 *t) |
| Builds a 3x3 2D translation matrix. | |
| void | mat3_scale_ptr (matrix3 *res, const vector2 *s) |
| Builds a 3x3 2D scaling matrix. | |
| void | mat3_from_mat4_ptr (matrix3 *res, const matrix4 *m) |
| Copies the upper-left 3x3 of a matrix4. | |
| void | mat3_mul_vec3_ptr (vector3 *res, const matrix3 *m, const vector3 *v) |
| Multiplies a 3x3 matrix by a vector3. | |
| void | mat3_mul_vec2_ptr (vector2 *res, const matrix3 *m, const vector2 *v) |
| Applies a 3x3 affine transform to a vector2. | |
| void | mat4_identity_ptr (matrix4 *res) |
| Sets the matrix to the identity matrix. | |
| void | mat4_mul_ptr (matrix4 *res, const matrix4 *a, const matrix4 *b) |
| void | mat4_transpose_ptr (matrix4 *res, const matrix4 *m) |
| void | mat4_inverse_ptr (matrix4 *res, const matrix4 *m) |
| Computes the inverse of a 4x4 matrix. | |
| void | mat4_translate_ptr (matrix4 *res, const vector3 *v) |
| Sets the matrix to a translation matrix. | |
| void | mat4_scale_ptr (matrix4 *res, const vector3 *v) |
| Sets the matrix to a scaling matrix using the provided scale vector. | |
| void | mat4_rotation_ptr (matrix4 *res, const vector3 *axis, vm_float_t angle) |
| Sets the matrix to a rotation matrix around the specified axis by the given angle. | |
| void | mat4_rotation_x_ptr (matrix4 *res, vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the X axis (degrees). | |
| void | mat4_rotation_y_ptr (matrix4 *res, vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the Y axis (degrees). | |
| void | mat4_rotation_z_ptr (matrix4 *res, vm_float_t degrees) |
| Builds a 4x4 rotation matrix around the Z axis (degrees). | |
| void | mat4_trs_ptr (matrix4 *res, const vector3 *translation, const quaternion *rotation, const vector3 *scale) |
| Builds a 4x4 TRS matrix from translation, rotation, and scale. | |
| void | mat4_from_mat3_ptr (matrix4 *res, const matrix3 *m) |
| Embeds a matrix3 into the upper-left of a matrix4. | |
| void | mat4_extract_translation_ptr (vector3 *res, const matrix4 *m) |
| Extracts the translation vector from a matrix4. | |
| void | mat4_extract_scale_ptr (vector3 *res, const matrix4 *m) |
| Extracts the scale vector from a matrix4. | |
| void | mat4_extract_rotation_ptr (quaternion *res, const matrix4 *m) |
| Extracts the rotation quaternion from a matrix4. | |
| void | mat4_perspective_ptr (matrix4 *res, vm_float_t fov, vm_float_t aspect, vm_float_t near, vm_float_t far) |
| Creates a perspective projection matrix. | |
| void | mat4_ortho_ptr (matrix4 *res, vm_float_t left, vm_float_t right, vm_float_t bottom, vm_float_t top, vm_float_t near, vm_float_t far) |
| Sets the matrix to an orthographic projection matrix. | |
| void | mat4_look_at_ptr (matrix4 *res, const vector3 *position, const vector3 *target, const vector3 *up) |
| Constructs a view matrix for a camera positioned at the given location, looking towards a target, with a specified up direction. | |
| void | mat4_perspective_fov_ptr (matrix4 *res, vm_float_t fov, vm_float_t w, vm_float_t h, vm_float_t n, vm_float_t f) |
| Sets the matrix to a perspective projection matrix. | |
| void | mat4_perspective_infinite_ptr (matrix4 *res, vm_float_t fov_y, vm_float_t aspect, vm_float_t n) |
| Sets the matrix to an infinite perspective projection matrix. | |
| void | mat4_mul_vec4_ptr (vector4 *res, const matrix4 *m, const vector4 *v) |
| void | mat4_mul_vec3_ptr (vector3 *res, const matrix4 *m, const vector3 *v, vm_float_t w) |
| matrix2i | mat2i_identity (void) |
| Constructs the 2x2 integer identity matrix. | |
| matrix2i | mat2i_mul (matrix2i a, matrix2i b) |
| Multiplies two 2x2 integer matrices (a * b). | |
| matrix2i | mat2i_transpose (matrix2i m) |
| Computes the transpose of a 2x2 integer matrix. | |
| matrix2i | mat2i_inverse (matrix2i m) |
| Computes the inverse of a 2x2 integer matrix. | |
| vector2i | mat2i_mul_vec2i (matrix2i m, vector2i v) |
| Multiplies a 2x2 integer matrix by a vector2i. | |
| vm_int_t | mat2i_determinant (matrix2i m) |
| Calculates the determinant of the given 2x2 integer matrix. | |
| matrix3i | mat3i_identity (void) |
| Constructs the 3x3 identity matrix. | |
| matrix3i | mat3i_mul (matrix3i a, matrix3i b) |
| Multiplies two 3x3 integer matrices. | |
| matrix3i | mat3i_transpose (matrix3i m) |
| Computes the transpose of a 3x3 integer matrix. | |
| matrix3i | mat3i_inverse (matrix3i m) |
| Computes the inverse of a 3x3 integer matrix. | |
| vector3i | mat3i_mul_vec3i (matrix3i m, vector3i v) |
| Multiplies a 3x3 integer matrix by a vector3i. | |
| vector2i | mat3i_mul_vec2i (matrix3i m, vector2i v) |
| Applies a 3x3 integer affine transform to a vector2i. | |
| vm_int_t | mat3i_determinant (matrix3i m) |
| Computes the determinant of a 3x3 integer matrix. | |
| matrix4i | mat4i_identity (void) |
| Constructs the 4x4 identity matrix. | |
| matrix4i | mat4i_mul (matrix4i a, matrix4i b) |
| Multiplies two 4x4 integer matrices. | |
| matrix4i | mat4i_transpose (matrix4i m) |
| Computes the transpose of a 4x4 integer matrix. | |
| matrix4i | mat4i_inverse (matrix4i m) |
| Computes the inverse of a 4x4 integer matrix. | |
| vector4i | mat4i_mul_vec4i (matrix4i m, vector4i v) |
| Multiplies a 4x4 integer matrix by a vector4i. | |
| vector3i | mat4i_mul_vec3i (matrix4i m, vector3i v, vm_int_t w) |
| Transforms a vector3i by a 4x4 integer matrix using homogeneous w. | |
| vm_int_t | mat4i_determinant (matrix4i m) |
| Computes the determinant of a 4x4 integer matrix (Laplace expansion along first row). | |
| void | mat2i_identity_ptr (matrix2i *res) |
| Initializes the integer 2x2 matrix to identity (diagonal 1, others 0). | |
| void | mat2i_mul_ptr (matrix2i *res, const matrix2i *a, const matrix2i *b) |
| Multiplies two integer 2x2 matrices (a * b) using explicit loops and stores the result in res. | |
| void | mat2i_transpose_ptr (matrix2i *res, const matrix2i *m) |
| Computes the transpose of the input integer 2x2 matrix and stores in res. | |
| void | mat2i_inverse_ptr (matrix2i *res, const matrix2i *m) |
| Computes the inverse of the input integer 2x2 matrix and stores in res. | |
| void | mat2i_mul_vec2i_ptr (vector2i *res, const matrix2i *m, const vector2i *v) |
| Multiplies a 2x2 integer matrix by a vector2i. | |
| void | mat3i_identity_ptr (matrix3i *res) |
| Fills the given 3x3 integer matrix with the identity matrix. | |
| void | mat3i_mul_ptr (matrix3i *res, const matrix3i *a, const matrix3i *b) |
| Multiplies two 3x3 integer matrices (standard matrix multiplication). | |
| void | mat3i_transpose_ptr (matrix3i *res, const matrix3i *m) |
| Computes the transpose of a 3x3 integer matrix. | |
| void | mat3i_inverse_ptr (matrix3i *res, const matrix3i *m) |
| Computes the inverse of a 3x3 integer matrix using adjugate over determinant. | |
| void | mat3i_mul_vec3i_ptr (vector3i *res, const matrix3i *m, const vector3i *v) |
| Multiplies a 3x3 integer matrix by a vector3i. | |
| void | mat3i_mul_vec2i_ptr (vector2i *res, const matrix3i *m, const vector2i *v) |
| Applies a 3x3 integer affine transform to a vector2i. | |
| void | mat4i_identity_ptr (matrix4i *res) |
| Sets the given 4x4 integer matrix to the identity matrix. | |
| void | mat4i_mul_ptr (matrix4i *res, const matrix4i *a, const matrix4i *b) |
| Performs matrix multiplication of two 4x4 matrices and stores the result. | |
| void | mat4i_transpose_ptr (matrix4i *res, const matrix4i *m) |
| Transposes the given 4x4 integer matrix and stores the result in the provided matrix structure. | |
| void | mat4i_inverse_ptr (matrix4i *res, const matrix4i *m) |
| Computes the inverse of the given 4x4 integer matrix and stores the result in the specified matrix. | |
| void | mat4i_mul_vec4i_ptr (vector4i *res, const matrix4i *m, const vector4i *v) |
| Multiplies a 4x4 integer matrix by a vector4i. | |
| void | mat4i_mul_vec3i_ptr (vector3i *res, const matrix4i *m, const vector3i *v, vm_int_t w) |
| Transforms a vector3i by a 4x4 integer matrix using homogeneous w. | |
| quaternion | quat_identity (void) |
| Constructs the identity quaternion. | |
| quaternion | quat_mul (quaternion a, quaternion b) |
| Multiplies two quaternions (a * b). | |
| quaternion | quat_normalize (quaternion q) |
| Normalizes a quaternion. | |
| quaternion | quat_conjugate (quaternion q) |
| Returns the conjugate of a quaternion. | |
| quaternion | quat_inverse (quaternion q) |
| Returns the inverse of a quaternion. | |
| quaternion | quat_from_euler (vector3 euler) |
| Constructs a quaternion from Euler angles (in radians, XYZ order). | |
| quaternion | quat_from_axis_angle (vector3 axis, vm_float_t degrees) |
| Builds a quaternion from an axis and an angle in degrees. | |
| quaternion | quat_from_mat3 (matrix3 m) |
| Builds a quaternion from a 3x3 rotation matrix. | |
| quaternion | quat_from_mat4 (matrix4 m) |
| Builds a quaternion from the rotation of a 4x4 matrix. | |
| quaternion | quat_slerp (quaternion a, quaternion b, vm_float_t t) |
| Spherical-linearly interpolates from a to b by t. | |
| quaternion | quat_nlerp (quaternion a, quaternion b, vm_float_t t) |
| Normalized-linearly interpolates from a to b by t. | |
| vector3 | quat_rotate_vec3 (quaternion q, vector3 v) |
| Rotates a vector3 by a quaternion. | |
| vector3 | quat_to_euler (quaternion q) |
| Converts a quaternion to Euler angles in degrees (XYZ). | |
| vector3 | quat_to_axis_angle (quaternion q, vm_float_t *degrees) |
| Converts a quaternion to an axis and an angle in degrees. | |
| matrix4 | quat_to_mat4 (quaternion q) |
| Converts a quaternion to a 4x4 rotation matrix. | |
| matrix3 | quat_to_mat3 (quaternion q) |
| Converts a quaternion to a 3x3 rotation matrix. | |
| vm_float_t | quat_dot (quaternion a, quaternion b) |
| Returns the dot product of two quaternions. | |
| bool | quat_near (quaternion a, quaternion b, vm_float_t eps) |
| Returns true if a and b are within eps of each other. | |
| void | quat_identity_ptr (quaternion *res) |
| Sets the quaternion to the identity quaternion (x=0, y=0, z=0, w=1). | |
| void | quat_mul_ptr (quaternion *res, const quaternion *a, const quaternion *b) |
| void | quat_normalize_ptr (quaternion *res, const quaternion *q) |
| void | quat_conjugate_ptr (quaternion *res, const quaternion *q) |
| Writes the conjugate of a quaternion. | |
| void | quat_inverse_ptr (quaternion *res, const quaternion *q) |
| Writes the inverse of a quaternion. | |
| void | quat_from_euler_ptr (quaternion *res, const vector3 *euler) |
| Converts Euler angles (in degrees, XYZ order: pitch, yaw, roll) to a quaternion and stores in res. | |
| void | quat_from_axis_angle_ptr (quaternion *res, const vector3 *axis, vm_float_t degrees) |
| Builds a quaternion from an axis and an angle in degrees. | |
| void | quat_from_mat3_ptr (quaternion *res, const matrix3 *m) |
| Builds a quaternion from a 3x3 rotation matrix. | |
| void | quat_from_mat4_ptr (quaternion *res, const matrix4 *m) |
| Builds a quaternion from the rotation of a 4x4 matrix. | |
| void | quat_slerp_ptr (quaternion *res, const quaternion *a, const quaternion *b, vm_float_t t) |
| Spherical-linearly interpolates from a to b by t. | |
| void | quat_nlerp_ptr (quaternion *res, const quaternion *a, const quaternion *b, vm_float_t t) |
| Normalized-linearly interpolates from a to b by t. | |
| void | quat_rotate_vec3_ptr (vector3 *res, const quaternion *q, const vector3 *v) |
| Rotates a vector3 by a quaternion. | |
| void | quat_to_euler_ptr (vector3 *res, const quaternion *q) |
| Converts a quaternion to Euler angles in degrees (XYZ). | |
| void | quat_to_axis_angle_ptr (vector3 *axis, vm_float_t *degrees, const quaternion *q) |
| Converts a quaternion to an axis and an angle in degrees. | |
| void | quat_to_mat4_ptr (matrix4 *res, const quaternion *q) |
| Converts a unit quaternion to a 4x4 rotation matrix and stores in res. | |
| void | quat_to_mat3_ptr (matrix3 *res, const quaternion *q) |
| Converts a quaternion to a 3x3 rotation matrix. | |
| vector2 | vec2_from (const vector2i *v) |
| Converts a vector2i to a vector2. | |
| vector2i | vec2i_from (const vector2 *v) |
| Converts a vector2 to a vector2i by truncation. | |
| vector2i | vec2i_from_floored (const vector2 *v) |
| Converts a vector2 to a vector2i by flooring each component. | |
| vector2i | vec2i_from_rounded (const vector2 *v) |
| Converts a vector2 to a vector2i by rounding each component. | |
| vector3 | vec3_from (const vector3i *v) |
| Converts a vector3i to a vector3. | |
| vector3i | vec3i_from (const vector3 *v) |
| Converts a vector3 to a vector3i by truncation. | |
| vector3i | vec3i_from_floored (const vector3 *v) |
| Converts a vector3 to a vector3i by flooring each component. | |
| vector3i | vec3i_from_rounded (const vector3 *v) |
| Converts a vector3 to a vector3i by rounding each component. | |
| vm_float_t | deg_to_rad (vm_float_t degrees) |
| Converts degrees to radians. | |
| vm_float_t | rad_to_deg (vm_float_t radians) |
| Converts radians to degrees. | |
| vector2 | vec2 (vm_float_t x, vm_float_t y) |
| Constructs a vector2 from x and y. | |
| void | vec2_assign (vector2 *dest, const vector2 *src) |
| Copies src into dest. | |
| void | vec2_assign_xy (vector2 *dest, vm_float_t x, vm_float_t y) |
| Assigns x and y to dest. | |
| void | vec2_add_assign (vector2 *dest, const vector2 *src) |
| Adds src to dest in place. | |
| vector3 | vec3 (vm_float_t x, vm_float_t y, vm_float_t z) |
| Constructs a vector3 from x, y, and z. | |
| void | vec3_assign (vector3 *dest, const vector3 *src) |
| Copies src into dest. | |
| void | vec3_assign_xyz (vector3 *dest, vm_float_t x, vm_float_t y, vm_float_t z) |
| Assigns x, y, and z to dest. | |
| void | vec3_add_assign (vector3 *dest, const vector3 *src) |
| Adds src to dest in place. | |
| vector2i | vec2i (vm_int_t x, vm_int_t y) |
| Constructs a vector2i from x and y. | |
| void | vec2i_assign (vector2i *dest, const vector2i *src) |
| Copies src into dest. | |
| void | vec2i_assign_xy (vector2i *dest, vm_int_t x, vm_int_t y) |
| Assigns x and y to dest. | |
| void | vec2i_add_assign (vector2i *dest, const vector2i *src) |
| Adds src to dest in place. | |
| vector3i | vec3i (vm_int_t x, vm_int_t y, vm_int_t z) |
| Constructs a vector3i from x, y, and z. | |
| void | vec3i_assign (vector3i *dest, const vector3i *src) |
| Copies src into dest. | |
| void | vec3i_assign_xyz (vector3i *dest, vm_int_t x, vm_int_t y, vm_int_t z) |
| Assigns x, y, and z to dest. | |
| void | vec3i_add_assign (vector3i *dest, const vector3i *src) |
| Adds src to dest in place. | |
| bool | vec2_eq (vector2 a, vector2 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec3_eq (vector3 a, vector3 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec4_eq (vector4 a, vector4 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec2i_eq (vector2i a, vector2i b) |
| Returns true if two vectors are exactly equal. | |
| bool | vec3i_eq (vector3i a, vector3i b) |
| Returns true if two vectors are exactly equal. | |
| bool | vec4i_eq (vector4i a, vector4i b) |
| Returns true if two vectors are exactly equal. | |
| bool | mat2_eq (matrix2 a, matrix2 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat3_eq (matrix3 a, matrix3 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat4_eq (matrix4 a, matrix4 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat2i_eq (matrix2i a, matrix2i b) |
| Returns true if two matrices are exactly equal. | |
| bool | mat3i_eq (matrix3i a, matrix3i b) |
| Returns true if two matrices are exactly equal. | |
| bool | mat4i_eq (matrix4i a, matrix4i b) |
| Returns true if two matrices are exactly equal. | |
| bool | quat_eq (quaternion a, quaternion b) |
| Returns true if two quaternions are equal within VECMAT_EPSILON. | |
| vm_float_t | elastic_oscillation (vm_float_t f, vm_float_t exp_mult, vm_float_t sin_mult, vm_float_t sin_offset, vm_float_t period) |
| vm_float_t | poly_ease_in (vm_float_t f, vm_float_t n) |
| vm_float_t | poly_ease_out (vm_float_t f, vm_float_t n) |
| vm_float_t | poly_ease_in_out (vm_float_t f, vm_float_t n) |
| vm_float_t | quadratic_ease_out (vm_float_t f) |
| vm_float_t | quadratic_ease_in (vm_float_t f) |
| vm_float_t | quadratic_ease_in_out (vm_float_t f) |
| vm_float_t | cubic_ease_out (vm_float_t f) |
| vm_float_t | cubic_ease_in (vm_float_t f) |
| vm_float_t | cubic_ease_in_out (vm_float_t f) |
| vm_float_t | quartic_ease_out (vm_float_t f) |
| vm_float_t | quartic_ease_in (vm_float_t f) |
| vm_float_t | quartic_ease_in_out (vm_float_t f) |
| vm_float_t | quintic_ease_out (vm_float_t f) |
| vm_float_t | quintic_ease_in (vm_float_t f) |
| vm_float_t | quintic_ease_in_out (vm_float_t f) |
| vm_float_t | sine_ease_out (vm_float_t f) |
| vm_float_t | sine_ease_in (vm_float_t f) |
| vm_float_t | sine_ease_in_out (vm_float_t f) |
| vm_float_t | circular_ease_out (vm_float_t f) |
| vm_float_t | circular_ease_in (vm_float_t f) |
| vm_float_t | circular_ease_in_out (vm_float_t f) |
| vm_float_t | exponential_ease_out (vm_float_t f) |
| vm_float_t | exponential_ease_in (vm_float_t f) |
| vm_float_t | exponential_ease_in_out (vm_float_t f) |
| vm_float_t | elastic_ease_out (vm_float_t f) |
| vm_float_t | elastic_ease_in (vm_float_t f) |
| vm_float_t | elastic_ease_in_out (vm_float_t f) |
| vm_float_t | back_ease_out (vm_float_t f) |
| vm_float_t | back_ease_in (vm_float_t f) |
| vm_float_t | back_ease_in_out (vm_float_t f) |
| vm_float_t | bounce_ease_out (vm_float_t f) |
| vm_float_t | bounce_ease_in (vm_float_t f) |
| vm_float_t | bounce_ease_in_out (vm_float_t f) |
Variables | |
| static const float | VM_DEG_TO_RAD_F32 = 0.017453292519943295769236907684886f |
| static const float | VM_RAD_TO_DEG_F32 = 57.295779513082320876798154814105f |
| static const double | VM_DEG_TO_RAD_F64 = 0.017453292519943295769236907684886 |
| static const double | VM_RAD_TO_DEG_F64 = 57.295779513082320876798154814105 |
| static const vm_float_t | VM_DEG_TO_RAD = VM_DEG_TO_RAD_F64 |
| static const vm_float_t | VM_RAD_TO_DEG = VM_RAD_TO_DEG_F64 |
| #define DOUBLE_EQ | ( | a, | |
| b, | |||
| eps ) |
| #define FLOAT_EQ | ( | a, | |
| b, | |||
| eps ) |
| #define M_PI 3.14159265358979323846 |
Definition at line 43 of file vecmat.h.
Referenced by elastic_oscillation(), mat3_rotation_z_ptr(), sine_ease_in(), sine_ease_in_out(), and sine_ease_out().
| #define M_PI_2 1.57079632679489661923 |
Definition at line 44 of file vecmat.h.
Referenced by quat_to_euler_ptr().
| #define VECMAT_ACOS | ( | x | ) |
Definition at line 419 of file vecmat.h.
Referenced by quat_slerp_ptr(), quat_to_axis_angle_ptr(), vec2_angle(), vec3_angle(), and vec3i_angle().
| #define VECMAT_ASIN | ( | x | ) |
| #define VECMAT_ATAN2 | ( | y, | |
| x ) |
Definition at line 421 of file vecmat.h.
Referenced by quat_to_euler_ptr(), vec2_heading(), vec2i_angle(), and vec3_signed_angle().
| #define VECMAT_CEIL | ( | x | ) |
Definition at line 425 of file vecmat.h.
Referenced by vec2_ceil_ptr(), vec3_ceil_ptr(), and vec4_ceil_ptr_scalar().
| #define VECMAT_COPYSIGN | ( | x, | |
| y ) |
Definition at line 428 of file vecmat.h.
Referenced by quat_to_euler_ptr(), and vec2_sign_ptr().
| #define VECMAT_COS | ( | x | ) |
Definition at line 416 of file vecmat.h.
Referenced by mat2_rotation_z_ptr(), mat3_rotation_x_ptr(), mat3_rotation_y_ptr(), mat3_rotation_z_ptr(), mat4_rotation_ptr(), mat4_rotation_x_ptr(), mat4_rotation_y_ptr(), mat4_rotation_z_ptr(), quat_from_axis_angle_ptr(), quat_from_euler_ptr(), sine_ease_in(), sine_ease_in_out(), vec2_from_angle(), vec2_rotate_ptr(), and vec3_rotate_axis_ptr().
| #define VECMAT_EPSILON VECMAT_EPS_F64 |
Definition at line 377 of file vecmat.h.
Referenced by mat2_eq(), mat3_eq(), mat4_eq(), quat_eq(), quat_to_axis_angle_ptr(), vec2_eq(), vec2_is_normalized(), vec2_is_zero(), vec3_eq(), vec3_is_normalized(), vec3_is_zero(), vec4_eq(), vec4_homogenize_ptr_avx(), vec4_homogenize_ptr_avx2(), vec4_homogenize_ptr_avx512(), vec4_homogenize_ptr_scalar(), vec4_homogenize_ptr_sve(), vec4_homogenize_ptr_sve2(), vec4_is_normalized(), and vec4_is_zero().
| #define VECMAT_EQ | ( | a, | |
| b, | |||
| eps ) |
| #define VECMAT_FABS | ( | x | ) |
Definition at line 413 of file vecmat.h.
Referenced by mat2_eq(), mat3_eq(), mat4_eq(), quat_eq(), quat_near(), quat_to_euler_ptr(), vec2_abs_ptr(), vec2_eq(), vec2_is_normalized(), vec2_is_zero(), vec2_length_chebyshev(), vec2_length_manhattan(), vec2_near(), vec3_abs_ptr(), vec3_eq(), vec3_is_normalized(), vec3_is_zero(), vec3_length_chebyshev(), vec3_length_manhattan(), vec3_near(), vec3_orthonormal_basis_ptr(), vec4_abs_ptr_scalar(), vec4_eq(), vec4_homogenize_ptr_avx(), vec4_homogenize_ptr_avx2(), vec4_homogenize_ptr_avx512(), vec4_homogenize_ptr_scalar(), vec4_homogenize_ptr_sve(), vec4_homogenize_ptr_sve2(), vec4_is_normalized(), and vec4_near().
| #define VECMAT_FLOOR | ( | x | ) |
Definition at line 424 of file vecmat.h.
Referenced by vec2_floor_ptr(), vec2_fract_ptr(), vec2i_from_floored(), vec3_floor_ptr(), vec3_fract_ptr(), vec3i_from_floored(), vec4_floor_ptr_scalar(), and vec4_fract_ptr_scalar().
| #define VECMAT_FMAX | ( | a, | |
| b ) |
Definition at line 423 of file vecmat.h.
Referenced by vec2_clamp_ptr(), vec2_clamp_scalar_ptr(), vec2_length_chebyshev(), vec2_max_component(), vec2_max_ptr(), vec3_clamp_ptr(), vec3_clamp_scalar_ptr(), vec3_length_chebyshev(), vec3_max_component(), vec3_max_ptr(), vec4_clamp_ptr_scalar(), vec4_clamp_scalar_ptr_scalar(), and vec4_max_ptr_scalar().
| #define VECMAT_FMIN | ( | a, | |
| b ) |
Definition at line 422 of file vecmat.h.
Referenced by vec2_clamp_ptr(), vec2_clamp_scalar_ptr(), vec2_min_component(), vec2_min_ptr(), vec3_clamp_ptr(), vec3_clamp_scalar_ptr(), vec3_min_component(), vec3_min_ptr(), vec4_clamp_ptr_scalar(), vec4_clamp_scalar_ptr_scalar(), and vec4_min_ptr_scalar().
| #define VECMAT_POW | ( | x, | |
| y ) |
Definition at line 427 of file vecmat.h.
Referenced by back_ease_in_out(), back_ease_out(), elastic_oscillation(), exponential_ease_in(), exponential_ease_in_out(), exponential_ease_out(), poly_ease_in(), poly_ease_in_out(), and poly_ease_out().
| #define VECMAT_ROUND | ( | x | ) |
Definition at line 426 of file vecmat.h.
Referenced by vec2_round_ptr(), vec2i_from_rounded(), vec3_round_ptr(), vec3i_from_rounded(), and vec4_round_ptr_scalar().
| #define VECMAT_SIN | ( | x | ) |
Definition at line 415 of file vecmat.h.
Referenced by elastic_oscillation(), mat2_rotation_z_ptr(), mat3_rotation_x_ptr(), mat3_rotation_y_ptr(), mat3_rotation_z_ptr(), mat4_rotation_ptr(), mat4_rotation_x_ptr(), mat4_rotation_y_ptr(), mat4_rotation_z_ptr(), quat_from_axis_angle_ptr(), quat_from_euler_ptr(), quat_slerp_ptr(), sine_ease_out(), vec2_from_angle(), vec2_rotate_ptr(), and vec3_rotate_axis_ptr().
| #define VECMAT_SQRT | ( | x | ) |
Definition at line 414 of file vecmat.h.
Referenced by circular_ease_in(), circular_ease_in_out(), circular_ease_out(), mat4_extract_scale_ptr(), quat_from_mat3_ptr(), quat_normalize_ptr_scalar(), quat_to_axis_angle_ptr(), vec2_distance(), vec2_length(), vec2_move_toward_ptr(), vec2_refract_ptr(), vec2i_distance(), vec2i_length(), vec3_length(), vec3_move_toward_ptr(), vec3_refract_ptr(), vec3i_length(), vec4_length(), and vec4i_length().
| #define VECMAT_STR | ( | x | ) |
| #define VECMAT_TAN | ( | x | ) |
Definition at line 417 of file vecmat.h.
Referenced by mat4_perspective_fov_ptr(), mat4_perspective_infinite_ptr(), and mat4_perspective_ptr().
| #define VECMAT_VERSION |
| typedef uint32_t vm_cpu_features_t |
| typedef double vm_float_t |
| anonymous enum |
| vm_float_t back_ease_in | ( | vm_float_t | f | ) |
| vm_float_t back_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 169 of file easing.c.
References VECMAT_POW.
| vm_float_t back_ease_out | ( | vm_float_t | f | ) |
Definition at line 159 of file easing.c.
References VECMAT_POW.
| vm_float_t bounce_ease_in | ( | vm_float_t | f | ) |
Definition at line 195 of file easing.c.
References bounce_ease_out().
| vm_float_t bounce_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 200 of file easing.c.
References bounce_ease_out().
| vm_float_t bounce_ease_out | ( | vm_float_t | f | ) |
Definition at line 177 of file easing.c.
Referenced by bounce_ease_in(), and bounce_ease_in_out().
| vm_float_t circular_ease_in | ( | vm_float_t | f | ) |
Definition at line 112 of file easing.c.
References VECMAT_SQRT.
| vm_float_t circular_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 117 of file easing.c.
References VECMAT_SQRT.
| vm_float_t circular_ease_out | ( | vm_float_t | f | ) |
Definition at line 107 of file easing.c.
References VECMAT_SQRT.
| vm_float_t cubic_ease_in | ( | vm_float_t | f | ) |
Definition at line 52 of file easing.c.
References poly_ease_in().
| vm_float_t cubic_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 57 of file easing.c.
References poly_ease_in_out().
| vm_float_t cubic_ease_out | ( | vm_float_t | f | ) |
Definition at line 47 of file easing.c.
References poly_ease_out().
| vm_float_t deg_to_rad | ( | const vm_float_t | degrees | ) |
Converts degrees to radians.
| degrees | Angle in degrees. |
Definition at line 14 of file vecmat.c.
References VM_DEG_TO_RAD.
Referenced by mat2_rotation_z_ptr(), mat3_rotation_x_ptr(), mat3_rotation_y_ptr(), mat4_perspective_fov_ptr(), mat4_perspective_infinite_ptr(), mat4_perspective_ptr(), mat4_rotation_ptr(), mat4_rotation_x_ptr(), mat4_rotation_y_ptr(), mat4_rotation_z_ptr(), quat_from_axis_angle_ptr(), and quat_from_euler_ptr().
| vm_float_t elastic_ease_in | ( | vm_float_t | f | ) |
Definition at line 145 of file easing.c.
References elastic_oscillation().
| vm_float_t elastic_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 151 of file easing.c.
References elastic_oscillation().
| vm_float_t elastic_ease_out | ( | vm_float_t | f | ) |
Definition at line 139 of file easing.c.
References elastic_oscillation().
| vm_float_t elastic_oscillation | ( | vm_float_t | f, |
| vm_float_t | exp_mult, | ||
| vm_float_t | sin_mult, | ||
| vm_float_t | sin_offset, | ||
| vm_float_t | period ) |
Definition at line 7 of file easing.c.
References M_PI, VECMAT_POW, and VECMAT_SIN.
Referenced by elastic_ease_in(), elastic_ease_in_out(), and elastic_ease_out().
| vm_float_t exponential_ease_in | ( | vm_float_t | f | ) |
Definition at line 128 of file easing.c.
References VECMAT_POW.
| vm_float_t exponential_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 133 of file easing.c.
References VECMAT_POW.
| vm_float_t exponential_ease_out | ( | vm_float_t | f | ) |
Definition at line 123 of file easing.c.
References VECMAT_POW.
| vm_float_t mat2_determinant | ( | const matrix2 | m | ) |
Calculates the determinant of the given 2x2 matrix.
| m | The matrix. |
Definition at line 88 of file matrix2.c.
References matrix2::v.
Referenced by mat2_inverse_ptr().
Returns true if two matrices are equal within VECMAT_EPSILON.
| a | First matrix. |
| b | Second matrix. |
Definition at line 115 of file vecmat.c.
References matrix2::v, VECMAT_EPSILON, and VECMAT_FABS.
Copies the upper-left 2x2 of a matrix3.
See mat2_from_mat3_ptr instead.
| m | Input matrix. |
Definition at line 132 of file matrix2.c.
References mat2_from_mat3_ptr().
Copies the upper-left 2x2 of a matrix3.
| res | Output value. |
| m | Input matrix. |
Definition at line 128 of file matrix2_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m21, and matrix3::m22.
Referenced by mat2_from_mat3().
| matrix2 mat2_identity | ( | void | ) |
Constructs the 2x2 identity matrix.
See mat2_identity_ptr instead.
Definition at line 14 of file matrix2.c.
References mat2_identity_ptr().
| void mat2_identity_ptr | ( | matrix2 * | res | ) |
Initializes the 2x2 matrix to identity (diagonal 1.0, others 0.0).
| res | Pointer to the output matrix2. |
Definition at line 12 of file matrix2_ptr.c.
References matrix2::v.
Referenced by mat2_identity(), and mat2_inverse_ptr().
Computes the inverse of a 2x2 matrix.
See mat2_inverse_ptr instead.
| m | The input matrix. |
Definition at line 60 of file matrix2.c.
References mat2_inverse_ptr().
Computes the inverse of the input 2x2 matrix using determinant and stores in res.
If the determinant is zero, sets res to identity matrix.
| res | Pointer to the output matrix2. |
| m | Pointer to the input matrix. |
Definition at line 60 of file matrix2_ptr.c.
References mat2_determinant(), mat2_identity_ptr(), and matrix2::v.
Referenced by mat2_inverse().
Multiplies two 2x2 matrices (a * b).
See mat2_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix2.c.
References mat2_mul_ptr().
Multiplies two 2x2 matrices (a * b) in column-major / column-vector convention.
| res | Pointer to the output matrix2. |
| a | Pointer to the first matrix. |
| b | Pointer to the second matrix. |
Definition at line 26 of file matrix2_ptr.c.
References matrix2::m11, matrix2::m12, matrix2::m21, and matrix2::m22.
Referenced by mat2_mul().
Multiplies a 2x2 matrix by a vector2.
See mat2_mul_vec2_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 102 of file matrix2.c.
References mat2_mul_vec2_ptr().
Multiplies a 2x2 matrix by a vector2.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 81 of file matrix2_ptr.c.
References matrix2::m11, matrix2::m12, matrix2::m21, matrix2::m22, vector2::x, and vector2::y.
Referenced by mat2_mul_vec2().
| matrix2 mat2_rotation_z | ( | const vm_float_t | degrees | ) |
Constructs a 2x2 Z-axis rotation matrix.
See mat2_rotation_z_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 75 of file matrix2.c.
References mat2_rotation_z_ptr().
| void mat2_rotation_z_ptr | ( | matrix2 * | res, |
| const vm_float_t | degrees ) |
Sets res to a 2x2 rotation matrix for rotation around the Z-axis.
Converts degrees to radians; positive is counter-clockwise.
| res | Pointer to the output matrix2. |
| degrees | Rotation angle in degrees. |
Definition at line 97 of file matrix2_ptr.c.
References deg_to_rad(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat2_rotation_z().
Builds a 2x2 scaling matrix from a vector2.
See mat2_scale_ptr instead.
| s | Scale vector. |
Definition at line 117 of file matrix2.c.
References mat2_scale_ptr().
Builds a 2x2 scaling matrix from a vector2.
| res | Output value. |
| s | Scale vector. |
Definition at line 114 of file matrix2_ptr.c.
References vector2::x, and vector2::y.
Referenced by mat2_scale().
Computes the transpose of a 2x2 matrix.
See mat2_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix2.c.
References mat2_transpose_ptr().
Computes the transpose of the input 2x2 matrix and stores in res.
| res | Pointer to the output matrix2. |
| m | Pointer to the input matrix. |
Definition at line 43 of file matrix2_ptr.c.
References matrix2::v.
Referenced by mat2_transpose().
Calculates the determinant of the given 2x2 integer matrix.
| m | The matrix. |
Definition at line 73 of file matrix2i.c.
References matrix2i::v.
Referenced by mat2i_inverse_ptr().
Returns true if two matrices are exactly equal.
| a | First matrix. |
| b | Second matrix. |
Definition at line 160 of file vecmat.c.
References matrix2i::v.
| matrix2i mat2i_identity | ( | void | ) |
Constructs the 2x2 integer identity matrix.
See mat2i_identity_ptr instead.
Definition at line 14 of file matrix2i.c.
References mat2i_identity_ptr().
| void mat2i_identity_ptr | ( | matrix2i * | res | ) |
Initializes the integer 2x2 matrix to identity (diagonal 1, others 0).
| res | Pointer to the output matrix2i. |
Definition at line 12 of file matrix2i_ptr.c.
References matrix2i::v.
Referenced by mat2i_identity(), and mat2i_inverse_ptr().
Computes the inverse of a 2x2 integer matrix.
See mat2i_inverse_ptr instead.
| m | The input matrix. |
Definition at line 60 of file matrix2i.c.
References mat2i_inverse_ptr().
Computes the inverse of the input integer 2x2 matrix and stores in res.
Uses double precision for inversion, truncates to int; sets to identity if det=0.
| res | Pointer to the output matrix2i. |
| m | Pointer to the input matrix. |
Definition at line 60 of file matrix2i_ptr.c.
References mat2i_determinant(), mat2i_identity_ptr(), and matrix2i::v.
Referenced by mat2i_inverse().
Multiplies two 2x2 integer matrices (a * b).
See mat2i_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix2i.c.
References mat2i_mul_ptr().
Multiplies two integer 2x2 matrices (a * b) using explicit loops and stores the result in res.
| res | Pointer to the output matrix2i. |
| a | Pointer to the first matrix. |
| b | Pointer to the second matrix. |
Definition at line 27 of file matrix2i_ptr.c.
References matrix2i::m11, matrix2i::m12, matrix2i::m21, and matrix2i::m22.
Referenced by mat2i_mul().
Multiplies a 2x2 integer matrix by a vector2i.
See mat2i_mul_vec2i_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 87 of file matrix2i.c.
References mat2i_mul_vec2i_ptr().
Multiplies a 2x2 integer matrix by a vector2i.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 81 of file matrix2i_ptr.c.
References matrix2i::m11, matrix2i::m12, matrix2i::m21, matrix2i::m22, vector2i::x, and vector2i::y.
Referenced by mat2i_mul_vec2i().
Computes the transpose of a 2x2 integer matrix.
See mat2i_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix2i.c.
References mat2i_transpose_ptr().
Computes the transpose of the input integer 2x2 matrix and stores in res.
| res | Pointer to the output matrix2i. |
| m | Pointer to the input matrix. |
Definition at line 44 of file matrix2i_ptr.c.
References matrix2i::v.
Referenced by mat2i_transpose().
| vm_float_t mat3_determinant | ( | const matrix3 | m | ) |
Computes the determinant of a 3x3 matrix.
| m | The input matrix. |
Definition at line 88 of file matrix3.c.
References matrix3::v.
Returns true if two matrices are equal within VECMAT_EPSILON.
| a | First matrix. |
| b | Second matrix. |
Definition at line 130 of file vecmat.c.
References matrix3::v, VECMAT_EPSILON, and VECMAT_FABS.
Copies the upper-left 3x3 of a matrix4.
See mat3_from_mat4_ptr instead.
| m | Input matrix. |
Definition at line 195 of file matrix3.c.
References mat3_from_mat4_ptr().
Copies the upper-left 3x3 of a matrix4.
| res | Output value. |
| m | Input matrix. |
Definition at line 199 of file matrix3_ptr.c.
References matrix3::m11, matrix4::m11, matrix3::m12, matrix4::m12, matrix3::m13, matrix4::m13, matrix3::m21, matrix4::m21, matrix3::m22, matrix4::m22, matrix3::m23, matrix4::m23, matrix3::m31, matrix4::m31, matrix3::m32, matrix4::m32, matrix3::m33, and matrix4::m33.
Referenced by mat3_from_mat4().
| matrix3 mat3_identity | ( | void | ) |
Constructs the 3x3 identity matrix.
See mat3_identity_ptr instead.
Definition at line 14 of file matrix3.c.
References mat3_identity_ptr().
| void mat3_identity_ptr | ( | matrix3 * | res | ) |
Initializes the 3x3 matrix to identity (diagonal 1.0, others 0.0).
| res | Pointer to the output matrix3. |
Definition at line 12 of file matrix3_ptr.c.
References matrix3::v.
Referenced by mat3_identity(), mat3_inverse_ptr(), mat3_scale_ptr(), and mat3_translate_ptr().
Computes the inverse of a 3x3 matrix.
See mat3_inverse_ptr instead.
| m | The input matrix. |
Definition at line 60 of file matrix3.c.
References mat3_inverse_ptr().
Computes the inverse of the input 3x3 matrix using the adjugate method and stores in res.
If the determinant is zero, sets res to identity.
| res | Pointer to the output matrix3. |
| m | Pointer to the input matrix. |
Definition at line 78 of file matrix3_ptr.c.
References mat3_identity_ptr(), and matrix3::v.
Referenced by mat3_inverse().
Multiplies two 3x3 matrices.
See mat3_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix3.c.
References mat3_mul_ptr().
Multiplies two 3x3 matrices (a * b) in column-major / column-vector convention.
Accumulates into a temporary matrix.
| res | Pointer to the output matrix3. |
| a | Pointer to the first matrix. |
| b | Pointer to the second matrix. |
Definition at line 34 of file matrix3_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m13, matrix3::m21, matrix3::m22, matrix3::m23, matrix3::m31, matrix3::m32, and matrix3::m33.
Referenced by mat3_mul().
Applies a 3x3 affine transform to a vector2.
See mat3_mul_vec2_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 120 of file matrix3.c.
References mat3_mul_vec2_ptr().
Applies a 3x3 affine transform to a vector2.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 230 of file matrix3_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m13, matrix3::m21, matrix3::m22, matrix3::m23, vector2::x, and vector2::y.
Referenced by mat3_mul_vec2().
Multiplies a 3x3 matrix by a vector3.
See mat3_mul_vec3_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 104 of file matrix3.c.
References mat3_mul_vec3_ptr().
Multiplies a 3x3 matrix by a vector3.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 213 of file matrix3_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m13, matrix3::m21, matrix3::m22, matrix3::m23, matrix3::m31, matrix3::m32, matrix3::m33, vector3::x, vector3::y, and vector3::z.
Referenced by mat3_mul_vec3().
| matrix3 mat3_rotation_x | ( | const vm_float_t | degrees | ) |
Builds a 3x3 rotation matrix around the X axis (degrees).
See mat3_rotation_x_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 135 of file matrix3.c.
References mat3_rotation_x_ptr().
| void mat3_rotation_x_ptr | ( | matrix3 * | res, |
| const vm_float_t | degrees ) |
Builds a 3x3 rotation matrix around the X axis (degrees).
| res | Output value. |
| degrees | Rotation angle in degrees. |
Definition at line 137 of file matrix3_ptr.c.
References deg_to_rad(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat3_rotation_x().
| matrix3 mat3_rotation_y | ( | const vm_float_t | degrees | ) |
Builds a 3x3 rotation matrix around the Y axis (degrees).
See mat3_rotation_y_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 150 of file matrix3.c.
References mat3_rotation_y_ptr().
| void mat3_rotation_y_ptr | ( | matrix3 * | res, |
| const vm_float_t | degrees ) |
Builds a 3x3 rotation matrix around the Y axis (degrees).
| res | Output value. |
| degrees | Rotation angle in degrees. |
Definition at line 155 of file matrix3_ptr.c.
References deg_to_rad(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat3_rotation_y().
| matrix3 mat3_rotation_z | ( | const vm_float_t | degrees | ) |
Constructs the 3x3 rotation matrix around the Z-axis.
See mat3_rotation_z_ptr instead.
| degrees | The rotation angle in degrees. |
Definition at line 75 of file matrix3.c.
References mat3_rotation_z_ptr().
| void mat3_rotation_z_ptr | ( | matrix3 * | res, |
| const vm_float_t | degrees ) |
Sets the 3x3 matrix to a rotation around the Z-axis by the given angle in degrees.
| res | Pointer to the output matrix3. |
| degrees | Rotation angle in degrees. |
Definition at line 112 of file matrix3_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m13, matrix3::m21, matrix3::m22, matrix3::m23, matrix3::m31, matrix3::m32, matrix3::m33, M_PI, VECMAT_COS, and VECMAT_SIN.
Referenced by mat3_rotation_z().
Builds a 3x3 2D scaling matrix.
See mat3_scale_ptr instead.
| s | Scale vector. |
Definition at line 180 of file matrix3.c.
References mat3_scale_ptr().
Builds a 3x3 2D scaling matrix.
| res | Output value. |
| s | Scale vector. |
Definition at line 186 of file matrix3_ptr.c.
References matrix3::m11, matrix3::m22, mat3_identity_ptr(), vector2::x, and vector2::y.
Referenced by mat3_scale().
Builds a 3x3 2D translation matrix.
See mat3_translate_ptr instead.
| t | Translation vector. |
Definition at line 165 of file matrix3.c.
References mat3_translate_ptr().
Builds a 3x3 2D translation matrix.
| res | Output value. |
| t | Translation vector. |
Definition at line 173 of file matrix3_ptr.c.
References matrix3::m13, matrix3::m23, mat3_identity_ptr(), vector2::x, and vector2::y.
Referenced by mat3_translate().
Computes the transpose of a 3x3 matrix.
See mat3_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix3.c.
References mat3_transpose_ptr().
Computes the transpose of the input 3x3 matrix and stores in res.
| res | Pointer to the output matrix3. |
| m | Pointer to the input matrix. |
Definition at line 58 of file matrix3_ptr.c.
References matrix3::v.
Referenced by mat3_transpose().
Computes the determinant of a 3x3 integer matrix.
| m | The input matrix. |
Definition at line 58 of file matrix3i.c.
References matrix3i::v.
Referenced by mat3i_inverse_ptr().
Returns true if two matrices are exactly equal.
| a | First matrix. |
| b | Second matrix. |
Definition at line 175 of file vecmat.c.
References matrix3i::v.
| matrix3i mat3i_identity | ( | void | ) |
Constructs the 3x3 identity matrix.
See mat3i_identity_ptr instead.
Definition at line 14 of file matrix3i.c.
References mat3i_identity_ptr().
| void mat3i_identity_ptr | ( | matrix3i * | res | ) |
Fills the given 3x3 integer matrix with the identity matrix.
| res | Pointer to the result matrix. |
Definition at line 12 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, matrix3i::m31, matrix3i::m32, and matrix3i::m33.
Referenced by mat3i_identity(), and mat3i_inverse_ptr().
Computes the inverse of a 3x3 integer matrix.
See mat3i_inverse_ptr instead.
| m | The input matrix. |
Definition at line 73 of file matrix3i.c.
References mat3i_inverse_ptr().
Computes the inverse of a 3x3 integer matrix using adjugate over determinant.
If the determinant is zero (singular), sets the result to the identity matrix.
| res | Pointer to the result matrix. |
| m | Pointer to the input matrix. |
Definition at line 67 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, matrix3i::m31, matrix3i::m32, matrix3i::m33, mat3i_determinant(), and mat3i_identity_ptr().
Referenced by mat3i_inverse().
Multiplies two 3x3 integer matrices.
See mat3i_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix3i.c.
References mat3i_mul_ptr().
Multiplies two 3x3 integer matrices (standard matrix multiplication).
| res | Pointer to the result matrix. |
| a | Pointer to the first input matrix. |
| b | Pointer to the second input matrix. |
Definition at line 26 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, matrix3i::m31, matrix3i::m32, and matrix3i::m33.
Referenced by mat3i_mul().
Applies a 3x3 integer affine transform to a vector2i.
See mat3i_mul_vec2i_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 105 of file matrix3i.c.
References mat3i_mul_vec2i_ptr().
Applies a 3x3 integer affine transform to a vector2i.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 115 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, vector2i::x, and vector2i::y.
Referenced by mat3i_mul_vec2i().
Multiplies a 3x3 integer matrix by a vector3i.
See mat3i_mul_vec3i_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 89 of file matrix3i.c.
References mat3i_mul_vec3i_ptr().
Multiplies a 3x3 integer matrix by a vector3i.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 98 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, matrix3i::m31, matrix3i::m32, matrix3i::m33, vector3i::x, vector3i::y, and vector3i::z.
Referenced by mat3i_mul_vec3i().
Computes the transpose of a 3x3 integer matrix.
See mat3i_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix3i.c.
References mat3i_transpose_ptr().
Computes the transpose of a 3x3 integer matrix.
| res | Pointer to the result matrix. |
| m | Pointer to the input matrix. |
Definition at line 50 of file matrix3i_ptr.c.
References matrix3i::m11, matrix3i::m12, matrix3i::m13, matrix3i::m21, matrix3i::m22, matrix3i::m23, matrix3i::m31, matrix3i::m32, and matrix3i::m33.
Referenced by mat3i_transpose().
| vm_float_t mat4_determinant | ( | const matrix4 | m | ) |
Calculates the determinant of the given 4x4 matrix.
Uses cofactor expansion for computation.
| m | The matrix. |
Definition at line 214 of file matrix4.c.
References matrix4::v.
Returns true if two matrices are equal within VECMAT_EPSILON.
| a | First matrix. |
| b | Second matrix. |
Definition at line 145 of file vecmat.c.
References matrix4::v, VECMAT_EPSILON, and VECMAT_FABS.
| quaternion mat4_extract_rotation | ( | const matrix4 | m | ) |
Extracts the rotation quaternion from a matrix4.
See mat4_extract_rotation_ptr instead.
| m | Input matrix. |
Definition at line 379 of file matrix4.c.
References mat4_extract_rotation_ptr().
| void mat4_extract_rotation_ptr | ( | quaternion * | res, |
| const matrix4 * | m ) |
Extracts the rotation quaternion from a matrix4.
| res | Output value. |
| m | Input matrix. |
Definition at line 336 of file matrix4_ptr.c.
References matrix3::m11, matrix4::m11, matrix3::m12, matrix4::m12, matrix3::m13, matrix4::m13, matrix3::m21, matrix4::m21, matrix3::m22, matrix4::m22, matrix3::m23, matrix4::m23, matrix3::m31, matrix4::m31, matrix3::m32, matrix4::m32, matrix3::m33, matrix4::m33, mat4_extract_scale_ptr(), quat_from_mat3_ptr(), vector3::x, vector3::y, and vector3::z.
Referenced by mat4_extract_rotation().
Extracts the scale vector from a matrix4.
See mat4_extract_scale_ptr instead.
| m | Input matrix. |
Definition at line 364 of file matrix4.c.
References mat4_extract_scale_ptr().
Extracts the scale vector from a matrix4.
| res | Output value. |
| m | Input matrix. |
Definition at line 323 of file matrix4_ptr.c.
References matrix4::m11, matrix4::m12, matrix4::m13, matrix4::m21, matrix4::m22, matrix4::m23, matrix4::m31, matrix4::m32, matrix4::m33, VECMAT_SQRT, vector3::x, vector3::y, and vector3::z.
Referenced by mat4_extract_rotation_ptr(), and mat4_extract_scale().
Extracts the translation vector from a matrix4.
See mat4_extract_translation_ptr instead.
| m | Input matrix. |
Definition at line 349 of file matrix4.c.
References mat4_extract_translation_ptr().
Extracts the translation vector from a matrix4.
| res | Output value. |
| m | Input matrix. |
Definition at line 310 of file matrix4_ptr.c.
References matrix4::m14, matrix4::m24, matrix4::m34, vector3::x, vector3::y, and vector3::z.
Referenced by mat4_extract_translation().
Embeds a matrix3 into the upper-left of a matrix4.
See mat4_from_mat3_ptr instead.
| m | Input matrix. |
Definition at line 334 of file matrix4.c.
References mat4_from_mat3_ptr().
Embeds a matrix3 into the upper-left of a matrix4.
| res | Output value. |
| m | Input matrix. |
Definition at line 277 of file matrix4_ptr.c.
References matrix3::m11, matrix4::m11, matrix3::m12, matrix4::m12, matrix3::m13, matrix4::m13, matrix3::m21, matrix4::m21, matrix3::m22, matrix4::m22, matrix3::m23, matrix4::m23, matrix3::m31, matrix4::m31, matrix3::m32, matrix4::m32, matrix3::m33, matrix4::m33, and mat4_identity_ptr().
Referenced by mat4_from_mat3().
| matrix4 mat4_identity | ( | void | ) |
Constructs the 4x4 identity matrix.
See mat4_identity_ptr instead.
Definition at line 14 of file matrix4.c.
References mat4_identity_ptr().
Referenced by mat4_look_at_ptr().
| void mat4_identity_ptr | ( | matrix4 * | res | ) |
Sets the matrix to the identity matrix.
The identity matrix is a 4x4 matrix with 1s on the main diagonal and 0s elsewhere.
| res | Pointer to the matrix4 to set to identity. |
Definition at line 16 of file matrix4_ptr.c.
References matrix4::v.
Referenced by mat4_from_mat3_ptr(), mat4_identity(), mat4_rotation_x_ptr(), mat4_rotation_y_ptr(), mat4_rotation_z_ptr(), and quat_to_mat4_ptr().
Computes the inverse of a 4x4 matrix.
See mat4_inverse_ptr instead.
| m | The input matrix. |
Definition at line 60 of file matrix4.c.
References mat4_inverse_ptr().
Computes the inverse of a 4x4 matrix.
This function calculates the inverse of the given 4x4 matrix using the adjugate matrix and determinant. If the matrix is singular (determinant is zero), the result is set to the identity matrix.
| res | Pointer to the matrix4 where the inverse will be stored. |
| m | Pointer to the matrix4 to invert. |
Definition at line 98 of file matrix4_ptr.c.
References matrix4::v.
Referenced by mat4_inverse().
Constructs a view matrix from eye position, target, and up vector.
See mat4_look_at_ptr instead.
| position | Eye position. |
| target | Target position. |
| up | Up vector. |
Definition at line 162 of file matrix4.c.
References mat4_look_at_ptr().
| void mat4_look_at_ptr | ( | matrix4 * | res, |
| const vector3 * | position, | ||
| const vector3 * | target, | ||
| const vector3 * | up ) |
Constructs a view matrix for a camera positioned at the given location, looking towards a target, with a specified up direction.
This function computes a 4x4 view matrix that orients the camera at the position vector, directing it towards the target vector, while aligning the up direction. The matrix is stored in column-major order.
| res | Pointer to the matrix4 where the result is stored. |
| position | Pointer to the vector3 representing the camera's position. |
| target | Pointer to the vector3 representing the point the camera is looking at. |
| up | Pointer to the vector3 representing the up direction for the camera. |
Definition at line 418 of file matrix4_ptr.c.
References mat4_identity(), matrix4::v, vec3_cross(), vec3_dot(), vec3_normalize(), vec3_sub(), vector3::x, vector3::y, and vector3::z.
Referenced by mat4_look_at().
Multiplies two 4x4 matrices (a * b).
See mat4_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix4.c.
References mat4_mul_ptr().
Definition at line 69 of file matrix4_ptr.c.
References mat4_mul_ptr_scalar(), and vm_cpu_init().
Referenced by mat4_mul().
| vector3 mat4_mul_vec3 | ( | const matrix4 | m, |
| const vector3 | v, | ||
| const vm_float_t | w ) |
Transforms a vector3 by a 4x4 matrix using homogeneous w.
See mat4_mul_vec3_ptr instead.
| m | Input matrix. |
| v | Input vector. |
| w | Homogeneous w component. |
Definition at line 257 of file matrix4.c.
References mat4_mul_vec3_ptr().
| void mat4_mul_vec3_ptr | ( | vector3 * | res, |
| const matrix4 * | m, | ||
| const vector3 * | v, | ||
| vm_float_t | w ) |
Definition at line 538 of file matrix4_ptr.c.
References mat4_mul_vec3_ptr_scalar(), and vm_cpu_init().
Referenced by mat4_mul_vec3().
Multiplies a 4x4 matrix by a vector4.
See mat4_mul_vec4_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 240 of file matrix4.c.
References mat4_mul_vec4_ptr().
Definition at line 510 of file matrix4_ptr.c.
References mat4_mul_vec4_ptr_scalar(), and vm_cpu_init().
Referenced by mat4_mul_vec4().
| matrix4 mat4_ortho | ( | const vm_float_t | left, |
| const vm_float_t | right, | ||
| const vm_float_t | bottom, | ||
| const vm_float_t | top, | ||
| const vm_float_t | near, | ||
| const vm_float_t | far ) |
Constructs an orthographic projection matrix.
See mat4_ortho_ptr instead.
| left | Left clipping plane. |
| right | Right clipping plane. |
| bottom | Bottom clipping plane. |
| top | Top clipping plane. |
| near | Near plane distance. |
| far | Far plane distance. |
Definition at line 144 of file matrix4.c.
References mat4_ortho_ptr().
| void mat4_ortho_ptr | ( | matrix4 * | res, |
| const vm_float_t | left, | ||
| const vm_float_t | right, | ||
| const vm_float_t | bottom, | ||
| const vm_float_t | top, | ||
| const vm_float_t | near, | ||
| const vm_float_t | far ) |
Sets the matrix to an orthographic projection matrix.
This function configures the matrix for an orthographic projection, mapping a rectangular frustum defined by the clipping planes to the canonical view volume.
| res | Pointer to the matrix4 to set to the orthographic projection matrix. |
| left | The left clipping plane coordinate. |
| right | The right clipping plane coordinate. |
| bottom | The bottom clipping plane coordinate. |
| top | The top clipping plane coordinate. |
| near | The near clipping plane coordinate. |
| far | The far clipping plane coordinate. |
Definition at line 393 of file matrix4_ptr.c.
References matrix4::v.
Referenced by mat4_ortho().
| matrix4 mat4_perspective | ( | const vm_float_t | fov, |
| const vm_float_t | aspect, | ||
| const vm_float_t | near, | ||
| const vm_float_t | far ) |
Constructs a perspective projection matrix.
See mat4_perspective_ptr instead.
| fov | Field of view (radians). |
| aspect | Aspect ratio (width/height). |
| near | Near plane distance. |
| far | Far plane distance. |
Definition at line 124 of file matrix4.c.
References mat4_perspective_ptr().
| matrix4 mat4_perspective_fov | ( | const vm_float_t | fov, |
| const vm_float_t | w, | ||
| const vm_float_t | h, | ||
| const vm_float_t | n, | ||
| const vm_float_t | f ) |
Constructs a perspective projection matrix using FOV, width, and height.
See mat4_perspective_fov_ptr instead.
| fov | Vertical field of view (radians). |
| w | Viewport width. |
| h | Viewport height. |
| n | Near plane. |
| f | Far plane. |
Definition at line 181 of file matrix4.c.
References mat4_perspective_fov_ptr().
| void mat4_perspective_fov_ptr | ( | matrix4 * | res, |
| const vm_float_t | fov, | ||
| const vm_float_t | w, | ||
| const vm_float_t | h, | ||
| const vm_float_t | n, | ||
| const vm_float_t | f ) |
Sets the matrix to a perspective projection matrix.
This function constructs a right-handed perspective projection matrix using the specified field of view, viewport width and height, near clipping plane, and far clipping plane.
| res | Pointer to the matrix4 to set to the perspective projection matrix. |
| fov | Field of view angle in degrees. |
| w | Viewport width. |
| h | Viewport height. |
| n | Near clipping plane distance. |
| f | Far clipping plane distance. |
Definition at line 452 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::v, and VECMAT_TAN.
Referenced by mat4_perspective_fov().
| matrix4 mat4_perspective_infinite | ( | const vm_float_t | fov_y, |
| const vm_float_t | aspect, | ||
| const vm_float_t | n ) |
Constructs an infinite far-plane perspective projection matrix.
See mat4_perspective_infinite_ptr instead.
| fov_y | Vertical field of view (radians). |
| aspect | Aspect ratio. |
| n | Near plane distance. |
Definition at line 199 of file matrix4.c.
References mat4_perspective_infinite_ptr().
| void mat4_perspective_infinite_ptr | ( | matrix4 * | res, |
| vm_float_t const | fov_y, | ||
| vm_float_t const | aspect, | ||
| vm_float_t const | n ) |
Sets the matrix to an infinite perspective projection matrix.
This function constructs a perspective projection matrix with an infinite far plane, which is useful for rendering scenes where depth precision is less critical beyond the near plane. The matrix is set such that the field of view and aspect ratio are applied, with the near plane at distance n.
| res | Pointer to the matrix4 to set to the infinite perspective projection. |
| fov_y | Vertical field of view in degrees. |
| aspect | Aspect ratio of the viewport (width / height). |
| n | Distance to the near clipping plane. |
Definition at line 479 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::v, and VECMAT_TAN.
Referenced by mat4_perspective_infinite().
| void mat4_perspective_ptr | ( | matrix4 * | res, |
| const vm_float_t | fov, | ||
| const vm_float_t | aspect, | ||
| const vm_float_t | near, | ||
| const vm_float_t | far ) |
Creates a perspective projection matrix.
This function computes a right-handed perspective projection matrix based on the given field of view, aspect ratio, and near and far clipping planes. The matrix is stored in the provided result pointer.
| res | Pointer to the matrix4 to store the perspective projection matrix. |
| fov | Field of view in degrees. |
| aspect | Aspect ratio of the viewport (width divided by height). |
| near | Distance to the near clipping plane. |
| far | Distance to the far clipping plane. |
Definition at line 365 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::v, and VECMAT_TAN.
Referenced by mat4_perspective().
| matrix4 mat4_rotation | ( | const vector3 | axis, |
| const vm_float_t | angle ) |
Constructs a rotation matrix around the given axis by the specified angle (in radians).
See mat4_rotation_ptr instead.
| axis | The rotation axis vector. |
| angle | The rotation angle in radians. |
Definition at line 106 of file matrix4.c.
References mat4_rotation_ptr().
| void mat4_rotation_ptr | ( | matrix4 * | res, |
| const vector3 * | axis, | ||
| const vm_float_t | angle ) |
Sets the matrix to a rotation matrix around the specified axis by the given angle.
The rotation is performed around the normalized axis vector by the specified angle in degrees. The resulting matrix is a 4x4 rotation matrix stored in column-major order.
| res | Pointer to the matrix4 to store the resulting rotation matrix. |
| axis | Pointer to the vector3 representing the axis of rotation. |
| angle | The rotation angle in degrees. |
Definition at line 195 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::v, vec3_normalize(), VECMAT_COS, VECMAT_SIN, vector3::x, vector3::y, and vector3::z.
Referenced by mat4_rotation().
| matrix4 mat4_rotation_x | ( | const vm_float_t | degrees | ) |
Builds a 4x4 rotation matrix around the X axis (degrees).
See mat4_rotation_x_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 272 of file matrix4.c.
References mat4_rotation_x_ptr().
| void mat4_rotation_x_ptr | ( | matrix4 * | res, |
| const vm_float_t | degrees ) |
Builds a 4x4 rotation matrix around the X axis (degrees).
| res | Output value. |
| degrees | Rotation angle in degrees. |
Definition at line 223 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::m22, matrix4::m23, matrix4::m32, matrix4::m33, mat4_identity_ptr(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat4_rotation_x().
| matrix4 mat4_rotation_y | ( | const vm_float_t | degrees | ) |
Builds a 4x4 rotation matrix around the Y axis (degrees).
See mat4_rotation_y_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 287 of file matrix4.c.
References mat4_rotation_y_ptr().
| void mat4_rotation_y_ptr | ( | matrix4 * | res, |
| const vm_float_t | degrees ) |
Builds a 4x4 rotation matrix around the Y axis (degrees).
| res | Output value. |
| degrees | Rotation angle in degrees. |
Definition at line 241 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::m11, matrix4::m13, matrix4::m31, matrix4::m33, mat4_identity_ptr(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat4_rotation_y().
| matrix4 mat4_rotation_z | ( | const vm_float_t | degrees | ) |
Builds a 4x4 rotation matrix around the Z axis (degrees).
See mat4_rotation_z_ptr instead.
| degrees | Rotation angle in degrees. |
Definition at line 302 of file matrix4.c.
References mat4_rotation_z_ptr().
| void mat4_rotation_z_ptr | ( | matrix4 * | res, |
| const vm_float_t | degrees ) |
Builds a 4x4 rotation matrix around the Z axis (degrees).
| res | Output value. |
| degrees | Rotation angle in degrees. |
Definition at line 259 of file matrix4_ptr.c.
References deg_to_rad(), matrix4::m11, matrix4::m12, matrix4::m21, matrix4::m22, mat4_identity_ptr(), VECMAT_COS, and VECMAT_SIN.
Referenced by mat4_rotation_z().
Constructs a scaling matrix from the given scale vector.
See mat4_scale_ptr instead.
| v | The scale vector (x, y, z factors). |
Definition at line 90 of file matrix4.c.
References mat4_scale_ptr().
Sets the matrix to a scaling matrix using the provided scale vector.
This function constructs a 4x4 scaling matrix where the diagonal elements correspond to the x, y, and z scale factors from the input vector. The bottom-right element is set to 1.0f for homogeneous coordinates. All other elements are implicitly zero (not set, assuming the matrix is initialized).
| res | Pointer to the matrix4 to set as a scaling matrix. |
| v | Pointer to the vector3 containing the scale factors (x, y, z). |
Definition at line 176 of file matrix4_ptr.c.
References matrix4::v, vector3::x, vector3::y, and vector3::z.
Referenced by mat4_scale().
Constructs a translation matrix from the given vector.
See mat4_translate_ptr instead.
| v | The translation vector (x, y, z). |
Definition at line 75 of file matrix4.c.
References mat4_translate_ptr().
Sets the matrix to a translation matrix.
This function initializes a 4x4 matrix to represent a translation transformation based on the provided vector, with the translation components placed in the last column and the rest forming an identity matrix.
| res | Pointer to the matrix4 to set. |
| v | Pointer to the vector3 containing the translation values. |
Definition at line 145 of file matrix4_ptr.c.
References matrix4::v, vector3::x, vector3::y, and vector3::z.
Referenced by mat4_translate().
Computes the transpose of a 4x4 matrix.
See mat4_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix4.c.
References mat4_transpose_ptr().
Definition at line 79 of file matrix4_ptr.c.
References mat4_transpose_ptr_scalar(), and vm_cpu_init().
Referenced by mat4_transpose().
| matrix4 mat4_trs | ( | const vector3 | translation, |
| const quaternion | rotation, | ||
| const vector3 | scale ) |
Builds a 4x4 TRS matrix from translation, rotation, and scale.
See mat4_trs_ptr instead.
| translation | Translation vector. |
| rotation | Rotation quaternion. |
| scale | Scale vector. |
Definition at line 319 of file matrix4.c.
References mat4_trs_ptr().
| void mat4_trs_ptr | ( | matrix4 * | res, |
| const vector3 * | translation, | ||
| const quaternion * | rotation, | ||
| const vector3 * | scale ) |
Builds a 4x4 TRS matrix from translation, rotation, and scale.
| res | Output value. |
| translation | Translation vector. |
| rotation | Rotation quaternion. |
| scale | Scale vector. |
Definition at line 293 of file matrix4_ptr.c.
References matrix4::m11, matrix4::m12, matrix4::m13, matrix4::m14, matrix4::m21, matrix4::m22, matrix4::m23, matrix4::m24, matrix4::m31, matrix4::m32, matrix4::m33, matrix4::m34, quat_to_mat4_ptr(), vector3::x, vector3::y, and vector3::z.
Referenced by mat4_trs().
Computes the determinant of a 4x4 integer matrix (Laplace expansion along first row).
| m | The input matrix. |
Definition at line 73 of file matrix4i.c.
References matrix4i::v.
Returns true if two matrices are exactly equal.
| a | First matrix. |
| b | Second matrix. |
Definition at line 190 of file vecmat.c.
References matrix4i::v.
| matrix4i mat4i_identity | ( | void | ) |
Constructs the 4x4 identity matrix.
See mat4i_identity_ptr instead.
Definition at line 14 of file matrix4i.c.
References mat4i_identity_ptr().
| void mat4i_identity_ptr | ( | matrix4i * | res | ) |
Sets the given 4x4 integer matrix to the identity matrix.
| res | Pointer to the matrix structure to set to identity. |
Definition at line 12 of file matrix4i_ptr.c.
References matrix4i::v.
Referenced by mat4i_identity().
Computes the inverse of a 4x4 integer matrix.
See mat4i_inverse_ptr instead.
| m | The input matrix. |
Definition at line 60 of file matrix4i.c.
References mat4i_inverse_ptr().
Computes the inverse of the given 4x4 integer matrix and stores the result in the specified matrix.
If the matrix is singular (determinant is zero), the result is set to the identity matrix.
| res | Pointer to the matrix structure to store the inverse matrix. |
| m | Pointer to the constant matrix to be inverted. |
Definition at line 81 of file matrix4i_ptr.c.
References matrix4i::v.
Referenced by mat4i_inverse().
Multiplies two 4x4 integer matrices.
See mat4i_mul_ptr instead.
| a | The first matrix. |
| b | The second matrix. |
Definition at line 30 of file matrix4i.c.
References mat4i_mul_ptr().
Performs matrix multiplication of two 4x4 matrices and stores the result.
| res | Pointer to the matrix structure to store the result of the multiplication. |
| a | Pointer to the first matrix operand. |
| b | Pointer to the second matrix operand. |
Definition at line 29 of file matrix4i_ptr.c.
References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, matrix4i::m41, matrix4i::m42, matrix4i::m43, and matrix4i::m44.
Referenced by mat4i_mul().
Transforms a vector3i by a 4x4 integer matrix using homogeneous w.
See mat4i_mul_vec3i_ptr instead.
| m | Input matrix. |
| v | Input vector. |
| w | Homogeneous w component. |
Definition at line 116 of file matrix4i.c.
References mat4i_mul_vec3i_ptr().
| void mat4i_mul_vec3i_ptr | ( | vector3i * | res, |
| const matrix4i * | m, | ||
| const vector3i * | v, | ||
| const vm_int_t | w ) |
Transforms a vector3i by a 4x4 integer matrix using homogeneous w.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
| w | Homogeneous w component. |
Definition at line 149 of file matrix4i_ptr.c.
References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, vector3i::x, vector3i::y, and vector3i::z.
Referenced by mat4i_mul_vec3i().
Multiplies a 4x4 integer matrix by a vector4i.
See mat4i_mul_vec4i_ptr instead.
| m | Input matrix. |
| v | Input vector. |
Definition at line 99 of file matrix4i.c.
References mat4i_mul_vec4i_ptr().
Multiplies a 4x4 integer matrix by a vector4i.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 129 of file matrix4i_ptr.c.
References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, matrix4i::m41, matrix4i::m42, matrix4i::m43, matrix4i::m44, vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by mat4i_mul_vec4i().
Computes the transpose of a 4x4 integer matrix.
See mat4i_transpose_ptr instead.
| m | The input matrix. |
Definition at line 45 of file matrix4i.c.
References mat4i_transpose_ptr().
Transposes the given 4x4 integer matrix and stores the result in the provided matrix structure.
| res | Pointer to the matrix structure to store the transposed matrix. |
| m | Pointer to the input matrix to be transposed. |
Definition at line 61 of file matrix4i_ptr.c.
References matrix4i::v.
Referenced by mat4i_transpose().
| vm_float_t poly_ease_in | ( | vm_float_t | f, |
| vm_float_t | n ) |
Definition at line 17 of file easing.c.
References VECMAT_POW.
Referenced by cubic_ease_in(), quadratic_ease_in(), quartic_ease_in(), and quintic_ease_in().
| vm_float_t poly_ease_in_out | ( | vm_float_t | f, |
| vm_float_t | n ) |
Definition at line 27 of file easing.c.
References VECMAT_POW.
Referenced by cubic_ease_in_out(), quadratic_ease_in_out(), quartic_ease_in_out(), and quintic_ease_in_out().
| vm_float_t poly_ease_out | ( | vm_float_t | f, |
| vm_float_t | n ) |
Definition at line 22 of file easing.c.
References VECMAT_POW.
Referenced by cubic_ease_out(), quadratic_ease_out(), quartic_ease_out(), and quintic_ease_out().
| vm_float_t quadratic_ease_in | ( | vm_float_t | f | ) |
Definition at line 37 of file easing.c.
References poly_ease_in().
| vm_float_t quadratic_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 42 of file easing.c.
References poly_ease_in_out().
| vm_float_t quadratic_ease_out | ( | vm_float_t | f | ) |
Definition at line 32 of file easing.c.
References poly_ease_out().
| vm_float_t quartic_ease_in | ( | vm_float_t | f | ) |
Definition at line 67 of file easing.c.
References poly_ease_in().
| vm_float_t quartic_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 72 of file easing.c.
References poly_ease_in_out().
| vm_float_t quartic_ease_out | ( | vm_float_t | f | ) |
Definition at line 62 of file easing.c.
References poly_ease_out().
| quaternion quat_conjugate | ( | const quaternion | q | ) |
Returns the conjugate of a quaternion.
See quat_conjugate_ptr instead.
| q | Input quaternion. |
Definition at line 90 of file quaternion.c.
References quat_conjugate_ptr().
| void quat_conjugate_ptr | ( | quaternion * | res, |
| const quaternion * | q ) |
Writes the conjugate of a quaternion.
| res | Output value. |
| q | Input quaternion. |
Definition at line 149 of file quaternion_ptr.c.
References quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_conjugate().
| vm_float_t quat_dot | ( | const quaternion | a, |
| const quaternion | b ) |
Returns the dot product of two quaternions.
| a | First input quaternion. |
| b | Second input quaternion. |
Definition at line 261 of file quaternion.c.
References quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_nlerp_ptr(), and quat_slerp_ptr().
| bool quat_eq | ( | const quaternion | a, |
| const quaternion | b ) |
Returns true if two quaternions are equal within VECMAT_EPSILON.
| a | First quaternion. |
| b | Second quaternion. |
Definition at line 205 of file vecmat.c.
References VECMAT_EPSILON, VECMAT_FABS, quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
| quaternion quat_from_axis_angle | ( | const vector3 | axis, |
| const vm_float_t | degrees ) |
Builds a quaternion from an axis and an angle in degrees.
See quat_from_axis_angle_ptr instead.
| axis | Rotation axis. |
| degrees | Rotation angle in degrees. |
Definition at line 121 of file quaternion.c.
References quat_from_axis_angle_ptr().
| void quat_from_axis_angle_ptr | ( | quaternion * | res, |
| const vector3 * | axis, | ||
| const vm_float_t | degrees ) |
Builds a quaternion from an axis and an angle in degrees.
| res | Output value. |
| axis | Rotation axis. |
| degrees | Rotation angle in degrees. |
Definition at line 184 of file quaternion_ptr.c.
References deg_to_rad(), vec3_normalize(), VECMAT_COS, VECMAT_SIN, quaternion::w, quaternion::x, vector3::x, quaternion::y, vector3::y, quaternion::z, and vector3::z.
Referenced by quat_from_axis_angle().
| quaternion quat_from_euler | ( | const vector3 | euler | ) |
Constructs a quaternion from Euler angles (in radians, XYZ order).
See quat_from_euler_ptr instead.
| euler | The Euler angles vector (x=pitch, y=yaw, z=roll). |
Definition at line 60 of file quaternion.c.
References quat_from_euler_ptr().
| void quat_from_euler_ptr | ( | quaternion * | res, |
| const vector3 * | euler ) |
Converts Euler angles (in degrees, XYZ order: pitch, yaw, roll) to a quaternion and stores in res.
Internally converts to radians, computes quaternion, and normalizes.
| res | Pointer to the output quaternion. |
| euler | Pointer to the input Euler angles vector. |
Definition at line 91 of file quaternion_ptr.c.
References deg_to_rad(), quat_normalize_ptr(), VECMAT_COS, VECMAT_SIN, vector3::x, vector3::y, and vector3::z.
Referenced by quat_from_euler().
| quaternion quat_from_mat3 | ( | const matrix3 | m | ) |
Builds a quaternion from a 3x3 rotation matrix.
See quat_from_mat3_ptr instead.
| m | Input matrix. |
Definition at line 136 of file quaternion.c.
References quat_from_mat3_ptr().
| void quat_from_mat3_ptr | ( | quaternion * | res, |
| const matrix3 * | m ) |
Builds a quaternion from a 3x3 rotation matrix.
| res | Output value. |
| m | Input matrix. |
Definition at line 201 of file quaternion_ptr.c.
References matrix3::m11, matrix3::m12, matrix3::m13, matrix3::m21, matrix3::m22, matrix3::m23, matrix3::m31, matrix3::m32, matrix3::m33, quat_normalize_ptr(), VECMAT_SQRT, quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by mat4_extract_rotation_ptr(), quat_from_mat3(), and quat_from_mat4_ptr().
| quaternion quat_from_mat4 | ( | const matrix4 | m | ) |
Builds a quaternion from the rotation of a 4x4 matrix.
See quat_from_mat4_ptr instead.
| m | Input matrix. |
Definition at line 151 of file quaternion.c.
References quat_from_mat4_ptr().
| void quat_from_mat4_ptr | ( | quaternion * | res, |
| const matrix4 * | m ) |
Builds a quaternion from the rotation of a 4x4 matrix.
| res | Output value. |
| m | Input matrix. |
Definition at line 238 of file quaternion_ptr.c.
References matrix4::m11, matrix4::m12, matrix4::m13, matrix4::m21, matrix4::m22, matrix4::m23, matrix4::m31, matrix4::m32, matrix4::m33, and quat_from_mat3_ptr().
Referenced by quat_from_mat4().
| quaternion quat_identity | ( | void | ) |
Constructs the identity quaternion.
See quat_identity_ptr instead.
Definition at line 14 of file quaternion.c.
References quat_identity_ptr().
| void quat_identity_ptr | ( | quaternion * | res | ) |
Sets the quaternion to the identity quaternion (x=0, y=0, z=0, w=1).
| res | Pointer to the quaternion to initialize. |
Definition at line 13 of file quaternion_ptr.c.
References quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_identity().
| quaternion quat_inverse | ( | const quaternion | q | ) |
Returns the inverse of a quaternion.
See quat_inverse_ptr instead.
| q | Input quaternion. |
Definition at line 105 of file quaternion.c.
References quat_inverse_ptr().
| void quat_inverse_ptr | ( | quaternion * | res, |
| const quaternion * | q ) |
Writes the inverse of a quaternion.
| res | Output value. |
| q | Input quaternion. |
Definition at line 163 of file quaternion_ptr.c.
References quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_inverse(), and quat_rotate_vec3_ptr().
| quaternion quat_mul | ( | const quaternion | a, |
| const quaternion | b ) |
Multiplies two quaternions (a * b).
See quat_mul_ptr instead.
| a | The first quaternion. |
| b | The second quaternion. |
Definition at line 30 of file quaternion.c.
References quat_mul_ptr().
| void quat_mul_ptr | ( | quaternion * | res, |
| const quaternion * | a, | ||
| const quaternion * | b ) |
Definition at line 37 of file quaternion_ptr.c.
References quat_mul_ptr_scalar(), and vm_cpu_init().
Referenced by quat_mul(), and quat_rotate_vec3_ptr().
| bool quat_near | ( | const quaternion | a, |
| const quaternion | b, | ||
| const vm_float_t | eps ) |
Returns true if a and b are within eps of each other.
| a | First input quaternion. |
| b | Second input quaternion. |
| eps | Distance tolerance. |
Definition at line 274 of file quaternion.c.
References VECMAT_FABS, quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
| quaternion quat_nlerp | ( | const quaternion | a, |
| const quaternion | b, | ||
| const vm_float_t | t ) |
Normalized-linearly interpolates from a to b by t.
See quat_nlerp_ptr instead.
| a | First input quaternion. |
| b | Second input quaternion. |
| t | Interpolation factor. |
Definition at line 185 of file quaternion.c.
References quat_nlerp_ptr().
| void quat_nlerp_ptr | ( | quaternion * | res, |
| const quaternion * | a, | ||
| const quaternion * | b, | ||
| const vm_float_t | t ) |
Normalized-linearly interpolates from a to b by t.
| res | Output value. |
| a | First input quaternion. |
| b | Second input quaternion. |
| t | Interpolation factor. |
Definition at line 256 of file quaternion_ptr.c.
References quat_dot(), quat_normalize_ptr(), quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_nlerp(), and quat_slerp_ptr().
| quaternion quat_normalize | ( | const quaternion | q | ) |
Normalizes a quaternion.
See quat_normalize_ptr instead.
| q | The input quaternion. |
Definition at line 45 of file quaternion.c.
References quat_normalize_ptr().
| void quat_normalize_ptr | ( | quaternion * | res, |
| const quaternion * | q ) |
Definition at line 72 of file quaternion_ptr.c.
References quat_normalize_ptr_scalar(), and vm_cpu_init().
Referenced by quat_from_euler_ptr(), quat_from_mat3_ptr(), quat_nlerp_ptr(), quat_normalize(), and quat_to_axis_angle_ptr().
| vector3 quat_rotate_vec3 | ( | const quaternion | q, |
| const vector3 | v ) |
Rotates a vector3 by a quaternion.
See quat_rotate_vec3_ptr instead.
| q | Input quaternion. |
| v | Input vector. |
Definition at line 201 of file quaternion.c.
References quat_rotate_vec3_ptr().
| void quat_rotate_vec3_ptr | ( | vector3 * | res, |
| const quaternion * | q, | ||
| const vector3 * | v ) |
Rotates a vector3 by a quaternion.
| res | Output value. |
| q | Input quaternion. |
| v | Input vector. |
Definition at line 314 of file quaternion_ptr.c.
References quat_inverse_ptr(), quat_mul_ptr(), quaternion::x, vector3::x, quaternion::y, vector3::y, quaternion::z, and vector3::z.
Referenced by quat_rotate_vec3().
| quaternion quat_slerp | ( | const quaternion | a, |
| const quaternion | b, | ||
| const vm_float_t | t ) |
Spherical-linearly interpolates from a to b by t.
See quat_slerp_ptr instead.
| a | First input quaternion. |
| b | Second input quaternion. |
| t | Interpolation factor. |
Definition at line 168 of file quaternion.c.
References quat_slerp_ptr().
| void quat_slerp_ptr | ( | quaternion * | res, |
| const quaternion * | a, | ||
| const quaternion * | b, | ||
| const vm_float_t | t ) |
Spherical-linearly interpolates from a to b by t.
| res | Output value. |
| a | First input quaternion. |
| b | Second input quaternion. |
| t | Interpolation factor. |
Definition at line 282 of file quaternion_ptr.c.
References quat_dot(), quat_nlerp_ptr(), VECMAT_ACOS, VECMAT_SIN, quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by quat_slerp().
| vector3 quat_to_axis_angle | ( | const quaternion | q, |
| vm_float_t * | degrees ) |
Converts a quaternion to an axis and an angle in degrees.
See quat_to_axis_angle_ptr instead.
| q | Input quaternion. |
| degrees | Optional output angle in degrees. |
Definition at line 232 of file quaternion.c.
References quat_to_axis_angle_ptr().
| void quat_to_axis_angle_ptr | ( | vector3 * | axis, |
| vm_float_t * | degrees, | ||
| const quaternion * | q ) |
Converts a quaternion to an axis and an angle in degrees.
| axis | Output rotation axis. |
| degrees | Optional output angle in degrees. |
| q | Input quaternion. |
Definition at line 364 of file quaternion_ptr.c.
References quat_normalize_ptr(), rad_to_deg(), VECMAT_ACOS, VECMAT_EPSILON, VECMAT_SQRT, quaternion::w, quaternion::x, vector3::x, quaternion::y, vector3::y, quaternion::z, and vector3::z.
Referenced by quat_to_axis_angle().
| vector3 quat_to_euler | ( | const quaternion | q | ) |
Converts a quaternion to Euler angles in degrees (XYZ).
See quat_to_euler_ptr instead.
| q | Input quaternion. |
Definition at line 216 of file quaternion.c.
References quat_to_euler_ptr().
| void quat_to_euler_ptr | ( | vector3 * | res, |
| const quaternion * | q ) |
Converts a quaternion to Euler angles in degrees (XYZ).
| res | Output value. |
| q | Input quaternion. |
Definition at line 334 of file quaternion_ptr.c.
References M_PI_2, VECMAT_ASIN, VECMAT_ATAN2, VECMAT_COPYSIGN, VECMAT_FABS, VM_RAD_TO_DEG, quaternion::w, quaternion::x, vector3::x, quaternion::y, vector3::y, quaternion::z, and vector3::z.
Referenced by quat_to_euler().
| matrix3 quat_to_mat3 | ( | const quaternion | q | ) |
Converts a quaternion to a 3x3 rotation matrix.
See quat_to_mat3_ptr instead.
| q | Input quaternion. |
Definition at line 247 of file quaternion.c.
References quat_to_mat3_ptr().
| void quat_to_mat3_ptr | ( | matrix3 * | res, |
| const quaternion * | q ) |
Converts a quaternion to a 3x3 rotation matrix.
| res | Output value. |
| q | Input quaternion. |
Definition at line 391 of file quaternion_ptr.c.
References matrix3::m11, matrix4::m11, matrix3::m12, matrix4::m12, matrix3::m13, matrix4::m13, matrix3::m21, matrix4::m21, matrix3::m22, matrix4::m22, matrix3::m23, matrix4::m23, matrix3::m31, matrix4::m31, matrix3::m32, matrix4::m32, matrix3::m33, matrix4::m33, and quat_to_mat4_ptr().
Referenced by quat_to_mat3().
| matrix4 quat_to_mat4 | ( | const quaternion | q | ) |
Converts a quaternion to a 4x4 rotation matrix.
See quat_to_mat4_ptr instead.
| q | The input quaternion. |
Definition at line 75 of file quaternion.c.
References quat_to_mat4_ptr().
| void quat_to_mat4_ptr | ( | matrix4 * | res, |
| const quaternion * | q ) |
Converts a unit quaternion to a 4x4 rotation matrix and stores in res.
Starts with the identity matrix and applies rotation components.
| res | Pointer to the output matrix4. |
| q | Pointer to the input quaternion (should be normalized). |
Definition at line 118 of file quaternion_ptr.c.
References matrix4::m11, matrix4::m12, matrix4::m13, matrix4::m21, matrix4::m22, matrix4::m23, matrix4::m31, matrix4::m32, matrix4::m33, mat4_identity_ptr(), quaternion::w, quaternion::x, quaternion::y, and quaternion::z.
Referenced by mat4_trs_ptr(), quat_to_mat3_ptr(), and quat_to_mat4().
| vm_float_t quintic_ease_in | ( | vm_float_t | f | ) |
Definition at line 82 of file easing.c.
References poly_ease_in().
| vm_float_t quintic_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 87 of file easing.c.
References poly_ease_in_out().
| vm_float_t quintic_ease_out | ( | vm_float_t | f | ) |
Definition at line 77 of file easing.c.
References poly_ease_out().
| vm_float_t rad_to_deg | ( | const vm_float_t | radians | ) |
Converts radians to degrees.
| radians | Angle in radians. |
Definition at line 25 of file vecmat.c.
References VM_RAD_TO_DEG.
Referenced by quat_to_axis_angle_ptr().
| vm_float_t sine_ease_in | ( | vm_float_t | f | ) |
Definition at line 97 of file easing.c.
References M_PI, and VECMAT_COS.
| vm_float_t sine_ease_in_out | ( | vm_float_t | f | ) |
Definition at line 102 of file easing.c.
References M_PI, and VECMAT_COS.
| vm_float_t sine_ease_out | ( | vm_float_t | f | ) |
Definition at line 92 of file easing.c.
References M_PI, and VECMAT_SIN.
| vector2 vec2 | ( | const vm_float_t | x, |
| const vm_float_t | y ) |
Returns the absolute values of each component.
See vec2_abs_ptr instead.
| v | The input vector. |
Definition at line 190 of file vector2.c.
References vec2_abs_ptr().
Computes the absolute values of the components of vector v, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 95 of file vector2_ptr.c.
References VECMAT_FABS, vector2::x, and vector2::y.
Referenced by vec2_abs().
Adds two vectors component-wise.
See vec2_add_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 96 of file vector2.c.
References vec2_add_ptr().
Adds src to dest in place.
| dest | Destination vector. |
| src | Vector to add. |
Definition at line 256 of file vecmat.c.
References vector2::x, and vector2::y.
Adds vectors a and b component-wise, storing the result in res.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 14 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_add().
| vector2 vec2_add_scalar | ( | const vector2 | v, |
| const vm_float_t | s ) |
Adds a scalar to each component.
See vec2_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 543 of file vector2.c.
References vec2_add_scalar_ptr().
| void vec2_add_scalar_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | s ) |
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 371 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_add_scalar().
| vm_float_t vec2_angle | ( | const vector2 | a, |
| const vector2 | b ) |
Computes the angle between two vectors (in radians, range [0, PI]).
Returns 0.0f if either vector has zero length.
| a | The first vector. |
| b | The second vector. |
Definition at line 492 of file vector2.c.
References vec2_dot(), vec2_length(), and VECMAT_ACOS.
| vm_float_t vec2_aspect_ratio | ( | const vector2 | v | ) |
Computes the aspect ratio of the vector (x / y).
Returns 0.0f if y == 0.0f.
| v | The input vector. |
Definition at line 463 of file vector2.c.
References vector2::x, and vector2::y.
Copies src into dest.
| dest | Destination vector. |
| src | Source vector. |
Definition at line 231 of file vecmat.c.
References vector2::x, and vector2::y.
| void vec2_assign_xy | ( | vector2 * | dest, |
| const vm_float_t | x, | ||
| const vm_float_t | y ) |
Assigns x and y to dest.
| dest | Destination vector. |
| x | X component. |
| y | Y component. |
Definition at line 244 of file vecmat.c.
References vector2::x, and vector2::y.
Applies ceil to each component.
See vec2_ceil_ptr instead.
| v | The input vector. |
Definition at line 298 of file vector2.c.
References vec2_ceil_ptr().
Applies the ceil function to each component of vector v, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 180 of file vector2_ptr.c.
References VECMAT_CEIL, vector2::x, and vector2::y.
Referenced by vec2_ceil().
Clamps vector v component-wise between min and max.
See vec2_clamp_ptr instead.
| v | The input vector. |
| min | The minimum bounds vector. |
| max | The maximum bounds vector. |
Definition at line 425 of file vector2.c.
References vec2_clamp_ptr().
Clamps vector v component-wise between min and max.
| res | Output vector. |
| v | Input vector to clamp. |
| min | Minimum bounds vector. |
| max | Maximum bounds vector. |
Definition at line 331 of file vector2_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, vector2::x, and vector2::y.
Referenced by vec2_clamp().
| vector2 vec2_clamp_scalar | ( | const vector2 | v, |
| const vm_float_t | min, | ||
| const vm_float_t | max ) |
Clamps each component to the scalar range [min, max].
See vec2_clamp_scalar_ptr instead.
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 576 of file vector2.c.
References vec2_clamp_scalar_ptr().
| void vec2_clamp_scalar_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | min, | ||
| const vm_float_t | max ) |
Clamps each component to the scalar range [min, max].
| res | Output vector. |
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 398 of file vector2_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, vector2::x, and vector2::y.
Referenced by vec2_clamp_scalar(), and vec2_saturate_ptr().
Computes the 2D cross-product as a vector.
See vec2_cross_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 206 of file vector2.c.
References vec2_cross_ptr().
Computes the 2D cross-product of a and b, storing the scalar value in res->x and 0 in res->y.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 220 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_cross().
| vm_float_t vec2_cross_scalar | ( | const vector2 | a, |
| const vector2 | b ) |
Returns the 2D cross product as a scalar (a.x*b.y - a.y*b.x).
| a | First input vector. |
| b | Second input vector. |
Definition at line 792 of file vector2.c.
References vector2::x, and vector2::y.
| vm_float_t vec2_distance | ( | const vector2 | a, |
| const vector2 | b ) |
Computes the Euclidean distance between two vectors (treated as points).
| a | The first point. |
| b | The second point. |
Definition at line 476 of file vector2.c.
References VECMAT_SQRT, vector2::x, and vector2::y.
| vm_float_t vec2_distance_squared | ( | const vector2 | a, |
| const vector2 | b ) |
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 778 of file vector2.c.
References vector2::x, and vector2::y.
Divides two vectors component-wise.
See vec2_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 527 of file vector2.c.
References vec2_div_ptr().
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 358 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_div().
| vector2 vec2_div_scalar | ( | const vector2 | v, |
| const vm_float_t | s ) |
Divides a vector by a scalar component-wise.
See vec2_div_scalar_ptr instead.
| v | The input vector. |
| s | The scalar divisor (non-zero). |
Definition at line 144 of file vector2.c.
References vec2_div_scalar_ptr().
| void vec2_div_scalar_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | s ) |
Divides vector v by scalar s component-wise, storing the result in res.
| res | Output vector. |
| v | Input vector. |
| s | Input scalar. |
Definition at line 53 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_div_scalar().
| vm_float_t vec2_dot | ( | const vector2 | a, |
| const vector2 | b ) |
Computes the dot product of two vectors.
| a | The first vector. |
| b | The second vector. |
Definition at line 439 of file vector2.c.
References vector2::x, and vector2::y.
Referenced by vec2_angle(), vec2_length(), vec2_length_squared(), vec2_project_ptr(), vec2_reflect_ptr(), vec2_refract_ptr(), and vec2_slide_ptr().
Returns true if two vectors are equal within VECMAT_EPSILON.
| a | First vector. |
| b | Second vector. |
Definition at line 37 of file vecmat.c.
References VECMAT_EPSILON, VECMAT_FABS, vector2::x, and vector2::y.
Applies floor to each component.
See vec2_floor_ptr instead.
| v | The input vector. |
Definition at line 283 of file vector2.c.
References vec2_floor_ptr().
Applies the floor function to each component of vector v, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 167 of file vector2_ptr.c.
References VECMAT_FLOOR, vector2::x, and vector2::y.
Referenced by vec2_floor().
Returns the fractional part of each component.
See vec2_fract_ptr instead.
| v | Input vector. |
Definition at line 606 of file vector2.c.
References vec2_fract_ptr().
Returns the fractional part of each component.
| res | Output vector. |
| v | Input vector. |
Definition at line 421 of file vector2_ptr.c.
References VECMAT_FLOOR, vector2::x, and vector2::y.
Referenced by vec2_fract().
Converts a vector2i to a vector2.
| v | Input integer vector. |
Definition at line 268 of file vecmat.c.
References vector2i::x, and vector2i::y.
| vector2 vec2_from_angle | ( | const vm_float_t | angle | ) |
Returns the unit vector at the given angle in radians.
See vec2_from_angle_ptr instead.
| angle | Angle in radians. |
Definition at line 667 of file vector2.c.
References VECMAT_COS, and VECMAT_SIN.
| vm_float_t vec2_heading | ( | const vector2 | v | ) |
Returns the heading angle of the vector in radians.
| v | Input vector. |
Definition at line 803 of file vector2.c.
References VECMAT_ATAN2, vector2::x, and vector2::y.
| bool vec2_is_normalized | ( | const vector2 | v | ) |
Returns true if the vector has unit length.
| v | Input vector. |
Definition at line 858 of file vector2.c.
References vec2_length_squared(), VECMAT_EPSILON, and VECMAT_FABS.
| bool vec2_is_zero | ( | const vector2 | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 847 of file vector2.c.
References VECMAT_EPSILON, VECMAT_FABS, vector2::x, and vector2::y.
| vm_float_t vec2_length | ( | const vector2 | v | ) |
Computes the length (magnitude) of the vector.
| v | The input vector. |
Definition at line 450 of file vector2.c.
References vec2_dot(), and VECMAT_SQRT.
Referenced by vec2_angle(), vec2_limit_length_ptr(), and vec2_normalize_ptr().
| vm_float_t vec2_length_chebyshev | ( | const vector2 | v | ) |
Returns the Chebyshev (L-inf) length.
| v | Input vector. |
Definition at line 766 of file vector2.c.
References VECMAT_FABS, VECMAT_FMAX, vector2::x, and vector2::y.
| vm_float_t vec2_length_manhattan | ( | const vector2 | v | ) |
Returns the Manhattan (L1) length.
| v | Input vector. |
Definition at line 755 of file vector2.c.
References VECMAT_FABS, vector2::x, and vector2::y.
| vm_float_t vec2_length_squared | ( | const vector2 | v | ) |
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 744 of file vector2.c.
References vec2_dot().
Referenced by vec2_is_normalized().
| vector2 vec2_lerp | ( | const vector2 | a, |
| const vector2 | b, | ||
| const vm_float_t | t ) |
Linearly interpolates from a to b by t.
See vec2_lerp_ptr instead.
| a | First input vector. |
| b | Second input vector. |
| t | Interpolation factor. |
Definition at line 511 of file vector2.c.
References vec2_lerp_ptr().
| void vec2_lerp_ptr | ( | vector2 * | res, |
| const vector2 * | a, | ||
| const vector2 * | b, | ||
| const vm_float_t | t ) |
Linearly interpolates from a to b by t.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
| t | Interpolation factor. |
Definition at line 345 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_lerp().
| vector2 vec2_limit_length | ( | const vector2 | v, |
| const vm_float_t | max_len ) |
Clamps the vector length to max_len.
See vec2_limit_length_ptr instead.
| v | Input vector. |
| max_len | Maximum length. |
Definition at line 715 of file vector2.c.
References vec2_limit_length_ptr().
| void vec2_limit_length_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | max_len ) |
Clamps the vector length to max_len.
| res | Output vector. |
| v | Input vector. |
| max_len | Maximum length. |
Definition at line 511 of file vector2_ptr.c.
References vec2_length(), vector2::x, and vector2::y.
Referenced by vec2_limit_length().
Returns the component-wise maximum of two vectors.
See vec2_max_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 253 of file vector2.c.
References vec2_max_ptr().
| vm_float_t vec2_max_component | ( | const vector2 | v | ) |
Returns the largest component.
| v | Input vector. |
Definition at line 825 of file vector2.c.
References VECMAT_FMAX, vector2::x, and vector2::y.
Computes the component-wise maximum of vectors a and b, storing the result in res.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 141 of file vector2_ptr.c.
References VECMAT_FMAX, vector2::x, and vector2::y.
Referenced by vec2_max().
Returns the component-wise minimum of two vectors.
See vec2_min_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 237 of file vector2.c.
References vec2_min_ptr().
| vm_float_t vec2_min_component | ( | const vector2 | v | ) |
Returns the smallest component.
| v | Input vector. |
Definition at line 814 of file vector2.c.
References VECMAT_FMIN, vector2::x, and vector2::y.
Computes the component-wise minimum of vectors a and b, storing the result in res.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 127 of file vector2_ptr.c.
References VECMAT_FMIN, vector2::x, and vector2::y.
Referenced by vec2_min().
| vector2 vec2_move_toward | ( | const vector2 | current, |
| const vector2 | target, | ||
| const vm_float_t | max_delta ) |
Moves current toward target by at most max_delta.
See vec2_move_toward_ptr instead.
| current | Current position. |
| target | Target position. |
| max_delta | Maximum distance to move. |
Definition at line 699 of file vector2.c.
References vec2_move_toward_ptr().
| void vec2_move_toward_ptr | ( | vector2 * | res, |
| const vector2 * | current, | ||
| const vector2 * | target, | ||
| const vm_float_t | max_delta ) |
Moves current toward target by at most max_delta.
| res | Output vector. |
| current | Current position. |
| target | Target position. |
| max_delta | Maximum distance to move. |
Definition at line 490 of file vector2_ptr.c.
References VECMAT_SQRT, vector2::x, and vector2::y.
Referenced by vec2_move_toward().
Multiplies two vectors component-wise (Hadamard product).
See vec2_mul_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 160 of file vector2.c.
References vec2_mul_ptr().
Multiplies vectors a and b component-wise, storing the result in res.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 70 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_mul().
| vector2 vec2_mul_scalar | ( | const vector2 | v, |
| const vm_float_t | s ) |
Multiplies a vector by a scalar component-wise.
See vec2_mul_scalar_ptr instead.
| v | The input vector. |
| s | The scalar multiplier. |
Definition at line 128 of file vector2.c.
References vec2_mul_scalar_ptr().
| void vec2_mul_scalar_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | s ) |
Multiplies vector v by scalar s component-wise, storing the result in res.
| res | Output vector. |
| v | Input vector. |
| s | Input scalar. |
Definition at line 40 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_mul_scalar().
| bool vec2_near | ( | const vector2 | a, |
| const vector2 | b, | ||
| const vm_float_t | eps ) |
Returns true if a and b are within eps of each other.
| a | First input vector. |
| b | Second input vector. |
| eps | Distance tolerance. |
Definition at line 871 of file vector2.c.
References VECMAT_FABS, vector2::x, and vector2::y.
Negates the vector (multiplies each component by -1.0f).
See vec2_neg_ptr instead.
| v | The input vector. |
Definition at line 175 of file vector2.c.
References vec2_neg_ptr().
Negates the components of vector v, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 82 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_neg().
Normalizes the vector to unit length.
See vec2_normalize_ptr instead.
| v | The input vector. |
Definition at line 221 of file vector2.c.
References vec2_normalize_ptr().
Normalizes vector v to unit length, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 107 of file vector2_ptr.c.
References vec2_length(), vector2::x, and vector2::y.
Referenced by vec2_normalize(), and vec2i_normalize_to_vec2_ptr().
| vector2 vec2_one | ( | void | ) |
Returns the perpendicular vector (90 degrees counterclockwise).
See vec2_perpendicular_ptr instead.
| v | The input vector. |
Definition at line 329 of file vector2.c.
References vec2_perpendicular_ptr().
Computes the perpendicular vector to v (90 degrees counterclockwise rotation), storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 206 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_perpendicular().
Projects the first vector onto the second.
See vec2_project_ptr instead.
| a | The vector to project. |
| b | The projection direction vector. |
Definition at line 361 of file vector2.c.
References vec2_project_ptr().
Projects vector a onto vector b (scalar projection scaled by b).
| res | The output projected vector. |
| a | The vector to project. |
| b | The direction vector (non-zero length recommended). |
Definition at line 261 of file vector2_ptr.c.
References vec2_dot(), vector2::x, and vector2::y.
Referenced by vec2_project(), and vec2_reject_ptr().
Reflects vector v across the normal, storing the result in res.
See vec2_reflect_ptr instead.
| v | The incident vector. |
| normal | The unit normal vector. |
Definition at line 345 of file vector2.c.
References vec2_reflect_ptr().
Reflects vector v across the normal, storing the result in res.
| res | Output vector. |
| v | Input incident vector. |
| normal | Input surface normal. |
Definition at line 247 of file vector2_ptr.c.
References vec2_dot(), vector2::x, and vector2::y.
Referenced by vec2_reflect().
| vector2 vec2_refract | ( | const vector2 | incident, |
| const vector2 | normal, | ||
| const vm_float_t | eta ) |
Computes the refraction of incident across normal with ratio eta.
See vec2_refract_ptr instead.
| incident | Incident vector. |
| normal | Surface normal. |
| eta | Ratio of indices of refraction. |
Definition at line 623 of file vector2.c.
References vec2_refract_ptr().
| void vec2_refract_ptr | ( | vector2 * | res, |
| const vector2 * | incident, | ||
| const vector2 * | normal, | ||
| const vm_float_t | eta ) |
Computes the refraction of incident across normal with ratio eta.
| res | Output vector. |
| incident | Incident vector. |
| normal | Surface normal. |
| eta | Ratio of indices of refraction. |
Definition at line 435 of file vector2_ptr.c.
References vec2_dot(), VECMAT_SQRT, vector2::x, and vector2::y.
Referenced by vec2_refract().
Returns the component of a orthogonal to b.
See vec2_reject_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 639 of file vector2.c.
References vec2_reject_ptr().
Returns the component of a orthogonal to b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 456 of file vector2_ptr.c.
References vec2_project_ptr(), vector2::x, and vector2::y.
Referenced by vec2_reject().
| vector2 vec2_rotate | ( | const vector2 | v, |
| const vm_float_t | angle ) |
Rotates the input vector counterclockwise by the given angle (radians).
See vec2_rotate_ptr instead.
| v | The input vector. |
| angle | The rotation angle in radians. |
Definition at line 392 of file vector2.c.
References vec2_rotate_ptr().
| vector2 vec2_rotate_around | ( | const vector2 | v, |
| const vector2 | pivot, | ||
| const vm_float_t | angle ) |
Rotates v around pivot by angle radians.
See vec2_rotate_around_ptr instead.
| v | Input vector. |
| pivot | Rotation pivot. |
| angle | Angle in radians. |
Definition at line 682 of file vector2.c.
References vec2_rotate_around_ptr().
| void vec2_rotate_around_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vector2 * | pivot, | ||
| const vm_float_t | angle ) |
Rotates v around pivot by angle radians.
| res | Output vector. |
| v | Input vector. |
| pivot | Rotation pivot. |
| angle | Angle in radians. |
Definition at line 472 of file vector2_ptr.c.
References vec2_rotate_ptr(), vector2::x, and vector2::y.
Referenced by vec2_rotate_around().
| void vec2_rotate_ptr | ( | vector2 * | result, |
| const vector2 * | v, | ||
| const vm_float_t | angle ) |
Rotates the input vector counterclockwise by the given angle (radians).
Uses standard 2D rotation matrix.
| result | The output rotated vector. |
| v | The input vector. |
| angle | The rotation angle in radians. |
Definition at line 297 of file vector2_ptr.c.
References VECMAT_COS, VECMAT_SIN, vector2::x, and vector2::y.
Referenced by vec2_rotate(), and vec2_rotate_around_ptr().
Applies round to each component.
See vec2_round_ptr instead.
| v | The input vector. |
Definition at line 313 of file vector2.c.
References vec2_round_ptr().
Applies the round function to each component of vector v, storing the result in res.
| res | Output vector. |
| v | Input vector. |
Definition at line 193 of file vector2_ptr.c.
References VECMAT_ROUND, vector2::x, and vector2::y.
Referenced by vec2_round().
Clamps each component to the range [0, 1].
See vec2_saturate_ptr instead.
| v | Input vector. |
Definition at line 591 of file vector2.c.
References vec2_saturate_ptr().
Clamps each component to the range [0, 1].
| res | Output vector. |
| v | Input vector. |
Definition at line 410 of file vector2_ptr.c.
References vec2_clamp_scalar_ptr().
Referenced by vec2_saturate().
| vector2 vec2_scale | ( | const vector2 | v, |
| const vm_float_t | s ) |
Scales a vector by a scalar component-wise.
See vec2_scale_ptr instead.
| v | The input vector. |
| s | The scalar multiplier. |
Definition at line 80 of file vector2.c.
References vec2_scale_ptr().
| void vec2_scale_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | s ) |
Scales a vector by a scalar component-wise, storing the result in res.
| res | Output vector. |
| v | Input vector. |
| s | Input scalar. |
Definition at line 234 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_scale().
Returns the sign of each component (+1.0f, -1.0f, or 0.0f).
See vec2_sign_ptr instead.
| v | The input vector. |
Definition at line 268 of file vector2.c.
References vec2_sign_ptr().
Sets each component of res to the sign of the corresponding component in v (+1, -1).
| res | Output vector. |
| v | Input vector. |
Definition at line 154 of file vector2_ptr.c.
References VECMAT_COPYSIGN, vector2::x, and vector2::y.
Referenced by vec2_sign().
Slides the input vector tangent to the normal (removes normal component).
See vec2_slide_ptr instead.
| v | The input vector. |
| normal | The unit normal vector. |
Definition at line 408 of file vector2.c.
References vec2_slide_ptr().
Slides the input vector tangent to the normal (removes normal component).
Formula: v - dot(v, normal) * normal (assumes unit normal).
| result | The output slid vector. |
| v | The input vector. |
| normal | The unit normal vector. |
Definition at line 316 of file vector2_ptr.c.
References vec2_dot(), vector2::x, and vector2::y.
Referenced by vec2_slide().
| vector2 vec2_splat | ( | const vm_float_t | s | ) |
Subtracts the second vector from the first component-wise.
See vec2_sub_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 112 of file vector2.c.
References vec2_sub_ptr().
Subtracts vector b from vector a component-wise, storing the result in res.
| res | Output vector. |
| a | Input vector a. |
| b | Input vector b. |
Definition at line 27 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_sub().
| vector2 vec2_sub_scalar | ( | const vector2 | v, |
| const vm_float_t | s ) |
Subtracts a scalar from each component.
See vec2_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 559 of file vector2.c.
References vec2_sub_scalar_ptr().
| void vec2_sub_scalar_ptr | ( | vector2 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | s ) |
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 384 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_sub_scalar().
| vm_float_t vec2_sum | ( | const vector2 | v | ) |
Returns the sum of all components.
| v | Input vector. |
Definition at line 836 of file vector2.c.
References vector2::x, and vector2::y.
Returns the tangent vector perpendicular to the input (90 degrees clockwise).
See vec2_tangent_ptr instead.
| v | The input vector. |
Definition at line 376 of file vector2.c.
References vec2_tangent_ptr().
Computes a tangent vector perpendicular to the input (90 degrees clockwise).
Equivalent to (v.y, -v.x).
| res | The output tangent vector. |
| v | The input vector. |
Definition at line 282 of file vector2_ptr.c.
References vector2::x, and vector2::y.
Referenced by vec2_tangent().
| vector3 vec2_to_vec3 | ( | const vector2 | v, |
| const vm_float_t | z ) |
Converts a vector2 to a vector3 using z.
See vec2_to_vec3_ptr instead.
| v | Input vector. |
| z | Z component. |
Definition at line 731 of file vector2.c.
References vec2_to_vec3_ptr().
| void vec2_to_vec3_ptr | ( | vector3 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | z ) |
Converts a vector2 to a vector3 with the given z.
| res | Output vector. |
| v | Input vector. |
| z | Z component. |
Definition at line 530 of file vector2_ptr.c.
References vector2::x, vector3::x, vector2::y, vector3::y, and vector3::z.
Referenced by vec2_to_vec3().
| vector2 vec2_x_axis | ( | const vm_float_t | x | ) |
| vector2 vec2_x_scale | ( | const vm_float_t | x | ) |
| vector2 vec2_y_axis | ( | const vm_float_t | y | ) |
| vector2 vec2_y_scale | ( | const vm_float_t | y | ) |
| vector2 vec2_zero | ( | void | ) |
Returns the absolute values of each component.
See vec2i_abs_ptr instead.
| v | The input vector. |
Definition at line 175 of file vector2i.c.
References vec2i_abs_ptr().
Computes the absolute values of the components of vector v (using int abs), storing the result in res.
Definition at line 101 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_abs().
Adds two vectors component-wise.
See vec2i_add_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 80 of file vector2i.c.
References vec2i_add_ptr().
Adds src to dest in place.
| dest | Destination vector. |
| src | Vector to add. |
Definition at line 316 of file vecmat.c.
References vector2i::x, and vector2i::y.
Adds vectors a and b component-wise, storing the result in res.
Definition at line 15 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_add().
Adds a scalar to each component.
See vec2i_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 405 of file vector2i.c.
References vec2i_add_scalar_ptr().
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 270 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_add_scalar().
| vm_float_t vec2i_angle | ( | const vector2i | a, |
| const vector2i | b ) |
Computes the signed angle between two vectors (in radians, range [-PI, PI]) using atan2(cross, dot).
Returns 0.0f if either vector has zero length.
| a | The first vector. |
| b | The second vector. |
Definition at line 322 of file vector2i.c.
References vec2i_dot(), vec2i_length(), VECMAT_ATAN2, vector2i::x, and vector2i::y.
| vm_float_t vec2i_aspect_ratio | ( | const vector2i | v | ) |
Computes the aspect ratio of the vector (x / y).
Returns 0.0f if y == 0.
| v | The input vector. |
Definition at line 340 of file vector2i.c.
References vector2i::x, and vector2i::y.
Copies src into dest.
| dest | Destination vector. |
| src | Source vector. |
Definition at line 291 of file vecmat.c.
References vector2i::x, and vector2i::y.
Assigns x and y to dest.
| dest | Destination vector. |
| x | X component. |
| y | Y component. |
Definition at line 304 of file vecmat.c.
References vector2i::x, and vector2i::y.
Clamps each component between min and max.
See vec2i_clamp_ptr instead.
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 373 of file vector2i.c.
References vec2i_clamp_ptr().
| void vec2i_clamp_ptr | ( | vector2i * | res, |
| const vector2i * | v, | ||
| const vector2i * | min, | ||
| const vector2i * | max ) |
Clamps each component between min and max.
| res | Output vector. |
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 244 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_clamp().
Computes the 2D cross-product as a vector.
See vec2i_cross_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 268 of file vector2i.c.
References vec2i_cross_ptr().
Computes the 2D cross-product of a and b, storing the scalar value in res->x and 0 in res->y.
Definition at line 189 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_cross().
Returns the 2D cross product as a scalar (a.x*b.y - a.y*b.x).
| a | First input vector. |
| b | Second input vector. |
Definition at line 527 of file vector2i.c.
References vector2i::x, and vector2i::y.
| vm_float_t vec2i_distance | ( | const vector2i | a, |
| const vector2i | b ) |
Computes the Euclidean distance between two vectors (treated as points).
| a | The first point. |
| b | The second point. |
Definition at line 305 of file vector2i.c.
References VECMAT_SQRT, vector2i::x, and vector2i::y.
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 550 of file vector2i.c.
References vector2i::x, and vector2i::y.
Divides two vectors component-wise.
See vec2i_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 389 of file vector2i.c.
References vec2i_div_ptr().
Component-wise floored division of a by b.
See vec2i_div_floor_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 453 of file vector2i.c.
References vec2i_div_floor_ptr().
Component-wise floored division of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 309 of file vector2i_ptr.c.
References vm_div_floor(), vector2i::x, and vector2i::y.
Referenced by vec2i_div_floor().
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 257 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_div().
Divides a vector by a scalar component-wise (float division, truncated to int).
See vec2i_div_scalar_ptr instead.
| v | The input vector. |
| s | The scalar divisor (sets to zero vector if zero). |
Definition at line 129 of file vector2i.c.
References vec2i_div_scalar_ptr().
Divides vector v by scalar s component-wise (float division, truncated to int), storing the result in res.
Sets vector to zero if s == 0.
Definition at line 57 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_div_scalar().
Computes the dot product of two vectors.
| a | The first vector. |
| b | The second vector. |
Definition at line 282 of file vector2i.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_angle(), vec2i_length(), and vec2i_length_squared().
Returns true if two vectors are exactly equal.
| a | First vector. |
| b | Second vector. |
Definition at line 79 of file vecmat.c.
References vector2i::x, and vector2i::y.
Converts a vector2 to a vector2i by truncation.
| v | Input vector. |
Definition at line 328 of file vecmat.c.
References vector2::x, and vector2::y.
Converts a vector2 to a vector2i by flooring each component.
| v | Input vector. |
Definition at line 339 of file vecmat.c.
References VECMAT_FLOOR, vector2::x, and vector2::y.
Converts a vector2 to a vector2i by rounding each component.
| v | Input vector. |
Definition at line 350 of file vecmat.c.
References VECMAT_ROUND, vector2::x, and vector2::y.
| bool vec2i_is_zero | ( | const vector2i | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 622 of file vector2i.c.
References vector2i::x, and vector2i::y.
| vm_float_t vec2i_length | ( | const vector2i | v | ) |
Computes the length (magnitude) of the vector.
| v | The input vector. |
Definition at line 293 of file vector2i.c.
References vec2i_dot(), and VECMAT_SQRT.
Referenced by vec2i_angle(), and vec2i_normalize_ptr().
Returns the Chebyshev (L-inf) length.
| v | Input vector. |
Definition at line 576 of file vector2i.c.
References vector2i::x, and vector2i::y.
Returns the Manhattan (L1) length.
| v | Input vector. |
Definition at line 563 of file vector2i.c.
References vector2i::x, and vector2i::y.
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 538 of file vector2i.c.
References vec2i_dot().
| vector2i vec2i_lerp | ( | const vector2i | a, |
| const vector2i | b, | ||
| const vm_float_t | t ) |
Linearly interpolates from a to b by t.
See vec2i_lerp_ptr instead.
| a | First input vector. |
| b | Second input vector. |
| t | Interpolation factor. |
Definition at line 356 of file vector2i.c.
References vec2i_lerp_ptr().
| void vec2i_lerp_ptr | ( | vector2i * | res, |
| const vector2i * | a, | ||
| const vector2i * | b, | ||
| const vm_float_t | t ) |
Linearly interpolates from a to b by t.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
| t | Interpolation factor. |
Definition at line 230 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_lerp().
Returns the component-wise maximum of two vectors.
See vec2i_max_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 222 of file vector2i.c.
References vec2i_max_ptr().
Returns the largest component.
| v | Input vector. |
Definition at line 600 of file vector2i.c.
References vector2i::x, and vector2i::y.
Computes the component-wise maximum of vectors a and b, storing the result in res.
Definition at line 149 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_max().
Returns the component-wise minimum of two vectors.
See vec2i_min_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 206 of file vector2i.c.
References vec2i_min_ptr().
Returns the smallest component.
| v | Input vector. |
Definition at line 589 of file vector2i.c.
References vector2i::x, and vector2i::y.
Computes the component-wise minimum of vectors a and b, storing the result in res.
Definition at line 135 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_min().
Component-wise floor modulo of a by b.
See vec2i_mod_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 437 of file vector2i.c.
References vec2i_mod_ptr().
Component-wise floor modulo of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 296 of file vector2i_ptr.c.
References vm_mod_floor(), vector2i::x, and vector2i::y.
Referenced by vec2i_mod().
Multiplies two vectors component-wise (Hadamard product).
See vec2i_mul_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 145 of file vector2i.c.
References vec2i_mul_ptr().
Multiplies vectors a and b component-wise (Hadamard product), storing the result in res.
Definition at line 76 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_mul().
Multiplies a vector by a scalar component-wise.
See vec2i_mul_scalar_ptr instead.
| v | The input vector. |
| s | The scalar multiplier. |
Definition at line 112 of file vector2i.c.
References vec2i_mul_scalar_ptr().
Multiplies vector v by scalar s component-wise, storing the result in res.
Definition at line 41 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_mul_scalar().
Negates the vector (multiplies each component by -1).
See vec2i_neg_ptr instead.
| v | The input vector. |
Definition at line 160 of file vector2i.c.
References vec2i_neg_ptr().
Negates the components of vector v, storing the result in res.
Definition at line 88 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_neg().
Normalizes the vector to approximate unit length (float length, truncated to int).
See vec2i_normalize_ptr instead.
| v | The input vector. |
Definition at line 190 of file vector2i.c.
References vec2i_normalize_ptr().
Normalizes vector v to approximate unit length (float length computation, truncated to int), storing the result in res.
Copies v unchanged if the length is zero.
Definition at line 116 of file vector2i_ptr.c.
References vec2i_length(), vector2i::x, and vector2i::y.
Referenced by vec2i_normalize().
Converts to a unit-length vector2.
See vec2i_normalize_to_vec2_ptr instead.
| v | Input vector. |
Definition at line 513 of file vector2i.c.
References vec2i_normalize_to_vec2_ptr().
Converts to a unit-length vector2.
| res | Output vector. |
| v | Input vector. |
Definition at line 348 of file vector2i_ptr.c.
References vec2_normalize_ptr(), vector2i::x, and vector2i::y.
Referenced by vec2i_normalize_to_vec2().
| vector2i vec2i_one | ( | void | ) |
Returns a vector2i with both components set to 1.
Definition at line 22 of file vector2i.c.
Returns the perpendicular vector (90 degrees counterclockwise).
See vec2i_perpendicular_ptr instead.
| v | The input vector. |
Definition at line 252 of file vector2i.c.
References vec2i_perpendicular_ptr().
Computes the perpendicular vector to v (90 degrees counterclockwise rotation), storing the result in res.
Definition at line 175 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_perpendicular().
Returns the sign of each component (+1, -1, or 0).
See vec2i_sign_ptr instead.
| v | The input vector. |
Definition at line 237 of file vector2i.c.
References vec2i_sign_ptr().
Sets each component of res to the sign of the corresponding component in v (+1, -1, or 0).
Definition at line 162 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_sign().
Returns a vector with every component set to s.
See vec2i_splat_ptr instead.
| s | Scalar value. |
Definition at line 484 of file vector2i.c.
Subtracts the second vector from the first component-wise.
See vec2i_sub_ptr instead.
| a | The first vector. |
| b | The second vector. |
Definition at line 96 of file vector2i.c.
References vec2i_sub_ptr().
Subtracts vector b from vector a component-wise, storing the result in res.
Definition at line 28 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_sub().
Subtracts a scalar from each component.
See vec2i_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 421 of file vector2i.c.
References vec2i_sub_scalar_ptr().
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 283 of file vector2i_ptr.c.
References vector2i::x, and vector2i::y.
Referenced by vec2i_sub_scalar().
Returns the sum of all components.
| v | Input vector. |
Definition at line 611 of file vector2i.c.
References vector2i::x, and vector2i::y.
Converts a vector2i to a vector3i using z.
See vec2i_to_vec3i_ptr instead.
| v | Input vector. |
| z | Z component. |
Definition at line 498 of file vector2i.c.
References vec2i_to_vec3i_ptr().
Converts a vector4i to a vector3i by dropping w.
| res | Output vector. |
| v | Input vector. |
| z | Z component. |
Definition at line 335 of file vector2i_ptr.c.
References vector2i::x, vector3i::x, vector2i::y, vector3i::y, and vector3i::z.
Referenced by vec2i_to_vec3i().
Wraps each component of v into [0, period).
See vec2i_wrap_ptr instead.
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 469 of file vector2i.c.
References vec2i_wrap_ptr().
Wraps each component of v into [0, period).
| res | Output vector. |
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 322 of file vector2i_ptr.c.
References vm_mod_floor(), vector2i::x, and vector2i::y.
Referenced by vec2i_wrap().
Returns a vector2i along the x-axis (y = 0).
| x | The x component value. |
Definition at line 33 of file vector2i.c.
Returns a vector2i representing x-axis scaling (y = 1).
| x | The x scale factor. |
Definition at line 55 of file vector2i.c.
Returns a vector2i along the y-axis (x = 0).
| y | The y component value. |
Definition at line 44 of file vector2i.c.
Returns a vector2i representing y-axis scaling (x = 1).
| y | The y scale factor. |
Definition at line 66 of file vector2i.c.
| vector2i vec2i_zero | ( | void | ) |
Returns a vector2i with both components set to 0.
Definition at line 12 of file vector2i.c.
| vector3 vec3 | ( | const vm_float_t | x, |
| const vm_float_t | y, | ||
| const vm_float_t | z ) |
Computes the absolute value per component of a vector3.
See vec3_abs_ptr for the out-parameter version.
| v | The vector. |
Definition at line 196 of file vector3.c.
References vec3_abs_ptr().
Computes the absolute value per component of a vector3.
| res | Result vector. |
| v | Vector. |
Definition at line 100 of file vector3_ptr.c.
References VECMAT_FABS, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_abs().
Component-wise addition of two vectors.
See vec3_add_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 102 of file vector3.c.
References vec3_add_ptr().
Adds src to dest in place.
| dest | Destination vector. |
| src | Vector to add. |
Definition at line 402 of file vecmat.c.
References vector3::x, vector3::y, and vector3::z.
Component-wise addition of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 14 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_add().
| vector3 vec3_add_scalar | ( | const vector3 | v, |
| const vm_float_t | s ) |
Adds a scalar to each component.
See vec3_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 485 of file vector3.c.
References vec3_add_scalar_ptr().
| void vec3_add_scalar_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | s ) |
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 320 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_add_scalar().
| vm_float_t vec3_angle | ( | const vector3 | a, |
| const vector3 | b ) |
Computes the angle between two non-zero vector3 in radians.
| a | First vector. |
| b | Second vector. |
Definition at line 413 of file vector3.c.
References vec3_dot(), vec3_length(), and VECMAT_ACOS.
Copies src into dest.
| dest | Destination vector. |
| src | Source vector. |
Definition at line 374 of file vecmat.c.
References vector3::x, vector3::y, and vector3::z.
| void vec3_assign_xyz | ( | vector3 * | dest, |
| const vm_float_t | x, | ||
| const vm_float_t | y, | ||
| const vm_float_t | z ) |
Assigns x, y, and z to dest.
| dest | Destination vector. |
| x | X component. |
| y | Y component. |
| z | Z component. |
Definition at line 389 of file vecmat.c.
References vector3::x, vector3::y, and vector3::z.
Applies ceil per component to a vector3.
See vec3_ceil_ptr for the out-parameter version.
| v | The vector. |
Definition at line 304 of file vector3.c.
References vec3_ceil_ptr().
Component-wise ceil of a vector.
| res | Result vector. |
| v | Vector. |
Definition at line 200 of file vector3_ptr.c.
References VECMAT_CEIL, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_ceil().
Clamps a vector3 between min and max per component.
See vec3_clamp_ptr for the out-parameter version.
| v | The vector. |
| min | Minimum bounds. |
| max | Maximum bounds. |
Definition at line 387 of file vector3.c.
References vec3_clamp_ptr().
Clamp vector components between min and max.
| res | Result vector. |
| v | Vector. |
| min | Minimum bounds. |
| max | Maximum bounds. |
Definition at line 280 of file vector3_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_clamp().
| vector3 vec3_clamp_scalar | ( | const vector3 | v, |
| const vm_float_t | min, | ||
| const vm_float_t | max ) |
Clamps each component to the scalar range [min, max].
See vec3_clamp_scalar_ptr instead.
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 518 of file vector3.c.
References vec3_clamp_scalar_ptr().
| void vec3_clamp_scalar_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | min, | ||
| const vm_float_t | max ) |
Clamps each component to the scalar range [min, max].
| res | Output vector. |
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 349 of file vector3_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_clamp_scalar(), and vec3_saturate_ptr().
Computes the cross-product of two vector3.
See vec3_cross_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 212 of file vector3.c.
References vec3_cross_ptr().
Referenced by mat4_look_at_ptr(), and vec3_signed_angle().
Compute cross-product of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 133 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_cross(), and vec3_orthonormal_basis_ptr().
| vm_float_t vec3_distance | ( | const vector3 | a, |
| const vector3 | b ) |
Computes the Euclidean distance between two vector3.
| a | First vector. |
| b | Second vector. |
Definition at line 401 of file vector3.c.
References vec3_length(), and vec3_sub().
| vm_float_t vec3_distance_squared | ( | const vector3 | a, |
| const vector3 | b ) |
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 749 of file vector3.c.
References vector3::x, vector3::y, and vector3::z.
Divides two vectors component-wise.
See vec3_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 469 of file vector3.c.
References vec3_div_ptr().
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 306 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_div().
| vector3 vec3_div_scalar | ( | const vector3 | v, |
| const vm_float_t | s ) |
Component-wise division of vector by scalar.
See vec3_div_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar (non-zero). |
Definition at line 150 of file vector3.c.
References vec3_div_scalar_ptr().
| void vec3_div_scalar_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | s ) |
Component-wise division of vector by scalar.
| res | Result vector. |
| v | Vector. |
| s | Scalar. |
Definition at line 56 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_div_scalar().
| vm_float_t vec3_dot | ( | const vector3 | a, |
| const vector3 | b ) |
Computes the dot product of two vector3.
| a | First vector. |
| b | Second vector. |
Definition at line 428 of file vector3.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by mat4_look_at_ptr(), vec3_angle(), vec3_length(), vec3_length_squared(), vec3_project_ptr(), vec3_reflect_ptr(), vec3_refract_ptr(), vec3_rotate_axis_ptr(), vec3_signed_angle(), and vec3_slide_ptr().
Returns true if two vectors are equal within VECMAT_EPSILON.
| a | First vector. |
| b | Second vector. |
Definition at line 50 of file vecmat.c.
References VECMAT_EPSILON, VECMAT_FABS, vector3::x, vector3::y, and vector3::z.
Applies the floor per component to a vector3.
See vec3_floor_ptr for the out-parameter version.
| v | The vector. |
Definition at line 289 of file vector3.c.
References vec3_floor_ptr().
Component-wise floor of a vector.
| res | Result vector. |
| v | Vector. |
Definition at line 187 of file vector3_ptr.c.
References VECMAT_FLOOR, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_floor().
Returns the fractional part of each component.
See vec3_fract_ptr instead.
| v | Input vector. |
Definition at line 548 of file vector3.c.
References vec3_fract_ptr().
Returns the fractional part of each component.
| res | Output vector. |
| v | Input vector. |
Definition at line 373 of file vector3_ptr.c.
References VECMAT_FLOOR, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_fract().
Converts a vector3i to a vector3.
| v | Input integer vector. |
Definition at line 415 of file vecmat.c.
References vector3i::x, vector3i::y, and vector3i::z.
| vector3 vec3_from_vec2 | ( | const vector2 | v, |
| const vm_float_t | z ) |
Builds a vector3 from a vector2 and z.
See vec3_from_vec2_ptr instead.
| v | Input vector. |
| z | Z component. |
Definition at line 642 of file vector3.c.
References vec3_from_vec2_ptr().
| void vec3_from_vec2_ptr | ( | vector3 * | res, |
| const vector2 * | v, | ||
| const vm_float_t | z ) |
Builds a higher-dimension vector from a vector2.
| res | Output vector. |
| v | Input vector. |
| z | Z component. |
Definition at line 460 of file vector3_ptr.c.
References vector2::x, vector3::x, vector2::y, vector3::y, and vector3::z.
Referenced by vec3_from_vec2().
| bool vec3_is_normalized | ( | const vector3 | v | ) |
Returns true if the vector has unit length.
| v | Input vector. |
Definition at line 823 of file vector3.c.
References vec3_length_squared(), VECMAT_EPSILON, and VECMAT_FABS.
| bool vec3_is_zero | ( | const vector3 | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 810 of file vector3.c.
References VECMAT_EPSILON, VECMAT_FABS, vector3::x, vector3::y, and vector3::z.
| vm_float_t vec3_length | ( | const vector3 | v | ) |
Computes the length (magnitude) of a vector3.
| v | The vector. |
Definition at line 439 of file vector3.c.
References vec3_dot(), and VECMAT_SQRT.
Referenced by vec3_angle(), vec3_distance(), vec3_limit_length_ptr(), and vec3_normalize_ptr().
| vm_float_t vec3_length_chebyshev | ( | const vector3 | v | ) |
Returns the Chebyshev (L-inf) length.
| v | Input vector. |
Definition at line 737 of file vector3.c.
References VECMAT_FABS, VECMAT_FMAX, vector3::x, vector3::y, and vector3::z.
| vm_float_t vec3_length_manhattan | ( | const vector3 | v | ) |
Returns the Manhattan (L1) length.
| v | Input vector. |
Definition at line 726 of file vector3.c.
References VECMAT_FABS, vector3::x, vector3::y, and vector3::z.
| vm_float_t vec3_length_squared | ( | const vector3 | v | ) |
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 715 of file vector3.c.
References vec3_dot().
Referenced by vec3_is_normalized().
| vector3 vec3_lerp | ( | const vector3 | a, |
| const vector3 | b, | ||
| const vm_float_t | t ) |
Linearly interpolates between two vector3.
See vec3_lerp_ptr for the out-parameter version.
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor [0, 1]. |
Definition at line 370 of file vector3.c.
References vec3_lerp_ptr().
| void vec3_lerp_ptr | ( | vector3 * | res, |
| const vector3 * | a, | ||
| const vector3 * | b, | ||
| const vm_float_t | t ) |
Linear interpolation between two vectors.
| res | Result vector. |
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor. |
Definition at line 265 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_lerp().
| vector3 vec3_limit_length | ( | const vector3 | v, |
| const vm_float_t | max_len ) |
Clamps the vector length to max_len.
See vec3_limit_length_ptr instead.
| v | Input vector. |
| max_len | Maximum length. |
Definition at line 675 of file vector3.c.
References vec3_limit_length_ptr().
| void vec3_limit_length_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | max_len ) |
Clamps the vector length to max_len.
| res | Output vector. |
| v | Input vector. |
| max_len | Maximum length. |
Definition at line 510 of file vector3_ptr.c.
References vec3_length(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_limit_length().
Computes the component-wise maximum of two vector3.
See vec3_max_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 259 of file vector3.c.
References vec3_max_ptr().
| vm_float_t vec3_max_component | ( | const vector3 | v | ) |
Returns the largest component.
| v | Input vector. |
Definition at line 788 of file vector3.c.
References VECMAT_FMAX, vector3::x, vector3::y, and vector3::z.
Component-wise maximum of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 161 of file vector3_ptr.c.
References VECMAT_FMAX, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_max().
Computes the component-wise minimum of two vector3.
See vec3_min_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 243 of file vector3.c.
References vec3_min_ptr().
| vm_float_t vec3_min_component | ( | const vector3 | v | ) |
Returns the smallest component.
| v | Input vector. |
Definition at line 777 of file vector3.c.
References VECMAT_FMIN, vector3::x, vector3::y, and vector3::z.
Component-wise minimum of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 147 of file vector3_ptr.c.
References VECMAT_FMIN, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_min().
| vector3 vec3_move_toward | ( | const vector3 | current, |
| const vector3 | target, | ||
| const vm_float_t | max_delta ) |
Moves current toward target by at most max_delta.
See vec3_move_toward_ptr instead.
| current | Current position. |
| target | Target position. |
| max_delta | Maximum distance to move. |
Definition at line 659 of file vector3.c.
References vec3_move_toward_ptr().
| void vec3_move_toward_ptr | ( | vector3 * | res, |
| const vector3 * | current, | ||
| const vector3 * | target, | ||
| const vm_float_t | max_delta ) |
Moves current toward target by at most max_delta.
| res | Output vector. |
| current | Current position. |
| target | Target position. |
| max_delta | Maximum distance to move. |
Definition at line 487 of file vector3_ptr.c.
References VECMAT_SQRT, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_move_toward().
Component-wise multiplication of two vectors.
See vec3_mul_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 166 of file vector3.c.
References vec3_mul_ptr().
Component-wise multiplication of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 74 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_mul().
| vector3 vec3_mul_scalar | ( | const vector3 | v, |
| const vm_float_t | s ) |
Component-wise multiplication of vector by scalar.
See vec3_mul_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar. |
Definition at line 134 of file vector3.c.
References vec3_mul_scalar_ptr().
| void vec3_mul_scalar_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | s ) |
Component-wise multiplication of vector by scalar.
| res | Result vector. |
| v | Vector. |
| s | Scalar. |
Definition at line 42 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_mul_scalar(), and vec3_scale_ptr().
| bool vec3_near | ( | const vector3 | a, |
| const vector3 | b, | ||
| const vm_float_t | eps ) |
Returns true if a and b are within eps of each other.
| a | First input vector. |
| b | Second input vector. |
| eps | Distance tolerance. |
Definition at line 836 of file vector3.c.
References VECMAT_FABS, vector3::x, vector3::y, and vector3::z.
Negation of a vector.
See vec3_neg_ptr for the out-parameter version.
| v | The vector. |
Definition at line 181 of file vector3.c.
References vec3_neg_ptr().
Negation of a vector.
| res | Result vector. |
| v | Vector. |
Definition at line 87 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_neg().
Normalizes a vector3 to unit length.
See vec3_normalize_ptr for the out-parameter version.
| v | The vector (non-zero). |
Definition at line 227 of file vector3.c.
References vec3_normalize_ptr().
Referenced by mat4_look_at_ptr(), mat4_rotation_ptr(), and quat_from_axis_angle_ptr().
Normalize a vector to unit length.
| res | Result vector. |
| v | Vector. |
Definition at line 113 of file vector3_ptr.c.
References vec3_length(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_normalize(), vec3_orthonormal_basis_ptr(), vec3_rotate_axis_ptr(), and vec3i_normalize_to_vec3_ptr().
| vector3 vec3_one | ( | void | ) |
Builds a tangent and bitangent orthonormal to n.
| n | Unit normal. |
| t | Output tangent. |
| b | Output bitangent. |
Definition at line 704 of file vector3.c.
References vec3_orthonormal_basis_ptr().
Builds a tangent and bitangent orthonormal to n.
| n | Unit normal. |
| t | Output tangent. |
| b | Output bitangent. |
Definition at line 530 of file vector3_ptr.c.
References vec3_cross_ptr(), vec3_normalize_ptr(), VECMAT_FABS, and vector3::x.
Referenced by vec3_orthonormal_basis().
Projects a onto b.
See vec3_project_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 564 of file vector3.c.
References vec3_project_ptr().
Projects a onto b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 387 of file vector3_ptr.c.
References vec3_dot(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_project(), and vec3_reject_ptr().
Reflects an incident vector over normal.
See vec3_reflect_ptr for the out-parameter version.
| incident | The incident vector. |
| normal | The surface normal. |
Definition at line 335 of file vector3.c.
References vec3_reflect_ptr().
Compute reflection of the incident vector over normal.
| res | Result vector. |
| incident | Incident vector. |
| normal | Normal vector. |
Definition at line 227 of file vector3_ptr.c.
References vec3_dot(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_reflect().
| vector3 vec3_refract | ( | const vector3 | incident, |
| const vector3 | normal, | ||
| const vm_float_t | eta ) |
Refracts an incident vector across an interface with a given normal and ratio of refraction eta.
See vec3_refract_ptr for the out-parameter version.
| incident | The incident vector. |
| normal | The surface normal. |
| eta | The ratio of refraction (eta = n1 / n2). |
Definition at line 353 of file vector3.c.
References vec3_refract_ptr().
| void vec3_refract_ptr | ( | vector3 * | res, |
| const vector3 * | incident, | ||
| const vector3 * | normal, | ||
| const vm_float_t | eta ) |
Compute refraction of the incident vector through normal with eta.
| res | Result vector. |
| incident | Incident vector. |
| normal | Normal vector. |
| eta | Refraction index ratio. |
Definition at line 243 of file vector3_ptr.c.
References vec3_dot(), VECMAT_SQRT, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_refract().
Returns the component of a orthogonal to b.
See vec3_reject_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 596 of file vector3.c.
References vec3_reject_ptr().
Returns the component of a orthogonal to b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 424 of file vector3_ptr.c.
References vec3_project_ptr(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_reject().
| vector3 vec3_rotate_axis | ( | const vector3 | v, |
| const vector3 | axis, | ||
| const vm_float_t | angle ) |
Rotates v around axis by angle radians.
See vec3_rotate_axis_ptr instead.
| v | Input vector. |
| axis | Rotation axis. |
| angle | Angle in radians. |
Definition at line 613 of file vector3.c.
References vec3_rotate_axis_ptr().
| void vec3_rotate_axis_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vector3 * | axis, | ||
| const vm_float_t | angle ) |
Rotates v around axis by angle radians.
| res | Output vector. |
| v | Input vector. |
| axis | Rotation axis. |
| angle | Angle in radians. |
Definition at line 441 of file vector3_ptr.c.
References vec3_dot(), vec3_normalize_ptr(), VECMAT_COS, VECMAT_SIN, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_rotate_axis().
Applies round per component to a vector3.
See vec3_round_ptr for the out-parameter version.
| v | The vector. |
Definition at line 319 of file vector3.c.
References vec3_round_ptr().
Component-wise round of a vector.
| res | Result vector. |
| v | Vector. |
Definition at line 213 of file vector3_ptr.c.
References VECMAT_ROUND, vector3::x, vector3::y, and vector3::z.
Referenced by vec3_round().
Clamps each component to the range [0, 1].
See vec3_saturate_ptr instead.
| v | Input vector. |
Definition at line 533 of file vector3.c.
References vec3_saturate_ptr().
Clamps each component to the range [0, 1].
| res | Output vector. |
| v | Input vector. |
Definition at line 362 of file vector3_ptr.c.
References vec3_clamp_scalar_ptr().
Referenced by vec3_saturate().
| vector3 vec3_scale | ( | const vector3 | v, |
| const vm_float_t | s ) |
Scales the vector by a scalar.
See vec3_scale_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 453 of file vector3.c.
References vec3_scale_ptr().
| void vec3_scale_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | s ) |
Scales the vector by a scalar.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 294 of file vector3_ptr.c.
References vec3_mul_scalar_ptr().
Referenced by vec3_scale().
Computes the sign per component of a vector3 (-1, 0, or 1).
See vec3_sign_ptr for the out-parameter version.
| v | The vector. |
Definition at line 274 of file vector3.c.
References vec3_sign_ptr().
Component-wise sign of a vector.
| res | Result vector. |
| v | Vector. |
Definition at line 174 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_sign().
| vm_float_t vec3_signed_angle | ( | const vector3 | a, |
| const vector3 | b, | ||
| const vector3 | axis ) |
Returns the signed angle from a to b around axis.
| a | First input vector. |
| b | Second input vector. |
| axis | Rotation axis. |
Definition at line 765 of file vector3.c.
References vec3_cross(), vec3_dot(), and VECMAT_ATAN2.
Removes the component of v along normal.
See vec3_slide_ptr instead.
| v | Input vector. |
| normal | Surface normal. |
Definition at line 580 of file vector3.c.
References vec3_slide_ptr().
Removes the component of v along normal.
| res | Output vector. |
| v | Input vector. |
| normal | Surface normal. |
Definition at line 409 of file vector3_ptr.c.
References vec3_dot(), vector3::x, vector3::y, and vector3::z.
Referenced by vec3_slide().
| vector3 vec3_splat | ( | const vm_float_t | s | ) |
Component-wise subtraction of two vectors.
See vec3_sub_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 118 of file vector3.c.
References vec3_sub_ptr().
Referenced by mat4_look_at_ptr(), and vec3_distance().
Component-wise subtraction of two vectors.
| res | Result vector. |
| a | First vector. |
| b | Second vector. |
Definition at line 28 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_sub().
| vector3 vec3_sub_scalar | ( | const vector3 | v, |
| const vm_float_t | s ) |
Subtracts a scalar from each component.
See vec3_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 501 of file vector3.c.
References vec3_sub_scalar_ptr().
| void vec3_sub_scalar_ptr | ( | vector3 * | res, |
| const vector3 * | v, | ||
| const vm_float_t | s ) |
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 334 of file vector3_ptr.c.
References vector3::x, vector3::y, and vector3::z.
Referenced by vec3_sub_scalar().
| vm_float_t vec3_sum | ( | const vector3 | v | ) |
Returns the sum of all components.
| v | Input vector. |
Definition at line 799 of file vector3.c.
References vector3::x, vector3::y, and vector3::z.
| vector3 vec3_x_axis | ( | const vm_float_t | x | ) |
| vector3 vec3_x_scale | ( | const vm_float_t | x | ) |
Returns the x and y components as a 2D vector.
See vec3_xy_ptr instead.
| v | Input vector. |
Definition at line 690 of file vector3.c.
References vec3_xy_ptr().
Returns the x and y components as a 2D vector.
| res | Output vector. |
| v | Input vector. |
Definition at line 473 of file vector3_ptr.c.
References vector2::x, vector3::x, vector2::y, and vector3::y.
Referenced by vec3_xy().
| vector3 vec3_y_axis | ( | const vm_float_t | y | ) |
| vector3 vec3_y_scale | ( | const vm_float_t | y | ) |
| vector3 vec3_z_axis | ( | const vm_float_t | z | ) |
| vector3 vec3_z_scale | ( | const vm_float_t | z | ) |
| vector3 vec3_zero | ( | void | ) |
Computes the absolute value per component of a vector3i.
See vec3i_abs_ptr for the out-parameter version.
| v | The vector. |
Definition at line 196 of file vector3i.c.
References vec3i_abs_ptr().
Computes the absolute value of each component of a vector3i.
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
Definition at line 105 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_abs().
Component-wise addition of two vectors.
See vec3i_add_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 102 of file vector3i.c.
References vec3i_add_ptr().
Adds src to dest in place.
| dest | Destination vector. |
| src | Vector to add. |
Definition at line 471 of file vecmat.c.
References vector3i::x, vector3i::y, and vector3i::z.
Computes the component-wise sum of two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 15 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_add().
Adds a scalar to each component.
See vec3i_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 390 of file vector3i.c.
References vec3i_add_scalar_ptr().
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 267 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_add_scalar().
| vm_float_t vec3i_angle | ( | const vector3i | a, |
| const vector3i | b ) |
Computes the angle between two non-zero vector3i in radians.
| a | First vector. |
| b | Second vector. |
Definition at line 356 of file vector3i.c.
References vec3i_dot(), vec3i_length(), and VECMAT_ACOS.
Copies src into dest.
| dest | Destination vector. |
| src | Source vector. |
Definition at line 443 of file vecmat.c.
References vector3i::x, vector3i::y, and vector3i::z.
Assigns x, y, and z to dest.
| dest | Destination vector. |
| x | X component. |
| y | Y component. |
| z | Z component. |
Definition at line 458 of file vecmat.c.
References vector3i::x, vector3i::y, and vector3i::z.
Clamps a vector3i between min and max per component.
See vec3i_clamp_ptr for the out-parameter version.
| v | The vector. |
| min | Minimum bounds. |
| max | Maximum bounds. |
Definition at line 308 of file vector3i.c.
References vec3i_clamp_ptr().
| void vec3i_clamp_ptr | ( | vector3i * | res, |
| const vector3i * | v, | ||
| const vector3i * | min, | ||
| const vector3i * | max ) |
Clamps each component of a vector3i between corresponding min and max values.
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
| min | Pointer to the minimum bounds vector. |
| max | Pointer to the maximum bounds vector. |
Definition at line 212 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_clamp().
Computes the cross-product of two vector3i.
See vec3i_cross_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 212 of file vector3i.c.
References vec3i_cross_ptr().
Computes the cross-product of two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 140 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_cross().
| vm_float_t vec3i_distance | ( | const vector3i | a, |
| const vector3i | b ) |
Computes the Euclidean distance between two vector3i.
| a | First vector. |
| b | Second vector. |
Definition at line 344 of file vector3i.c.
References vec3i_length(), and vec3i_sub().
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 538 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Divides two vectors component-wise.
See vec3i_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 374 of file vector3i.c.
References vec3i_div_ptr().
Component-wise floored division of a by b.
See vec3i_div_floor_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 438 of file vector3i.c.
References vec3i_div_floor_ptr().
Component-wise floored division of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 309 of file vector3i_ptr.c.
References vm_div_floor3(), vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_div_floor().
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 253 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_div().
Component-wise division of vector by scalar.
See vec3i_div_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar (non-zero). |
Definition at line 150 of file vector3i.c.
References vec3i_div_scalar_ptr().
Scales a vector3i by the inverse of an integer scalar.
If the scalar is zero, stores the zero vector.
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
| s | The scalar divisor. |
Definition at line 59 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_div_scalar().
Computes the dot product of two vector3i.
| a | First vector. |
| b | Second vector. |
Definition at line 322 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_angle(), vec3i_length(), and vec3i_length_squared().
Returns true if two vectors are exactly equal.
| a | First vector. |
| b | Second vector. |
Definition at line 91 of file vecmat.c.
References vector3i::x, vector3i::y, and vector3i::z.
Converts a vector3 to a vector3i by truncation.
| v | Input vector. |
Definition at line 484 of file vecmat.c.
References vector3::x, vector3::y, and vector3::z.
Converts a vector3 to a vector3i by flooring each component.
| v | Input vector. |
Definition at line 499 of file vecmat.c.
References VECMAT_FLOOR, vector3::x, vector3::y, and vector3::z.
Converts a vector3 to a vector3i by rounding each component.
| v | Input vector. |
Definition at line 514 of file vecmat.c.
References VECMAT_ROUND, vector3::x, vector3::y, and vector3::z.
Builds a vector3i from a vector2i and z.
See vec3i_from_vec2i_ptr instead.
| v | Input vector. |
| z | Z component. |
Definition at line 483 of file vector3i.c.
References vec3i_from_vec2i_ptr().
Builds a vector3i from a vector2i and z.
| res | Output vector. |
| v | Input vector. |
| z | Z component. |
Definition at line 337 of file vector3i_ptr.c.
References vector2i::x, vector3i::x, vector2i::y, vector3i::y, and vector3i::z.
Referenced by vec3i_from_vec2i().
| bool vec3i_is_zero | ( | const vector3i | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 616 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
| vm_float_t vec3i_length | ( | const vector3i | v | ) |
Computes the length (magnitude) of a vector3i.
| v | The vector. |
Definition at line 333 of file vector3i.c.
References vec3i_dot(), and VECMAT_SQRT.
Referenced by vec3i_angle(), vec3i_distance(), and vec3i_normalize_ptr().
Returns the Chebyshev (L-inf) length.
| v | Input vector. |
Definition at line 566 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Returns the Manhattan (L1) length.
| v | Input vector. |
Definition at line 552 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 526 of file vector3i.c.
References vec3i_dot().
| vector3i vec3i_lerp | ( | const vector3i | a, |
| const vector3i | b, | ||
| const vm_float_t | t ) |
Linearly interpolates between two vector3i.
See vec3i_lerp_ptr for the out-parameter version.
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor [0, 1]. |
Definition at line 291 of file vector3i.c.
References vec3i_lerp_ptr().
| void vec3i_lerp_ptr | ( | vector3i * | res, |
| const vector3i * | a, | ||
| const vector3i * | b, | ||
| const vm_float_t | t ) |
Performs linear interpolation between two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the start vector. |
| b | Pointer to the end vector. |
| t | Interpolation factor (typically between 0.0 and 1.0). |
Definition at line 196 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_lerp().
Computes the component-wise maximum of two vector3i.
See vec3i_max_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 259 of file vector3i.c.
References vec3i_max_ptr().
Returns the largest component.
| v | Input vector. |
Definition at line 593 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Computes the component-wise maximum of two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 168 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_max().
Computes the component-wise minimum of two vector3i.
See vec3i_min_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 243 of file vector3i.c.
References vec3i_min_ptr().
Returns the smallest component.
| v | Input vector. |
Definition at line 581 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Computes the component-wise minimum of two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 154 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_min().
Component-wise floor modulo of a by b.
See vec3i_mod_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 422 of file vector3i.c.
References vec3i_mod_ptr().
Component-wise floor modulo of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 295 of file vector3i_ptr.c.
References vm_mod_floor3(), vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_mod().
Component-wise multiplication of two vectors.
See vec3i_mul_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 166 of file vector3i.c.
References vec3i_mul_ptr().
Computes the component-wise product (Hadamard) of two vector3i.
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 79 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_mul().
Component-wise multiplication of vector by scalar.
See vec3i_mul_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar. |
Definition at line 134 of file vector3i.c.
References vec3i_mul_scalar_ptr().
Scales a vector3i by an integer scalar.
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
| s | The scalar multiplier. |
Definition at line 43 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_mul_scalar().
Negation of a vector.
See vec3i_neg_ptr for the out-parameter version.
| v | The vector. |
Definition at line 181 of file vector3i.c.
References vec3i_neg_ptr().
Negates a vector3i (multiplies by -1).
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
Definition at line 92 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_neg().
Normalizes a vector3i to unit length.
See vec3i_normalize_ptr for the out-parameter version.
| v | The vector (non-zero). |
Definition at line 227 of file vector3i.c.
References vec3i_normalize_ptr().
Normalizes a vector3i to approximate unit length.
If the vector length is zero, copies the input vector.
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
Definition at line 120 of file vector3i_ptr.c.
References vec3i_length(), vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_normalize().
Converts to a unit-length vector3.
See vec3i_normalize_to_vec3_ptr instead.
| v | Input vector. |
Definition at line 513 of file vector3i.c.
References vec3i_normalize_to_vec3_ptr().
Converts to a unit-length vector3.
| res | Output vector. |
| v | Input vector. |
Definition at line 362 of file vector3i_ptr.c.
References vec3_normalize_ptr(), vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_normalize_to_vec3().
| vector3i vec3i_one | ( | void | ) |
Returns a vector3i with all components set to 1.
Definition at line 22 of file vector3i.c.
Computes the sign per component of a vector3i (-1, 0, or 1).
See vec3i_sign_ptr for the out-parameter version.
| v | The vector. |
Definition at line 274 of file vector3i.c.
References vec3i_sign_ptr().
Computes the sign of each component of a vector3i (-1, 0, or 1).
| res | Pointer to the vector that will store the result. |
| v | Pointer to the input vector. |
Definition at line 181 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_sign().
Returns a vector with every component set to s.
See vec3i_splat_ptr instead.
| s | Scalar value. |
Definition at line 469 of file vector3i.c.
Component-wise subtraction of two vectors.
See vec3i_sub_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 118 of file vector3i.c.
References vec3i_sub_ptr().
Referenced by vec3i_distance().
Computes the component-wise difference of two vector3i (a minus b).
| res | Pointer to the vector that will store the result. |
| a | Pointer to the first vector. |
| b | Pointer to the second vector. |
Definition at line 29 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_sub().
Subtracts a scalar from each component.
See vec3i_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 406 of file vector3i.c.
References vec3i_sub_scalar_ptr().
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 281 of file vector3i_ptr.c.
References vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_sub_scalar().
Returns the sum of all components.
| v | Input vector. |
Definition at line 605 of file vector3i.c.
References vector3i::x, vector3i::y, and vector3i::z.
Wraps each component of v into [0, period).
See vec3i_wrap_ptr instead.
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 454 of file vector3i.c.
References vec3i_wrap_ptr().
Wraps each component of v into [0, period).
| res | Output vector. |
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 323 of file vector3i_ptr.c.
References vm_mod_floor3(), vector3i::x, vector3i::y, and vector3i::z.
Referenced by vec3i_wrap().
Returns a vector3i along the x-axis.
| x | The x component value. |
Definition at line 33 of file vector3i.c.
Returns a vector3i for scaling along the x-axis.
| x | The x scale factor. |
Definition at line 66 of file vector3i.c.
Returns the x and y components as a 2D vector.
See vec3i_xy_ptr instead.
| v | Input vector. |
Definition at line 498 of file vector3i.c.
References vec3i_xy_ptr().
Returns the x and y components as a 2D vector.
| res | Output vector. |
| v | Input vector. |
Definition at line 350 of file vector3i_ptr.c.
References vector2i::x, vector3i::x, vector2i::y, and vector3i::y.
Referenced by vec3i_xy().
Returns a vector3i along the y-axis.
| y | The y component value. |
Definition at line 44 of file vector3i.c.
Returns a vector3i for scaling along the y-axis.
| y | The y scale factor. |
Definition at line 77 of file vector3i.c.
Returns a vector3i along the z-axis.
| z | The z component value. |
Definition at line 55 of file vector3i.c.
Returns a vector3i for scaling along the z-axis.
| z | The z scale factor. |
Definition at line 88 of file vector3i.c.
| vector3i vec3i_zero | ( | void | ) |
Returns a zero-initialized vector3i.
Definition at line 12 of file vector3i.c.
Computes the absolute value per component of a vector4.
See vec4_abs_ptr for the out-parameter version.
| v | The vector. |
Definition at line 218 of file vector4.c.
References vec4_abs_ptr().
Definition at line 492 of file vector4_ptr.c.
References vec4_abs_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_abs().
Component-wise addition of two vectors.
See vec4_add_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 124 of file vector4.c.
References vec4_add_ptr().
Definition at line 432 of file vector4_ptr.c.
References vec4_add_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_add().
| vector4 vec4_add_scalar | ( | const vector4 | v, |
| const vm_float_t | s ) |
Adds a scalar to each component.
See vec4_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 455 of file vector4.c.
References vec4_add_scalar_ptr().
| void vec4_add_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| vm_float_t | s ) |
Definition at line 562 of file vector4_ptr.c.
References vec4_add_scalar_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_add_scalar().
Applies ceil per component to a vector4.
See vec4_ceil_ptr for the out-parameter version.
| v | The vector. |
Definition at line 310 of file vector4.c.
References vec4_ceil_ptr().
Definition at line 622 of file vector4_ptr.c.
References vec4_ceil_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_ceil().
Clamps a vector4 between min and max per component.
See vec4_clamp_ptr for the out-parameter version.
| v | The vector. |
| min | Minimum bounds. |
| max | Maximum bounds. |
Definition at line 359 of file vector4.c.
References vec4_clamp_ptr().
Definition at line 542 of file vector4_ptr.c.
References vec4_clamp_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_clamp().
| vector4 vec4_clamp_scalar | ( | const vector4 | v, |
| const vm_float_t | min, | ||
| const vm_float_t | max ) |
Clamps each component to the scalar range [min, max].
See vec4_clamp_scalar_ptr instead.
| v | Input vector. |
| min | Lower bound. |
| max | Upper bound. |
Definition at line 488 of file vector4.c.
References vec4_clamp_scalar_ptr().
| void vec4_clamp_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| vm_float_t | min, | ||
| vm_float_t | max ) |
Definition at line 582 of file vector4_ptr.c.
References vec4_clamp_scalar_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_clamp_scalar().
| vm_float_t vec4_distance | ( | const vector4 | a, |
| const vector4 | b ) |
Computes the Euclidean distance between two vector4.
| a | First vector. |
| b | Second vector. |
Definition at line 411 of file vector4.c.
References vec4_length(), and vec4_sub().
| vm_float_t vec4_distance_squared | ( | const vector4 | a, |
| const vector4 | b ) |
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 604 of file vector4.c.
References vec4_length_squared(), and vec4_sub().
Divides two vectors component-wise.
See vec4_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 439 of file vector4.c.
References vec4_div_ptr().
Definition at line 552 of file vector4_ptr.c.
References vec4_div_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_div().
| vector4 vec4_div_scalar | ( | const vector4 | v, |
| const vm_float_t | s ) |
Component-wise division of vector by scalar.
See vec4_div_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar (non-zero). |
Definition at line 172 of file vector4.c.
References vec4_div_scalar_ptr().
| void vec4_div_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| vm_float_t | s ) |
Definition at line 472 of file vector4_ptr.c.
References vec4_div_scalar_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_div_scalar().
| vm_float_t vec4_dot | ( | const vector4 | a, |
| const vector4 | b ) |
Computes the dot product of two vector4.
| a | First vector. |
| b | Second vector. |
Definition at line 388 of file vector4.c.
References vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_length(), vec4_length_squared(), vec4_project_ptr(), and vec4_slide_ptr().
Returns true if two vectors are equal within VECMAT_EPSILON.
| a | First vector. |
| b | Second vector. |
Definition at line 64 of file vecmat.c.
References VECMAT_EPSILON, VECMAT_FABS, vector4::w, vector4::x, vector4::y, and vector4::z.
Applies the floor per component to a vector4.
See vec4_floor_ptr for the out-parameter version.
| v | The vector. |
Definition at line 295 of file vector4.c.
References vec4_floor_ptr().
Definition at line 612 of file vector4_ptr.c.
References vec4_floor_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_floor().
Returns the fractional part of each component.
See vec4_fract_ptr instead.
| v | Input vector. |
Definition at line 518 of file vector4.c.
References vec4_fract_ptr().
Definition at line 642 of file vector4_ptr.c.
References vec4_fract_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_fract().
Homogenizes a vector4 (divides x, y, z by w).
See vec4_homogenize_ptr for the out-parameter version.
| v | The homogeneous vector (w != 0.0f). |
Definition at line 374 of file vector4.c.
References vec4_homogenize_ptr().
Definition at line 652 of file vector4_ptr.c.
References vec4_homogenize_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_homogenize().
| bool vec4_is_normalized | ( | const vector4 | v | ) |
Returns true if the vector has unit length.
| v | Input vector. |
Definition at line 626 of file vector4.c.
References vec4_length_squared(), VECMAT_EPSILON, and VECMAT_FABS.
| bool vec4_is_zero | ( | const vector4 | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 615 of file vector4.c.
References vec4_length_squared(), and VECMAT_EPSILON.
| vm_float_t vec4_length | ( | const vector4 | v | ) |
Computes the length (magnitude) of a vector4.
| v | The vector. |
Definition at line 399 of file vector4.c.
References vec4_dot(), and VECMAT_SQRT.
Referenced by vec4_distance(), and vec4_normalize_ptr_scalar().
| vm_float_t vec4_length_squared | ( | const vector4 | v | ) |
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 592 of file vector4.c.
References vec4_dot().
Referenced by vec4_distance_squared(), vec4_is_normalized(), and vec4_is_zero().
| vector4 vec4_lerp | ( | const vector4 | a, |
| const vector4 | b, | ||
| const vm_float_t | t ) |
Linearly interpolates between two vector4.
See vec4_lerp_ptr for the out-parameter version.
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor [0, 1]. |
Definition at line 342 of file vector4.c.
References vec4_lerp_ptr().
| void vec4_lerp_ptr | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b, | ||
| vm_float_t | t ) |
Definition at line 532 of file vector4_ptr.c.
References vec4_lerp_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_lerp().
Computes the component-wise maximum of two vector4.
See vec4_max_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 265 of file vector4.c.
References vec4_max_ptr().
Definition at line 522 of file vector4_ptr.c.
References vec4_max_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_max().
Computes the component-wise minimum of two vector4.
See vec4_min_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 249 of file vector4.c.
References vec4_min_ptr().
Definition at line 512 of file vector4_ptr.c.
References vec4_min_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_min().
Component-wise multiplication of two vectors.
See vec4_mul_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 188 of file vector4.c.
References vec4_mul_ptr().
Definition at line 452 of file vector4_ptr.c.
References vec4_mul_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_mul().
| vector4 vec4_mul_scalar | ( | const vector4 | v, |
| const vm_float_t | s ) |
Component-wise multiplication of vector by scalar.
See vec4_mul_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar. |
Definition at line 156 of file vector4.c.
References vec4_mul_scalar_ptr().
| void vec4_mul_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| vm_float_t | s ) |
Definition at line 462 of file vector4_ptr.c.
References vec4_mul_scalar_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_mul_scalar().
| bool vec4_near | ( | const vector4 | a, |
| const vector4 | b, | ||
| const vm_float_t | eps ) |
Returns true if a and b are within eps of each other.
| a | First input vector. |
| b | Second input vector. |
| eps | Distance tolerance. |
Definition at line 639 of file vector4.c.
References VECMAT_FABS, vector4::w, vector4::x, vector4::y, and vector4::z.
Negation of a vector.
See vec4_neg_ptr for the out-parameter version.
| v | The vector. |
Definition at line 203 of file vector4.c.
References vec4_neg_ptr().
Definition at line 482 of file vector4_ptr.c.
References vec4_neg_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_neg().
Normalizes a vector4 to unit length.
See vec4_normalize_ptr for the out-parameter version.
| v | The vector (non-zero). |
Definition at line 233 of file vector4.c.
References vec4_normalize_ptr().
Definition at line 502 of file vector4_ptr.c.
References vec4_normalize_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_normalize().
| vector4 vec4_one | ( | void | ) |
Projects a onto b.
See vec4_project_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 534 of file vector4.c.
References vec4_project_ptr().
Projects a onto b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 385 of file vector4_ptr.c.
References vec4_dot(), vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_project(), and vec4_reject_ptr().
Returns the component of a orthogonal to b.
See vec4_reject_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 550 of file vector4.c.
References vec4_reject_ptr().
Returns the component of a orthogonal to b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 422 of file vector4_ptr.c.
References vec4_project_ptr(), vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_reject().
Applies round per component to a vector4.
See vec4_round_ptr for the out-parameter version.
| v | The vector. |
Definition at line 325 of file vector4.c.
References vec4_round_ptr().
Definition at line 632 of file vector4_ptr.c.
References vec4_round_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_round().
Clamps each component to the range [0, 1].
See vec4_saturate_ptr instead.
| v | Input vector. |
Definition at line 503 of file vector4.c.
References vec4_saturate_ptr().
Definition at line 592 of file vector4_ptr.c.
References vec4_saturate_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_saturate().
Computes the sign per component of a vector4 (-1, 0, or 1).
See vec4_sign_ptr for the out-parameter version.
| v | The vector. |
Definition at line 280 of file vector4.c.
References vec4_sign_ptr().
Definition at line 602 of file vector4_ptr.c.
References vec4_sign_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_sign().
Removes the component of v along normal.
See vec4_slide_ptr instead.
| v | Input vector. |
| normal | Surface normal. |
Definition at line 566 of file vector4.c.
References vec4_slide_ptr().
Removes the component of v along normal.
| res | Output vector. |
| v | Input vector. |
| normal | Surface normal. |
Definition at line 406 of file vector4_ptr.c.
References vec4_dot(), vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_slide().
| vector4 vec4_splat | ( | const vm_float_t | s | ) |
Component-wise subtraction of two vectors.
See vec4_sub_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 140 of file vector4.c.
References vec4_sub_ptr().
Referenced by vec4_distance(), and vec4_distance_squared().
Definition at line 442 of file vector4_ptr.c.
References vec4_sub_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_sub().
| vector4 vec4_sub_scalar | ( | const vector4 | v, |
| const vm_float_t | s ) |
Subtracts a scalar from each component.
See vec4_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 471 of file vector4.c.
References vec4_sub_scalar_ptr().
| void vec4_sub_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| vm_float_t | s ) |
Definition at line 572 of file vector4_ptr.c.
References vec4_sub_scalar_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_sub_scalar().
Copies the x, y, z components from a vector4 to a vector3.
Definition at line 285 of file vector4_ptr.c.
References vector3::x, vector4::x, vector3::y, vector4::y, vector3::z, and vector4::z.
Referenced by vec4_to_vec3().
| vector4 vec4_w_axis | ( | const vm_float_t | w | ) |
| vector4 vec4_w_scale | ( | const vm_float_t | w | ) |
| vector4 vec4_x_axis | ( | const vm_float_t | x | ) |
| vector4 vec4_x_scale | ( | const vm_float_t | x | ) |
| vector4 vec4_y_axis | ( | const vm_float_t | y | ) |
| vector4 vec4_y_scale | ( | const vm_float_t | y | ) |
| vector4 vec4_z_axis | ( | const vm_float_t | z | ) |
| vector4 vec4_z_scale | ( | const vm_float_t | z | ) |
| vector4 vec4_zero | ( | void | ) |
Computes the absolute value per component of a vector4i.
See vec4i_abs_ptr for the out-parameter version.
| v | The vector. |
Definition at line 217 of file vector4i.c.
References vec4i_abs_ptr().
Computes the absolute value of each component of a vector4i and stores the result in res.
| res | Pointer to result vector |
| v | Pointer to input vector |
Definition at line 116 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_abs().
Component-wise addition of two vectors.
See vec4i_add_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 123 of file vector4i.c.
References vec4i_add_ptr().
Adds the components of two vector4i and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
Definition at line 15 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_add().
Adds a scalar to each component.
See vec4i_add_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 395 of file vector4i.c.
References vec4i_add_scalar_ptr().
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 293 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_add_scalar().
Clamps each component of the input vector to the range defined by the minimum and maximum vectors.
See vec4i_clamp_ptr for the out-parameter version.
| v | The input vector. |
| min | The minimum value for each component. |
| max | The maximum value for each component. |
Definition at line 314 of file vector4i.c.
References vec4i_clamp_ptr().
| void vec4i_clamp_ptr | ( | vector4i * | res, |
| const vector4i * | v, | ||
| const vector4i * | min, | ||
| const vector4i * | max ) |
Clamps the components of a vector4i to the range [min, max] and stores the result in res.
| res | Pointer to result vector |
| v | Pointer to input vector |
| min | Pointer to minimum bounds vector |
| max | Pointer to maximum bounds vector |
Definition at line 222 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_clamp().
| vm_float_t vec4i_distance | ( | const vector4i | a, |
| const vector4i | b ) |
Computes the Euclidean distance between two vector4i.
| a | First vector. |
| b | Second vector. |
Definition at line 351 of file vector4i.c.
References vec4i_length(), and vec4i_sub().
Returns the squared Euclidean distance between a and b.
| a | First input vector. |
| b | Second input vector. |
Definition at line 497 of file vector4i.c.
References vec4i_length_squared(), and vec4i_sub().
Divides two vectors component-wise.
See vec4i_div_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 379 of file vector4i.c.
References vec4i_div_ptr().
Component-wise floored division of a by b.
See vec4i_div_floor_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 443 of file vector4i.c.
References vec4i_div_floor_ptr().
Component-wise floored division of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 338 of file vector4i_ptr.c.
References vm_div_floor4(), vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_div_floor().
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 278 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_div().
Component-wise division of vector by scalar.
See vec4i_div_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar (non-zero). |
Definition at line 171 of file vector4i.c.
References vec4i_div_scalar_ptr().
Divides the components of a vector4i by a scalar and stores the result in res.
If the scalar is zero, sets all components of res to zero.
| res | Pointer to result vector |
| v | Pointer to input vector |
| s | Scalar divisor |
Definition at line 65 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_div_scalar().
Computes the dot product of two vector4i.
| a | First vector. |
| b | Second vector. |
Definition at line 328 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_length(), and vec4i_length_squared().
Returns true if two vectors are exactly equal.
| a | First vector. |
| b | Second vector. |
Definition at line 103 of file vecmat.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
| bool vec4i_is_zero | ( | const vector4i | v | ) |
Returns true if every component is zero.
| v | Input vector. |
Definition at line 582 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
| vm_float_t vec4i_length | ( | const vector4i | v | ) |
Computes the length (magnitude) of a vector4i.
| v | The vector. |
Definition at line 339 of file vector4i.c.
References vec4i_dot(), and VECMAT_SQRT.
Referenced by vec4i_distance(), and vec4i_normalize_ptr().
Returns the Chebyshev (L-inf) length.
| v | Input vector. |
Definition at line 523 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Returns the Manhattan (L1) length.
| v | Input vector. |
Definition at line 508 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Returns the squared Euclidean length.
| v | Input vector. |
Definition at line 485 of file vector4i.c.
References vec4i_dot().
Referenced by vec4i_distance_squared().
| vector4i vec4i_lerp | ( | const vector4i | a, |
| const vector4i | b, | ||
| const vm_float_t | t ) |
Linearly interpolates between two vector4i.
See vec4i_lerp_ptr for the out-parameter version.
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor [0, 1]. |
Definition at line 296 of file vector4i.c.
References vec4i_lerp_ptr().
| void vec4i_lerp_ptr | ( | vector4i * | res, |
| const vector4i * | a, | ||
| const vector4i * | b, | ||
| const vm_float_t | t ) |
Linearly interpolates between two vector4i using an interpolation factor t (clamped to [0,1]) and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
| t | Interpolation factor |
Definition at line 203 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_lerp().
Computes the component-wise maximum of two vector4i.
See vec4i_max_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 264 of file vector4i.c.
References vec4i_max_ptr().
Returns the largest component.
| v | Input vector. |
Definition at line 556 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Computes the component-wise maximum of two vector4i and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
Definition at line 171 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_max().
Computes the component-wise minimum of two vector4i.
See vec4i_min_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 248 of file vector4i.c.
References vec4i_min_ptr().
Returns the smallest component.
| v | Input vector. |
Definition at line 541 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Takes the component-wise minimum of two vector4i and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
Definition at line 155 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_min().
Component-wise floor modulo of a by b.
See vec4i_mod_ptr instead.
| a | First input vector. |
| b | Second input vector. |
Definition at line 427 of file vector4i.c.
References vec4i_mod_ptr().
Component-wise floor modulo of a by b.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 323 of file vector4i_ptr.c.
References vm_mod_floor4(), vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_mod().
Component-wise multiplication of two vectors.
See vec4i_mul_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 187 of file vector4i.c.
References vec4i_mul_ptr().
Multiplies the components of two vector4i and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
Definition at line 87 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_mul().
Component-wise multiplication of vector by scalar.
See vec4i_mul_scalar_ptr for the out-parameter version.
| v | The vector. |
| s | The scalar. |
Definition at line 155 of file vector4i.c.
References vec4i_mul_scalar_ptr().
Multiplies the components of a vector4i by a scalar and stores the result in res.
| res | Pointer to result vector |
| v | Pointer to input vector |
| s | Scalar value |
Definition at line 47 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_mul_scalar().
Negation of a vector.
See vec4i_neg_ptr for the out-parameter version.
| v | The vector. |
Definition at line 202 of file vector4i.c.
References vec4i_neg_ptr().
Negates the components of a vector4i and stores the result in res.
| res | Pointer to result vector |
| v | Pointer to input vector |
Definition at line 101 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_neg().
Normalizes a vector4i to unit length.
See vec4i_normalize_ptr for the out-parameter version.
| v | The vector (non-zero). |
Definition at line 232 of file vector4i.c.
References vec4i_normalize_ptr().
Normalizes a vector4i by dividing its components by the vector length and stores the result in res.
If the length is zero, copies the input vector to res.
| res | Pointer to result vector |
| v | Pointer to input vector |
Definition at line 133 of file vector4i_ptr.c.
References vec4i_length(), vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_normalize().
| vector4i vec4i_one | ( | void | ) |
Returns a vector4i with all components set to 1.
Definition at line 22 of file vector4i.c.
Computes the sign per component of a vector4i (-1, 0, or 1).
See vec4i_sign_ptr for the out-parameter version.
| v | The vector. |
Definition at line 279 of file vector4i.c.
References vec4i_sign_ptr().
Computes the sign (-1, 0, or 1) of each component of a vector4i and stores the result in res.
| res | Pointer to result vector |
| v | Pointer to input vector |
Definition at line 186 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_sign().
Returns a vector with every component set to s.
See vec4i_splat_ptr instead.
| s | Scalar value. |
Definition at line 474 of file vector4i.c.
Component-wise subtraction of two vectors.
See vec4i_sub_ptr for the out-parameter version.
| a | First vector. |
| b | Second vector. |
Definition at line 139 of file vector4i.c.
References vec4i_sub_ptr().
Referenced by vec4i_distance(), and vec4i_distance_squared().
Subtracts the components of the second vector from the first vector4i and stores the result in res.
| res | Pointer to result vector |
| a | Pointer to first vector |
| b | Pointer to second vector |
Definition at line 31 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_sub().
Subtracts a scalar from each component.
See vec4i_sub_scalar_ptr instead.
| v | Input vector. |
| s | Scalar value. |
Definition at line 411 of file vector4i.c.
References vec4i_sub_scalar_ptr().
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 308 of file vector4i_ptr.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_sub_scalar().
Returns the sum of all components.
| v | Input vector. |
Definition at line 571 of file vector4i.c.
References vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Converts a vector4i to a vector3i (discards the w component).
| v | The source vector4i. |
Definition at line 363 of file vector4i.c.
References vec4i_to_vec3i_ptr().
Copies the x, y, z components of a vector4i and stores the result in a vector3i.
Definition at line 237 of file vector4i_ptr.c.
References vector3i::x, vector4i::x, vector3i::y, vector4i::y, vector3i::z, and vector4i::z.
Referenced by vec4i_to_vec3i().
Returns a vector4i along the w-axis.
| w | The w component value. |
Definition at line 65 of file vector4i.c.
Returns a vector4i for scaling along the w-axis.
| w | The w scale factor. |
Definition at line 109 of file vector4i.c.
Wraps each component of v into [0, period).
See vec4i_wrap_ptr instead.
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 459 of file vector4i.c.
References vec4i_wrap_ptr().
Wraps each component of v into [0, period).
| res | Output vector. |
| v | Input vector. |
| period | Wrap period per component. |
Definition at line 353 of file vector4i_ptr.c.
References vm_mod_floor4(), vector4i::w, vector4i::x, vector4i::y, and vector4i::z.
Referenced by vec4i_wrap().
Returns a vector4i along the x-axis.
| x | The x component value. |
Definition at line 33 of file vector4i.c.
Returns a vector4i for scaling along the x-axis.
| x | The x scale factor. |
Definition at line 76 of file vector4i.c.
Returns a vector4i along the y-axis.
| y | The y component value. |
Definition at line 44 of file vector4i.c.
Returns a vector4i for scaling along the y-axis.
| y | The y scale factor. |
Definition at line 87 of file vector4i.c.
Returns a vector4i along the z-axis.
| z | The z component value. |
Definition at line 55 of file vector4i.c.
Returns a vector4i for scaling along the z-axis.
| z | The z scale factor. |
Definition at line 98 of file vector4i.c.
| vector4i vec4i_zero | ( | void | ) |
Returns a zero-initialized vector4i.
Definition at line 12 of file vector4i.c.
| vm_cpu_features_t vm_cpu_compiled_features | ( | void | ) |
Definition at line 130 of file cpu.c.
References VM_CPU_AVX, VM_CPU_AVX2, VM_CPU_AVX512, VM_CPU_SCALAR, VM_CPU_SVE, and VM_CPU_SVE2.
Referenced by vm_cpu_selected_features().
| void vm_cpu_init | ( | void | ) |
Definition at line 77 of file dispatch.c.
References dispatch_ready, vm_cpu_bind(), and vm_cpu_selected_features().
Referenced by mat4_mul_ptr(), mat4_mul_vec3_ptr(), mat4_mul_vec4_ptr(), mat4_transpose_ptr(), quat_mul_ptr(), quat_normalize_ptr(), vec4_abs_ptr(), vec4_add_ptr(), vec4_add_scalar_ptr(), vec4_ceil_ptr(), vec4_clamp_ptr(), vec4_clamp_scalar_ptr(), vec4_div_ptr(), vec4_div_scalar_ptr(), vec4_floor_ptr(), vec4_fract_ptr(), vec4_homogenize_ptr(), vec4_lerp_ptr(), vec4_max_ptr(), vec4_min_ptr(), vec4_mul_ptr(), vec4_mul_scalar_ptr(), vec4_neg_ptr(), vec4_normalize_ptr(), vec4_round_ptr(), vec4_saturate_ptr(), vec4_sign_ptr(), vec4_sub_ptr(), and vec4_sub_scalar_ptr().
| const char * vm_cpu_name | ( | vm_cpu_features_t | features | ) |
Definition at line 193 of file cpu.c.
References VM_CPU_AVX, VM_CPU_AVX2, VM_CPU_AVX512, VM_CPU_SCALAR, VM_CPU_SVE, and VM_CPU_SVE2.
| vm_cpu_features_t vm_cpu_runtime_features | ( | void | ) |
Definition at line 151 of file cpu.c.
References runtime_cache, runtime_cached, VM_CPU_AVX, VM_CPU_AVX2, VM_CPU_AVX512, vm_cpu_probe_sve(), vm_cpu_probe_sve2(), VM_CPU_SCALAR, VM_CPU_SVE, and VM_CPU_SVE2.
Referenced by vm_cpu_selected_features().
| vm_cpu_features_t vm_cpu_selected_features | ( | void | ) |
Definition at line 175 of file cpu.c.
References VM_CPU_AVX, VM_CPU_AVX2, VM_CPU_AVX512, vm_cpu_compiled_features(), vm_cpu_runtime_features(), VM_CPU_SCALAR, VM_CPU_SVE, and VM_CPU_SVE2.
Referenced by vm_cpu_init().
|
static |
Definition at line 85 of file vecmat.h.
Referenced by deg_to_rad().
|
static |
|
static |
|
static |
Definition at line 86 of file vecmat.h.
Referenced by quat_to_euler_ptr(), and rad_to_deg().
|
static |