+ actor.SetProperty( Actor::Property::SCALE, mStartingScale * pinch.scale );
+ }
+
+ /**
+ * @brief Called when a rotation gesture is detected on our control.
+ *
+ * @param[in] actor The actor that's been pinched
+ * @param[in] rotation The rotation gesture information
+ */
+ void OnRotation( Actor actor, const RotationGesture& rotation )
+ {
+ switch( rotation.state )
+ {
+ case Gesture::Started:
+ {
+ // Starting orientation is required so that we know what to multiply the rotation.rotation by.
+ mStartingOrientation = actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION );
+ break;
+ }
+
+ case Gesture::Finished:
+ case Gesture::Cancelled:
+ {
+ // Do an animation to come back to go back to the original orientation.
+ Animation anim = Animation::New( ROTATE_BACK_ANIMATION_DURATION );
+ anim.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion::IDENTITY, AlphaFunction::LINEAR );
+ anim.Play();
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( mStartingOrientation * Quaternion( rotation.rotation, Vector3::ZAXIS ) ) );