summaryrefslogtreecommitdiffstats
path: root/scene/resources/multimesh.h
diff options
context:
space:
mode:
authorArman Elgudzhyan <48544263+puchik@users.noreply.github.com>2023-07-22 20:53:39 -0700
committerArman Elgudzhyan <48544263+puchik@users.noreply.github.com>2024-02-15 22:37:07 -0800
commit7ac8365e1122299eaf783310bf61c3c8148579cc (patch)
treed9c3c4a716366c8b429c64b63eb0de2458370ff6 /scene/resources/multimesh.h
parenta9bb8509f2faac81bdb995c6c89a5347372f3498 (diff)
downloadredot-engine-7ac8365e1122299eaf783310bf61c3c8148579cc.tar.gz
Support custom AABB within MultiMesh resources
- Supporting custom AABB on the MultiMesh resource itself allows us to prevent costly runtime AABB recalculations. - Should also help improve CPU Particle performance.
Diffstat (limited to 'scene/resources/multimesh.h')
-rw-r--r--scene/resources/multimesh.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h
index 98885db0cc..d7bcb13162 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -48,6 +48,7 @@ private:
Ref<Mesh> mesh;
RID multimesh;
TransformFormat transform_format = TRANSFORM_2D;
+ AABB custom_aabb;
bool use_colors = false;
bool use_custom_data = false;
int instance_count = 0;
@@ -103,6 +104,9 @@ public:
void set_instance_custom_data(int p_instance, const Color &p_custom_data);
Color get_instance_custom_data(int p_instance) const;
+ void set_custom_aabb(const AABB &p_custom);
+ AABB get_custom_aabb() const;
+
virtual AABB get_aabb() const;
virtual RID get_rid() const override;