class_collisionpolygon.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/CollisionPolygon.xml.
  6. .. _class_CollisionPolygon:
  7. CollisionPolygon
  8. ================
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Editor-only class for defining a collision polygon in 3D space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Allows editing a collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates a :ref:`Shape<class_Shape>` for gameplay. Properties modified during gameplay will have no effect.
  15. \ **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_CollisionPolygon_property_polygon>`'s vertices instead.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  22. | :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon_property_depth>` | ``1.0`` |
  23. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon_property_disabled>` | ``false`` |
  25. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  26. | :ref:`float<class_float>` | :ref:`margin<class_CollisionPolygon_property_margin>` | ``0.04`` |
  27. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  28. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon_property_polygon>` | ``PoolVector2Array( )`` |
  29. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  30. .. rst-class:: classref-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Property Descriptions
  34. ---------------------
  35. .. _class_CollisionPolygon_property_depth:
  36. .. rst-class:: classref-property
  37. :ref:`float<class_float>` **depth** = ``1.0``
  38. .. rst-class:: classref-property-setget
  39. - void **set_depth** **(** :ref:`float<class_float>` value **)**
  40. - :ref:`float<class_float>` **get_depth** **(** **)**
  41. Length that the resulting collision extends in either direction perpendicular to its polygon.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_CollisionPolygon_property_disabled:
  45. .. rst-class:: classref-property
  46. :ref:`bool<class_bool>` **disabled** = ``false``
  47. .. rst-class:: classref-property-setget
  48. - void **set_disabled** **(** :ref:`bool<class_bool>` value **)**
  49. - :ref:`bool<class_bool>` **is_disabled** **(** **)**
  50. If ``true``, no collision will be produced.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_CollisionPolygon_property_margin:
  54. .. rst-class:: classref-property
  55. :ref:`float<class_float>` **margin** = ``0.04``
  56. .. rst-class:: classref-property-setget
  57. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  58. - :ref:`float<class_float>` **get_margin** **(** **)**
  59. The collision margin for the generated :ref:`Shape<class_Shape>`. See :ref:`Shape.margin<class_Shape_property_margin>` for more details.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_CollisionPolygon_property_polygon:
  63. .. rst-class:: classref-property
  64. :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon** = ``PoolVector2Array( )``
  65. .. rst-class:: classref-property-setget
  66. - void **set_polygon** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` value **)**
  67. - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_polygon** **(** **)**
  68. Array of vertices which define the polygon.
  69. \ **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.
  70. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  71. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  72. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  73. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`