Exemplo n.º 1
0
void
graphene_matrix_rotate (graphene_matrix_t     *m,
                        float                  angle,
                        const graphene_vec3_t *axis)
{
  graphene_simd4x4f_t rot_m;

  graphene_simd4x4f_rotation (&rot_m, angle, axis->value);
  graphene_simd4x4f_mul (&m->value, &rot_m, &m->value);
}
Exemplo n.º 2
0
static inline void
graphene_matrix_rotate_internal (graphene_simd4x4f_t *m,
                                 float                angle,
                                 graphene_simd4f_t    axis)
{
  float rad = angle * GRAPHENE_PI / 180.f;
  graphene_simd4x4f_t rot_m;

  graphene_simd4x4f_rotation (&rot_m, rad, axis);
  graphene_simd4x4f_matrix_mul (m, &rot_m, m);
}
Exemplo n.º 3
0
graphene_matrix_t *
graphene_matrix_init_rotate (graphene_matrix_t     *m,
                             float                  angle,
                             const graphene_vec3_t *axis)
{
  g_return_val_if_fail (m != NULL, NULL);
  g_return_val_if_fail (axis != NULL, m);

  graphene_simd4x4f_rotation (&m->value, angle, axis->value);

  return m;
}
Exemplo n.º 4
0
/**
 * graphene_matrix_init_rotate:
 * @m: a #graphene_matrix_t
 * @angle: the rotation angle, in degrees
 * @axis: the axis vector as a #graphene_vec3_t
 *
 * Initializes @m to represent a rotation of @angle degrees on
 * the axis represented by the @axis vector.
 *
 * Returns: (transfer none): the initialized matrix
 *
 * Since: 1.0
 */
graphene_matrix_t *
graphene_matrix_init_rotate (graphene_matrix_t     *m,
                             float                  angle,
                             const graphene_vec3_t *axis)
{
  float rad;

  rad = angle * GRAPHENE_PI / 180.f;

  graphene_simd4x4f_rotation (&m->value, rad, axis->value);

  return m;
}