re-organise files, remove cglm prefix from file to make them more clean

This commit is contained in:
Recep Aslantas
2017-07-11 18:05:10 +03:00
parent 3b159cdf02
commit 9d61668e04
49 changed files with 977 additions and 847 deletions

View File

@@ -0,0 +1,91 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_affine_h
#define cglmc_affine_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_translate_to(mat4 m, vec3 v, mat4 dest);
CGLM_EXPORT
void
glmc_translate(mat4 m, vec3 v);
CGLM_EXPORT
void
glmc_translate_x(mat4 m, float to);
CGLM_EXPORT
void
glmc_translate_y(mat4 m, float to);
CGLM_EXPORT
void
glmc_translate_z(mat4 m, float to);
CGLM_EXPORT
void
glmc_scale_to(mat4 m, vec3 v, mat4 dest);
CGLM_EXPORT
void
glmc_scale(mat4 m, vec3 v);
CGLM_EXPORT
void
glmc_scale1(mat4 m, float s);
CGLM_EXPORT
void
glmc_rotate_x(mat4 m, float rad, mat4 dest);
CGLM_EXPORT
void
glmc_rotate_y(mat4 m, float rad, mat4 dest);
CGLM_EXPORT
void
glmc_rotate_z(mat4 m, float rad, mat4 dest);
CGLM_EXPORT
void
glmc_rotate_ndc_make(mat4 m, float angle, vec3 axis_ndc);
CGLM_EXPORT
void
glmc_rotate_make(mat4 m, float angle, vec3 axis);
CGLM_EXPORT
void
glmc_rotate_ndc(mat4 m, float angle, vec3 axis_ndc);
CGLM_EXPORT
void
glmc_rotate(mat4 m, float angle, vec3 axis);
CGLM_EXPORT
void
glmc_decompose_scalev(mat4 m, vec3 s);
CGLM_EXPORT
void
glmc_decompose_rs(mat4 m, mat4 r, vec3 s);
CGLM_EXPORT
void
glmc_decompose(mat4 m, vec4 t, mat4 r, vec3 s);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_affine_h */

54
include/cglm/call/cam.h Normal file
View File

@@ -0,0 +1,54 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_cam_h
#define cglmc_cam_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_frustum(float left,
float right,
float bottom,
float top,
float nearVal,
float farVal,
mat4 dest);
CGLM_EXPORT
void
glmc_ortho(float left,
float right,
float bottom,
float top,
float nearVal,
float farVal,
mat4 dest);
CGLM_EXPORT
void
glmc_perspective(float fovy,
float aspect,
float nearVal,
float farVal,
mat4 dest);
CGLM_EXPORT
void
glmc_lookat(vec3 eye,
vec3 center,
vec3 up,
mat4 dest);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_cam_h */

51
include/cglm/call/euler.h Normal file
View File

