• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MathConstants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.andengine.util.math.MathConstants的典型用法代码示例。如果您正苦于以下问题:Java MathConstants类的具体用法?Java MathConstants怎么用?Java MathConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MathConstants类属于org.andengine.util.math包,在下文中一共展示了MathConstants类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setSkewM

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
private static void setSkewM(final float[] pMatrixStack, final int pOffset, final float pSkewX, final float pSkewY) {
	pMatrixStack[pOffset + 0] = 1.0f;
	pMatrixStack[pOffset + 1] = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewY);
	pMatrixStack[pOffset + 2] = 0.0f;
	pMatrixStack[pOffset + 3] = 0.0f;

	pMatrixStack[pOffset + 4] = (float) Math.tan(-MathConstants.DEG_TO_RAD * pSkewX);
	pMatrixStack[pOffset + 5] = 1.0f;
	pMatrixStack[pOffset + 6] = 0.0f;
	pMatrixStack[pOffset + 7] = 0.0f;

	pMatrixStack[pOffset + 8] = 0.0f;
	pMatrixStack[pOffset + 9] = 0.0f;
	pMatrixStack[pOffset + 10] = 1.0f;
	pMatrixStack[pOffset + 11] = 0.0f;

	pMatrixStack[pOffset + 12] = 0.0f;
	pMatrixStack[pOffset + 13] = 0.0f;
	pMatrixStack[pOffset + 14] = 0.0f;
	pMatrixStack[pOffset + 15] = 1.0f;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:22,代码来源:GLMatrixStack.java


示例2: preRotate

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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,代码行数:17,代码来源:Transformation.java


示例3: postRotate

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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,代码行数:21,代码来源:Transformation.java


示例4: preSkew

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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);

	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 + tanY * c;
	this.b = b + tanY * d;
	this.c = tanX * a + c;
	this.d = tanX * b + d;
	this.tx = tx;
	this.ty = ty;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:19,代码来源:Transformation.java


示例5: postSkew

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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);

	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 + b * tanX;
	this.b = a * tanY + b;
	this.c = c + d * tanX;
	this.d = c * tanY + d;
	this.tx = tx + ty * tanX;
	this.ty = tx * tanY + ty;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:19,代码来源:Transformation.java


示例6: updateOrientation

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
private void updateOrientation() {
		SensorManager.getRotationMatrix(this.mRotationMatrix, null, this.mAccelerationValues, this.mMagneticFieldValues);

		// TODO Use dont't use identical matrixes in remapCoordinateSystem, due to performance reasons.
		switch (this.mDisplayRotation) {
			case Surface.ROTATION_0:
				/* Nothing. */
				break;
			case Surface.ROTATION_90:
				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X, this.mRotationMatrix);
				break;
//			case Surface.ROTATION_180:
//				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_?, SensorManager.AXIS_?, this.mRotationMatrix);
//				break;
//			case Surface.ROTATION_270:
//				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_?, SensorManager.AXIS_?, this.mRotationMatrix);
//				break;
		}

		final float[] values = this.mValues;
		SensorManager.getOrientation(this.mRotationMatrix, values);

		for (int i = values.length - 1; i >= 0; i--) {
			values[i] = values[i] * MathConstants.RAD_TO_DEG;
		}
	}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:27,代码来源:OrientationData.java


示例7: preRotate

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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,代码行数:17,代码来源:Transformation.java


示例8: postRotate

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
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,代码行数:21,代码来源:Transformation.java


示例9: updateOrientation

import org.andengine.util.math.MathConstants; //导入依赖的package包/类
private void updateOrientation() {
		SensorManager.getRotationMatrix(this.mRotationMatrix, null, this.mAccelerationValues, this.mMagneticFieldValues);

		// TODO Use dont't use identical matrixes in remapCoordinateSystem, due to performance reasons.
		switch(this.mDisplayRotation) {
			case Surface.ROTATION_0:
				/* Nothing. */
				break;
			case Surface.ROTATION_90:
				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X, this.mRotationMatrix);
				break;
//			case Surface.ROTATION_180:
//				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_?, SensorManager.AXIS_?, this.mRotationMatrix);
//				break;
//			case Surface.ROTATION_270:
//				SensorManager.remapCoordinateSystem(this.mRotationMatrix, SensorManager.AXIS_?, SensorManager.AXIS_?, this.mRotationMatrix);
//				break;
		}

		final float[] values = this.mValues;
		SensorManager.getOrientation(this.mRotationMatrix, values);

		for(int i = values.length - 1; i >= 0; i--) {
			values[i] = values[i] * MathConstants.RAD_TO_DEG;
		}
	}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:27,代码来源:OrientationData.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Organism类代码示例发布时间:2022-05-23
下一篇:
Java GOST3410KeyPairGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap