Exemplo n.º 1
0
        protected void applyScale(GL10 pGL)
        {
            float scaleX = this.mScaleX;
            float scaleY = this.mScaleY;

            if (scaleX != 1 || scaleY != 1)
            {
                float scaleCenterX = this.mScaleCenterX;
                float scaleCenterY = this.mScaleCenterY;

                pGL.GlTranslatef(scaleCenterX, scaleCenterY, 0);
                pGL.GlScalef(scaleX, scaleY, 1);
                pGL.GlTranslatef(-scaleCenterX, -scaleCenterY, 0);
            }
        }
Exemplo n.º 2
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.  */
            }
        }
Exemplo n.º 3
0
 protected void applyTranslation(GL10 pGL)
 {
     pGL.GlTranslatef(this.mX, this.mY, 0);
 }