@@ -0,0 +1,51 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_euler_h
#define cglmc_euler_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_euler_angles(mat4 m, vec3 dest);
CGLM_EXPORT
void
glmc_euler(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_zyx(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_zxy(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_xzy(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_yzx(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_yxz(vec3 angles, mat4 dest);
CGLM_EXPORT
void
glmc_euler_by_order(vec3 angles, glm_euler_sq axis, mat4 dest);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_euler_h */

44
include/cglm/call/io.h Normal file
View File

@@ -0,0 +1,44 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_io_h
#define cglmc_io_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_mat4_print(mat4 matrix,
FILE * __restrict ostream);
CGLM_EXPORT
void
glmc_mat3_print(mat3 matrix,
FILE * __restrict ostream);
CGLM_EXPORT
void
glmc_vec4_print(vec4 vec,
FILE * __restrict ostream);
CGLM_EXPORT
void
glmc_vec3_print(vec3 vec,
FILE * __restrict ostream);
CGLM_EXPORT
void
glmc_versor_print(versor vec,
FILE * __restrict ostream);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_io_h */

66
include/cglm/call/mat3.h Normal file
View File

@@ -0,0 +1,66 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_mat3_h
#define cglmc_mat3_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
/* DEPRECATED! use _copy, _ucopy versions */
#define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest)
CGLM_EXPORT
void
glmc_mat3_copy(mat3 mat, mat3 dest);
CGLM_EXPORT
void
glmc_mat3_identity(mat3 mat);
CGLM_EXPORT
void
glmc_mat3_mul(mat3 m1, mat3 m2, mat3 dest);
CGLM_EXPORT
void
glmc_mat3_transpose_to(mat3 m, mat3 dest);
CGLM_EXPORT
void
glmc_mat3_transpose(mat3 m);
CGLM_EXPORT
void
glmc_mat3_mulv(mat3 m, vec3 v, vec3 dest);
CGLM_EXPORT
void
glmc_mat3_scale(mat3 m, float s);
CGLM_EXPORT
float
glmc_mat3_det(mat3 mat);
CGLM_EXPORT
void
glmc_mat3_inv(mat3 mat, mat3 dest);
CGLM_EXPORT
void
glmc_mat3_swap_col(mat3 mat, int col1, int col2);
CGLM_EXPORT
void
glmc_mat3_swap_row(mat3 mat, int row1, int row2);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_mat3_h */

95
include/cglm/call/mat4.h Normal file
View File

@@ -0,0 +1,95 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_mat_h
#define cglmc_mat_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
/* DEPRECATED! use _copy, _ucopy versions */
#define glmc_mat4_udup(mat, dest) glmc_mat4_ucopy(mat, dest)
#define glmc_mat4_dup(mat, dest) glmc_mat4_copy(mat, dest)
CGLM_EXPORT
void
glmc_mat4_ucopy(mat4 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_copy(mat4 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_identity(mat4 mat);
CGLM_EXPORT
void
glmc_mat4_pick3(mat4 mat, mat3 dest);
CGLM_EXPORT
void
glmc_mat4_pick3t(mat4 mat, mat3 dest);
CGLM_EXPORT
void
glmc_mat4_ins3(mat3 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_mul(mat4 m1, mat4 m2, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_mulN(mat4 * __restrict matrices[], int len, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_mulv(mat4 m, vec4 v, vec4 dest);
CGLM_EXPORT
void
glmc_mat4_transpose_to(mat4 m, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_transpose(mat4 m);
CGLM_EXPORT
void
glmc_mat4_scale_p(mat4 m, float s);
CGLM_EXPORT
void
glmc_mat4_scale(mat4 m, float s);
CGLM_EXPORT
float
glmc_mat4_det(mat4 mat);
CGLM_EXPORT
void
glmc_mat4_inv(mat4 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_inv_precise(mat4 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_swap_col(mat4 mat, int col1, int col2);
CGLM_EXPORT
void
glmc_mat4_swap_row(mat4 mat, int row1, int row2);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_mat_h */

64
include/cglm/call/quat.h Normal file
View File

@@ -0,0 +1,64 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_quat_h
#define cglmc_quat_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_quat_identity(versor q);
CGLM_EXPORT
void
glmc_quat(versor q,
float angle,
float x,
float y,
float z);
CGLM_EXPORT
void
glmc_quatv(versor q,
float angle,
vec3 v);
CGLM_EXPORT
float
glmc_quat_norm(versor q);
CGLM_EXPORT
void
glmc_quat_normalize(versor q);
CGLM_EXPORT
float
glmc_quat_dot(versor q, versor r);
CGLM_EXPORT
void
glmc_quat_mulv(versor q1, versor q2, versor dest);
CGLM_EXPORT
void
glmc_quat_mat4(versor q, mat4 dest);
CGLM_EXPORT
void
glmc_quat_slerp(versor q,
versor r,
float t,
versor dest);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_quat_h */

94
include/cglm/call/vec3.h Normal file
View File

@@ -0,0 +1,94 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_vec3_h
#define cglmc_vec3_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
/* DEPRECATED! use _copy, _ucopy versions */
#define glmc_vec_dup(v, dest) glmc_vec_copy(v, dest)
CGLM_EXPORT
void
glmc_vec_copy(vec3 a, vec3 dest);
CGLM_EXPORT
float
glmc_vec_dot(vec3 a, vec3 b);
CGLM_EXPORT
void
glmc_vec_cross(vec3 a, vec3 b, vec3 d);
CGLM_EXPORT
float
glmc_vec_norm(vec3 vec);
CGLM_EXPORT
float
glmc_vec_norm2(vec3 vec);
CGLM_EXPORT
void
glmc_vec_normalize_to(vec3 vec, vec3 dest);
CGLM_EXPORT
void
glmc_vec_normalize(vec3 v);
CGLM_EXPORT
void
glmc_vec_add(vec3 v1, vec3 v2, vec3 dest);
CGLM_EXPORT
void
glmc_vec_sub(vec3 v1, vec3 v2, vec3 dest);
CGLM_EXPORT
void
glmc_vec_scale(vec3 v, float s, vec3 dest);
CGLM_EXPORT
void
glmc_vec_scale_as(vec3 v, float s, vec3 dest);
CGLM_EXPORT
void
glmc_vec_flipsign(vec3 v);
CGLM_EXPORT
float
glmc_vec_angle(vec3 v1, vec3 v2);
CGLM_EXPORT
void
glmc_vec_rotate(vec3 v, float angle, vec3 axis);
CGLM_EXPORT
void
glmc_vec_rotate_m4(mat4 m, vec3 v, vec3 dest);
CGLM_EXPORT
void
glmc_vec_proj(vec3 a, vec3 b, vec3 dest);
CGLM_EXPORT
void
glmc_vec_center(vec3 v1, vec3 v2, vec3 dest);
CGLM_EXPORT
float
glmc_vec_distance(vec3 v1, vec3 v2);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_vec3_h */

76
include/cglm/call/vec4.h Normal file
View File

@@ -0,0 +1,76 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_vec4_h
#define cglmc_vec4_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
/* DEPRECATED! use _copy, _ucopy versions */
#define glmc_vec4_dup3(v, dest) glmc_vec4_copy3(v, dest)
#define glmc_vec4_dup(v, dest) glmc_vec4_copy(v, dest)
CGLM_EXPORT
void
glmc_vec4_copy3(vec4 a, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_copy(vec4 v, vec4 dest);
CGLM_EXPORT
float
glmc_vec4_dot(vec4 a, vec4 b);
CGLM_EXPORT
float
glmc_vec4_norm(vec4 vec);
CGLM_EXPORT
float
glmc_vec4_norm2(vec4 vec);
CGLM_EXPORT
void
glmc_vec4_normalize_to(vec4 vec, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_normalize(vec4 v);
CGLM_EXPORT
void
glmc_vec4_add(vec4 v1, vec4 v2, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_sub(vec4 v1, vec4 v2, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_scale(vec4 v, float s, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_flipsign(vec4 v);
CGLM_EXPORT
float
glmc_vec4_distance(vec4 v1, vec4 v2);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_vec4_h */