本文整理汇总了Java中org.andengine.util.math.MathConstants.DEG_TO_RAD属性的典型用法代码示例。如果您正苦于以下问题:Java MathConstants.DEG_TO_RAD属性的具体用法?Java MathConstants.DEG_TO_RAD怎么用?Java MathConstants.DEG_TO_RAD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.andengine.util.math.MathConstants
的用法示例。
在下文中一共展示了MathConstants.DEG_TO_RAD属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preRotate
public final void preRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = (float) Math.sin(angleRad);
final float cos = (float) Math.cos(angleRad);
final float a = this.a;
final float b = this.b;
final float c = this.c;
final float d = this.d;
this.a = cos * a + sin * c;
this.b = cos * b + sin * d;
this.c = cos * c - sin * a;
this.d = cos * d - sin * b;
}
示例2: postRotate
public final void postRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = (float) Math.sin(angleRad);
final float cos = (float) Math.cos(angleRad);
final float a = this.a;
final float b = this.b;
final float c = this.c;
final float d = this.d;
final float tx = this.tx;
final float ty = this.ty;
this.a = a * cos - b * sin;
this.b = a * sin + b * cos;
this.c = c * cos - d * sin;
this.d = c * sin + d * cos;
this.tx = tx * cos - ty * sin;
this.ty = tx * sin + ty * cos;
}
示例3: preRotate
public final void preRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
final float cos = FloatMath.cos(angleRad);
final float a = this.a;
final float b = this.b;
final float c = this.c;
final float d = this.d;
this.a = cos * a + sin * c;
this.b = cos * b + sin * d;
this.c = cos * c - sin * a;
this.d = cos * d - sin * b;
}
示例4: postRotate
public final void postRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
final float cos = FloatMath.cos(angleRad);
final float a = this.a;
final float b = this.b;
final float c = this.c;
final float d = this.d;
final float tx = this.tx;
final float ty = this.ty;
this.a = a * cos - b * sin;
this.b = a * sin + b * cos;
this.c = c * cos - d * sin;
this.d = c * sin + d * cos;
this.tx = tx * cos - ty * sin;
this.ty = tx * sin + ty * cos;
}
示例5: setToRotate
public final Transformation setToRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = (float) Math.sin(angleRad);
final float cos = (float) Math.cos(angleRad);
this.a = cos;
this.b = sin;
this.c = -sin;
this.d = cos;
this.tx = 0.0f;
this.ty = 0.0f;
return this;
}
示例6: setToRotate
public final Transformation setToRotate(final float pAngle) {
final float angleRad = MathConstants.DEG_TO_RAD * pAngle;
final float sin = FloatMath.sin(angleRad);
final float cos = FloatMath.cos(angleRad);
this.a = cos;
this.b = sin;
this.c = -sin;
this.d = cos;
this.tx = 0.0f;
this.ty = 0.0f;
return this;
}