|
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 | |
| 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, const 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, const 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, 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. | |
| 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_to_vec3i_ptr (vector3i *res, const vector4i *v) |
| Copies the x, y, z components of a vector4i and stores the result in a vector3i. | |
| static vm_int_t | vm_div_floor4 (const vm_int_t a, const vm_int_t b) |
| static vm_int_t | vm_mod_floor4 (const vm_int_t a, const vm_int_t b) |
| 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, const vm_int_t s) |
| Adds a scalar to each component. | |
| void | vec4i_sub_scalar_ptr (vector4i *res, const vector4i *v, const 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). | |
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().
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.
| 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().
| 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().
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().
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().
| 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 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().
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.
| 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().
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().
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().
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 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().
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().
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.
| 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().
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().
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().
Definition at line 245 of file vector4i_ptr.c.
Referenced by vec4i_div_floor_ptr().
Definition at line 259 of file vector4i_ptr.c.
Referenced by vec4i_mod_ptr(), and vec4i_wrap_ptr().