class_meshinstance.rst 6.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_MeshInstance:
  4. MeshInstance
  5. ============
  6. **Inherits:** :ref:`GeometryInstance<class_geometryinstance>` **<** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Node that instances meshes into a scenario.
  11. Member Functions
  12. ----------------
  13. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`create_convex_collision<class_MeshInstance_create_convex_collision>` **(** **)** |
  15. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`create_debug_tangents<class_MeshInstance_create_debug_tangents>` **(** **)** |
  17. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`create_trimesh_collision<class_MeshInstance_create_trimesh_collision>` **(** **)** |
  19. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Mesh<class_mesh>` | :ref:`get_mesh<class_MeshInstance_get_mesh>` **(** **)** const |
  21. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`NodePath<class_nodepath>` | :ref:`get_skeleton_path<class_MeshInstance_get_skeleton_path>` **(** **)** |
  23. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Material<class_material>` | :ref:`get_surface_material<class_MeshInstance_get_surface_material>` **(** :ref:`int<class_int>` surface **)** const |
  25. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_mesh<class_MeshInstance_set_mesh>` **(** :ref:`Mesh<class_mesh>` mesh **)** |
  27. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_skeleton_path<class_MeshInstance_set_skeleton_path>` **(** :ref:`NodePath<class_nodepath>` skeleton_path **)** |
  29. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_surface_material<class_MeshInstance_set_surface_material>` **(** :ref:`int<class_int>` surface, :ref:`Material<class_material>` material **)** |
  31. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. Member Variables
  33. ----------------
  34. - :ref:`Mesh<class_mesh>` **mesh**
  35. - :ref:`NodePath<class_nodepath>` **skeleton**
  36. Description
  37. -----------
  38. MeshInstance is a :ref:`Node<class_node>` that takes a :ref:`Mesh<class_mesh>` resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single :ref:`Mesh<class_mesh>` in many places. This allows to reuse geometry and save on resources. When a :ref:`Mesh<class_mesh>` has to be instanced more than thousands of times at close proximity, consider using a :ref:`MultiMesh<class_multimesh>` in a :ref:`MultiMeshInstance<class_multimeshinstance>` instead.
  39. Member Function Description
  40. ---------------------------
  41. .. _class_MeshInstance_create_convex_collision:
  42. - void **create_convex_collision** **(** **)**
  43. .. _class_MeshInstance_create_debug_tangents:
  44. - void **create_debug_tangents** **(** **)**
  45. .. _class_MeshInstance_create_trimesh_collision:
  46. - void **create_trimesh_collision** **(** **)**
  47. This helper creates a :ref:`StaticBody<class_staticbody>` child :ref:`Node<class_node>` using the mesh geometry as collision. It's mainly used for testing.
  48. .. _class_MeshInstance_get_mesh:
  49. - :ref:`Mesh<class_mesh>` **get_mesh** **(** **)** const
  50. Return the current :ref:`Mesh<class_mesh>` resource for the instance.
  51. .. _class_MeshInstance_get_skeleton_path:
  52. - :ref:`NodePath<class_nodepath>` **get_skeleton_path** **(** **)**
  53. .. _class_MeshInstance_get_surface_material:
  54. - :ref:`Material<class_material>` **get_surface_material** **(** :ref:`int<class_int>` surface **)** const
  55. .. _class_MeshInstance_set_mesh:
  56. - void **set_mesh** **(** :ref:`Mesh<class_mesh>` mesh **)**
  57. Set the :ref:`Mesh<class_mesh>` resource for the instance.
  58. .. _class_MeshInstance_set_skeleton_path:
  59. - void **set_skeleton_path** **(** :ref:`NodePath<class_nodepath>` skeleton_path **)**
  60. .. _class_MeshInstance_set_surface_material:
  61. - void **set_surface_material** **(** :ref:`int<class_int>` surface, :ref:`Material<class_material>` material **)**