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 ) * . 35 f ;dst [ i + 1 ] = mHalfHeight + toCenter * FloatMath . sin ( HALF_PI * input );}}}
垂直中心扭曲算法
最新推荐文章于 2021-08-11 13:47:33 发布