mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
189 lines
8.7 KiB
ReStructuredText
189 lines
8.7 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the MultiMesh.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_MultiMesh:
|
|
|
|
MultiMesh
|
|
=========
|
|
|
|
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Provides high performance mesh instancing.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
| :ref:`ColorFormat<enum_MultiMesh_ColorFormat>` | :ref:`color_format<class_MultiMesh_color_format>` |
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
| :ref:`CustomDataFormat<enum_MultiMesh_CustomDataFormat>` | :ref:`custom_data_format<class_MultiMesh_custom_data_format>` |
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`instance_count<class_MultiMesh_instance_count>` |
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
| :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_MultiMesh_mesh>` |
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
| :ref:`TransformFormat<enum_MultiMesh_TransformFormat>` | :ref:`transform_format<class_MultiMesh_transform_format>` |
|
|
+----------------------------------------------------------+---------------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AABB<class_AABB>` | :ref:`get_aabb<class_MultiMesh_get_aabb>` **(** **)** const |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_instance_color<class_MultiMesh_get_instance_color>` **(** :ref:`int<class_int>` instance **)** const |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_instance_custom_data<class_MultiMesh_get_instance_custom_data>` **(** :ref:`int<class_int>` instance **)** const |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Transform<class_Transform>` | :ref:`get_instance_transform<class_MultiMesh_get_instance_transform>` **(** :ref:`int<class_int>` instance **)** const |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_instance_color<class_MultiMesh_set_instance_color>` **(** :ref:`int<class_int>` instance, :ref:`Color<class_Color>` color **)** |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_instance_custom_data<class_MultiMesh_set_instance_custom_data>` **(** :ref:`int<class_int>` instance, :ref:`Color<class_Color>` custom_data **)** |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_instance_transform<class_MultiMesh_set_instance_transform>` **(** :ref:`int<class_int>` instance, :ref:`Transform<class_Transform>` transform **)** |
|
|
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_MultiMesh_TransformFormat:
|
|
|
|
enum **TransformFormat**:
|
|
|
|
- **TRANSFORM_2D** = **0**
|
|
|
|
- **TRANSFORM_3D** = **1**
|
|
|
|
.. _enum_MultiMesh_ColorFormat:
|
|
|
|
enum **ColorFormat**:
|
|
|
|
- **COLOR_NONE** = **0**
|
|
|
|
- **COLOR_8BIT** = **1**
|
|
|
|
- **COLOR_FLOAT** = **2**
|
|
|
|
.. _enum_MultiMesh_CustomDataFormat:
|
|
|
|
enum **CustomDataFormat**:
|
|
|
|
- **CUSTOM_DATA_NONE** = **0**
|
|
|
|
- **CUSTOM_DATA_8BIT** = **1**
|
|
|
|
- **CUSTOM_DATA_FLOAT** = **2**
|
|
|
|
Description
|
|
-----------
|
|
|
|
MultiMesh provides low level mesh instancing. If the amount of :ref:`Mesh<class_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<class_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 AABB used for visibility must be provided by the user.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_MultiMesh_color_format:
|
|
|
|
- :ref:`ColorFormat<enum_MultiMesh_ColorFormat>` **color_format**
|
|
|
|
+----------+-------------------------+
|
|
| *Setter* | set_color_format(value) |
|
|
+----------+-------------------------+
|
|
| *Getter* | get_color_format() |
|
|
+----------+-------------------------+
|
|
|
|
.. _class_MultiMesh_custom_data_format:
|
|
|
|
- :ref:`CustomDataFormat<enum_MultiMesh_CustomDataFormat>` **custom_data_format**
|
|
|
|
+----------+-------------------------------+
|
|
| *Setter* | set_custom_data_format(value) |
|
|
+----------+-------------------------------+
|
|
| *Getter* | get_custom_data_format() |
|
|
+----------+-------------------------------+
|
|
|
|
.. _class_MultiMesh_instance_count:
|
|
|
|
- :ref:`int<class_int>` **instance_count**
|
|
|
|
+----------+---------------------------+
|
|
| *Setter* | set_instance_count(value) |
|
|
+----------+---------------------------+
|
|
| *Getter* | get_instance_count() |
|
|
+----------+---------------------------+
|
|
|
|
.. _class_MultiMesh_mesh:
|
|
|
|
- :ref:`Mesh<class_Mesh>` **mesh**
|
|
|
|
+----------+-----------------+
|
|
| *Setter* | set_mesh(value) |
|
|
+----------+-----------------+
|
|
| *Getter* | get_mesh() |
|
|
+----------+-----------------+
|
|
|
|
.. _class_MultiMesh_transform_format:
|
|
|
|
- :ref:`TransformFormat<enum_MultiMesh_TransformFormat>` **transform_format**
|
|
|
|
+----------+-----------------------------+
|
|
| *Setter* | set_transform_format(value) |
|
|
+----------+-----------------------------+
|
|
| *Getter* | get_transform_format() |
|
|
+----------+-----------------------------+
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_MultiMesh_get_aabb:
|
|
|
|
- :ref:`AABB<class_AABB>` **get_aabb** **(** **)** const
|
|
|
|
Return the visibility AABB.
|
|
|
|
.. _class_MultiMesh_get_instance_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_instance_color** **(** :ref:`int<class_int>` instance **)** const
|
|
|
|
Get the color of a specific instance.
|
|
|
|
.. _class_MultiMesh_get_instance_custom_data:
|
|
|
|
- :ref:`Color<class_Color>` **get_instance_custom_data** **(** :ref:`int<class_int>` instance **)** const
|
|
|
|
.. _class_MultiMesh_get_instance_transform:
|
|
|
|
- :ref:`Transform<class_Transform>` **get_instance_transform** **(** :ref:`int<class_int>` instance **)** const
|
|
|
|
Return the transform of a specific instance.
|
|
|
|
.. _class_MultiMesh_set_instance_color:
|
|
|
|
- void **set_instance_color** **(** :ref:`int<class_int>` instance, :ref:`Color<class_Color>` color **)**
|
|
|
|
Set the color of a specific instance.
|
|
|
|
.. _class_MultiMesh_set_instance_custom_data:
|
|
|
|
- void **set_instance_custom_data** **(** :ref:`int<class_int>` instance, :ref:`Color<class_Color>` custom_data **)**
|
|
|
|
.. _class_MultiMesh_set_instance_transform:
|
|
|
|
- void **set_instance_transform** **(** :ref:`int<class_int>` instance, :ref:`Transform<class_Transform>` transform **)**
|
|
|
|
Set the transform for a specific instance.
|
|
|