mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[godot] Call computeWorldVertices before fetching region. See #2154
This commit is contained in:
parent
98980e02d3
commit
34534d0e90
@ -552,10 +552,10 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
|||||||
|
|
||||||
if (attachment->getRTTI().isExactly(spine::RegionAttachment::rtti)) {
|
if (attachment->getRTTI().isExactly(spine::RegionAttachment::rtti)) {
|
||||||
auto *region = (spine::RegionAttachment *) attachment;
|
auto *region = (spine::RegionAttachment *) attachment;
|
||||||
renderer_object = (SpineRendererObject *) ((spine::AtlasRegion *) region->getRendererObject())->page->getRendererObject();
|
|
||||||
|
|
||||||
vertices->setSize(8, 0);
|
vertices->setSize(8, 0);
|
||||||
region->computeWorldVertices(*slot, *vertices, 0);
|
region->computeWorldVertices(*slot, *vertices, 0);
|
||||||
|
renderer_object = (SpineRendererObject *) ((spine::AtlasRegion *) region->getRendererObject())->page->getRendererObject();
|
||||||
uvs = ®ion->getUVs();
|
uvs = ®ion->getUVs();
|
||||||
indices = &quad_indices;
|
indices = &quad_indices;
|
||||||
|
|
||||||
@ -566,10 +566,10 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
|||||||
tint.a *= attachment_color.a;
|
tint.a *= attachment_color.a;
|
||||||
} else if (attachment->getRTTI().isExactly(spine::MeshAttachment::rtti)) {
|
} else if (attachment->getRTTI().isExactly(spine::MeshAttachment::rtti)) {
|
||||||
auto *mesh = (spine::MeshAttachment *) attachment;
|
auto *mesh = (spine::MeshAttachment *) attachment;
|
||||||
renderer_object = (SpineRendererObject *) ((spine::AtlasRegion *) mesh->getRendererObject())->page->getRendererObject();
|
|
||||||
|
|
||||||
vertices->setSize(mesh->getWorldVerticesLength(), 0);
|
vertices->setSize(mesh->getWorldVerticesLength(), 0);
|
||||||
mesh->computeWorldVertices(*slot, *vertices);
|
mesh->computeWorldVertices(*slot, *vertices);
|
||||||
|
renderer_object = (SpineRendererObject *) ((spine::AtlasRegion *) mesh->getRendererObject())->page->getRendererObject();
|
||||||
uvs = &mesh->getUVs();
|
uvs = &mesh->getUVs();
|
||||||
indices = &mesh->getTriangles();
|
indices = &mesh->getTriangles();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user