Skip to content

Commit

Permalink
Fixed reversed custom AABB null check when recalculating multimesh AABBs
Browse files Browse the repository at this point in the history
  • Loading branch information
puchik committed Feb 18, 2024
1 parent 5f05e2b commit 533eab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/gles3/storage/mesh_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
//if we have a mesh set, we need to re-generate the AABB from the new data
const float *data = p_buffer.ptr();

if (multimesh->custom_aabb != AABB()) {
if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, multimesh->instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
Expand Down Expand Up @@ -2113,7 +2113,7 @@ void MeshStorage::_update_dirty_multimeshes() {

if (multimesh->aabb_dirty && multimesh->mesh.is_valid()) {
multimesh->aabb_dirty = false;
if (multimesh->custom_aabb != AABB()) {
if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, visible_instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
Expand Down
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
//if we have a mesh set, we need to re-generate the AABB from the new data
const float *data = p_buffer.ptr();

if (multimesh->custom_aabb != AABB()) {
if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, multimesh->instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
Expand Down Expand Up @@ -2087,7 +2087,7 @@ void MeshStorage::_update_dirty_multimeshes() {
if (multimesh->aabb_dirty) {
//aabb is dirty..
multimesh->aabb_dirty = false;
if (multimesh->custom_aabb != AABB()) {
if (multimesh->custom_aabb == AABB()) {
_multimesh_re_create_aabb(multimesh, data, visible_instances);
multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
}
Expand Down

0 comments on commit 533eab8

Please sign in to comment.