Merge pull request #88506 from puchik/multimesh-aabb-cull-fix

Fix reversed custom `AABB` check when recalculating multimesh `AABB`s
This commit is contained in:
Rémi Verschelde 2024-02-19 00:09:06 +01:00
commit 8cf1cfdc0f
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}
@ -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);
}

View file

@ -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);
}
@ -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);
}