• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/// @ref gtx_matrix_cross_product
2/// @file glm/gtx/matrix_cross_product.inl
3
4namespace glm
5{
6	template <typename T, precision P>
7	GLM_FUNC_QUALIFIER tmat3x3<T, P> matrixCross3
8	(
9		tvec3<T, P> const & x
10	)
11	{
12		tmat3x3<T, P> Result(T(0));
13		Result[0][1] = x.z;
14		Result[1][0] = -x.z;
15		Result[0][2] = -x.y;
16		Result[2][0] = x.y;
17		Result[1][2] = x.x;
18		Result[2][1] = -x.x;
19		return Result;
20	}
21
22	template <typename T, precision P>
23	GLM_FUNC_QUALIFIER tmat4x4<T, P> matrixCross4
24	(
25		tvec3<T, P> const & x
26	)
27	{
28		tmat4x4<T, P> Result(T(0));
29		Result[0][1] = x.z;
30		Result[1][0] = -x.z;
31		Result[0][2] = -x.y;
32		Result[2][0] = x.y;
33		Result[1][2] = x.x;
34		Result[2][1] = -x.x;
35		return Result;
36	}
37
38}//namespace glm
39