mirror of
https://github.com/recp/cglm.git
synced 2026-06-01 04:20:24 -05:00
Compare commits
4 Commits
83d5b2c973
...
46f46e5dcb
| Author | SHA1 | Date | |
|---|---|---|---|
| 46f46e5dcb | |||
| a97af506ce | |||
| 454f032310 | |||
| f0f05dadc5 |
@@ -15,5 +15,6 @@ It would be duplicate documentation also it
|
||||
would be hard to sync documentation between inline and call version for me.
|
||||
|
||||
By including **clgm/cglm.h** you include all inline versions. To get precompiled
|
||||
versions you need to include **cglm/call.h** header it also includes all
|
||||
call versions plus *clgm/cglm.h* (inline versions)
|
||||
versions you need to include **cglm/call.h** header. When using the
|
||||
precompiled versions, explicitly including **cglm/cglm.h** is still necessary
|
||||
for the inline versions to be included.
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "cglm.h"
|
||||
#include "call/vec2.h"
|
||||
#include "call/vec3.h"
|
||||
#include "call/vec4.h"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
/* DEPRECATED! use _diag */
|
||||
#define glmc_aabb2d_size(aabb) glmc_aabb2d_diag(aabb)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
float
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../../cglm.h"
|
||||
#include "../../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
float
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
float
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
/* DEPRECATED! use _copy, _ucopy versions */
|
||||
#define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
/* DEPRECATED! use _copy, _ucopy versions */
|
||||
#define glmc_mat4_udup(mat, dest) glmc_mat4_ucopy(mat, dest)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
float
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "../cglm.h"
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
bool
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
float
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
/* DEPRECATED! use _copy, _ucopy versions */
|
||||
#define glmc_vec_dup(v, dest) glmc_vec3_copy(v, dest)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../cglm.h"
|
||||
#include "../common.h"
|
||||
|
||||
/* DEPRECATED! use _copy, _ucopy versions */
|
||||
#define glmc_vec4_dup3(v, dest) glmc_vec4_copy3(v, dest)
|
||||
|
||||
@@ -83,25 +83,6 @@
|
||||
# include "clipspace/view_rh_no.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
* if you have axis order like vec3 orderVec = [0, 1, 2] or [0, 2, 1]...
|
||||
* vector then you can convert it to this enum by doing this:
|
||||
* @code
|
||||
* glm_euler_seq order;
|
||||
* order = orderVec[0] | orderVec[1] << 2 | orderVec[2] << 4;
|
||||
* @endcode
|
||||
* you may need to explicit cast if required
|
||||
*/
|
||||
typedef enum glm_euler_seq {
|
||||
GLM_EULER_XYZ = 0 << 0 | 1 << 2 | 2 << 4,
|
||||
GLM_EULER_XZY = 0 << 0 | 2 << 2 | 1 << 4,
|
||||
GLM_EULER_YZX = 1 << 0 | 2 << 2 | 0 << 4,
|
||||
GLM_EULER_YXZ = 1 << 0 | 0 << 2 | 2 << 4,
|
||||
GLM_EULER_ZXY = 2 << 0 | 0 << 2 | 1 << 4,
|
||||
GLM_EULER_ZYX = 2 << 0 | 1 << 2 | 0 << 4
|
||||
} glm_euler_seq;
|
||||
|
||||
CGLM_INLINE
|
||||
glm_euler_seq
|
||||
glm_euler_order(int ord[3]) {
|
||||
|
||||
@@ -91,6 +91,25 @@ typedef CGLM_ALIGN_MAT vec4 mat4[4];
|
||||
typedef vec2 mat4x2[4]; /* [col (4), row (2)] */
|
||||
typedef vec3 mat4x3[4]; /* [col (4), row (3)] */
|
||||
|
||||
|
||||
/*!
|
||||
* if you have axis order like vec3 orderVec = [0, 1, 2] or [0, 2, 1]...
|
||||
* vector then you can convert it to this enum by doing this:
|
||||
* @code
|
||||
* glm_euler_seq order;
|
||||
* order = orderVec[0] | orderVec[1] << 2 | orderVec[2] << 4;
|
||||
* @endcode
|
||||
* you may need to explicit cast if required
|
||||
*/
|
||||
typedef enum glm_euler_seq {
|
||||
GLM_EULER_XYZ = 0 << 0 | 1 << 2 | 2 << 4,
|
||||
GLM_EULER_XZY = 0 << 0 | 2 << 2 | 1 << 4,
|
||||
GLM_EULER_YZX = 1 << 0 | 2 << 2 | 0 << 4,
|
||||
GLM_EULER_YXZ = 1 << 0 | 0 << 2 | 2 << 4,
|
||||
GLM_EULER_ZXY = 2 << 0 | 0 << 2 | 1 << 4,
|
||||
GLM_EULER_ZYX = 2 << 0 | 1 << 2 | 0 << 4
|
||||
} glm_euler_seq;
|
||||
|
||||
/*
|
||||
Important: cglm stores quaternion as [x, y, z, w] in memory since v0.4.0
|
||||
it was [w, x, y, z] before v0.4.0 ( v0.3.5 and earlier ). w is real part.
|
||||
|
||||
Reference in New Issue
Block a user