mirror of
https://github.com/recp/cglm.git
synced 2026-11-18 10:17:13 -06:00
Add glm_perspective_rh_zo function + tests
This commit adds the RH/ZO perspective function. It does so in the new file `cam_rh_zo.h` and further refactors the LH variant into new file `cam_lh_zo.h`. This creates some churn in the tests and configuration files as new test files were added as well, and all these changes found their way into the build files. Tests passing on Linux.
This commit is contained in:
1 parent
1bce62c371
commit
b3a18b8a15
14 files changed
+269
-70
No files matched your search
@@ -10,6 +10,21 @@ static void outputForPerspectiveLH_ZO() {
|
||||
const float near = 0.1f;
|
||||
const float far = 100.0f;
|
||||
glm::mat4 cmp = glm::perspectiveLH_ZO(fovy, aspect, near, far);
|
||||
puts("/*reference test data for glm_perspective_lh_zo*/");
|
||||
puts("mat4 cmp = {0};");
|
||||
printf("cmp[0][0] = %0.7ff;\n", cmp[0][0]);
|
||||
printf("cmp[1][1] = %0.7ff;\n", cmp[1][1]);
|
||||
printf("cmp[2][2] = %0.7ff;\n", cmp[2][2]);
|
||||
printf("cmp[2][3] = %0.7ff;\n", cmp[2][3]);
|
||||
printf("cmp[3][2] = %0.7ff;\n", cmp[3][2]);
|
||||
}
|
||||
static void outputForPerspectiveRH_ZO() {
|
||||
const float fovy = glm::radians(45.0f);
|
||||
const float aspect = 640/480.0f;
|
||||
const float near = 0.1f;
|
||||
const float far = 100.0f;
|
||||
glm::mat4 cmp = glm::perspectiveRH_ZO(fovy, aspect, near, far);
|
||||
puts("/*reference test data for glm_perspective_rh_zo*/");
|
||||
puts("mat4 cmp = {0};");
|
||||
printf("cmp[0][0] = %0.7ff;\n", cmp[0][0]);
|
||||
printf("cmp[1][1] = %0.7ff;\n", cmp[1][1]);
|
||||
@@ -19,6 +34,6 @@ static void outputForPerspectiveLH_ZO() {
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
outputForPerspectiveLH_ZO();
|
||||
outputForPerspectiveRH_ZO();
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user