File: ext_matrix_common.cpp

package info (click to toggle)
glm 0.9.9.8%2Bds-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 8,152 kB
  • sloc: cpp: 38,114; sh: 31; makefile: 23
file content (53 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <glm/ext/matrix_common.hpp>
#include <glm/ext/matrix_double4x4.hpp>
#include <glm/ext/matrix_float4x4.hpp>
#include <glm/ext/matrix_relational.hpp>
#include <glm/ext/vector_bool4.hpp>

static int test_mix()
{
	int Error = 0;

	{
		glm::mat4 A(2);
		glm::mat4 B(4);
		glm::mat4 C = glm::mix(A, B, 0.5f);
		glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1);
		Error += glm::all(D) ? 0 : 1;
	}

	{
		glm::mat4 A(2);
		glm::mat4 B(4);
		glm::mat4 C = glm::mix(A, B, 0.5);
		glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1);
		Error += glm::all(D) ? 0 : 1;
	}

	{
		glm::dmat4 A(2);
		glm::dmat4 B(4);
		glm::dmat4 C = glm::mix(A, B, 0.5);
		glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1);
		Error += glm::all(D) ? 0 : 1;
	}

	{
		glm::dmat4 A(2);
		glm::dmat4 B(4);
		glm::dmat4 C = glm::mix(A, B, 0.5f);
		glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1);
		Error += glm::all(D) ? 0 : 1;
	}

	return Error;
}

int main()
{
	int Error = 0;

	Error += test_mix();

	return Error;
}