当前位置: 首页>>代码示例>>Java>>正文


Java MathConstants.DEG_TO_RAD属性代码示例

本文整理汇总了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;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:16,代码来源:Transformation.java

示例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;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:20,代码来源:Transformation.java

示例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;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:16,代码来源:Transformation.java

示例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;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:20,代码来源:Transformation.java

示例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;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:15,代码来源:Transformation.java

示例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;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:15,代码来源:Transformation.java


注:本文中的org.andengine.util.math.MathConstants.DEG_TO_RAD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。