특정 위치에 원이 그려져 있습니다. 속도를 10f로 설정하면 잘 움직일 수 있지만 원을 그리면 속도가 매우 빨라집니다. 분명히 (단위/초)로 이동하지 않습니다. 무슨 일인지 잘 모르겠습니다. 나는 archSpeed
이 라디안 또는 뭔가가 필요하다고 생각했는데, 속도가 느려졌습니다. 그래도 여전히 올바르지 않습니다. 는 여기에 내가 떨어져 내놓고있어 원 아크 식이다 :원호 방정식 - 속도를 이해하고 있습니까?
s = r * theta
여기
내가 사용하는 기능은 다음과 같습니다
private void moveOut(double deltaTime)
{
SetPosition(x += direction * speed * deltaTime, y, 0);
if (x - (direction * GetWidth()/2f) >= centerX + radius + GetWidth()/2f)
{
//onOutside = true;
}
Log.d(TAG, "moving out");
}
private void circleCenter(double deltaTime)
{
float angleSpeed = (float) (radius * (speed * Math.PI/180) * deltaTime);
currentAngle += angleSpeed;
if (currentAngle >= 2 * Math.PI)
{
currentAngle = (float) (2 * Math.PI - currentAngle);
}
SetPosition(centerX + radius * FloatMath.cos(currentAngle), centerY + radius * FloatMath.sin(currentAngle), 0);
}
아, 감사합니다 .- 오히려 단위를 포함 시켰어야합니다. –