mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
cogl-matrix: Add a public cogl_matrix_transpose()
This function takes a single matrix argument and replaces the matrix with its transpose. Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
parent
037c0aa88c
commit
d2fd168351
@ -1689,7 +1689,6 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
|
||||
_cogl_matrix_init_from_quaternion (matrix, quaternion);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Transpose a float matrix.
|
||||
*/
|
||||
@ -1713,7 +1712,6 @@ _cogl_matrix_util_transposef (float to[16], const float from[16])
|
||||
to[14] = from[11];
|
||||
to[15] = from[15];
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
|
||||
@ -2122,3 +2120,18 @@ cogl_matrix_look_at (CoglMatrix *matrix,
|
||||
|
||||
cogl_matrix_multiply (matrix, matrix, &tmp);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_matrix_transpose (CoglMatrix *matrix)
|
||||
{
|
||||
float new_values[16];
|
||||
|
||||
/* We don't need to do anything if the matrix is the identity matrix */
|
||||
if (!(matrix->flags & MAT_DIRTY_TYPE) &&
|
||||
matrix->type == COGL_MATRIX_TYPE_IDENTITY)
|
||||
return;
|
||||
|
||||
_cogl_matrix_util_transposef (new_values, cogl_matrix_get_array (matrix));
|
||||
|
||||
cogl_matrix_init_from_array (matrix, new_values);
|
||||
}
|
||||
|
@ -653,6 +653,18 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
|
||||
gboolean
|
||||
cogl_matrix_is_identity (const CoglMatrix *matrix);
|
||||
|
||||
/**
|
||||
* cogl_matrix_transpose:
|
||||
* @matrix: A #CoglMatrix
|
||||
*
|
||||
* Replaces @matrix with its transpose. Ie, every element (i,j) in the
|
||||
* new matrix is taken from element (j,i) in the old matrix.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
cogl_matrix_transpose (CoglMatrix *matrix);
|
||||
|
||||
#ifdef _COGL_SUPPORTS_GTYPE_INTEGRATION
|
||||
|
||||
#define COGL_GTYPE_TYPE_MATRIX (cogl_gtype_matrix_get_type ())
|
||||
|
@ -486,6 +486,7 @@ cogl_matrix_multiply
|
||||
cogl_matrix_rotate
|
||||
cogl_matrix_translate
|
||||
cogl_matrix_scale
|
||||
cogl_matrix_transpose
|
||||
cogl_matrix_get_array
|
||||
cogl_matrix_get_inverse
|
||||
cogl_matrix_transform_point
|
||||
|
@ -463,6 +463,7 @@ cogl_matrix_multiply
|
||||
cogl_matrix_rotate
|
||||
cogl_matrix_translate
|
||||
cogl_matrix_scale
|
||||
cogl_matrix_transpose
|
||||
cogl_matrix_init_from_array
|
||||
cogl_matrix_get_array
|
||||
cogl_matrix_get_inverse
|
||||
|
Loading…
Reference in New Issue
Block a user