pre-compiled version

This commit is contained in:
Recep Aslantas
2016-10-27 01:12:55 +03:00
parent f4e2cff63b
commit 75f5efe0bb
22 changed files with 1336 additions and 13 deletions

View File

@@ -0,0 +1,85 @@
/*
* 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
#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);
#endif /* cglmc_affine_h */

48
include/call/cglmc-cam.h Normal file
View File

@@ -0,0 +1,48 @@
/*
* 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
#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);
#endif /* cglmc_cam_h */

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef glmc_euler_h
#define glmc_euler_h
#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);
#endif /* glmc_euler_h */

38
include/call/cglmc-io.h Normal file
View File

@@ -0,0 +1,38 @@
/*
* 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
#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);
#endif /* cglmc_io_h */

81
include/call/cglmc-mat.h Normal file
View File

@@ -0,0 +1,81 @@
/*
* 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
#include "../cglm.h"
CGLM_EXPORT
void
glmc_mat4_udup(mat4 mat, mat4 dest);
CGLM_EXPORT
void
glmc_mat4_dup(mat4 mat, mat4 dest);
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);
#endif /* cglmc_mat_h */

53
include/call/cglmc-mat3.h Normal file
View File

@@ -0,0 +1,53 @@
/*
* 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
#include "../cglm.h"
CGLM_EXPORT
void
glmc_mat3_dup(mat3 mat, mat3 dest);
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);
#endif /* cglmc_mat3_h */

48
include/call/cglmc-quat.h Normal file
View File

@@ -0,0 +1,48 @@
/*
* 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
#include "../cglm.h"
CGLM_EXPORT
void
glmc_quat_init(versor q,
float angle,
float x,
float y,
float z);
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);
#endif /* cglmc_quat_h */

93
include/call/cglmc-vec.h Normal file
View File

@@ -0,0 +1,93 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglm_vec_h
#define cglm_vec_h
#include "../cglm.h"
CGLM_EXPORT
void
glmc_vec_dup(vec3 a, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_dup3(vec4 a, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_dup(vec4 v, vec4 dest);
CGLM_EXPORT
float
glmc_vec_dot(vec3 a, vec3 b);
CGLM_EXPORT
float
glmc_vec4_dot(vec4 a, vec4 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_vec4_norm(vec4 vec);
CGLM_EXPORT
void
glmc_vec_normalize_to(vec3 vec, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_normalize_to(vec4 vec, vec4 dest);
CGLM_EXPORT
void
glmc_vec_normalize(vec3 v);
CGLM_EXPORT
void
glmc_vec4_normalize(vec4 v);
CGLM_EXPORT
void
glmc_vec_add(vec3 v1, vec3 v2, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_add(vec4 v1, vec4 v2, vec4 dest);
CGLM_EXPORT
void
glmc_vec_sub(vec3 v1, vec3 v2, vec3 dest);
CGLM_EXPORT
void
glmc_vec4_sub(vec4 v1, vec4 v2, vec4 dest);
CGLM_EXPORT
void
glmc_vec_scale(vec3 v, float s, vec3 dest);
CGLM_EXPORT
void
glmc_vec_flipsign(vec3 v);
CGLM_EXPORT
void
glmc_vec4_flipsign(vec4 v);
CGLM_EXPORT
void
glmc_vec4_scale(vec4 v, float s, vec4 dest);
#endif /* cglm_vec_h */

21
include/cglm-call.h Normal file
View File

@@ -0,0 +1,21 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglm_call_h
#define cglm_call_h
#include "cglm.h"
#include "call/cglmc-vec.h"
#include "call/cglmc-mat.h"
#include "call/cglmc-mat3.h"
#include "call/cglmc-affine.h"
#include "call/cglmc-cam.h"
#include "call/cglmc-quat.h"
#include "call/cglmc-euler.h"
#include "call/cglmc-io.h"
#endif /* cglm_call_h */

View File

@@ -14,8 +14,14 @@
#include <math.h>
#if defined(_WIN32)
# ifdef CGLM_DLL
# define CGLM_EXPORT __declspec(dllexport)
# else
# define CGLM_EXPORT __declspec(dllimport)
# endif
# define CGLM_INLINE __forceinline
#else
# define CGLM_EXPORT __attribute__((visibility("default")))
# define CGLM_INLINE static inline __attribute((always_inline))
#endif