summaryrefslogtreecommitdiffstats
path: root/servers
diff options
context:
space:
mode:
authorrune-scape <spartacrafter@gmail.com>2024-07-28 08:28:24 -0700
committerrune-scape <spartacrafter@gmail.com>2024-08-28 14:46:03 -0700
commitf04a9bb63027fb5284070b3d8f51d094f37b59f8 (patch)
treec96798fe8110f663ff16542ed2f29eb437968561 /servers
parent40b378e9e2338d84f897f6991cc913a713295785 (diff)
downloadredot-engine-f04a9bb63027fb5284070b3d8f51d094f37b59f8.tar.gz
Avoid const_cast in mesh_storage.h
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/dummy/storage/mesh_storage.h2
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp4
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.h2
-rw-r--r--servers/rendering/storage/mesh_storage.cpp2
-rw-r--r--servers/rendering/storage/mesh_storage.h4
5 files changed, 7 insertions, 7 deletions
diff --git a/servers/rendering/dummy/storage/mesh_storage.h b/servers/rendering/dummy/storage/mesh_storage.h
index ec19562147..b0953b5dce 100644
--- a/servers/rendering/dummy/storage/mesh_storage.h
+++ b/servers/rendering/dummy/storage/mesh_storage.h
@@ -163,7 +163,7 @@ public:
virtual AABB _multimesh_get_custom_aabb(RID p_multimesh) const override { return AABB(); }
virtual RID _multimesh_get_mesh(RID p_multimesh) const override { return RID(); }
- virtual AABB _multimesh_get_aabb(RID p_multimesh) const override { return AABB(); }
+ virtual AABB _multimesh_get_aabb(RID p_multimesh) override { return AABB(); }
virtual Transform3D _multimesh_instance_get_transform(RID p_multimesh, int p_index) const override { return Transform3D(); }
virtual Transform2D _multimesh_instance_get_transform_2d(RID p_multimesh, int p_index) const override { return Transform2D(); }
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 539bdcbbd0..9b8b541b5d 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -2040,7 +2040,7 @@ AABB MeshStorage::_multimesh_get_custom_aabb(RID p_multimesh) const {
return multimesh->custom_aabb;
}
-AABB MeshStorage::_multimesh_get_aabb(RID p_multimesh) const {
+AABB MeshStorage::_multimesh_get_aabb(RID p_multimesh) {
MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh);
ERR_FAIL_NULL_V(multimesh, AABB());
if (multimesh->custom_aabb != AABB()) {
@@ -2048,7 +2048,7 @@ AABB MeshStorage::_multimesh_get_aabb(RID p_multimesh) const {
}
if (multimesh->aabb_dirty) {
- const_cast<MeshStorage *>(this)->_update_dirty_multimeshes();
+ _update_dirty_multimeshes();
}
return multimesh->aabb;
}
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
index 4344db783d..f811314fb6 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
@@ -652,7 +652,7 @@ public:
virtual void _multimesh_set_custom_aabb(RID p_multimesh, const AABB &p_aabb) override;
virtual AABB _multimesh_get_custom_aabb(RID p_multimesh) const override;
- virtual AABB _multimesh_get_aabb(RID p_multimesh) const override;
+ virtual AABB _multimesh_get_aabb(RID p_multimesh) override;
virtual MultiMeshInterpolator *_multimesh_get_interpolator(RID p_multimesh) const override;
diff --git a/servers/rendering/storage/mesh_storage.cpp b/servers/rendering/storage/mesh_storage.cpp
index 221ebaa277..6680920c98 100644
--- a/servers/rendering/storage/mesh_storage.cpp
+++ b/servers/rendering/storage/mesh_storage.cpp
@@ -285,7 +285,7 @@ int RendererMeshStorage::multimesh_get_visible_instances(RID p_multimesh) const
return _multimesh_get_visible_instances(p_multimesh);
}
-AABB RendererMeshStorage::multimesh_get_aabb(RID p_multimesh) const {
+AABB RendererMeshStorage::multimesh_get_aabb(RID p_multimesh) {
return _multimesh_get_aabb(p_multimesh);
}
diff --git a/servers/rendering/storage/mesh_storage.h b/servers/rendering/storage/mesh_storage.h
index ecd2a967d0..5e3a4738e6 100644
--- a/servers/rendering/storage/mesh_storage.h
+++ b/servers/rendering/storage/mesh_storage.h
@@ -151,7 +151,7 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh, int p_visible);
virtual int multimesh_get_visible_instances(RID p_multimesh) const;
- virtual AABB multimesh_get_aabb(RID p_multimesh) const;
+ virtual AABB multimesh_get_aabb(RID p_multimesh);
virtual RID _multimesh_allocate() = 0;
virtual void _multimesh_initialize(RID p_rid) = 0;
@@ -183,7 +183,7 @@ public:
virtual void _multimesh_set_visible_instances(RID p_multimesh, int p_visible) = 0;
virtual int _multimesh_get_visible_instances(RID p_multimesh) const = 0;
- virtual AABB _multimesh_get_aabb(RID p_multimesh) const = 0;
+ virtual AABB _multimesh_get_aabb(RID p_multimesh) = 0;
// Multimesh is responsible for allocating / destroying a MultiMeshInterpolator object.
// This allows shared functionality for interpolation across backends.