|
Vecmat 0.2.3
C math and linear algebra library for 2D/3D graphics, physics, and science.
|
Go to the source code of this file.
Functions | |
| VECMAT_SCALAR_API void | vec4_add_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Performs component-wise addition of two vector4. | |
| VECMAT_SCALAR_API void | vec4_sub_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Performs component-wise subtraction of two vector4. | |
| VECMAT_SCALAR_API void | vec4_mul_scalar_ptr_scalar (vector4 *res, const vector4 *v, const vm_float_t s) |
| Performs component-wise multiplication of a vector4 by a scalar. | |
| VECMAT_SCALAR_API void | vec4_div_scalar_ptr_scalar (vector4 *res, const vector4 *v, const vm_float_t s) |
| Performs component-wise division of a vector4 by a scalar. | |
| VECMAT_SCALAR_API void | vec4_mul_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Performs component-wise multiplication of two vector4. | |
| VECMAT_SCALAR_API void | vec4_neg_ptr_scalar (vector4 *res, const vector4 *v) |
| Performs component-wise negation of a vector4. | |
| VECMAT_SCALAR_API void | vec4_abs_ptr_scalar (vector4 *res, const vector4 *v) |
| Performs component-wise absolute value on a vector4. | |
| VECMAT_SCALAR_API void | vec4_normalize_ptr_scalar (vector4 *res, const vector4 *v) |
| Normalizes a vector4 by scaling its components to unit length. | |
| VECMAT_SCALAR_API void | vec4_min_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Performs component-wise minimum of two vector4. | |
| VECMAT_SCALAR_API void | vec4_max_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Performs component-wise maximum of two vector4. | |
| VECMAT_SCALAR_API void | vec4_sign_ptr_scalar (vector4 *res, const vector4 *v) |
| Computes the component-wise sign of a vector4. | |
| VECMAT_SCALAR_API void | vec4_floor_ptr_scalar (vector4 *res, const vector4 *v) |
| Performs component-wise floor operation on a vector4. | |
| VECMAT_SCALAR_API void | vec4_ceil_ptr_scalar (vector4 *res, const vector4 *v) |
| Performs component-wise ceiling of a vector4. | |
| VECMAT_SCALAR_API void | vec4_round_ptr_scalar (vector4 *res, const vector4 *v) |
| Performs component-wise rounding of a vector4 to the nearest integer. | |
| VECMAT_SCALAR_API void | vec4_lerp_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b, const vm_float_t t) |
| Performs linear interpolation between two vector4 with interpolation factor t. | |
| VECMAT_SCALAR_API void | vec4_clamp_ptr_scalar (vector4 *res, const vector4 *v, const vector4 *min, const vector4 *max) |
| Performs component-wise clamping of a vector4 to the specified min and max bounds. | |
| VECMAT_SCALAR_API void | vec4_homogenize_ptr_scalar (vector4 *res, const vector4 *v) |
| Homogenizes a vector4 by dividing its x, y, z components by w. | |
| void | vec4_to_vec3_ptr (vector3 *res, const vector4 *v) |
| Copies the x, y, z components from a vector4 to a vector3. | |
| VECMAT_SCALAR_API void | vec4_div_ptr_scalar (vector4 *res, const vector4 *a, const vector4 *b) |
| Divides two vectors component-wise. | |
| VECMAT_SCALAR_API void | vec4_add_scalar_ptr_scalar (vector4 *res, const vector4 *v, const vm_float_t s) |
| Adds a scalar to each component. | |
| VECMAT_SCALAR_API void | vec4_sub_scalar_ptr_scalar (vector4 *res, const vector4 *v, const vm_float_t s) |
| Subtracts a scalar from each component. | |
| VECMAT_SCALAR_API void | vec4_clamp_scalar_ptr_scalar (vector4 *res, const vector4 *v, const vm_float_t min, const vm_float_t max) |
| Clamps each component to the scalar range [min, max]. | |
| VECMAT_SCALAR_API void | vec4_saturate_ptr_scalar (vector4 *res, const vector4 *v) |
| Clamps each component to the range [0, 1]. | |
| VECMAT_SCALAR_API void | vec4_fract_ptr_scalar (vector4 *res, const vector4 *v) |
| Returns the fractional part of each component. | |
| void | vec4_project_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| Projects a onto b. | |
| void | vec4_slide_ptr (vector4 *res, const vector4 *v, const vector4 *normal) |
| Removes the component of v along normal. | |
| void | vec4_reject_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| Returns the component of a orthogonal to b. | |
| 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_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_mul_scalar_ptr (vector4 *res, const vector4 *v, const vm_float_t s) |
| void | vec4_div_scalar_ptr (vector4 *res, const vector4 *v, const vm_float_t s) |
| 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_lerp_ptr (vector4 *res, const vector4 *a, const vector4 *b, const vm_float_t t) |
| void | vec4_clamp_ptr (vector4 *res, const vector4 *v, const vector4 *min, const vector4 *max) |
| void | vec4_div_ptr (vector4 *res, const vector4 *a, const vector4 *b) |
| void | vec4_add_scalar_ptr (vector4 *res, const vector4 *v, const vm_float_t s) |
| void | vec4_sub_scalar_ptr (vector4 *res, const vector4 *v, const vm_float_t s) |
| void | vec4_clamp_scalar_ptr (vector4 *res, const vector4 *v, const vm_float_t min, const vm_float_t max) |
| void | vec4_saturate_ptr (vector4 *res, const vector4 *v) |
| 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_fract_ptr (vector4 *res, const vector4 *v) |
| void | vec4_homogenize_ptr (vector4 *res, const vector4 *v) |
Definition at line 492 of file vector4_ptr.c.
References vec4_abs_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_abs().
| VECMAT_SCALAR_API void vec4_abs_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Performs component-wise absolute value on a vector4.
Definition at line 109 of file vector4_ptr.c.
References VECMAT_FABS, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_abs_ptr().
Definition at line 432 of file vector4_ptr.c.
References vec4_add_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_add().
| VECMAT_SCALAR_API void vec4_add_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Performs component-wise addition of two vector4.
Definition at line 15 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_add_ptr().
| void vec4_add_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_add_scalar_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vm_float_t | s ) |
Adds a scalar to each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 314 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_add_scalar_ptr().
Definition at line 622 of file vector4_ptr.c.
References vec4_ceil_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_ceil().
| VECMAT_SCALAR_API void vec4_ceil_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Performs component-wise ceiling of a vector4.
Definition at line 201 of file vector4_ptr.c.
References VECMAT_CEIL, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_ceil_ptr().
Definition at line 542 of file vector4_ptr.c.
References vec4_clamp_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_clamp().
| VECMAT_SCALAR_API void vec4_clamp_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vector4 * | min, | ||
| const vector4 * | max ) |
Performs component-wise clamping of a vector4 to the specified min and max bounds.
| res | Pointer to result vector4. |
| v | Pointer to input vector4. |
| min | Pointer to minimum bounds vector4. |
| max | Pointer to maximum bounds vector4. |
Definition at line 249 of file vector4_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_clamp_ptr().
| void vec4_clamp_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vm_float_t | min, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_clamp_scalar_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | 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 345 of file vector4_ptr.c.
References VECMAT_FMAX, VECMAT_FMIN, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_clamp_scalar_ptr(), and vec4_saturate_ptr_scalar().
Definition at line 552 of file vector4_ptr.c.
References vec4_div_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_div().
| VECMAT_SCALAR_API void vec4_div_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Divides two vectors component-wise.
| res | Output vector. |
| a | First input vector. |
| b | Second input vector. |
Definition at line 299 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_div_ptr().
| void vec4_div_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_div_scalar_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vm_float_t | s ) |
Performs component-wise division of a vector4 by a scalar.
If the scalar is zero, sets the result vector to (0,0,0,0).
Definition at line 62 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_div_scalar_ptr().
Definition at line 612 of file vector4_ptr.c.
References vec4_floor_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_floor().
| VECMAT_SCALAR_API void vec4_floor_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Performs component-wise floor operation on a vector4.
Definition at line 187 of file vector4_ptr.c.
References VECMAT_FLOOR, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_floor_ptr().
Definition at line 642 of file vector4_ptr.c.
References vec4_fract_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_fract().
| VECMAT_SCALAR_API void vec4_fract_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Returns the fractional part of each component.
| res | Output vector. |
| v | Input vector. |
Definition at line 370 of file vector4_ptr.c.
References VECMAT_FLOOR, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_fract_ptr().
Definition at line 652 of file vector4_ptr.c.
References vec4_homogenize_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_homogenize().
| VECMAT_SCALAR_API void vec4_homogenize_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Homogenizes a vector4 by dividing its x, y, z components by w.
If |w| > VECMAT_EPSILON and setting w to 1.0f. Otherwise, sets all components of the result to 0.0f.
Definition at line 266 of file vector4_ptr.c.
References VECMAT_EPSILON, VECMAT_FABS, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_homogenize_ptr().
| void vec4_lerp_ptr | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_lerp_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b, | ||
| const vm_float_t | t ) |
Performs linear interpolation between two vector4 with interpolation factor t.
| res | Pointer to result vector4. |
| a | Pointer to first vector4. |
| b | Pointer to second vector4. |
| t | Interpolation factor. |
Definition at line 232 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_lerp_ptr().
Definition at line 522 of file vector4_ptr.c.
References vec4_max_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_max().
| VECMAT_SCALAR_API void vec4_max_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Performs component-wise maximum of two vector4.
Definition at line 159 of file vector4_ptr.c.
References VECMAT_FMAX, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_max_ptr().
Definition at line 512 of file vector4_ptr.c.
References vec4_min_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_min().
| VECMAT_SCALAR_API void vec4_min_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Performs component-wise minimum of two vector4.
Definition at line 144 of file vector4_ptr.c.
References VECMAT_FMIN, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_min_ptr().
Definition at line 452 of file vector4_ptr.c.
References vec4_mul_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_mul().
| VECMAT_SCALAR_API void vec4_mul_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Performs component-wise multiplication of two vector4.
Definition at line 81 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_mul_ptr().
| void vec4_mul_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_mul_scalar_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vm_float_t | s ) |
Performs component-wise multiplication of a vector4 by a scalar.
Definition at line 45 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_mul_scalar_ptr().
Definition at line 482 of file vector4_ptr.c.
References vec4_neg_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_neg().
| VECMAT_SCALAR_API void vec4_neg_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Performs component-wise negation of a vector4.
Definition at line 95 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_neg_ptr().
Definition at line 502 of file vector4_ptr.c.
References vec4_normalize_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_normalize().
| VECMAT_SCALAR_API void vec4_normalize_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Normalizes a vector4 by scaling its components to unit length.
Definition at line 123 of file vector4_ptr.c.
References vec4_length(), VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_normalize_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.
| 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().
Definition at line 632 of file vector4_ptr.c.
References vec4_round_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_round().
| VECMAT_SCALAR_API void vec4_round_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Performs component-wise rounding of a vector4 to the nearest integer.
Definition at line 215 of file vector4_ptr.c.
References VECMAT_ROUND, VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_round_ptr().
Definition at line 592 of file vector4_ptr.c.
References vec4_saturate_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_saturate().
| VECMAT_SCALAR_API void vec4_saturate_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Clamps each component to the range [0, 1].
| res | Output vector. |
| v | Input vector. |
Definition at line 359 of file vector4_ptr.c.
References vec4_clamp_scalar_ptr_scalar(), and VECMAT_SCALAR_API.
Referenced by vec4_saturate_ptr().
Definition at line 602 of file vector4_ptr.c.
References vec4_sign_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_sign().
| VECMAT_SCALAR_API void vec4_sign_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v ) |
Computes the component-wise sign of a vector4.
Definition at line 173 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_sign_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().
Definition at line 442 of file vector4_ptr.c.
References vec4_sub_ptr_scalar(), and vm_cpu_init().
Referenced by vec4_sub().
| VECMAT_SCALAR_API void vec4_sub_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | a, | ||
| const vector4 * | b ) |
Performs component-wise subtraction of two vector4.
Definition at line 30 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_sub_ptr().
| void vec4_sub_scalar_ptr | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const 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().
| VECMAT_SCALAR_API void vec4_sub_scalar_ptr_scalar | ( | vector4 * | res, |
| const vector4 * | v, | ||
| const vm_float_t | s ) |
Subtracts a scalar from each component.
| res | Output vector. |
| v | Input vector. |
| s | Scalar value. |
Definition at line 329 of file vector4_ptr.c.
References VECMAT_SCALAR_API, vector4::w, vector4::x, vector4::y, and vector4::z.
Referenced by vec4_sub_scalar_ptr().
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().