2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Add units based variant of the rotation accessors.
This commit is contained in:
parent
e1dfbec336
commit
b450363370
@ -1,3 +1,8 @@
|
|||||||
|
2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-actor.[ch]: Add units based variant of the
|
||||||
|
rotation accessors.
|
||||||
|
|
||||||
2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
|
2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
Bug 892 - Incorrect results using rotation-[center|angle] properties
|
Bug 892 - Incorrect results using rotation-[center|angle] properties
|
||||||
|
@ -3712,6 +3712,37 @@ clutter_actor_get_depthu (ClutterActor *self)
|
|||||||
return self->priv->z;
|
return self->priv->z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_rotationu:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @axis: the axis of rotation
|
||||||
|
* @angle: the angle of rotation
|
||||||
|
* @x: X coordinate of the rotation center, in #ClutterUnit<!-- -->s
|
||||||
|
* @y: Y coordinate of the rotation center, in #ClutterUnit<!-- -->s
|
||||||
|
* @z: Z coordinate of the rotation center, in #ClutterUnit<!-- -->s
|
||||||
|
*
|
||||||
|
* Sets the rotation angle of @self around the given axis.
|
||||||
|
*
|
||||||
|
* This function is the units based variant of clutter_actor_set_rotation().
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_rotationu (ClutterActor *self,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
gdouble angle,
|
||||||
|
ClutterUnit x,
|
||||||
|
ClutterUnit y,
|
||||||
|
ClutterUnit z)
|
||||||
|
{
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
|
clutter_actor_set_rotation_internal (self, axis,
|
||||||
|
CLUTTER_FLOAT_TO_FIXED (angle),
|
||||||
|
x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_set_rotationx:
|
* clutter_actor_set_rotationx:
|
||||||
* @self: a #ClutterActor
|
* @self: a #ClutterActor
|
||||||
@ -3782,6 +3813,70 @@ clutter_actor_set_rotation (ClutterActor *self,
|
|||||||
x, y, z);
|
x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_get_rotationu:
|
||||||
|
* @self: a #ClutterActor
|
||||||
|
* @axis: the axis of rotation
|
||||||
|
* @x: return value for the X coordinate of the center of rotation,
|
||||||
|
* in #ClutterUnit<!-- -->s
|
||||||
|
* @y: return value for the Y coordinate of the center of rotation,
|
||||||
|
* in #ClutterUnit<!-- -->s
|
||||||
|
* @z: return value for the Z coordinate of the center of rotation,
|
||||||
|
* in #ClutterUnit<!-- -->s
|
||||||
|
*
|
||||||
|
* Retrieves the angle and center of rotation on the given axis,
|
||||||
|
* set using clutter_actor_set_rotation().
|
||||||
|
*
|
||||||
|
* This function is the units based variant of clutter_actor_get_rotation().
|
||||||
|
*
|
||||||
|
* Return value: the angle of rotation
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
clutter_actor_get_rotationu (ClutterActor *self,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
ClutterUnit *x,
|
||||||
|
ClutterUnit *y,
|
||||||
|
ClutterUnit *z)
|
||||||
|
{
|
||||||
|
ClutterActorPrivate *priv;
|
||||||
|
gdouble retval = 0;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
|
||||||
|
|
||||||
|
priv = self->priv;
|
||||||
|
|
||||||
|
switch (axis)
|
||||||
|
{
|
||||||
|
case CLUTTER_X_AXIS:
|
||||||
|
retval = CLUTTER_FIXED_TO_DOUBLE (priv->rxang);
|
||||||
|
if (y)
|
||||||
|
*y = priv->rxy;
|
||||||
|
if (z)
|
||||||
|
*z = priv->rxz;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CLUTTER_Y_AXIS:
|
||||||
|
retval = CLUTTER_FIXED_TO_DOUBLE (priv->ryang);
|
||||||
|
if (x)
|
||||||
|
*x = priv->ryx;
|
||||||
|
if (z)
|
||||||
|
*z = priv->ryz;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CLUTTER_Z_AXIS:
|
||||||
|
retval = CLUTTER_FIXED_TO_DOUBLE (priv->rzang);
|
||||||
|
if (x)
|
||||||
|
*x = priv->rzx;
|
||||||
|
if (y)
|
||||||
|
*y = priv->rzy;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_get_rotationx:
|
* clutter_actor_get_rotationx:
|
||||||
* @self: a #ClutterActor
|
* @self: a #ClutterActor
|
||||||
|
@ -346,6 +346,12 @@ void clutter_actor_set_rotationx (ClutterActor
|
|||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint z);
|
gint z);
|
||||||
|
void clutter_actor_set_rotationu (ClutterActor *self,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
gdouble angle,
|
||||||
|
ClutterUnit x,
|
||||||
|
ClutterUnit y,
|
||||||
|
ClutterUnit z);
|
||||||
gdouble clutter_actor_get_rotation (ClutterActor *self,
|
gdouble clutter_actor_get_rotation (ClutterActor *self,
|
||||||
ClutterRotateAxis axis,
|
ClutterRotateAxis axis,
|
||||||
gint *x,
|
gint *x,
|
||||||
@ -356,6 +362,11 @@ ClutterFixed clutter_actor_get_rotationx (ClutterActor
|
|||||||
gint *x,
|
gint *x,
|
||||||
gint *y,
|
gint *y,
|
||||||
gint *z);
|
gint *z);
|
||||||
|
gdouble clutter_actor_get_rotationu (ClutterActor *self,
|
||||||
|
ClutterRotateAxis axis,
|
||||||
|
ClutterUnit *x,
|
||||||
|
ClutterUnit *y,
|
||||||
|
ClutterUnit *z);
|
||||||
|
|
||||||
void clutter_actor_set_opacity (ClutterActor *self,
|
void clutter_actor_set_opacity (ClutterActor *self,
|
||||||
guint8 opacity);
|
guint8 opacity);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user