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


Java MathUtils.revertRotateAroundCenter方法代码示例

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


在下文中一共展示了MathUtils.revertRotateAroundCenter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertSceneTouchEventToSurfaceTouchEvent

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
public void convertSceneTouchEventToSurfaceTouchEvent(final TouchEvent pSceneTouchEvent, final int pSurfaceWidth, final int pSurfaceHeight) {
	this.convertAxisAlignedSceneToSurfaceTouchEvent(pSceneTouchEvent, pSurfaceWidth, pSurfaceHeight);

	final float rotation = this.mRotation;
	if (rotation == 0) {
		/* Nothing. */
	} else if (rotation == 180) {
		pSceneTouchEvent.setY(pSurfaceHeight - pSceneTouchEvent.getY());
		pSceneTouchEvent.setX(pSurfaceWidth - pSceneTouchEvent.getX());
	} else {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pSceneTouchEvent.getY();

		MathUtils.revertRotateAroundCenter(Camera.VERTICES_TMP, -rotation, pSurfaceWidth >> 1, pSurfaceHeight >> 1); // TODO Use a Transformation object instead!?!

		pSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:19,代码来源:Camera.java

示例2: unapplySceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplySceneRotation(final float[] pSceneCoordinates) {
	final float rotation = this.mRotation;

	if (rotation != 0) {
		MathUtils.revertRotateAroundCenter(pSceneCoordinates, rotation, this.getCenterX(), this.getCenterY()); // TODO Use a Transformation object instead!?!
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:8,代码来源:Camera.java

示例3: unapplyCameraSceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplyCameraSceneRotation(final float[] pCameraSceneCoordinates) {
	final float cameraSceneRotation = this.mCameraSceneRotation;

	if (cameraSceneRotation != 0) {
		MathUtils.revertRotateAroundCenter(pCameraSceneCoordinates, cameraSceneRotation, this.getCameraSceneWidth() * 0.5f, this.getCameraSceneHeight() * 0.5f); // TODO Use a Transformation object instead!?!
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:8,代码来源:Camera.java

示例4: getSurfaceCoordinatesFromSceneCoordinates

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
public float[] getSurfaceCoordinatesFromSceneCoordinates(final float[] pSceneCoordinates, final int pSurfaceWidth, final int pSurfaceHeight) {
	this.convertAxisAlignedSceneCoordinatesToSurfaceCoordinates(pSceneCoordinates, pSurfaceWidth, pSurfaceHeight);

	final float rotation = this.mRotation;
	if (rotation == 0) {
		/* Nothing. */
	} else if (rotation == 180) {
		pSceneCoordinates[Constants.VERTEX_INDEX_Y] = pSurfaceHeight - pSceneCoordinates[Constants.VERTEX_INDEX_Y];
		pSceneCoordinates[Constants.VERTEX_INDEX_X] = pSurfaceWidth - pSceneCoordinates[Constants.VERTEX_INDEX_X];
	} else {
		MathUtils.revertRotateAroundCenter(pSceneCoordinates, -rotation, pSurfaceWidth >> 1, pSurfaceHeight >> 1); // TODO Use a Transformation object instead!?!
	}

	return pSceneCoordinates;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:16,代码来源:Camera.java

示例5: unapplySceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplySceneRotation(final float[] pSceneCoordinates) {
	final float rotation = this.mRotation;

	if(rotation != 0) {
		MathUtils.revertRotateAroundCenter(pSceneCoordinates, rotation, this.getCenterX(), this.getCenterY());
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:8,代码来源:Camera.java

示例6: unapplyCameraSceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplyCameraSceneRotation(final float[] pCameraSceneCoordinates) {
	final float cameraSceneRotation = -this.mCameraSceneRotation;

	if(cameraSceneRotation != 0) {
		MathUtils.revertRotateAroundCenter(pCameraSceneCoordinates, cameraSceneRotation, (this.mXMax - this.mXMin) * 0.5f, (this.mYMax - this.mYMin) * 0.5f);
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:8,代码来源:Camera.java

示例7: unapplyCameraSceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplyCameraSceneRotation(final TouchEvent pCameraSceneTouchEvent) {
	final float cameraSceneRotation = this.mCameraSceneRotation;

	if (cameraSceneRotation != 0) {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pCameraSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pCameraSceneTouchEvent.getY();

		MathUtils.revertRotateAroundCenter(Camera.VERTICES_TMP, cameraSceneRotation, this.getCameraSceneWidth() * 0.5f, this.getCameraSceneHeight() * 0.5f); // TODO Use a Transformation object instead!?!

		pCameraSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:13,代码来源:Camera.java

示例8: unapplySceneRotation

import org.andengine.util.math.MathUtils; //导入方法依赖的package包/类
private void unapplySceneRotation(final TouchEvent pSceneTouchEvent) {
	final float rotation = this.mRotation;

	if (rotation != 0) {
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X] = pSceneTouchEvent.getX();
		Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y] = pSceneTouchEvent.getY();

		MathUtils.revertRotateAroundCenter(Camera.VERTICES_TMP, rotation, this.getCenterX(), this.getCenterY()); // TODO Use a Transformation object instead!?!

		pSceneTouchEvent.set(Camera.VERTICES_TMP[Constants.VERTEX_INDEX_X], Camera.VERTICES_TMP[Constants.VERTEX_INDEX_Y]);
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:13,代码来源:Camera.java


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