.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_MultiMesh: MultiMesh ========= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Provides high performance mesh instancing. Member Functions ---------------- +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect3` | :ref:`get_aabb` **(** **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_color_format` **(** **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_instance_color` **(** :ref:`int` instance **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_instance_count` **(** **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`get_instance_transform` **(** :ref:`int` instance **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Mesh` | :ref:`get_mesh` **(** **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_transform_format` **(** **)** const | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color_format` **(** :ref:`int` format **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_instance_color` **(** :ref:`int` instance, :ref:`Color` color **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_instance_count` **(** :ref:`int` count **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_instance_transform` **(** :ref:`int` instance, :ref:`Transform` transform **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_mesh` **(** :ref:`Mesh` mesh **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_transform_format` **(** :ref:`int` format **)** | +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`PoolColorArray` **color_array** - :ref:`int` **color_format** - :ref:`int` **instance_count** - :ref:`Mesh` **mesh** - :ref:`PoolVector3Array` **transform_array** - :ref:`int` **transform_format** Numeric Constants ----------------- - **TRANSFORM_2D** = **0** - **TRANSFORM_3D** = **1** - **COLOR_NONE** = **0** - **COLOR_8BIT** = **1** - **COLOR_FLOAT** = **2** Description ----------- MultiMesh provides low level mesh instancing. If the amount of :ref:`Mesh` instances needed goes from hundreds to thousands (and most need to be visible at close proximity) creating such a large amount of :ref:`MeshInstance` nodes may affect performance by using too much CPU or video memory. For this case a MultiMesh becomes very useful, as it can draw thousands of instances with little API overhead. As a drawback, if the instances are too far away of each other, performance may be reduced as every single instance will always rendered (they are spatially indexed as one, for the whole object). Since instances may have any behavior, the Rect3 used for visibility must be provided by the user. Member Function Description --------------------------- .. _class_MultiMesh_get_aabb: - :ref:`Rect3` **get_aabb** **(** **)** const Return the visibility Rect3. .. _class_MultiMesh_get_color_format: - :ref:`int` **get_color_format** **(** **)** const .. _class_MultiMesh_get_instance_color: - :ref:`Color` **get_instance_color** **(** :ref:`int` instance **)** const Get the color of a specific instance. .. _class_MultiMesh_get_instance_count: - :ref:`int` **get_instance_count** **(** **)** const Return the amount of instances that is going to be drawn. .. _class_MultiMesh_get_instance_transform: - :ref:`Transform` **get_instance_transform** **(** :ref:`int` instance **)** const Return the transform of a specific instance. .. _class_MultiMesh_get_mesh: - :ref:`Mesh` **get_mesh** **(** **)** const Return the :ref:`Mesh` resource drawn as multiple instances. .. _class_MultiMesh_get_transform_format: - :ref:`int` **get_transform_format** **(** **)** const .. _class_MultiMesh_set_color_format: - void **set_color_format** **(** :ref:`int` format **)** .. _class_MultiMesh_set_instance_color: - void **set_instance_color** **(** :ref:`int` instance, :ref:`Color` color **)** Set the color of a specific instance. .. _class_MultiMesh_set_instance_count: - void **set_instance_count** **(** :ref:`int` count **)** Set the amount of instances that is going to be drawn. Changing this number will erase all the existing instance transform and color data. .. _class_MultiMesh_set_instance_transform: - void **set_instance_transform** **(** :ref:`int` instance, :ref:`Transform` transform **)** Set the transform for a specific instance. .. _class_MultiMesh_set_mesh: - void **set_mesh** **(** :ref:`Mesh` mesh **)** Set the :ref:`Mesh` resource to be drawn in multiple instances. .. _class_MultiMesh_set_transform_format: - void **set_transform_format** **(** :ref:`int` format **)**