Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made Transformation class final.

  • Loading branch information...
commit 596e7a13776014ef209f3a867bc8ea5290c029db 1 parent 88c3e23
Nicolas Gramlich authored
Showing with 19 additions and 19 deletions.
  1. +19 −19 src/org/andengine/util/adt/transformation/Transformation.java
View
38 src/org/andengine/util/adt/transformation/Transformation.java
@@ -30,7 +30,7 @@
* @author Nicolas Gramlich
* @since 15:47:18 - 23.12.2010
*/
-public class Transformation {
+public final class Transformation {
// ===========================================================
// Constants
// ===========================================================
@@ -71,11 +71,11 @@ public String toString() {
// Methods
// ===========================================================
- public void reset() {
+ public final void reset() {
this.setToIdentity();
}
- public void setToIdentity() {
+ public final void setToIdentity() {
this.a = 1.0f;
this.d = 1.0f;
@@ -85,7 +85,7 @@ public void setToIdentity() {
this.ty = 0.0f;
}
- public void setTo(final Transformation pTransformation) {
+ public final void setTo(final Transformation pTransformation) {
this.a = pTransformation.a;
this.d = pTransformation.d;
@@ -95,17 +95,17 @@ public void setTo(final Transformation pTransformation) {
this.ty = pTransformation.ty;
}
- public void preTranslate(final float pX, final float pY) {
+ public final void preTranslate(final float pX, final float pY) {
this.tx += pX * this.a + pY * this.c;
this.ty += pX * this.b + pY * this.d;
}
- public void postTranslate(final float pX, final float pY) {
+ public final void postTranslate(final float pX, final float pY) {
this.tx += pX;
this.ty += pY;
}
- public Transformation setToTranslate(final float pX, final float pY) {
+ public final Transformation setToTranslate(final float pX, final float pY) {
this.a = 1.0f;
this.b = 0.0f;
this.c = 0.0f;
@@ -116,7 +116,7 @@ public Transformation setToTranslate(final float pX, final float pY) {
return this;
}
- public void preRotate(final float pAngle) {
+ public final void preRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
@@ -133,7 +133,7 @@ public void preRotate(final float pAngle) {
this.d = cos * d - sin * b;
}
- public void postRotate(final float pAngle) {
+ public final void postRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
@@ -154,7 +154,7 @@ public void postRotate(final float pAngle) {
this.ty = tx * sin + ty * cos;
}
- public Transformation setToRotate(final float pAngle) {
+ public final Transformation setToRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
@@ -170,14 +170,14 @@ public Transformation setToRotate(final float pAngle) {
return this;
}
- public void preScale(final float pScaleX, final float pScaleY) {
+ public final void preScale(final float pScaleX, final float pScaleY) {
this.a *= pScaleX;
this.b *= pScaleX;
this.c *= pScaleY;
this.d *= pScaleY;
}
- public void postScale(final float pScaleX, final float pScaleY) {
+ public final void postScale(final float pScaleX, final float pScaleY) {
this.a = this.a * pScaleX;
this.b = this.b * pScaleY;
this.c = this.c * pScaleX;
@@ -186,7 +186,7 @@ public void postScale(final float pScaleX, final float pScaleY) {
this.ty = this.ty * pScaleY;
}
- public Transformation setToScale(final float pScaleX, final float pScaleY) {
+ public final Transformation setToScale(final float pScaleX, final float pScaleY) {
this.a = pScaleX;
this.b = 0.0f;
this.c = 0.0f;
@@ -197,7 +197,7 @@ public Transformation setToScale(final float pScaleX, final float pScaleY) {
return this;
}
- public void preSkew(final float pSkewX, final float pSkewY) {
+ public final void preSkew(final float pSkewX, final float pSkewY) {
final float tanX = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewX);
final float tanY = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewY);
@@ -216,7 +216,7 @@ public void preSkew(final float pSkewX, final float pSkewY) {
this.ty = ty;
}
- public void postSkew(final float pSkewX, final float pSkewY) {
+ public final void postSkew(final float pSkewX, final float pSkewY) {
final float tanX = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewX);
final float tanY = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewY);
@@ -235,7 +235,7 @@ public void postSkew(final float pSkewX, final float pSkewY) {
this.ty = tx * tanY + ty;
}
- public Transformation setToSkew(final float pSkewX, final float pSkewY) {
+ public final Transformation setToSkew(final float pSkewX, final float pSkewY) {
this.a = 1.0f;
this.b = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewY);
this.c = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewX);
@@ -246,7 +246,7 @@ public Transformation setToSkew(final float pSkewX, final float pSkewY) {
return this;
}
- public void postConcat(final Transformation pTransformation) {
+ public final void postConcat(final Transformation pTransformation) {
this.postConcat(pTransformation.a, pTransformation.b, pTransformation.c, pTransformation.d, pTransformation.tx, pTransformation.ty);
}
@@ -266,7 +266,7 @@ private void postConcat(final float pA, final float pB, final float pC, final fl
this.ty = tx * pB + ty * pD + pTY;
}
- public void preConcat(final Transformation pTransformation) {
+ public final void preConcat(final Transformation pTransformation) {
this.preConcat(pTransformation.a, pTransformation.b, pTransformation.c, pTransformation.d, pTransformation.tx, pTransformation.ty);
}
@@ -286,7 +286,7 @@ private void preConcat(final float pA, final float pB, final float pC, final flo
this.ty = pTX * b + pTY * d + ty;
}
- public void transform(final float[] pVertices) {
+ public final void transform(final float[] pVertices) {
int count = pVertices.length >> 1;
int i = 0;
int j = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.