Fix drawing of 2D skeletons in the RD renderer.
Also clean up skeleton code in preparation for adding them to GLES3 Properly update Mesh2D AABBs when skeleton is updated
This commit is contained in:
parent
c9c09ad608
commit
0e5a98cdd8
9 changed files with 15 additions and 111 deletions
|
|
@ -616,7 +616,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
|
|||
|
||||
Skeleton *skeleton = skeleton_owner.get_or_null(p_skeleton);
|
||||
|
||||
if (!skeleton || skeleton->size == 0) {
|
||||
if (!skeleton || skeleton->size == 0 || mesh->skeleton_aabb_version == skeleton->version) {
|
||||
return mesh->aabb;
|
||||
}
|
||||
|
||||
|
|
@ -708,6 +708,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
|
|||
}
|
||||
}
|
||||
|
||||
mesh->skeleton_aabb_version = skeleton->version;
|
||||
return aabb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ private:
|
|||
|
||||
AABB aabb;
|
||||
AABB custom_aabb;
|
||||
uint64_t skeleton_aabb_version = 0;
|
||||
|
||||
Vector<RID> material_cache;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue