mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8784ffe8a | ||
|
|
cf8dc82783 | ||
|
|
9af0ebd142 | ||
|
|
82a195f26a |
@@ -7,7 +7,7 @@
|
|||||||
#*****************************************************************************
|
#*****************************************************************************
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_INIT([cglm], [0.6.1], [info@recp.me])
|
AC_INIT([cglm], [0.6.2], [info@recp.me])
|
||||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects serial-tests])
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects serial-tests])
|
||||||
|
|
||||||
# Don't use the default cflags (-O2 -g), we set ours manually in Makefile.am.
|
# Don't use the default cflags (-O2 -g), we set ours manually in Makefile.am.
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ author = u'Recep Aslantas'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = u'0.6.1'
|
version = u'0.6.2'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = u'0.6.1'
|
release = u'0.6.2'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ CGLM_INLINE
|
|||||||
vec3s
|
vec3s
|
||||||
glms_quat_imagn(versors q) {
|
glms_quat_imagn(versors q) {
|
||||||
vec3s dest;
|
vec3s dest;
|
||||||
glm_normalize_to(q.imag.raw, dest.raw);
|
glm_normalize_to(q.raw, dest.raw);
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,22 +18,26 @@
|
|||||||
* compatible, cglm doesn't use the anonymous structs internally.
|
* compatible, cglm doesn't use the anonymous structs internally.
|
||||||
*/
|
*/
|
||||||
#ifndef CGLM_USE_ANONYMOUS_STRUCT
|
#ifndef CGLM_USE_ANONYMOUS_STRUCT
|
||||||
/* If the user doesn't explicitly specify if they want anonymous structs or
|
/* If the user doesn't explicitly specify if they want anonymous structs or
|
||||||
* not, then we'll try to intuit an appropriate choice. */
|
* not, then we'll try to intuit an appropriate choice. */
|
||||||
# if defined(CGLM_NO_ANONYMOUS_STRUCT)
|
# if defined(CGLM_NO_ANONYMOUS_STRUCT)
|
||||||
/* The user has defined CGLM_NO_ANONYMOUS_STRUCT. This used to be the
|
/* The user has defined CGLM_NO_ANONYMOUS_STRUCT. This used to be the
|
||||||
* only #define governing the use of anonymous structs, so for backward
|
* only #define governing the use of anonymous structs, so for backward
|
||||||
* compatibility, we still honor that choice and disable them. */
|
* compatibility, we still honor that choice and disable them. */
|
||||||
# define CGLM_USE_ANONYMOUS_STRUCT 0
|
# define CGLM_USE_ANONYMOUS_STRUCT 0
|
||||||
# elif __STDC_VERSION__ >= 20112L || defined(_MSVC_VER)
|
# elif __STDC_VERSION__ >= 20112L || defined(_MSVC_VER)
|
||||||
/* We're compiling for C11 or this is the MSVC compiler. In either
|
/* We're compiling for C11 or this is the MSVC compiler. In either
|
||||||
* case, anonymous structs are available, so use them. */
|
* case, anonymous structs are available, so use them. */
|
||||||
# define CGLM_USE_ANONYMOUS_STRUCT 1
|
# define CGLM_USE_ANONYMOUS_STRUCT 1
|
||||||
# else
|
# elif defined(_MSC_VER) && (_MSC_VER >= 1900) /* Visual Studio 2015 */
|
||||||
/* Otherwise, we're presumably building for C99 or C89 and can't rely
|
/* We can support anonymous structs
|
||||||
* on anonymous structs being available. Turn them off. */
|
* since Visual Studio 2015 or 2017 (1910) maybe? */
|
||||||
# define CGLM_USE_ANONYMOUS_STRUCT 0
|
# define CGLM_USE_ANONYMOUS_STRUCT 1
|
||||||
# endif
|
# else
|
||||||
|
/* Otherwise, we're presumably building for C99 or C89 and can't rely
|
||||||
|
* on anonymous structs being available. Turn them off. */
|
||||||
|
# define CGLM_USE_ANONYMOUS_STRUCT 0
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef union vec2s {
|
typedef union vec2s {
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
|
|
||||||
#define CGLM_VERSION_MAJOR 0
|
#define CGLM_VERSION_MAJOR 0
|
||||||
#define CGLM_VERSION_MINOR 6
|
#define CGLM_VERSION_MINOR 6
|
||||||
#define CGLM_VERSION_PATCH 1
|
#define CGLM_VERSION_PATCH 2
|
||||||
|
|
||||||
#endif /* cglm_version_h */
|
#endif /* cglm_version_h */
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ main(int argc, const char * argv[]) {
|
|||||||
|
|
||||||
fprintf(stderr, CYAN "\nWelcome to cglm tests\n\n" RESET);
|
fprintf(stderr, CYAN "\nWelcome to cglm tests\n\n" RESET);
|
||||||
|
|
||||||
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
int32_t len;
|
int32_t len;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
void
|
void
|
||||||
test_rand_mat4(mat4 dest) {
|
test_rand_mat4(mat4 dest) {
|
||||||
glm_mat4_copy(GLM_MAT4_IDENTITY, dest);
|
glm_mat4_copy(GLM_MAT4_IDENTITY, dest);
|
||||||
|
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
|
|
||||||
/* random position */
|
/* random position */
|
||||||
dest[3][0] = drand48();
|
dest[3][0] = drand48();
|
||||||
@@ -28,8 +26,6 @@ void
|
|||||||
test_rand_mat3(mat3 dest) {
|
test_rand_mat3(mat3 dest) {
|
||||||
mat4 m4;
|
mat4 m4;
|
||||||
|
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
|
|
||||||
/* random rotatation around random axis with random angle */
|
/* random rotatation around random axis with random angle */
|
||||||
glm_rotate_make(m4, drand48(), (vec3){drand48(), drand48(), drand48()});
|
glm_rotate_make(m4, drand48(), (vec3){drand48(), drand48(), drand48()});
|
||||||
glm_mat4_pick3(m4, dest);
|
glm_mat4_pick3(m4, dest);
|
||||||
@@ -37,8 +33,6 @@ test_rand_mat3(mat3 dest) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
test_rand_vec3(vec3 dest) {
|
test_rand_vec3(vec3 dest) {
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
|
|
||||||
dest[0] = drand48();
|
dest[0] = drand48();
|
||||||
dest[1] = drand48();
|
dest[1] = drand48();
|
||||||
dest[2] = drand48();
|
dest[2] = drand48();
|
||||||
@@ -53,8 +47,6 @@ test_rand_vec3s() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
test_rand_vec4(vec4 dest) {
|
test_rand_vec4(vec4 dest) {
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
|
|
||||||
dest[0] = drand48();
|
dest[0] = drand48();
|
||||||
dest[1] = drand48();
|
dest[1] = drand48();
|
||||||
dest[2] = drand48();
|
dest[2] = drand48();
|
||||||
@@ -70,14 +62,11 @@ test_rand_vec4s() {
|
|||||||
|
|
||||||
float
|
float
|
||||||
test_rand(void) {
|
test_rand(void) {
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
return drand48();
|
return drand48();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
test_rand_quat(versor q) {
|
test_rand_quat(versor q) {
|
||||||
srand((unsigned int)time(NULL));
|
|
||||||
|
|
||||||
glm_quat(q, drand48(), drand48(), drand48(), drand48());
|
glm_quat(q, drand48(), drand48(), drand48(), drand48());
|
||||||
glm_quat_normalize(q);
|
glm_quat_normalize(q);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
<ClCompile Include="..\test\src\test_mat4.c" />
|
<ClCompile Include="..\test\src\test_mat4.c" />
|
||||||
<ClCompile Include="..\test\src\test_project.c" />
|
<ClCompile Include="..\test\src\test_project.c" />
|
||||||
<ClCompile Include="..\test\src\test_quat.c" />
|
<ClCompile Include="..\test\src\test_quat.c" />
|
||||||
|
<ClCompile Include="..\test\src\test_struct.c" />
|
||||||
<ClCompile Include="..\test\src\test_vec3.c" />
|
<ClCompile Include="..\test\src\test_vec3.c" />
|
||||||
<ClCompile Include="..\test\src\test_vec4.c" />
|
<ClCompile Include="..\test\src\test_vec4.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
<ClCompile Include="..\test\src\test_vec4.c">
|
<ClCompile Include="..\test\src\test_vec4.c">
|
||||||
<Filter>src</Filter>
|
<Filter>src</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\test\src\test_struct.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\test\tests.h">
|
<ClInclude Include="..\test\tests.h">
|
||||||
|
|||||||
Reference in New Issue
Block a user