Libgdx 如何获取儿童角色中某个点的世界坐标?

Libgdx 如何获取儿童角色中某个点的世界坐标?,libgdx,coordinates,scene2d,Libgdx,Coordinates,Scene2d,我有Group对象,它们由其他Group对象组成,最后由Actor对象组成。现在,当组和角色旋转、偏移和缩放时,“世界”中的坐标或相对于根节点的坐标会发生变化。如何获得演员局部空间中某点的世界坐标 为了进一步说明,以下是我想要的示例: Group parentGroup; Actor childInGroup; ... parentGroup.addActor(childInGroup); childInGroup.setPosition(10f, 15f); childInGroup.setR

我有
Group
对象,它们由其他
Group
对象组成,最后由
Actor
对象组成。现在,当组和角色旋转、偏移和缩放时,“世界”中的坐标或相对于根节点的坐标会发生变化。如何获得演员局部空间中某点的世界坐标

为了进一步说明,以下是我想要的示例:

Group parentGroup;
Actor childInGroup;
...
parentGroup.addActor(childInGroup);
childInGroup.setPosition(10f, 15f);
childInGroup.setRotation(45f);

// Get the childInGroup's position in the world
float childWorldPosX = ...; // This is what I want to know
float childWorldPosY = ...; // ... and this.

如果您只想在
参与者
的层次结构中更高一级,则可以使用,或者直接使用直接获取“舞台全局”坐标。在这种情况下,libGDX将递归应用
localToParentCoordinates
,直到它到达stage的根元素。

Actor.localToParentCoordinates()
Actor.localToStageCoordinates()
@noone谢谢!介意将此作为答案发布,以便我可以接受吗?