Пример #1
0
/**
 * graphene_vec3_get_xyz1:
 * @v: a #graphene_vec3_t
 * @res: (out caller-allocates): return location for the vector
 *
 * Converts a #graphene_vec3_t in a #graphene_vec4_t using 1.0
 * as the value for the fourth component of the resulting vector.
 *
 * Since: 1.0
 */
void
graphene_vec3_get_xyz1 (const graphene_vec3_t *v,
                        graphene_vec4_t       *res)
{
  res->value = graphene_simd4f_add (graphene_simd4f_zero_w (v->value),
                                    graphene_simd4f_init (0.f, 0.f, 0.f, 1.f));
}
Пример #2
0
/**
 * graphene_simd4f_zero_w:
 * @s: a #graphene_simd4f_t
 *
 * Creates a new #graphene_simd4f_t that contains the
 * same values of the given @s vector, except for the
 * W component, which is set to 0.
 *
 * Returns: the new vector
 *
 * Since: 1.0
 */
graphene_simd4f_t
(graphene_simd4f_zero_w) (const graphene_simd4f_t s)
{
  return graphene_simd4f_zero_w (s);
}
Пример #3
0
/**
 * graphene_vec4_get_xyz:
 * @v: a #graphene_vec4_t
 * @res: (out caller-allocates): return location for a graphene_vec3_t
 *
 * Creates a #graphene_vec3_t that contains the first three components
 * of the given #graphene_vec4_t.
 *
 * Since: 1.0
 */
void
graphene_vec4_get_xyz (const graphene_vec4_t *v,
                       graphene_vec3_t       *res)
{
  res->value = graphene_simd4f_zero_w (v->value);
}