本文整理汇总了Java中org.andengine.util.math.MathConstants.RAD_TO_DEG属性的典型用法代码示例。如果您正苦于以下问题:Java MathConstants.RAD_TO_DEG属性的具体用法?Java MathConstants.RAD_TO_DEG怎么用?Java MathConstants.RAD_TO_DEG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.andengine.util.math.MathConstants
的用法示例。
在下文中一共展示了MathConstants.RAD_TO_DEG属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateOrientation
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;
}
}
示例2: updateOrientation
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;
}
}