如何在 LibGDX 中围绕圆圈旋转 Sprite?

How to rotate a Sprite around the circle in LibGDX?

我想围绕一个圆圈旋转精灵,但我做不到。如果我不能说出我的问题,你可以从这张图片中理解:

Sprite 有一个方法 setOrigin(), https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/Sprite.html#setOrigin-float-float-

Sprite 的原点设置在圆心并旋转它。代码看起来类似于:

float circleCenterX = ...;
float circleCenterY = ...;
float angle = ...;
Sprite sprite = ...;

sprite.setOrigin(circleCenterX, circleCenterY);
sprite.rotate(angle); // or sprite.setRotation(angle);