private void updateMesh(float fraction) {
float[] src = mOrig;
float[] dst = mVerts;
float startX = mMaxDistance * fraction;
for (int i = 0; i < MESH_COUNT * 2; i += 2) {
float sx = src[i];
float sy = src[i + 1];
if (sx > startX) {
dst[i] = sx;
dst[i + 1] = mHalfHeight;
} else if (sx < startX - mRotateAreaWidth) {
dst[i] = sx;
dst[i + 1] = sy;
} else {
float input = (startX - sx) / mRotateAreaWidth;
float toCenter = sy - mHalfHeight;
dst[i] = sx - toCenter * FloatMath.cos(HALF_PI * input) * .35f;
dst[i + 1] = mHalfHeight + toCenter * FloatMath.sin(HALF_PI * input);
}
}
}
07-15
07-15
07-15
07-15
07-15
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交