Пример #1
0
        protected void applyRotation(GL10 pGL)
        {
            float rotation = this.mRotation;

            if (rotation != 0)
            {
                float rotationCenterX = this.mRotationCenterX;
                float rotationCenterY = this.mRotationCenterY;

                pGL.GlTranslatef(rotationCenterX, rotationCenterY, 0);
                pGL.GlRotatef(rotation, 0, 0, 1);
                pGL.GlTranslatef(-rotationCenterX, -rotationCenterY, 0);

                /* TODO There is a special, but very likely case when mRotationCenter and mScaleCenter are the same.
                 * In that case the last glTranslatef of the rotation and the first glTranslatef of the scale is superfluous.
                 * The problem is that applyRotation and applyScale would need to be "merged" in order to efficiently check for that condition.  */
            }
        }