本文整理汇总了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]);
}
}
示例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!?!
}
}
示例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!?!
}
}
示例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;
}
示例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());
}
}
示例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);
}
}
示例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]);
}
}
示例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]);
}
}