Skip to content

Commit

Permalink
Add graphene_matrix_decompose()
Browse files Browse the repository at this point in the history
Users of graphene_matrix_t have expressed the desire to have a
"decompose" method to go from a transformation matrix to its component
transformations. Since we're already doing this work for the
interpolation between two matrices, we might as well make it publicly
available.
  • Loading branch information
ebassi committed Aug 26, 2019
1 parent 7e400c5 commit a676aad
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 89 deletions.
1 change: 1 addition & 0 deletions doc/graphene-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ graphene_matrix_get_z_translation
graphene_matrix_get_x_scale
graphene_matrix_get_y_scale
graphene_matrix_get_z_scale
graphene_matrix_decompose
graphene_matrix_interpolate
graphene_matrix_equal
graphene_matrix_equal_fast
Expand Down
8 changes: 8 additions & 0 deletions include/graphene-matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,12 @@ bool graphene_matrix_equal_fast (const graphene_
GRAPHENE_AVAILABLE_IN_1_0
void graphene_matrix_print (const graphene_matrix_t *m);

GRAPHENE_AVAILABLE_IN_1_10
bool graphene_matrix_decompose (const graphene_matrix_t *m,
graphene_vec3_t *translate,
graphene_vec3_t *scale,
graphene_quaternion_t *rotate,
graphene_vec3_t *shear,
graphene_vec4_t *perspective);

GRAPHENE_END_DECLS
Loading

0 comments on commit a676aad

Please sign in to comment.