class_collisionpolygon3d.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/CollisionPolygon3D.xml.
  6. .. _class_CollisionPolygon3D:
  7. CollisionPolygon3D
  8. ==================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Node that represents a 3D collision polygon, given by the thickening of a 2D polygon in the local XY plane along the local Z axis.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Provides a 3D collision polygon to a :ref:`CollisionObject3D<class_CollisionObject3D>` parent, by thickening a 2D (convex or concave) polygon in the local XY plane along the local Z axis. The 2D polygon in the local XY plane can be drawn in the editor or specified by a list of vertices. That 2D polygon is thickened evenly in the local Z and -Z directions.
  15. This node has the same effect as several :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>` nodes, created by thickening the 2D convex polygons in the convex decomposition of the given 2D polygon (but without the overhead of multiple nodes).
  16. \ **Warning:** A non-uniformly scaled CollisionPolygon3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change its :ref:`polygon<class_CollisionPolygon3D_property_polygon>`'s vertices instead.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+
  23. | :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon3D_property_depth>` | ``1.0`` |
  24. +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon3D_property_disabled>` | ``false`` |
  26. +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+
  27. | :ref:`float<class_float>` | :ref:`margin<class_CollisionPolygon3D_property_margin>` | ``0.04`` |
  28. +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+
  29. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`polygon<class_CollisionPolygon3D_property_polygon>` | ``PackedVector2Array()`` |
  30. +-----------------------------------------------------+-------------------------------------------------------------+--------------------------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Property Descriptions
  35. ---------------------
  36. .. _class_CollisionPolygon3D_property_depth:
  37. .. rst-class:: classref-property
  38. :ref:`float<class_float>` **depth** = ``1.0``
  39. .. rst-class:: classref-property-setget
  40. - void **set_depth** **(** :ref:`float<class_float>` value **)**
  41. - :ref:`float<class_float>` **get_depth** **(** **)**
  42. Length that the resulting collision extends in either direction perpendicular to its 2D polygon.
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_CollisionPolygon3D_property_disabled:
  46. .. rst-class:: classref-property
  47. :ref:`bool<class_bool>` **disabled** = ``false``
  48. .. rst-class:: classref-property-setget
  49. - void **set_disabled** **(** :ref:`bool<class_bool>` value **)**
  50. - :ref:`bool<class_bool>` **is_disabled** **(** **)**
  51. If ``true``, no collision will be produced.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_CollisionPolygon3D_property_margin:
  55. .. rst-class:: classref-property
  56. :ref:`float<class_float>` **margin** = ``0.04``
  57. .. rst-class:: classref-property-setget
  58. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  59. - :ref:`float<class_float>` **get_margin** **(** **)**
  60. The collision margin for the generated :ref:`Shape3D<class_Shape3D>`. See :ref:`Shape3D.margin<class_Shape3D_property_margin>` for more details.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_CollisionPolygon3D_property_polygon:
  64. .. rst-class:: classref-property
  65. :ref:`PackedVector2Array<class_PackedVector2Array>` **polygon** = ``PackedVector2Array()``
  66. .. rst-class:: classref-property-setget
  67. - void **set_polygon** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` value **)**
  68. - :ref:`PackedVector2Array<class_PackedVector2Array>` **get_polygon** **(** **)**
  69. Array of vertices which define the 2D polygon in the local XY plane.
  70. \ **Note:** The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the ``polygon`` member.
  71. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  72. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  73. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  74. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  75. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  76. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`