Compare commits

...

12 Commits

Author SHA1 Message Date
Recep Aslantas
6626d2b74f Update affine.h 2020-11-22 01:25:34 +03:00
Recep Aslantas
5bda762df6 use epsilon to compare results in glm_uniscaled() 2020-11-22 01:14:18 +03:00
Recep Aslantas
f9824a8dc6 test: use custom epsilon to compare 2020-11-22 00:59:48 +03:00
Recep Aslantas
ccd3058adc remove CGLM_USE_DEFAULT_EPSILON
* to override float epsilon we just need to define GLM_FLT_EPSILON
* CGLM_USE_DEFAULT_EPSILON was redundant, also it forces to override system default epsilon which may not be good idea, because not all systems may support smaller epsilon values
2020-11-22 00:38:57 +03:00
Recep Aslantas
4ab9ab4772 docs: fix/improve build documentation 2020-11-21 18:20:04 +03:00
Recep Aslantas
a5ff477fc8 doc: fix duplicate entry warning 2020-11-21 18:13:59 +03:00
Recep Aslantas
254570d006 Merge pull request #169 from podsvirov/docs-c-id-attribute-restrict
Fix Documentions WARNING for __restrict attribute
2020-11-21 18:11:28 +03:00
Konstantin Podsvirov
681f20d540 Fix Documentions WARNING for __restrict attribute
Add `__restrict` keyword to `c_id_attributes` added in `sphinx 3.0`.

