mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e47cc22300 | ||
|
|
8aa80d3e9b | ||
|
|
f90d3f5faf | ||
|
|
02513b77c1 | ||
|
|
fb444203b6 | ||
|
|
38632b2dd4 | ||
|
|
1214a566b6 | ||
|
|
41c874aa97 | ||
|
|
38be538342 | ||
|
|
4d55510ff0 | ||
|
|
e789186889 | ||
|
|
24b9992f19 | ||
|
|
e7f35704ca | ||
|
|
24ab1ff621 | ||
|
|
f1b55589ac | ||
|
|
ef5a8549e2 | ||
|
|
d5371f10a1 | ||
|
|
cab370d1c7 | ||
|
|
76107064d7 | ||
|
|
12ea809e0a | ||
|
|
e2fcf80e48 | ||
|
|
8a34e74b87 | ||
|
|
33770b9181 | ||
|
|
cb6d5c1f7e | ||
|
|
4ffc01655e | ||
|
|
25feab7860 | ||
|
|
bf18ca647e | ||
|
|
86c585b9e5 | ||
|
|
d6cae07602 | ||
|
|
ba0973054e | ||
|
|
ec371099bc | ||
|
|
a3b66f5b4c | ||
|
|
4462a84f4a |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -41,10 +41,14 @@ packages/
|
|||||||
.anjuta/*
|
.anjuta/*
|
||||||
*.anjuta*
|
*.anjuta*
|
||||||
config.h.*
|
config.h.*
|
||||||
config.h
|
/config.h
|
||||||
stamp*
|
stamp*
|
||||||
COPYING
|
COPYING
|
||||||
.idea/*
|
.idea/*
|
||||||
*.VC.db
|
*.VC.db
|
||||||
cscope.*
|
cscope.*
|
||||||
*-git-ignored-file.*
|
*-git-ignored-file.*
|
||||||
|
test/*.trs
|
||||||
|
test/test_*
|
||||||
|
*.log
|
||||||
|
test-*
|
||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "test/lib/cmocka"]
|
||||||
|
path = test/lib/cmocka
|
||||||
|
url = git://git.cryptomilk.org/projects/cmocka.git
|
||||||
61
.travis.yml
Normal file
61
.travis.yml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
language: c
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
|
||||||
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
compiler:
|
||||||
|
- clang
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
exclude:
|
||||||
|
# Skip GCC builds on macOS.
|
||||||
|
- os: osx
|
||||||
|
compiler: gcc
|
||||||
|
include:
|
||||||
|
# Additional GCC builds for code coverage.
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: CODE_COVERAGE=ON
|
||||||
|
|
||||||
|
cache:
|
||||||
|
apt: true
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.6
|
||||||
|
- lcov
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- pip install --user cpp-coveralls
|
||||||
|
|
||||||
|
script:
|
||||||
|
- sh ./build-deps.sh
|
||||||
|
- sh ./autogen.sh
|
||||||
|
- if [[ "$CC" == "gcc" && "$CODE_COVERAGE" == "ON" ]]; then
|
||||||
|
./configure CFLAGS="-ftest-coverage -fprofile-arcs";
|
||||||
|
else
|
||||||
|
./configure;
|
||||||
|
fi
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- if [[ "$CC" == "gcc" && "$CODE_COVERAGE" == "ON" ]]; then
|
||||||
|
coveralls
|
||||||
|
--build-root .
|
||||||
|
--exclude lib
|
||||||
|
--exclude test
|
||||||
|
--gcov-options '\-lp'
|
||||||
|
--verbose;
|
||||||
|
fi
|
||||||
41
README.md
41
README.md
@@ -1,7 +1,17 @@
|
|||||||
# 🎥 OpenGL Mathematics (glm) for `C`
|
# 🎥 OpenGL Mathematics (glm) for `C`
|
||||||
|
[](https://travis-ci.org/recp/cglm)
|
||||||
|
[](https://ci.appveyor.com/project/recp/cglm/branch/master)
|
||||||
|
[](https://coveralls.io/github/recp/cglm?branch=master)
|
||||||
|
[](https://www.codacy.com/app/recp/cglm?utm_source=github.com&utm_medium=referral&utm_content=recp/cglm&utm_campaign=Badge_Grade)
|
||||||
|
|
||||||
The original glm library is for C++ only (templates, namespaces, classes...), this library targeted to C99 but currently you can use it for C89 safely by language extensions e.g `__register`
|
The original glm library is for C++ only (templates, namespaces, classes...), this library targeted to C99 but currently you can use it for C89 safely by language extensions e.g `__register`
|
||||||
|
|
||||||
|
#### Note for previous versions:
|
||||||
|
|
||||||
|
- _dup (duplicate) is changed to _copy. For instance `glm_vec_dup -> glm_vec_copy`
|
||||||
|
- OpenGL related functions are dropped to make this lib platform/third-party independent
|
||||||
|
- make sure you have latest version and feel free to report bugs, troubles
|
||||||
|
|
||||||
#### Note for C++ developers:
|
#### Note for C++ developers:
|
||||||
If you don't aware about original GLM library yet, you may also want to look at:
|
If you don't aware about original GLM library yet, you may also want to look at:
|
||||||
https://github.com/g-truc/glm
|
https://github.com/g-truc/glm
|
||||||
@@ -22,7 +32,7 @@ https://github.com/g-truc/glm
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
##Features
|
## Features
|
||||||
- general purpose matrix operations (mat4, mat3)
|
- general purpose matrix operations (mat4, mat3)
|
||||||
- chain matrix multiplication (square only)
|
- chain matrix multiplication (square only)
|
||||||
- general purpose vector operations (cross, dot, rotate, proj, angle...)
|
- general purpose vector operations (cross, dot, rotate, proj, angle...)
|
||||||
@@ -76,7 +86,7 @@ glm_mul(T, R, modelMat);
|
|||||||
glm_inv_tr(modelMat);
|
glm_inv_tr(modelMat);
|
||||||
```
|
```
|
||||||
|
|
||||||
##License
|
## License
|
||||||
MIT. check the LICENSE file
|
MIT. check the LICENSE file
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
@@ -84,6 +94,8 @@ MIT. check the LICENSE file
|
|||||||
### Unix (Autotools)
|
### Unix (Autotools)
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
$ sh ./build-deps.sh # run only once (dependencies)
|
||||||
|
$
|
||||||
$ sh autogen.sh
|
$ sh autogen.sh
|
||||||
$ ./configure
|
$ ./configure
|
||||||
$ make
|
$ make
|
||||||
@@ -92,11 +104,20 @@ $ [sudo] make install
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Windows (MSBuild)
|
### Windows (MSBuild)
|
||||||
|
Windows related build files, project files are located in `win` folder,
|
||||||
|
make sure you are inside `cglm/win` folder.
|
||||||
|
Code Analysis are enabled, it may take awhile to build
|
||||||
|
|
||||||
```text
|
```Powershell
|
||||||
TODO:
|
$ cd win
|
||||||
|
$ .\build.bat
|
||||||
```
|
```
|
||||||
##How to use
|
if `msbuild` won't work (because of multi version VS) then try to build with `devenv`:
|
||||||
|
```Powershell
|
||||||
|
$ devenv cglm.sln /Build Release
|
||||||
|
```
|
||||||
|
|
||||||
|
## How to use
|
||||||
If you want to use inline versions of funcstions then; include main header
|
If you want to use inline versions of funcstions then; include main header
|
||||||
```C
|
```C
|
||||||
#include <cglm.h>
|
#include <cglm.h>
|
||||||
@@ -126,7 +147,15 @@ glmc_vec_normalize(vec);
|
|||||||
```
|
```
|
||||||
|
|
||||||
Function usage and parameters are documented inside related headers.
|
Function usage and parameters are documented inside related headers.
|
||||||
##Notes
|
## Notes
|
||||||
|
|
||||||
- This library uses float types only, does not support Integers, Double... yet
|
- This library uses float types only, does not support Integers, Double... yet
|
||||||
- If headers are not working properly with your compiler, IDE please open an issue, because I'm using GCC and clang to test it maybe sometimes MSVC
|
- If headers are not working properly with your compiler, IDE please open an issue, because I'm using GCC and clang to test it maybe sometimes MSVC
|
||||||
|
|
||||||
|
**TODO:**
|
||||||
|
- [ ] Unit tests
|
||||||
|
- [ ] Unit tests for comparing cglm with glm results
|
||||||
|
- [x] Add version info
|
||||||
|
- [ ] Unaligned operations (e.g. `glm_umat4_mul`)
|
||||||
|
- [ ] Extra documentation
|
||||||
|
- [ ] ARM Neon Arch
|
||||||
|
|||||||
7
appveyor.yml
Normal file
7
appveyor.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
image: Visual Studio 2017
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- ps: >-
|
||||||
|
cd win
|
||||||
|
|
||||||
|
.\build.bat
|
||||||
13
autogen.sh
13
autogen.sh
@@ -6,12 +6,15 @@
|
|||||||
# Full license can be found in the LICENSE file
|
# Full license can be found in the LICENSE file
|
||||||
#
|
#
|
||||||
|
|
||||||
cd `dirname "$0"`
|
cd $(dirname "$0")
|
||||||
|
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
libtoolBin=$(which glibtoolize)
|
libtoolBin=$(which glibtoolize)
|
||||||
libtoolBinDir=$(dirname "${libtoolBin}")
|
libtoolBinDir=$(dirname "${libtoolBin}")
|
||||||
ln -s $libtoolBin "${libtoolBinDir}/libtoolize"
|
|
||||||
|
if [ ! -f "${libtoolBinDir}/libtoolize" ]; then
|
||||||
|
ln -s $libtoolBin "${libtoolBinDir}/libtoolize"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
autoheader
|
autoheader
|
||||||
|
|||||||
30
build-deps.sh
Normal file
30
build-deps.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c), Recep Aslantas.
|
||||||
|
#
|
||||||
|
# MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
# Full license can be found in the LICENSE file
|
||||||
|
#
|
||||||
|
|
||||||
|
# check if deps are pulled
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# fix glibtoolize
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
|
||||||
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
libtoolBin=$(which glibtoolize)
|
||||||
|
libtoolBinDir=$(dirname "${libtoolBin}")
|
||||||
|
ln -s $libtoolBin "${libtoolBinDir}/libtoolize"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# general deps: gcc make autoconf automake libtool cmake
|
||||||
|
|
||||||
|
# test - cmocka
|
||||||
|
cd ./test/lib/cmocka
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
|
make -j8
|
||||||
|
cd ../../../../
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
#*****************************************************************************
|
#*****************************************************************************
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_INIT([cglm], [0.1.0], [info@recp.me])
|
AC_INIT([cglm], [0.2.1], [info@recp.me])
|
||||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
|
||||||
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|||||||
@@ -13,13 +13,17 @@ extern "C" {
|
|||||||
|
|
||||||
#include "../cglm.h"
|
#include "../cglm.h"
|
||||||
|
|
||||||
CGLM_EXPORT
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
void
|
#define glmc_mat4_udup(mat, dest) glmc_mat4_ucopy(mat, dest)
|
||||||
glmc_mat4_udup(mat4 mat, mat4 dest);
|
#define glmc_mat4_dup(mat, dest) glmc_mat4_copy(mat, dest)
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat4_dup(mat4 mat, mat4 dest);
|
glmc_mat4_ucopy(mat4 mat, mat4 dest);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_mat4_copy(mat4 mat, mat4 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -13,9 +13,12 @@ extern "C" {
|
|||||||
|
|
||||||
#include "../cglm.h"
|
#include "../cglm.h"
|
||||||
|
|
||||||
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
|
#define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest)
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat3_dup(mat3 mat, mat3 dest);
|
glmc_mat3_copy(mat3 mat, mat3 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -13,17 +13,22 @@ extern "C" {
|
|||||||
|
|
||||||
#include "../cglm.h"
|
#include "../cglm.h"
|
||||||
|
|
||||||
CGLM_EXPORT
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
void
|
#define glmc_vec_dup(v, dest) glmc_vec_copy(v, dest)
|
||||||
glmc_vec_dup(vec3 a, vec3 dest);
|
#define glmc_vec4_dup3(v, dest) glmc_vec4_copy3(v, dest)
|
||||||
|
#define glmc_vec4_dup(v, dest) glmc_vec4_copy(v, dest)
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec4_dup3(vec4 a, vec3 dest);
|
glmc_vec_copy(vec3 a, vec3 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec4_dup(vec4 v, vec4 dest);
|
glmc_vec4_copy3(vec4 a, vec3 dest);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_vec4_copy(vec4 v, vec4 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
float
|
float
|
||||||
@@ -117,6 +122,18 @@ CGLM_EXPORT
|
|||||||
void
|
void
|
||||||
glmc_vec_proj(vec3 a, vec3 b, vec3 dest);
|
glmc_vec_proj(vec3 a, vec3 b, vec3 dest);
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glmc_vec_center(vec3 v1, vec3 v2, vec3 dest);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
float
|
||||||
|
glmc_vec_distance(vec3 v1, vec3 v2);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
float
|
||||||
|
glmc_vec4_distance(vec4 v1, vec4 v2);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ glm_inv_tr(mat4 mat) {
|
|||||||
/* translate */
|
/* translate */
|
||||||
glm_mat3_mulv(r, mat[3], t);
|
glm_mat3_mulv(r, mat[3], t);
|
||||||
glm_vec_flipsign(t);
|
glm_vec_flipsign(t);
|
||||||
glm_vec_dup(t, mat[3]);
|
glm_vec_copy(t, mat[3]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,13 @@ glm_translate_z(mat4 m, float to) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_translate_make(mat4 m, vec3 v) {
|
||||||
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
glm_translate_to(t, v, m);
|
||||||
|
}
|
||||||
|
|
||||||
/* scale */
|
/* scale */
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
@@ -130,7 +137,14 @@ glm_scale_to(mat4 m, vec3 v, mat4 dest) {
|
|||||||
glm_vec4_scale(m[1], v[1], dest[1]);
|
glm_vec4_scale(m[1], v[1], dest[1]);
|
||||||
glm_vec4_scale(m[2], v[2], dest[2]);
|
glm_vec4_scale(m[2], v[2], dest[2]);
|
||||||
|
|
||||||
glm_vec4_dup(m[3], dest[3]);
|
glm_vec4_copy(m[3], dest[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_scale_make(mat4 m, vec3 v) {
|
||||||
|
mat4 t = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
glm_scale_to(t, v, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
@@ -267,9 +281,9 @@ glm_rotate_ndc(mat4 m, float angle, vec3 axis_ndc) {
|
|||||||
glm_vec4_scale(m[2], rot[2][2], tmp[0]);
|
glm_vec4_scale(m[2], rot[2][2], tmp[0]);
|
||||||
glm_vec4_add(tmp[3], tmp[0], tmp[3]);
|
glm_vec4_add(tmp[3], tmp[0], tmp[3]);
|
||||||
|
|
||||||
glm_vec4_dup(tmp[1], m[0]);
|
glm_vec4_copy(tmp[1], m[0]);
|
||||||
glm_vec4_dup(tmp[2], m[1]);
|
glm_vec4_copy(tmp[2], m[1]);
|
||||||
glm_vec4_dup(tmp[3], m[2]);
|
glm_vec4_copy(tmp[3], m[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
@@ -325,10 +339,10 @@ glm_decompose_rs(mat4 m, mat4 r, vec3 s) {
|
|||||||
vec4 t = {0.0f, 0.0f, 0.0f, 1.0f};
|
vec4 t = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||||
vec3 v;
|
vec3 v;
|
||||||
|
|
||||||
glm_vec4_dup(m[0], r[0]);
|
glm_vec4_copy(m[0], r[0]);
|
||||||
glm_vec4_dup(m[1], r[1]);
|
glm_vec4_copy(m[1], r[1]);
|
||||||
glm_vec4_dup(m[2], r[2]);
|
glm_vec4_copy(m[2], r[2]);
|
||||||
glm_vec4_dup(t, r[3]);
|
glm_vec4_copy(t, r[3]);
|
||||||
|
|
||||||
s[0] = glm_vec_norm(m[0]);
|
s[0] = glm_vec_norm(m[0]);
|
||||||
s[1] = glm_vec_norm(m[1]);
|
s[1] = glm_vec_norm(m[1]);
|
||||||
@@ -359,7 +373,7 @@ glm_decompose_rs(mat4 m, mat4 r, vec3 s) {
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_decompose(mat4 m, vec4 t, mat4 r, vec3 s) {
|
glm_decompose(mat4 m, vec4 t, mat4 r, vec3 s) {
|
||||||
glm_vec4_dup(m[3], t);
|
glm_vec4_copy(m[3], t);
|
||||||
glm_decompose_rs(m, r, s);
|
glm_decompose_rs(m, r, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,18 @@
|
|||||||
#define cglm_vcam_h
|
#define cglm_vcam_h
|
||||||
|
|
||||||
#include "cglm-common.h"
|
#include "cglm-common.h"
|
||||||
#include "cglm-platform.h"
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up perspective peprojection matrix
|
||||||
|
*
|
||||||
|
* @param[in] left viewport.left
|
||||||
|
* @param[in] right viewport.right
|
||||||
|
* @param[in] bottom viewport.bottom
|
||||||
|
* @param[in] top viewport.top
|
||||||
|
* @param[in] nearVal near clipping plane
|
||||||
|
* @param[in] farVal far clipping plane
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_frustum(float left,
|
glm_frustum(float left,
|
||||||
@@ -19,7 +29,7 @@ glm_frustum(float left,
|
|||||||
float top,
|
float top,
|
||||||
float nearVal,
|
float nearVal,
|
||||||
float farVal,
|
float farVal,
|
||||||
mat4 dest) {
|
mat4 dest) {
|
||||||
float rl, tb, fn;
|
float rl, tb, fn;
|
||||||
|
|
||||||
glm__memzero(float, dest, sizeof(mat4));
|
glm__memzero(float, dest, sizeof(mat4));
|
||||||
@@ -37,6 +47,17 @@ glm_frustum(float left,
|
|||||||
dest[3][2] = -2.0f * farVal * nearVal * fn;
|
dest[3][2] = -2.0f * farVal * nearVal * fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up orthographic projection matrix
|
||||||
|
*
|
||||||
|
* @param[in] left viewport.left
|
||||||
|
* @param[in] right viewport.right
|
||||||
|
* @param[in] bottom viewport.bottom
|
||||||
|
* @param[in] top viewport.top
|
||||||
|
* @param[in] nearVal near clipping plane
|
||||||
|
* @param[in] farVal far clipping plane
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_ortho(float left,
|
glm_ortho(float left,
|
||||||
@@ -45,7 +66,7 @@ glm_ortho(float left,
|
|||||||
float top,
|
float top,
|
||||||
float nearVal,
|
float nearVal,
|
||||||
float farVal,
|
float farVal,
|
||||||
mat4 dest) {
|
mat4 dest) {
|
||||||
float rl, tb, fn;
|
float rl, tb, fn;
|
||||||
|
|
||||||
glm__memzero(float, dest, sizeof(mat4));
|
glm__memzero(float, dest, sizeof(mat4));
|
||||||
@@ -63,69 +84,84 @@ glm_ortho(float left,
|
|||||||
dest[3][3] = 1.0f;
|
dest[3][3] = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up unit orthographic projection matrix
|
||||||
|
*
|
||||||
|
* @param[in] aspect aspect ration ( width / height )
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_ortho_default(mat4 dest) {
|
glm_ortho_default(float aspect,
|
||||||
int32_t rect[4];
|
mat4 dest) {
|
||||||
float aspectRatio;
|
if (aspect >= 1.0f) {
|
||||||
|
glm_ortho(-1.0f * aspect,
|
||||||
glm_platfom_get_viewport_rect(rect);
|
1.0f * aspect,
|
||||||
aspectRatio = (float)rect[2]/rect[3];
|
|
||||||
|
|
||||||
if (rect[2] >= rect[3]) {
|
|
||||||
glm_ortho(-1.0f * aspectRatio,
|
|
||||||
1.0f * aspectRatio,
|
|
||||||
-1.0f,
|
-1.0f,
|
||||||
1.0f,
|
1.0f,
|
||||||
-100.0f,
|
-100.0f,
|
||||||
100.0f,
|
100.0f,
|
||||||
dest);
|
dest);
|
||||||
} else {
|
return;
|
||||||
glm_ortho(-1.0f,
|
|
||||||
1.0f,
|
|
||||||
-1.0f / aspectRatio,
|
|
||||||
1.0f / aspectRatio,
|
|
||||||
-100.0f,
|
|
||||||
100.0f,
|
|
||||||
dest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm_ortho(-1.0f,
|
||||||
|
1.0f,
|
||||||
|
-1.0f / aspect,
|
||||||
|
1.0f / aspect,
|
||||||
|
-100.0f,
|
||||||
|
100.0f,
|
||||||
|
dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up orthographic projection matrix with given CUBE size
|
||||||
|
*
|
||||||
|
* @param[in] aspect aspect ratio ( width / height )
|
||||||
|
* @param[in] size cube size
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_ortho_default_s(float size, mat4 dest) {
|
glm_ortho_default_s(float aspect,
|
||||||
int32_t rect[4];
|
float size,
|
||||||
float aspectRatio;
|
mat4 dest) {
|
||||||
|
if (aspect >= 1.0f) {
|
||||||
glm_platfom_get_viewport_rect(rect);
|
glm_ortho(-size * aspect,
|
||||||
aspectRatio = (float)rect[2]/rect[3];
|
size * aspect,
|
||||||
|
|
||||||
if (rect[2] >= rect[3]) {
|
|
||||||
glm_ortho(-size * aspectRatio,
|
|
||||||
size * aspectRatio,
|
|
||||||
-size,
|
-size,
|
||||||
size,
|
size,
|
||||||
-size - 100.0f,
|
-size - 100.0f,
|
||||||
size + 100.0f,
|
size + 100.0f,
|
||||||
dest);
|
dest);
|
||||||
} else {
|
return;
|
||||||
glm_ortho(-size,
|
|
||||||
size,
|
|
||||||
-size / aspectRatio,
|
|
||||||
size / aspectRatio,
|
|
||||||
-size - 100.0f,
|
|
||||||
size + 100.0f,
|
|
||||||
dest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm_ortho(-size,
|
||||||
|
size,
|
||||||
|
-size / aspect,
|
||||||
|
size / aspect,
|
||||||
|
-size - 100.0f,
|
||||||
|
size + 100.0f,
|
||||||
|
dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up perspective projection matrix
|
||||||
|
*
|
||||||
|
* @param[in] fovy field of view angle
|
||||||
|
* @param[in] aspect aspect ratio ( width / height )
|
||||||
|
* @param[in] nearVal near clipping plane
|
||||||
|
* @param[in] farVal far clipping planes
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_perspective(float fovy,
|
glm_perspective(float fovy,
|
||||||
float aspect,
|
float aspect,
|
||||||
float nearVal,
|
float nearVal,
|
||||||
float farVal,
|
float farVal,
|
||||||
mat4 dest) {
|
mat4 dest) {
|
||||||
float f, fn;
|
float f, fn;
|
||||||
|
|
||||||
glm__memzero(float, dest, sizeof(mat4));
|
glm__memzero(float, dest, sizeof(mat4));
|
||||||
@@ -140,31 +176,50 @@ glm_perspective(float fovy,
|
|||||||
dest[3][2] = 2 * nearVal * farVal * fn;
|
dest[3][2] = 2 * nearVal * farVal * fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up perspective projection matrix with default near/far
|
||||||
|
* and angle values
|
||||||
|
*
|
||||||
|
* @param[in] aspect aspect ratio ( width / height )
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_perspective_default(mat4 dest) {
|
glm_perspective_default(float aspect,
|
||||||
int32_t rect[4];
|
mat4 dest) {
|
||||||
glm_platfom_get_viewport_rect(rect);
|
|
||||||
|
|
||||||
glm_perspective((float)CGLM_PI_4,
|
glm_perspective((float)CGLM_PI_4,
|
||||||
(float)rect[2]/rect[3],
|
aspect,
|
||||||
0.01f,
|
0.01f,
|
||||||
100.0f,
|
100.0f,
|
||||||
dest);
|
dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief resize perspective matrix by aspect ratio ( width / height )
|
||||||
|
* this very make easy to resize proj matrix when window, viewport
|
||||||
|
* reized
|
||||||
|
*
|
||||||
|
* @param[in] aspect aspect ratio ( width / height )
|
||||||
|
* @param[in, out] proj perspective projection matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_perspective_resize(mat4 proj) {
|
glm_perspective_resize(float aspect,
|
||||||
int32_t rect[4];
|
mat4 proj) {
|
||||||
|
|
||||||
if (proj[0][0] == 0)
|
if (proj[0][0] == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
glm_platfom_get_viewport_rect(rect);
|
proj[0][0] = proj[1][1] / aspect;
|
||||||
proj[0][0] = (float)proj[1][1] * rect[3] / rect[2];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief set up view matrix
|
||||||
|
*
|
||||||
|
* @param[in] eye eye vector
|
||||||
|
* @param[in] center center vector
|
||||||
|
* @param[in] up up vector
|
||||||
|
* @param[out] dest result matrix
|
||||||
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_lookat(vec3 eye,
|
glm_lookat(vec3 eye,
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ glm_euler_angles(mat4 m, vec3 dest) {
|
|||||||
path = (fabsf(a[0][0]) + fabsf(a[0][1]) + fabsf(a[0][2])) >=
|
path = (fabsf(a[0][0]) + fabsf(a[0][1]) + fabsf(a[0][2])) >=
|
||||||
(fabsf(a[1][0]) + fabsf(a[1][1]) + fabsf(a[1][2]));
|
(fabsf(a[1][0]) + fabsf(a[1][1]) + fabsf(a[1][2]));
|
||||||
|
|
||||||
glm_vec_dup(a[path], dest);
|
glm_vec_copy(a[path], dest);
|
||||||
} else {
|
} else {
|
||||||
dest[0] = atan2f(m[1][0], m[2][0]);
|
dest[0] = atan2f(m[1][0], m[2][0]);
|
||||||
dest[1] = CGLM_PI_2;
|
dest[1] = CGLM_PI_2;
|
||||||
|
|||||||
@@ -24,8 +24,18 @@
|
|||||||
{0.0f, 0.0f, 1.0f, 0.0f}, \
|
{0.0f, 0.0f, 1.0f, 0.0f}, \
|
||||||
{0.0f, 0.0f, 0.0f, 1.0f}}
|
{0.0f, 0.0f, 0.0f, 1.0f}}
|
||||||
|
|
||||||
|
#define GLM_MAT4_ZERO_INIT {{0.0f, 0.0f, 0.0f, 0.0f}, \
|
||||||
|
{0.0f, 0.0f, 0.0f, 0.0f}, \
|
||||||
|
{0.0f, 0.0f, 0.0f, 0.0f}, \
|
||||||
|
{0.0f, 0.0f, 0.0f, 0.0f}}
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
|
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
|
||||||
|
#define GLM_MAT4_ZERO (mat4)GLM_MAT4_ZERO_INIT
|
||||||
|
|
||||||
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
|
#define glm_mat4_udup(mat, dest) glm_mat4_ucopy(mat, dest)
|
||||||
|
#define glm_mat4_dup(mat, dest) glm_mat4_copy(mat, dest)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief copy all members of [mat] to [dest]
|
* @brief copy all members of [mat] to [dest]
|
||||||
@@ -38,7 +48,7 @@
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_mat4_udup(mat4 mat, mat4 dest) {
|
glm_mat4_ucopy(mat4 mat, mat4 dest) {
|
||||||
glm__memcpy(float, dest, mat, sizeof(mat4));
|
glm__memcpy(float, dest, mat, sizeof(mat4));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +60,7 @@ glm_mat4_udup(mat4 mat, mat4 dest) {
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_mat4_dup(mat4 mat, mat4 dest) {
|
glm_mat4_copy(mat4 mat, mat4 dest) {
|
||||||
#ifdef __AVX__
|
#ifdef __AVX__
|
||||||
_mm256_store_ps(dest[0], _mm256_load_ps(mat[0]));
|
_mm256_store_ps(dest[0], _mm256_load_ps(mat[0]));
|
||||||
_mm256_store_ps(dest[2], _mm256_load_ps(mat[2]));
|
_mm256_store_ps(dest[2], _mm256_load_ps(mat[2]));
|
||||||
@@ -60,7 +70,7 @@ glm_mat4_dup(mat4 mat, mat4 dest) {
|
|||||||
_mm_store_ps(dest[2], _mm_load_ps(mat[2]));
|
_mm_store_ps(dest[2], _mm_load_ps(mat[2]));
|
||||||
_mm_store_ps(dest[3], _mm_load_ps(mat[3]));
|
_mm_store_ps(dest[3], _mm_load_ps(mat[3]));
|
||||||
#else
|
#else
|
||||||
glm_mat4_udup(mat, dest);
|
glm_mat4_ucopy(mat, dest);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +252,7 @@ glm_mat4_mulv(mat4 m, vec4 v, vec4 dest) {
|
|||||||
res[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3];
|
res[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3];
|
||||||
res[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3];
|
res[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3];
|
||||||
res[3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3];
|
res[3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3];
|
||||||
glm_vec4_dup(res, dest);
|
glm_vec4_copy(res, dest);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +270,7 @@ glm_mat4_mulv3(mat4 m, vec3 v, vec3 dest) {
|
|||||||
res[0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2];
|
res[0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2];
|
||||||
res[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2];
|
res[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2];
|
||||||
res[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2];
|
res[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2];
|
||||||
glm_vec_dup(res, dest);
|
glm_vec_copy(res, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -477,9 +487,9 @@ CGLM_INLINE
|
|||||||
void
|
void
|
||||||
glm_mat4_swap_col(mat4 mat, int col1, int col2) {
|
glm_mat4_swap_col(mat4 mat, int col1, int col2) {
|
||||||
vec4 tmp;
|
vec4 tmp;
|
||||||
glm_vec4_dup(mat[col1], tmp);
|
glm_vec4_copy(mat[col1], tmp);
|
||||||
glm_vec4_dup(mat[col2], mat[col1]);
|
glm_vec4_copy(mat[col2], mat[col1]);
|
||||||
glm_vec4_dup(tmp, mat[col2]);
|
glm_vec4_copy(tmp, mat[col2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -14,9 +14,17 @@
|
|||||||
#define GLM_MAT3_IDENTITY_INIT {{1.0f, 0.0f, 0.0f}, \
|
#define GLM_MAT3_IDENTITY_INIT {{1.0f, 0.0f, 0.0f}, \
|
||||||
{0.0f, 1.0f, 0.0f}, \
|
{0.0f, 1.0f, 0.0f}, \
|
||||||
{0.0f, 0.0f, 1.0f}}
|
{0.0f, 0.0f, 1.0f}}
|
||||||
|
#define GLM_MAT3_ZERO_INIT {{0.0f, 0.0f, 0.0f}, \
|
||||||
|
{0.0f, 0.0f, 0.0f}, \
|
||||||
|
{0.0f, 0.0f, 0.0f}}
|
||||||
|
|
||||||
|
|
||||||
/* for C only */
|
/* for C only */
|
||||||
#define GLM_MAT3_IDENTITY (mat3)GLM_MAT3_IDENTITY_INIT
|
#define GLM_MAT3_IDENTITY (mat3)GLM_MAT3_IDENTITY_INIT
|
||||||
|
#define GLM_MAT3_ZERO (mat3)GLM_MAT3_ZERO_INIT
|
||||||
|
|
||||||
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
|
#define glm_mat3_dup(mat, dest) glm_mat3_copy(mat, dest)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief copy all members of [mat] to [dest]
|
* @brief copy all members of [mat] to [dest]
|
||||||
@@ -26,7 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_mat3_dup(mat3 mat, mat3 dest) {
|
glm_mat3_copy(mat3 mat, mat3 dest) {
|
||||||
glm__memcpy(float, dest, mat, sizeof(mat3));
|
glm__memcpy(float, dest, mat, sizeof(mat3));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,9 +225,9 @@ CGLM_INLINE
|
|||||||
void
|
void
|
||||||
glm_mat3_swap_col(mat3 mat, int col1, int col2) {
|
glm_mat3_swap_col(mat3 mat, int col1, int col2) {
|
||||||
vec3 tmp;
|
vec3 tmp;
|
||||||
glm_vec_dup(mat[col1], tmp);
|
glm_vec_copy(mat[col1], tmp);
|
||||||
glm_vec_dup(mat[col2], mat[col1]);
|
glm_vec_copy(mat[col2], mat[col1]);
|
||||||
glm_vec_dup(tmp, mat[col2]);
|
glm_vec_copy(tmp, mat[col2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c), Recep Aslantas.
|
|
||||||
*
|
|
||||||
* MIT License (MIT), http://opensource.org/licenses/MIT
|
|
||||||
* Full license can be found in the LICENSE file
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef cglm_mat_opengl_h
|
|
||||||
#define cglm_mat_opengl_h
|
|
||||||
|
|
||||||
#include "cglm-common.h"
|
|
||||||
#include "cglm-platform.h"
|
|
||||||
|
|
||||||
CGLM_INLINE
|
|
||||||
void
|
|
||||||
glm_uniform(int32_t location, mat4 m) {
|
|
||||||
glm_platform_uniform_mat4fv(location, m[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* cglm_mat_opengl_h */
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c), Recep Aslantas.
|
|
||||||
*
|
|
||||||
* MIT License (MIT), http://opensource.org/licenses/MIT
|
|
||||||
* Full license can be found in the LICENSE file
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef cglm_platform_h
|
|
||||||
#define cglm_platform_h
|
|
||||||
|
|
||||||
#include "cglm-common.h"
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
# include <OpenGL/gl3.h>
|
|
||||||
#else
|
|
||||||
# ifdef _WIN32
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# include <windows.h>
|
|
||||||
# endif
|
|
||||||
# include <GL/gl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
extern
|
|
||||||
void
|
|
||||||
glUniformMatrix4fv(GLint location,
|
|
||||||
GLsizei count,
|
|
||||||
GLboolean transpose,
|
|
||||||
const GLfloat *value);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CGLM_INLINE
|
|
||||||
void
|
|
||||||
glm_platform_uniform_mat4fv(int32_t location,
|
|
||||||
const float *value) {
|
|
||||||
glUniformMatrix4fv(location, 1, GL_FALSE, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
CGLM_INLINE
|
|
||||||
void
|
|
||||||
glm_platfom_get_viewport_rect(int32_t *rect) {
|
|
||||||
glGetIntegerv(GL_VIEWPORT, rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* cglm_platform_h */
|
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_quat_identity(versor q) {
|
glm_quat_identity(versor q) {
|
||||||
glm_vec4_dup(GLM_QUAT_IDENTITY, q);
|
versor v = GLM_QUAT_IDENTITY_INIT;
|
||||||
|
glm_vec4_copy(v, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
@@ -31,7 +32,7 @@ glm_quat(versor q,
|
|||||||
float z) {
|
float z) {
|
||||||
float a, c, s;
|
float a, c, s;
|
||||||
|
|
||||||
a = angle / 2.0f;
|
a = angle * 0.5f;
|
||||||
c = cosf(a);
|
c = cosf(a);
|
||||||
s = sinf(a);
|
s = sinf(a);
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ glm_quatv(versor q,
|
|||||||
vec3 v) {
|
vec3 v) {
|
||||||
float a, c, s;
|
float a, c, s;
|
||||||
|
|
||||||
a = angle / 2.0f;
|
a = angle * 0.5f;
|
||||||
c = cosf(a);
|
c = cosf(a);
|
||||||
s = sinf(a);
|
s = sinf(a);
|
||||||
|
|
||||||
@@ -99,23 +100,33 @@ CGLM_INLINE
|
|||||||
void
|
void
|
||||||
glm_quat_mat4(versor q, mat4 dest) {
|
glm_quat_mat4(versor q, mat4 dest) {
|
||||||
float w, x, y, z;
|
float w, x, y, z;
|
||||||
|
float xx, yy, zz;
|
||||||
|
float xy, yz, xz;
|
||||||
|
float wx, wy, wz;
|
||||||
|
|
||||||
w = q[0];
|
w = q[0];
|
||||||
x = q[1];
|
x = q[1];
|
||||||
y = q[2];
|
y = q[2];
|
||||||
z = q[3];
|
z = q[3];
|
||||||
|
|
||||||
dest[0][0] = 1.0f - 2.0f * (y * y + z * z);
|
xx = 2.0f * x * x; xy = 2.0f * x * y; wx = 2.0f * w * x;
|
||||||
dest[0][1] = 2.0f * (x * y + w * z);
|
yy = 2.0f * y * y; yz = 2.0f * y * z; wy = 2.0f * w * y;
|
||||||
dest[0][2] = 2.0f * (x * z - w * y);
|
zz = 2.0f * z * z; xz = 2.0f * x * z; wz = 2.0f * w * z;
|
||||||
dest[0][3] = 0.0f;
|
|
||||||
dest[1][0] = 2.0f * (x * y - w * z);
|
dest[0][0] = 1.0f - yy - zz;
|
||||||
dest[1][1] = 1.0f - 2.0f * (x * x + z * z);
|
dest[1][1] = 1.0f - xx - zz;
|
||||||
dest[1][2] = 2.0f * (y * z + w * x);
|
dest[2][2] = 1.0f - xx - yy;
|
||||||
|
|
||||||
|
dest[0][1] = xy + wz;
|
||||||
|
dest[1][2] = yz + wx;
|
||||||
|
dest[2][0] = xz + wy;
|
||||||
|
|
||||||
|
dest[1][0] = xy - wz;
|
||||||
|
dest[2][1] = yz - wx;
|
||||||
|
dest[0][2] = xz - wy;
|
||||||
|
|
||||||
dest[1][3] = 0.0f;
|
dest[1][3] = 0.0f;
|
||||||
dest[2][0] = 2.0f * (x * z + w * y);
|
dest[0][3] = 0.0f;
|
||||||
dest[2][1] = 2.0f * (y * z - w * x);
|
|
||||||
dest[2][2] = 1.0f - 2.0f * (x * x + y * y);
|
|
||||||
dest[2][3] = 0.0f;
|
dest[2][3] = 0.0f;
|
||||||
dest[3][0] = 0.0f;
|
dest[3][0] = 0.0f;
|
||||||
dest[3][1] = 0.0f;
|
dest[3][1] = 0.0f;
|
||||||
|
|||||||
@@ -45,4 +45,10 @@ glm_make_deg(float *rad) {
|
|||||||
*rad = *rad * 180.0f / CGLM_PI;
|
*rad = *rad * 180.0f / CGLM_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
float
|
||||||
|
glm_pow2(float x) {
|
||||||
|
return x * x;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* cglm_util_h */
|
#endif /* cglm_util_h */
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ glm_vec_broadcast(float val, vec3 d) {
|
|||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec4_broadcast(float val, vec3 d) {
|
glm_vec4_broadcast(float val, vec4 d) {
|
||||||
#if defined( __SSE__ ) || defined( __SSE2__ )
|
#if defined( __SSE__ ) || defined( __SSE2__ )
|
||||||
_mm_store_ps(d, _mm_set1_ps(val));
|
_mm_store_ps(d, _mm_set1_ps(val));
|
||||||
#else
|
#else
|
||||||
@@ -148,7 +148,7 @@ float
|
|||||||
glm_vec4_min(vec4 v) {
|
glm_vec4_min(vec4 v) {
|
||||||
float min;
|
float min;
|
||||||
|
|
||||||
min = glm_vec_max(v);
|
min = glm_vec_min(v);
|
||||||
if (v[3] < min)
|
if (v[3] < min)
|
||||||
min = v[3];
|
min = v[3];
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
#include "cglm-common.h"
|
#include "cglm-common.h"
|
||||||
#include "cglm-vec-ext.h"
|
#include "cglm-vec-ext.h"
|
||||||
#include "arch/simd/cglm-intrin.h"
|
#include "arch/simd/cglm-intrin.h"
|
||||||
|
#include "cglm-util.h"
|
||||||
|
|
||||||
|
/* DEPRECATED! use _copy, _ucopy versions */
|
||||||
|
#define glm_vec_dup(v, dest) glm_vec_copy(v, dest)
|
||||||
|
#define glm_vec4_dup3(v, dest) glm_vec4_copy3(v, dest)
|
||||||
|
#define glm_vec4_dup(v, dest) glm_vec4_copy(v, dest)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief copy all members of [a] to [dest]
|
* @brief copy all members of [a] to [dest]
|
||||||
@@ -25,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec_dup(vec3 a, vec3 dest) {
|
glm_vec_copy(vec3 a, vec3 dest) {
|
||||||
dest[0] = a[0];
|
dest[0] = a[0];
|
||||||
dest[1] = a[1];
|
dest[1] = a[1];
|
||||||
dest[2] = a[2];
|
dest[2] = a[2];
|
||||||
@@ -39,7 +45,7 @@ glm_vec_dup(vec3 a, vec3 dest) {
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec4_dup3(vec4 a, vec3 dest) {
|
glm_vec4_copy3(vec4 a, vec3 dest) {
|
||||||
dest[0] = a[0];
|
dest[0] = a[0];
|
||||||
dest[1] = a[1];
|
dest[1] = a[1];
|
||||||
dest[2] = a[2];
|
dest[2] = a[2];
|
||||||
@@ -53,7 +59,7 @@ glm_vec4_dup3(vec4 a, vec3 dest) {
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_vec4_dup(vec4 v, vec4 dest) {
|
glm_vec4_copy(vec4 v, vec4 dest) {
|
||||||
#if defined( __SSE__ ) || defined( __SSE2__ )
|
#if defined( __SSE__ ) || defined( __SSE2__ )
|
||||||
_mm_store_ps(dest, _mm_load_ps(v));
|
_mm_store_ps(dest, _mm_load_ps(v));
|
||||||
#else
|
#else
|
||||||
@@ -475,7 +481,7 @@ glm_vec_rotate_m4(mat4 m, vec3 v, vec3 dest) {
|
|||||||
res[1] = x[1] * v[0] + y[1] * v[1] + z[1] * v[2];
|
res[1] = x[1] * v[0] + y[1] * v[1] + z[1] * v[2];
|
||||||
res[2] = x[2] * v[0] + y[2] * v[1] + z[2] * v[2];
|
res[2] = x[2] * v[0] + y[2] * v[1] + z[2] * v[2];
|
||||||
|
|
||||||
glm_vec_dup(res, dest);
|
glm_vec_copy(res, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -493,4 +499,49 @@ glm_vec_proj(vec3 a, vec3 b, vec3 dest) {
|
|||||||
dest);
|
dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief find center point of two vector
|
||||||
|
*
|
||||||
|
* @param[in] v1
|
||||||
|
* @param[in] v2
|
||||||
|
* @param[out] dest center point
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_vec_center(vec3 v1, vec3 v2, vec3 dest) {
|
||||||
|
glm_vec_add(v1, v2, dest);
|
||||||
|
glm_vec_scale(dest, 0.5f, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief distance between two vectors
|
||||||
|
*
|
||||||
|
* @param[in] v1
|
||||||
|
* @param[in] v2
|
||||||
|
* @return returns distance
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
float
|
||||||
|
glm_vec_distance(vec3 v1, vec3 v2) {
|
||||||
|
return sqrtf(glm_pow2(v2[0] - v1[0])
|
||||||
|
+ glm_pow2(v2[1] - v1[1])
|
||||||
|
+ glm_pow2(v2[2] - v1[2]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief distance between two vectors
|
||||||
|
*
|
||||||
|
* @param[in] v1
|
||||||
|
* @param[in] v2
|
||||||
|
* @return returns distance
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
float
|
||||||
|
glm_vec4_distance(vec4 v1, vec4 v2) {
|
||||||
|
return sqrtf(glm_pow2(v2[0] - v1[0])
|
||||||
|
+ glm_pow2(v2[1] - v1[1])
|
||||||
|
+ glm_pow2(v2[2] - v1[2])
|
||||||
|
+ glm_pow2(v2[3] - v1[3]));
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* cglm_vec_h */
|
#endif /* cglm_vec_h */
|
||||||
|
|||||||
15
include/cglm-version.h
Normal file
15
include/cglm-version.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c), Recep Aslantas.
|
||||||
|
*
|
||||||
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
* Full license can be found in the LICENSE file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef cglm_version_h
|
||||||
|
#define cglm_version_h
|
||||||
|
|
||||||
|
#define CGLM_VERSION_MAJOR 0
|
||||||
|
#define CGLM_VERSION_MINOR 2
|
||||||
|
#define CGLM_VERSION_PATCH 1
|
||||||
|
|
||||||
|
#endif /* cglm_version_h */
|
||||||
75
makefile.am
75
makefile.am
@@ -18,37 +18,55 @@ AM_CFLAGS = -Wall \
|
|||||||
lib_LTLIBRARIES = libcglm.la
|
lib_LTLIBRARIES = libcglm.la
|
||||||
libcglm_la_LDFLAGS = -no-undefined -version-info 0:1:0
|
libcglm_la_LDFLAGS = -no-undefined -version-info 0:1:0
|
||||||
|
|
||||||
nobase_include_HEADERS = include/cglm.h \
|
checkLDFLAGS = -L./.libs \
|
||||||
include/cglm-call.h \
|
-L./test/lib/cmocka/build/src \
|
||||||
include/cglm-cam.h \
|
-lcmocka \
|
||||||
include/cglm-io.h \
|
-lm \
|
||||||
include/cglm-mat3.h \
|
-lcglm
|
||||||
include/cglm-types.h \
|
checkCFLAGS = -I./test/lib/cmocka/include \
|
||||||
include/cglm-common.h \
|
-I./include
|
||||||
include/cglm-affine.h \
|
|
||||||
include/cglm-vec.h \
|
check_PROGRAMS = test/test_mat4
|
||||||
include/cglm-euler.h \
|
TESTS = $(check_PROGRAMS)
|
||||||
include/cglm-util.h \
|
|
||||||
include/cglm-quat.h \
|
test_test_mat4_LDFLAGS = $(checkLDFLAGS)
|
||||||
include/cglm-mat.h \
|
test_test_mat4_CFLAGS = $(checkCFLAGS)
|
||||||
include/cglm-affine-mat.h \
|
|
||||||
include/cglm-platform.h \
|
cglmdir=$(includedir)/cglm
|
||||||
include/cglm-opengl.h \
|
cglm_HEADERS = include/cglm-version.h \
|
||||||
include/arch/simd/cglm-mat-simd-avx.h \
|
include/cglm.h \
|
||||||
|
include/cglm-call.h \
|
||||||
|
include/cglm-cam.h \
|
||||||
|
include/cglm-io.h \
|
||||||
|
include/cglm-mat3.h \
|
||||||
|
include/cglm-types.h \
|
||||||
|
include/cglm-common.h \
|
||||||
|
include/cglm-affine.h \
|
||||||
|
include/cglm-vec.h \
|
||||||
|
include/cglm-euler.h \
|
||||||
|
include/cglm-util.h \
|
||||||
|
include/cglm-quat.h \
|
||||||
|
include/cglm-mat.h \
|
||||||
|
include/cglm-affine-mat.h
|
||||||
|
|
||||||
|
cglm_arch_simddir=$(includedir)/cglm/arch/simd/
|
||||||
|
cglm_arch_simd_HEADERS = include/arch/simd/cglm-mat-simd-avx.h \
|
||||||
include/arch/simd/cglm-affine-mat-avx.h \
|
include/arch/simd/cglm-affine-mat-avx.h \
|
||||||
include/arch/simd/cglm-quat-simd.h \
|
include/arch/simd/cglm-quat-simd.h \
|
||||||
include/arch/simd/cglm-affine-mat-sse2.h \
|
include/arch/simd/cglm-affine-mat-sse2.h \
|
||||||
include/arch/simd/cglm-mat3-simd-sse2.h \
|
include/arch/simd/cglm-mat3-simd-sse2.h \
|
||||||
include/arch/simd/cglm-mat-simd-sse2.h \
|
include/arch/simd/cglm-mat-simd-sse2.h \
|
||||||
include/arch/simd/cglm-intrin.h \
|
include/arch/simd/cglm-intrin.h
|
||||||
include/call/cglmc-euler.h \
|
|
||||||
include/call/cglmc-quat.h \
|
cglm_calldir=$(includedir)/cglm/call
|
||||||
include/call/cglmc-cam.h \
|
cglm_call_HEADERS = include/call/cglmc-euler.h \
|
||||||
include/call/cglmc-io.h \
|
include/call/cglmc-quat.h \
|
||||||
include/call/cglmc-affine.h \
|
include/call/cglmc-cam.h \
|
||||||
include/call/cglmc-vec.h \
|
include/call/cglmc-io.h \
|
||||||
include/call/cglmc-mat3.h \
|
include/call/cglmc-affine.h \
|
||||||
include/call/cglmc-mat.h
|
include/call/cglmc-vec.h \
|
||||||
|
include/call/cglmc-mat3.h \
|
||||||
|
include/call/cglmc-mat.h
|
||||||
|
|
||||||
libcglm_la_SOURCES=\
|
libcglm_la_SOURCES=\
|
||||||
src/cglm-euler.c \
|
src/cglm-euler.c \
|
||||||
@@ -59,3 +77,8 @@ libcglm_la_SOURCES=\
|
|||||||
src/cglm-vec.c \
|
src/cglm-vec.c \
|
||||||
src/cglm-mat3.c \
|
src/cglm-mat3.c \
|
||||||
src/cglm-mat.c
|
src/cglm-mat.c
|
||||||
|
|
||||||
|
test_test_mat4_SOURCES=test/src/test_mat4.c
|
||||||
|
|
||||||
|
all-local:
|
||||||
|
sh ./post-build.sh
|
||||||
|
|||||||
19
post-build.sh
Normal file
19
post-build.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c), Recep Aslantas.
|
||||||
|
#
|
||||||
|
# MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
# Full license can be found in the LICENSE file
|
||||||
|
#
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
|
||||||
|
mkdir -p .libs
|
||||||
|
|
||||||
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
ln -sf $(pwd)/test/lib/cmocka/build/src/libcmocka.0.dylib \
|
||||||
|
.libs/libcmocka.0.dylib;
|
||||||
|
else
|
||||||
|
ln -sf $(pwd)/test/lib/cmocka/build/src/libcmocka.so.0 \
|
||||||
|
.libs/libcmocka.so.0;
|
||||||
|
fi
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat4_udup(mat4 mat, mat4 dest) {
|
glmc_mat4_ucopy(mat4 mat, mat4 dest) {
|
||||||
glm_mat4_dup(mat, dest);
|
glm_mat4_copy(mat, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat4_dup(mat4 mat, mat4 dest) {
|
glmc_mat4_copy(mat4 mat, mat4 dest) {
|
||||||
glm_mat4_dup(mat, dest);
|
glm_mat4_copy(mat, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat3_dup(mat3 mat, mat3 dest) {
|
glmc_mat3_copy(mat3 mat, mat3 dest) {
|
||||||
glm_mat3_dup(mat, dest);
|
glm_mat3_copy(mat, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
|
|||||||
@@ -9,20 +9,20 @@
|
|||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec_dup(vec3 a, vec3 dest) {
|
glmc_vec_copy(vec3 a, vec3 dest) {
|
||||||
glm_vec_dup(a, dest);
|
glm_vec_copy(a, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec4_dup3(vec4 a, vec3 dest) {
|
glmc_vec4_copy3(vec4 a, vec3 dest) {
|
||||||
glm_vec4_dup3(a, dest);
|
glm_vec4_copy3(a, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec4_dup(vec4 v, vec4 dest) {
|
glmc_vec4_copy(vec4 v, vec4 dest) {
|
||||||
glm_vec4_dup(v, dest);
|
glm_vec4_copy(v, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
@@ -162,3 +162,21 @@ void
|
|||||||
glmc_vec_proj(vec3 a, vec3 b, vec3 dest) {
|
glmc_vec_proj(vec3 a, vec3 b, vec3 dest) {
|
||||||
glm_vec_proj(a, b, dest);
|
glm_vec_proj(a, b, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_vec_center(vec3 v1, vec3 v2, vec3 dest) {
|
||||||
|
glm_vec_center(v1, v2, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
float
|
||||||
|
glmc_vec_distance(vec3 v1, vec3 v2) {
|
||||||
|
return glm_vec_distance(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
float
|
||||||
|
glmc_vec4_distance(vec4 v1, vec4 v2) {
|
||||||
|
return glm_vec4_distance(v1, v2);
|
||||||
|
}
|
||||||
|
|||||||
22
src/config.h
Normal file
22
src/config.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c), Recep Aslantas.
|
||||||
|
*
|
||||||
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
* Full license can be found in the LICENSE file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef cglm__config__h_
|
||||||
|
#define cglm__config__h_
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(WIN32)
|
||||||
|
|
||||||
|
/* Exclude rarely-used stuff from Windows headers */
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# include <SDKDDKVer.h>
|
||||||
|
|
||||||
|
/* Windows Header Files: */
|
||||||
|
# include <windows.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* cglm__config__h_ */
|
||||||
23
src/dllmain.c
Normal file
23
src/dllmain.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c), Recep Aslantas.
|
||||||
|
*
|
||||||
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
* Full license can be found in the LICENSE file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
APIENTRY
|
||||||
|
DllMain(HMODULE hModule,
|
||||||
|
DWORD ul_reason_for_call,
|
||||||
|
LPVOID lpReserved) {
|
||||||
|
switch (ul_reason_for_call) {
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
case DLL_THREAD_ATTACH:
|
||||||
|
case DLL_THREAD_DETACH:
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
1
test/lib/cmocka
Submodule
1
test/lib/cmocka
Submodule
Submodule test/lib/cmocka added at 5f61d2f188
40
test/src/test_common.h
Normal file
40
test/src/test_common.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c), Recep Aslantas.
|
||||||
|
*
|
||||||
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
* Full license can be found in the LICENSE file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef test_common_h
|
||||||
|
#define test_common_h
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <cmocka.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <cglm.h>
|
||||||
|
#include <cglm-call.h>
|
||||||
|
|
||||||
|
#define precision 0.00001f
|
||||||
|
|
||||||
|
static
|
||||||
|
void
|
||||||
|
test_rand_mat4(mat4 dest);
|
||||||
|
|
||||||
|
static
|
||||||
|
void
|
||||||
|
test_rand_mat4(mat4 dest) {
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
srand((unsigned int)time(NULL));
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
for (j = 0; j < 4; j++) {
|
||||||
|
dest[i][j] = drand48();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* test_common_h */
|
||||||
77
test/src/test_mat4.c
Normal file
77
test/src/test_mat4.c
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c), Recep Aslantas.
|
||||||
|
*
|
||||||
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
||||||
|
* Full license can be found in the LICENSE file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
|
#include "test_common.h"
|
||||||
|
|
||||||
|
#define m 4
|
||||||
|
#define n 4
|
||||||
|
|
||||||
|
void
|
||||||
|
test_mat4_mul(void **state) {
|
||||||
|
mat4 m1 = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
mat4 m2 = GLM_MAT4_IDENTITY_INIT;
|
||||||
|
mat4 m3;
|
||||||
|
mat4 m4 = GLM_MAT4_ZERO_INIT;
|
||||||
|
int i, j, k;
|
||||||
|
|
||||||
|
/* test identity matrix multiplication */
|
||||||
|
glm_mat4_mul(m1, m2, m3);
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
for (j = 0; j < n; j++) {
|
||||||
|
if (i == j)
|
||||||
|
assert_true(m3[i][j] == 1.0f);
|
||||||
|
else
|
||||||
|
assert_true(m3[i][j] == 0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* test random matrices */
|
||||||
|
/* random matrices */
|
||||||
|
test_rand_mat4(m1);
|
||||||
|
test_rand_mat4(m2);
|
||||||
|
|
||||||
|
glm_mat4_mul(m1, m2, m3);
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
for (j = 0; j < n; j++) {
|
||||||
|
for (k = 0; k < m; k++)
|
||||||
|
/* column-major */
|
||||||
|
m4[i][j] += m1[k][j] * m2[i][k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
for (j = 0; j < n; j++) {
|
||||||
|
for (k = 0; k < m; k++)
|
||||||
|
assert_true(fabsf(m3[i][j] - m4[i][j]) <= FLT_EPSILON);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* test pre compiled */
|
||||||
|
glmc_mat4_mul(m1, m2, m3);
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
for (j = 0; j < n; j++) {
|
||||||
|
for (k = 0; k < m; k++)
|
||||||
|
assert_true(fabsf(m3[i][j] - m4[i][j]) <= FLT_EPSILON);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, const char * argv[]) {
|
||||||
|
const struct CMUnitTest tests[] = {
|
||||||
|
cmocka_unit_test(test_mat4_mul)
|
||||||
|
};
|
||||||
|
|
||||||
|
return cmocka_run_group_tests(tests,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
4
win/.gitignore
vendored
Normal file
4
win/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
!cglm.sln
|
||||||
|
!cglm.vcxproj
|
||||||
|
!cglm.vcxproj.filters
|
||||||
|
!packages.config
|
||||||
1
win/build.bat
Normal file
1
win/build.bat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
msbuild cglm.vcxproj /p:Configuration=Release
|
||||||
28
win/cglm.sln
Normal file
28
win/cglm.sln
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
VisualStudioVersion = 15.0.26403.7
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglm", "cglm.vcxproj", "{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Release|x64.Build.0 = Release|x64
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
213
win/cglm.vcxproj
Normal file
213
win/cglm.vcxproj
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>15.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{CA8BCAF9-CD25-4133-8F62-3D1449B5D2FC}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>cglm</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<PrecompiledHeaderFile />
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<EnablePREfast>true</EnablePREfast>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
|
||||||
|
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<PrecompiledHeaderFile />
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<EnablePREfast>true</EnablePREfast>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<PrecompiledHeaderFile />
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<EnablePREfast>true</EnablePREfast>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CGLM_EXPORTS;CGLM_DLL;%(PreprocessorDefinitions);CGLM_DLL</PreprocessorDefinitions>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<PrecompiledHeaderFile />
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<EnablePREfast>true</EnablePREfast>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-affine-mat-avx.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-affine-mat-sse2.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-intrin.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat-simd-avx.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat-simd-sse2.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat3-simd-sse2.h" />
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-quat-simd.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-affine.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-cam.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-euler.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-io.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-mat.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-mat3.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-quat.h" />
|
||||||
|
<ClInclude Include="..\include\call\cglmc-vec.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-affine-mat.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-affine.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-call.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-cam.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-common.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-euler.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-io.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-mat.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-mat3.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-quat.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-types.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-util.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-vec-ext.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-vec.h" />
|
||||||
|
<ClInclude Include="..\include\cglm-version.h" />
|
||||||
|
<ClInclude Include="..\include\cglm.h" />
|
||||||
|
<ClInclude Include="..\src\config.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\src\cglm-cam.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-euler.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-io.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-mat.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-mat3.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-quat.c" />
|
||||||
|
<ClCompile Include="..\src\cglm-vec.c" />
|
||||||
|
<ClCompile Include="..\src\clgm-affine.c" />
|
||||||
|
<ClCompile Include="..\src\dllmain.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
156
win/cglm.vcxproj.filters
Normal file
156
win/cglm.vcxproj.filters
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="src">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="include">
|
||||||
|
<UniqueIdentifier>{f46634e5-c098-41a0-afb3-45afb6a53593}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="include\call">
|
||||||
|
<UniqueIdentifier>{496b3b53-1258-4efa-87b2-4280ea82f87e}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="include\arch">
|
||||||
|
<UniqueIdentifier>{28919415-29bd-4edd-8ab1-1ec9a16e46f0}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="include\arch\simd">
|
||||||
|
<UniqueIdentifier>{792cb1a9-bdc8-4f00-bfde-067750b0ab41}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\include\cglm.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-affine.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-affine-mat.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-call.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-cam.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-common.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-euler.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-io.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-mat.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-mat3.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-quat.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-types.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-util.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-vec.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-vec-ext.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-affine.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-cam.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-euler.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-io.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-mat.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-mat3.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-quat.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\call\cglmc-vec.h">
|
||||||
|
<Filter>include\call</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-affine-mat-avx.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-affine-mat-sse2.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-intrin.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat3-simd-sse2.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat-simd-avx.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-mat-simd-sse2.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\arch\simd\cglm-quat-simd.h">
|
||||||
|
<Filter>include\arch\simd</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\src\config.h">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\include\cglm-version.h">
|
||||||
|
<Filter>include</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\src\cglm-cam.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-euler.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-io.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-mat.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-mat3.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-quat.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\cglm-vec.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\clgm-affine.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\src\dllmain.c">
|
||||||
|
<Filter>src</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user