mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
Compare commits
17 Commits
v0.7.9
...
aabb-spher
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a308dcd9e | ||
|
|
fec396950b | ||
|
|
981af0565e | ||
|
|
1d215ef5f3 | ||
|
|
2b7cfde64f | ||
|
|
c783c42101 | ||
|
|
bddcfedead | ||
|
|
34e7438271 | ||
|
|
485ff6bc46 | ||
|
|
4ab9ab4772 | ||
|
|
a5ff477fc8 | ||
|
|
254570d006 | ||
|
|
681f20d540 | ||
|
|
fd87f6e2c3 | ||
|
|
2c12c6dce5 | ||
|
|
5619527fd3 | ||
|
|
8b1c3c3fc4 |
@@ -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)
|
||||||
@@ -18,7 +18,7 @@ else(CGLM_STATIC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CGLM_USE_C99)
|
if(CGLM_USE_C99)
|
||||||
set(C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -117,6 +117,7 @@ export(TARGETS ${PROJECT_NAME}
|
|||||||
)
|
)
|
||||||
|
|
||||||
install(EXPORT ${PROJECT_NAME}
|
install(EXPORT ${PROJECT_NAME}
|
||||||
|
FILE "${PROJECT_NAME}Config.cmake"
|
||||||
NAMESPACE ${PROJECT_NAME}::
|
NAMESPACE ${PROJECT_NAME}::
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake)
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||||
|
|
||||||
|
|||||||
15
cglm.podspec
15
cglm.podspec
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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']
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ glm_decompose_rs(mat4 m, mat4 r, vec3 s) {
|
|||||||
glm_vec4_scale(r[1], 1.0f/s[1], r[1]);
|
glm_vec4_scale(r[1], 1.0f/s[1], r[1]);
|
||||||
glm_vec4_scale(r[2], 1.0f/s[2], r[2]);
|
glm_vec4_scale(r[2], 1.0f/s[2], r[2]);
|
||||||
|
|
||||||
/* Note from Apple Open Source (asume that the matrix is orthonormal):
|
/* Note from Apple Open Source (assume that the matrix is orthonormal):
|
||||||
check for a coordinate system flip. If the determinant
|
check for a coordinate system flip. If the determinant
|
||||||
is -1, then negate the matrix and the scaling factors. */
|
is -1, then negate the matrix and the scaling factors. */
|
||||||
glm_vec3_cross(m[0], m[1], v);
|
glm_vec3_cross(m[0], m[1], v);
|
||||||
|
|||||||
@@ -228,6 +228,8 @@ glm_aabb_aabb(vec3 box[2], vec3 other[2]) {
|
|||||||
* https://github.com/erich666/GraphicsGems/blob/master/gems/BoxSphere.c
|
* https://github.com/erich666/GraphicsGems/blob/master/gems/BoxSphere.c
|
||||||
* Solid Box - Solid Sphere test.
|
* Solid Box - Solid Sphere test.
|
||||||
*
|
*
|
||||||
|
* Sphere Representation in cglm: [center.x, center.y, center.z, radii]
|
||||||
|
*
|
||||||
* @param[in] box solid bounding box
|
* @param[in] box solid bounding box
|
||||||
* @param[in] s solid sphere
|
* @param[in] s solid sphere
|
||||||
*/
|
*/
|
||||||
@@ -237,13 +239,13 @@ glm_aabb_sphere(vec3 box[2], vec4 s) {
|
|||||||
float dmin;
|
float dmin;
|
||||||
int a, b, c;
|
int a, b, c;
|
||||||
|
|
||||||
a = s[0] >= box[0][0];
|
a = (s[0] < box[0][0]) + (s[0] > box[1][0]);
|
||||||
b = s[1] >= box[0][1];
|
b = (s[1] < box[0][1]) + (s[1] > box[1][1]);
|
||||||
c = s[2] >= box[0][2];
|
c = (s[2] < box[0][2]) + (s[2] > box[1][2]);
|
||||||
|
|
||||||
dmin = glm_pow2(s[0] - box[a][0])
|
dmin = glm_pow2((s[0] - box[!(a - 1)][0]) * (a != 0))
|
||||||
+ glm_pow2(s[1] - box[b][1])
|
+ glm_pow2((s[1] - box[!(b - 1)][1]) * (b != 0))
|
||||||
+ glm_pow2(s[2] - box[c][2]);
|
+ glm_pow2((s[2] - box[!(c - 1)][2]) * (c != 0));
|
||||||
|
|
||||||
return dmin <= glm_pow2(s[3]);
|
return dmin <= glm_pow2(s[3]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ glm_vec3_abs(vec3 v, vec3 dest) {
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec3_fract(vec3 v, vec3 dest) {
|
glm_vec3_fract(vec3 v, vec3 dest) {
|
||||||
dest[0] = fminf(v[0] - floorf(v[0]), 0x1.fffffep-1f);
|
dest[0] = fminf(v[0] - floorf(v[0]), 0.999999940395355224609375f);
|
||||||
dest[1] = fminf(v[1] - floorf(v[1]), 0x1.fffffep-1f);
|
dest[1] = fminf(v[1] - floorf(v[1]), 0.999999940395355224609375f);
|
||||||
dest[2] = fminf(v[2] - floorf(v[2]), 0x1.fffffep-1f);
|
dest[2] = fminf(v[2] - floorf(v[2]), 0.999999940395355224609375f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -268,10 +268,10 @@ glm_vec4_abs(vec4 v, vec4 dest) {
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec4_fract(vec4 v, vec4 dest) {
|
glm_vec4_fract(vec4 v, vec4 dest) {
|
||||||
dest[0] = fminf(v[0] - floorf(v[0]), 0x1.fffffep-1f);
|
dest[0] = fminf(v[0] - floorf(v[0]), 0.999999940395355224609375f);
|
||||||
dest[1] = fminf(v[1] - floorf(v[1]), 0x1.fffffep-1f);
|
dest[1] = fminf(v[1] - floorf(v[1]), 0.999999940395355224609375f);
|
||||||
dest[2] = fminf(v[2] - floorf(v[2]), 0x1.fffffep-1f);
|
dest[2] = fminf(v[2] - floorf(v[2]), 0.999999940395355224609375f);
|
||||||
dest[3] = fminf(v[3] - floorf(v[3]), 0x1.fffffep-1f);
|
dest[3] = fminf(v[3] - floorf(v[3]), 0.999999940395355224609375f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -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 */
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user