Add function glm_perspective_lh_zo

This commit adds the function `glm_perspective_lh_zo`, modelled on the
implementation of glm_perspective, but amended to provide a left-hand
coordinate system expected by DirectX, Metal and Vulkan (per the GLM
project's `glm/detail/setup.hpp`). It uses a clip-space of zero-to-one.

The function is tested against a longhand version of the algorithm it
seeks to implement as well as against the output of the GLM project's
`glm::perspectiveLH_ZO` function. This commit adds a new subdirectory
`test/glm_cmp` which contains a basic CMake file and `main.cpp`. An
interested user should link or copy or clone the GLM project into this
directory. The `main` function can be used to print the reference data
used so others can verify behaviour in the future, or add new literal
reference values.
This commit is contained in:
michaelg
2021-04-28 23:15:51 +01:00
committed by Tai Chi Minh Ralph Eastwood
parent a242d83805
commit 1bce62c371
9 changed files with 120 additions and 0 deletions

View File

@@ -394,6 +394,10 @@ You can pass matrices the same way to other APIs e.g. Vulkan, DX...
- 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
## Comparing cglm with glm results
Contributors who wish to generate test results using the GLM library are pointed at the simple application in `test/glm_cmp`. A single file `test/glm_cmp/src/main.cpp` exists to which further functions can be added to print additional reference values. This is deliberately not part of the standard build.
**TODO:**
- [ ] Unit tests (In Progress)
- [ ] Unit tests for comparing cglm with glm results