mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16:53 +08:00
[libgdx] Fixed Box2D test, offset bounding boxes by skeleton x/y
This commit is contained in:
parent
7af22538e2
commit
bb93011144
@ -156,8 +156,8 @@ public class Box2DExample extends ApplicationAdapter {
|
|||||||
if (!(slot.getAttachment() instanceof Box2dAttachment)) continue;
|
if (!(slot.getAttachment() instanceof Box2dAttachment)) continue;
|
||||||
Box2dAttachment attachment = (Box2dAttachment)slot.getAttachment();
|
Box2dAttachment attachment = (Box2dAttachment)slot.getAttachment();
|
||||||
if (attachment.body == null) continue;
|
if (attachment.body == null) continue;
|
||||||
float x = skeleton.x + slot.getBone().getWorldX();
|
float x = slot.getBone().getWorldX();
|
||||||
float y = skeleton.y + slot.getBone().getWorldY();
|
float y = slot.getBone().getWorldY();
|
||||||
float rotation = slot.getBone().getWorldRotationX();
|
float rotation = slot.getBone().getWorldRotationX();
|
||||||
attachment.body.setTransform(x, y, rotation * MathUtils.degRad);
|
attachment.body.setTransform(x, y, rotation * MathUtils.degRad);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user