Files
cglm/include/cglm/call/mat2.h
T
Daniel Pirch 44b6d7f332 add const to function parameters where possible
- Adds `const` qualifiers to read-only pointer and array parameters.
- Multi-dimentional array parameters use the `CGLM_CONST` macro instead,
  because for these `const` only works in C++ and C23 (with N2607).
- For `glm_mat4_mulN`, the matrices are not const-qualified although they
  are read-only, but changing the pointer type would require changing
  application code.
- Incorrect incorrect in/out in doc comments was fixed for
  `glm_ray_sphere`, `glm_swapf`, `glm_quat_rotate_at`.
2026-10-25 23:24:28 +01:00

84 lines
1.3 KiB
C

/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_mat2_h
#define cglmc_mat2_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../common.h"
CGLM_EXPORT
void
glmc_mat2_make(const float * __restrict src, mat2 dest);
CGLM_EXPORT
void
glmc_mat2_copy(CGLM_CONST mat2 mat, mat2 dest);
CGLM_EXPORT
void
glmc_mat2_identity(mat2 m);
CGLM_EXPORT
void
glmc_mat2_identity_array(mat2 * __restrict mats, size_t count);
CGLM_EXPORT
void
glmc_mat2_zero(mat2 m);
CGLM_EXPORT
void
glmc_mat2_mul(CGLM_CONST mat2 m1, CGLM_CONST mat2 m2, mat2 dest);
CGLM_EXPORT
void
glmc_mat2_mulv(CGLM_CONST mat2 m, const vec2 v, vec2 dest);
CGLM_EXPORT
void
glmc_mat2_transpose_to(CGLM_CONST mat2 mat, mat2 dest);
CGLM_EXPORT
void
glmc_mat2_transpose(mat2 m);
CGLM_EXPORT
void
glmc_mat2_scale(mat2 m, float s);
CGLM_EXPORT
void
glmc_mat2_inv(CGLM_CONST mat2 mat, mat2 dest);
CGLM_EXPORT
void
glmc_mat2_swap_col(mat2 mat, int col1, int col2);
CGLM_EXPORT
void
glmc_mat2_swap_row(mat2 mat, int row1, int row2);
CGLM_EXPORT
float
glmc_mat2_trace(CGLM_CONST mat2 m);
CGLM_EXPORT
float
glmc_mat2_det(CGLM_CONST mat2 m);
CGLM_EXPORT
float
glmc_mat2_rmc(const vec2 r, CGLM_CONST mat2 m, const vec2 c);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_mat2_h */