|
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 | |
| vm_float_t | deg_to_rad (const vm_float_t degrees) |
| Converts degrees to radians. | |
| vm_float_t | rad_to_deg (const vm_float_t radians) |
| Converts radians to degrees. | |
| bool | vec2_eq (const vector2 a, const vector2 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec3_eq (const vector3 a, const vector3 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec4_eq (const vector4 a, const vector4 b) |
| Returns true if two vectors are equal within VECMAT_EPSILON. | |
| bool | vec2i_eq (const vector2i a, const vector2i b) |
| Returns true if two vectors are exactly equal. | |
| bool | vec3i_eq (const vector3i a, const vector3i b) |
| Returns true if two vectors are exactly equal. | |
| bool | vec4i_eq (const vector4i a, const vector4i b) |
| Returns true if two vectors are exactly equal. | |
| bool | mat2_eq (const matrix2 a, const matrix2 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat3_eq (const matrix3 a, const matrix3 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat4_eq (const matrix4 a, const matrix4 b) |
| Returns true if two matrices are equal within VECMAT_EPSILON. | |
| bool | mat2i_eq (const matrix2i a, const matrix2i b) |
| Returns true if two matrices are exactly equal. | |
| bool | mat3i_eq (const matrix3i a, const matrix3i b) |
| Returns true if two matrices are exactly equal. | |
| bool | mat4i_eq (const matrix4i a, const matrix4i b) |
| Returns true if two matrices are exactly equal. | |
| bool | quat_eq (const quaternion a, const quaternion b) |
| Returns true if two quaternions are equal within VECMAT_EPSILON. | |
| vector2 | vec2 (const vm_float_t x, const 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, const vm_float_t x, const 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. | |
| vector2 | vec2_from (const vector2i *v) |
| Converts a vector2i to a vector2. | |
| vector2i | vec2i (const vm_int_t x, const 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, const vm_int_t x, const 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. | |
| 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 (const vm_float_t x, const vm_float_t y, const 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, const vm_float_t x, const vm_float_t y, const 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. | |
| vector3 | vec3_from (const vector3i *v) |
| Converts a vector3i to a vector3. | |
| vector3i | vec3i (const vm_int_t x, const vm_int_t y, const 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, const vm_int_t x, const vm_int_t y, const 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. | |
| 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 | ( | 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().
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.
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.
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.
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.
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.
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.
| 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.
| 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().
| vector2 vec2 | ( | const vm_float_t | x, |
| const vm_float_t | y ) |
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.
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.
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.
Converts a vector2i to a vector2.
| v | Input integer vector. |
Definition at line 268 of file vecmat.c.
References vector2i::x, and vector2i::y.
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.
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.
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.
| vector3 vec3 | ( | const vm_float_t | x, |
| const vm_float_t | y, | ||
| const vm_float_t | z ) |
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.
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.
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.
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.
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.
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.
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.
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.
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.