Closes #167
2020-11-21 15:34:18 +03:00
Recep Aslantas
fd87f6e2c3 Merge pull request #168 from podsvirov/fix-fix-docs-for-vec2
Fix fix docs for glm_vec2()
2020-11-21 14:32:48 +03:00
Konstantin Podsvirov
2c12c6dce5 Fix fix docs for glm_vec2()
Remove extra `\` symbol.
2020-11-21 14:05:19 +03:00
Recep Aslantas
5619527fd3 Update cglm.podspec 2020-11-19 22:42:12 +03:00
Recep Aslantas
8b1c3c3fc4 now working on v0.8.0 2020-11-19 22:21:21 +03:00
13 changed files with 46 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8.2) cmake_minimum_required(VERSION 3.8.2)
project(cglm VERSION 0.7.9 LANGUAGES C) project(cglm VERSION 0.8.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED YES) set(CMAKE_C_STANDARD_REQUIRED YES)

View File

@@ -2,10 +2,10 @@ Pod::Spec.new do |s|
# Description # Description
s.name = "cglm" s.name = "cglm"
s.version = "0.7.2" s.version = "0.7.9"
s.summary = "📽 Optimized OpenGL/Graphics Math (glm) for C" s.summary = "📽 Highly Optimized Graphics Math (glm) for C"
s.description = <<-DESC s.description = <<-DESC
cglm is math library for graphics programming for C. It is similar to original glm but it is written for C instead of C++ (you can use here too). See the documentation or README for all features. cglm is math library for graphics programming for C. See the documentation or README for all features.
DESC DESC
s.documentation_url = "http://cglm.readthedocs.io" s.documentation_url = "http://cglm.readthedocs.io"
@@ -25,4 +25,13 @@ cglm is math library for graphics programming for C. It is similar to original g
# Linking # Linking
s.library = "m" s.library = "m"
# Configuration
s.pod_target_xcconfig = {
'CLANG_ENABLE_MODULES' => 'NO',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
'CLANG_WARN_DOCUMENTATION_COMMENTS' => 'NO',
'GCC_C_LANGUAGE_STANDARD' => 'gnu11',
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GLM_TESTS_NO_COLORFUL_OUTPUT'
}
end end

View File

@@ -7,7 +7,7 @@
#***************************************************************************** #*****************************************************************************
AC_PREREQ([2.69]) AC_PREREQ([2.69])
AC_INIT([cglm], [0.7.9], [info@recp.me]) AC_INIT([cglm], [0.8.0], [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.

View File

@@ -50,7 +50,7 @@ If you don't want to install **cglm** to your system's folder you can get static
Meson (All platforms): Meson (All platforms):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash .. code-block::
:linenos: :linenos:
$ meson build # [Optional] --default-library=static $ meson build # [Optional] --default-library=static
@@ -60,7 +60,7 @@ Meson (All platforms):
**Meson Options:** **Meson Options:**
.. code-block:: CMake .. code-block::
:linenos: :linenos:
c_std=c11 c_std=c11
@@ -69,9 +69,9 @@ Meson (All platforms):
enable_tests=false # to run tests: ninja test enable_tests=false # to run tests: ninja test
**Use with your CMake project example** **Use with your Meson project**
.. code-block:: CMake .. code-block::
:linenos: :linenos:
# Clone cglm or create a cglm.wrap under <source_root>/subprojects # Clone cglm or create a cglm.wrap under <source_root>/subprojects

View File

@@ -25,7 +25,7 @@
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
# #
# needs_sphinx = '1.0' # needs_sphinx = '3.0'
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -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.7.9' version = u'0.8.0'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = u'0.7.9' release = u'0.8.0'
# 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.
@@ -197,3 +197,7 @@ epub_exclude_files = ['search.html']
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True todo_include_todos = True
# -- Options for the C domain ------------------------------------------------
c_id_attributes = ['__restrict']

View File

@@ -374,7 +374,7 @@ Functions documentation
| *[in]* **q** quaternion | *[in]* **q** quaternion
| *[in]* **pivot** pivot | *[in]* **pivot** pivot
.. c:function:: void glm_quat_rotate(mat4 m, versor q, mat4 dest) .. c:function:: void glm_quat_rotate_atm(mat4 m, versor q, vec3 pivot)
| rotate NEW transform matrix using quaternion at pivot point | rotate NEW transform matrix using quaternion at pivot point
| this creates rotation matrix, it assumes you don't have a matrix | this creates rotation matrix, it assumes you don't have a matrix

View File

@@ -55,7 +55,7 @@ Functions:
Functions documentation Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
.. c:function:: void glm_vec2(float \*v, vec2 dest) .. c:function:: void glm_vec2(float * v, vec2 dest)
init vec2 using vec3 or vec4 init vec2 using vec3 or vec4

View File

@@ -425,7 +425,7 @@ bool
glm_uniscaled(mat4 m) { glm_uniscaled(mat4 m) {
CGLM_ALIGN(8) vec3 s; CGLM_ALIGN(8) vec3 s;
glm_decompose_scalev(m, s); glm_decompose_scalev(m, s);
return glm_vec3_eq_all(s); return glm_vec3_eq_eps(s, s[0]);
} }
/*! /*!

View File

@@ -42,12 +42,18 @@
#include "types.h" #include "types.h"
#include "simd/intrin.h" #include "simd/intrin.h"
#ifndef CGLM_USE_DEFAULT_EPSILON /** CGLM_USE_DEFAULT_EPSILON is removed, to override float epsilon,
# ifndef GLM_FLT_EPSILON * just define GLM_FLT_EPSILON with epsilon value like below
# define GLM_FLT_EPSILON 1e-6 *
* #define GLM_FLT_EPSILON 1e-6f
*/
#ifndef GLM_FLT_EPSILON
# ifndef FLT_EPSILON
# define GLM_FLT_EPSILON 1e-6f
# else
# define GLM_FLT_EPSILON FLT_EPSILON
# endif # endif
#else
# define GLM_FLT_EPSILON FLT_EPSILON
#endif #endif
#endif /* cglm_common_h */ #endif /* cglm_common_h */

View File

@@ -9,7 +9,7 @@
#define cglm_version_h #define cglm_version_h
#define CGLM_VERSION_MAJOR 0 #define CGLM_VERSION_MAJOR 0
#define CGLM_VERSION_MINOR 7 #define CGLM_VERSION_MINOR 8
#define CGLM_VERSION_PATCH 9 #define CGLM_VERSION_PATCH 0
#endif /* cglm_version_h */ #endif /* cglm_version_h */

View File

@@ -1,5 +1,5 @@
project('cglm', 'c', project('cglm', 'c',
version : '0.7.9', version : '0.8.0',
license : 'mit', license : 'mit',
default_options : [ default_options : [
'c_std=c11', 'c_std=c11',

View File

@@ -35,9 +35,9 @@ TEST_IMPL(camera_decomp) {
farVal = 100.0f; farVal = 100.0f;
glm_perspective(fovy, aspect, nearVal, farVal, proj); glm_perspective(fovy, aspect, nearVal, farVal, proj);
ASSERT(fabsf(aspect - glm_persp_aspect(proj)) < GLM_FLT_EPSILON) ASSERT(fabsf(aspect - glm_persp_aspect(proj)) < 1e-5f)
ASSERT(fabsf(fovy - glm_persp_fovy(proj)) < GLM_FLT_EPSILON) ASSERT(fabsf(fovy - glm_persp_fovy(proj)) < 1e-5f)
ASSERT(fabsf(49.984f - glm_deg(glm_persp_fovy(proj))) < GLM_FLT_EPSILON) ASSERT(fabsf(49.984f - glm_deg(glm_persp_fovy(proj))) < 1e-5f)
glm_persp_sizes(proj, fovy, sizes); glm_persp_sizes(proj, fovy, sizes);

View File

@@ -106,7 +106,7 @@ test_rand_quat(versor q);
CGLM_INLINE CGLM_INLINE
bool bool
test_eq(float a, float b) { test_eq(float a, float b) {
return fabsf(a - b) <= GLM_FLT_EPSILON * 10; return fabsf(a - b) <= 1e-5f;
} }
CGLM_INLINE CGLM_INLINE