Exemple #1
0
/**
 * vsg_vector3@t@_set:
 * @vec: a #VsgVector3@t@
 * @x: abscissa
 * @y: ordinate
 * @z: Z coordinate
 *
 * Sets @vec to coordinates: @x, @y.
 */
void vsg_vector3@t@_set (VsgVector3@t@ *vec,
                         @type@ x, @type@ y, @type@ z)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (vec != NULL);
#endif

  vsg_vector3@t@_set_inline (vec, x, y, z);
}
Exemple #2
0
/**
 * vsg_vector3@t@_new:
 * @x: abscissa
 * @y: ordinate
 * @z: Z coordinate
 *
 * Allocates a new instance of #VsgVector3@t@. This instance MUST be freed only
 * with vsg_vector3@t@_free().
 *
 * Returns: new #VsgVector3@t@ instance.
 */
VsgVector3@t@ *vsg_vector3@t@_new (@type@ x, @type@ y,
                                  @type@ z)
{
  VsgVector3@t@ *result = _vector3@t@_alloc ();

  vsg_vector3@t@_set_inline (result, x, y, z);

  return result;
}
Exemple #3
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_quaternion@t@_vector3@t@_set:
 * @quat: a #VsgQuaternion@t@
 * @vector: a #VsgVector3@t@
 *
 * Sets @quat to components to @vector.
 */
void vsg_quaternion@t@_vector3@t@_set (VsgQuaternion@t@ *quat,
                                       const VsgVector3@t@ *vector)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (quat != NULL);
  g_return_if_fail (vector != NULL);
#endif

  vsg_quaternion@t@_vector3@t@_set_inline (quat, vector);
}
Exemple #4
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_quaternion@t@_set:
 * @quat: a #VsgQuaternion@t@
 * @x: abscissa
 * @y: ordinate
 * @z: Z coordinate
 * @w: W coordinate
 *
 * Sets @quat components to (@x, @y, @z, @w)
 */
void vsg_quaternion@t@_set (VsgQuaternion@t@ *quat,
                            @type@ x, @type@ y,
                            @type@ z, @type@ w)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (quat != NULL);
#endif

  vsg_quaternion@t@_set_inline (quat, x,  y, z, w);
}
Exemple #5
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_quaternion@t@_rotate@t@_set:
 * @quat: a #VsgQuaternion@t@
 * @from: a #VsgVector3@t@
 * @to: a #VsgVector3@t@
 *
 * Sets @quat components so as to correspond to a 3D rotation between vector
 * @from and vector @to.
 */
void vsg_quaternion@t@_rotate@t@_set (VsgQuaternion@t@ *quat,
                                      const VsgVector3@t@ *from,
                                      const VsgVector3@t@ *to)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (quat != NULL);
  g_return_if_fail (from != NULL);
  g_return_if_fail (to != NULL);
#endif

  vsg_quaternion@t@_rotate@t@_set_inline (quat, from, to);
}
Exemple #6
0
/**
 * vsg_matrix3@t@_new:
 * @a00: a #@type@
 * @a01: a #@type@
 * @a02: a #@type@
 * @a10: a #@type@
 * @a11: a #@type@
 * @a12: a #@type@
 * @a20: a #@type@
 * @a21: a #@type@
 * @a22: a #@type@
 *
 * Allocates a new #VsgMatrix3@t@. Arguments specify new matrix components.
 *
 * Returns: new #VsgMatrix3@t@ instance
 */
VsgMatrix3@t@ *vsg_matrix3@t@_new (@type@ a00, @type@ a01,
                                   @type@ a02, @type@ a10,
                                   @type@ a11, @type@ a12,
                                   @type@ a20, @type@ a21,
                                   @type@ a22)
{
  VsgMatrix3@t@ *result = _matrix3@t@_alloc ();

  vsg_matrix3@t@_set_inline (result,
                             a00, a01, a02, a10, a11, a12, a20, a21, a22);

  return result;
}
Exemple #7
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_vector3@t@_new:
 * @x: abscissa
 * @y: ordinate
 * @z: Z coordinate
 *
 * Allocates a new instance of #VsgVector3@t@. This instance MUST be freed only
 * with vsg_vector3@t@_free().
 *
 * Returns: new #VsgVector3@t@ instance.
 */
VsgVector3@t@ *vsg_vector3@t@_new (@type@ x, @type@ y,
                                  @type@ z)
{
#if _USE_G_SLICES
  VsgVector3@t@ *result = g_slice_new (VsgVector3@t@);
#else
  VsgVector3@t@ *result = _vector3@t@_alloc ();
#endif

  vsg_vector3@t@_set_inline (result, x, y, z);

  return result;
}
Exemple #8
0
/**
 * vsg_matrix3@t@_set:
 * @mat: a #VsgMatrix3@t@
 * @a00: a #@type@
 * @a01: a #@type@
 * @a02: a #@type@
 * @a10: a #@type@
 * @a11: a #@type@
 * @a12: a #@type@
 * @a20: a #@type@
 * @a21: a #@type@
 * @a22: a #@type@
 *
 * Sets components of @mat to values specified by other arguments.
 */
void vsg_matrix3@t@_set (VsgMatrix3@t@ *mat,
                         @type@ a00, @type@ a01, @type@ a02,
                         @type@ a10, @type@ a11, @type@ a12,
                         @type@ a20, @type@ a21, @type@ a22)
{
#ifdef VSG_CHECK_PARAMS
  g_return_if_fail (mat != NULL);
#endif

  vsg_matrix3@t@_set_inline (mat,
                             a00,  a01, a02,
                             a10, a11, a12,
                             a20, a21, a22);
}
Exemple #9
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_quaternion@t@_new:
 * @x: abscissa
 * @y: ordinate
 * @z: Z coordinate
 * @w: W coordinate
 *
 * Allocates a new instance of #VsgQuaternion@t@. This instance MUST
 * be freed only with vsg_quaternion@t@_free().
 *
 * Returns: new #VsgQuaternion@t@ instance.
 */
VsgQuaternion@t@ *vsg_quaternion@t@_new (@type@ x,
                                         @type@ y,
                                         @type@ z,
                                         @type@ w)
{
#if _USE_G_SLICES
  VsgQuaternion@t@ *result = g_slice_new (VsgQuaternion@t@);
#else
  VsgQuaternion@t@ *result = _quaternion@t@_alloc ();
#endif

  vsg_quaternion@t@_set_inline (result, x, y, z, w);

  return result;
}
Exemple #10
0
Fichier : .c Projet : pigay/vsg
/**
 * vsg_matrix3@t@_new:
 * @a00: a #@type@
 * @a01: a #@type@
 * @a02: a #@type@
 * @a10: a #@type@
 * @a11: a #@type@
 * @a12: a #@type@
 * @a20: a #@type@
 * @a21: a #@type@
 * @a22: a #@type@
 *
 * Allocates a new #VsgMatrix3@t@. Arguments specify new matrix components.
 *
 * Returns: new #VsgMatrix3@t@ instance
 */
VsgMatrix3@t@ *vsg_matrix3@t@_new (@type@ a00, @type@ a01,
                                   @type@ a02, @type@ a10,
                                   @type@ a11, @type@ a12,
                                   @type@ a20, @type@ a21,
                                   @type@ a22)
{
#if _USE_G_SLICES
  VsgMatrix3@t@ *result = g_slice_new (VsgMatrix3@t@);
#else
  VsgMatrix3@t@ *result = _matrix3@t@_alloc ();
#endif

  vsg_matrix3@t@_set_inline (result,
                             a00, a01, a02, a10, a11, a12, a20, a21, a22);

  return result;
}