class_collisionpolygon.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CollisionPolygon.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CollisionPolygon:
  6. CollisionPolygon
  7. ================
  8. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Editor-only class for defining a collision polygon in 3D space.
  10. Description
  11. -----------
  12. 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.
  13. Properties
  14. ----------
  15. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  16. | :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon_property_depth>` | ``1.0`` |
  17. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon_property_disabled>` | ``false`` |
  19. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  20. | :ref:`float<class_float>` | :ref:`margin<class_CollisionPolygon_property_margin>` | ``0.04`` |
  21. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  22. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon_property_polygon>` | ``PoolVector2Array( )`` |
  23. +-------------------------------------------------+-----------------------------------------------------------+--------------------------+
  24. Property Descriptions
  25. ---------------------
  26. .. _class_CollisionPolygon_property_depth:
  27. - :ref:`float<class_float>` **depth**
  28. +-----------+------------------+
  29. | *Default* | ``1.0`` |
  30. +-----------+------------------+
  31. | *Setter* | set_depth(value) |
  32. +-----------+------------------+
  33. | *Getter* | get_depth() |
  34. +-----------+------------------+
  35. Length that the resulting collision extends in either direction perpendicular to its polygon.
  36. ----
  37. .. _class_CollisionPolygon_property_disabled:
  38. - :ref:`bool<class_bool>` **disabled**
  39. +-----------+---------------------+
  40. | *Default* | ``false`` |
  41. +-----------+---------------------+
  42. | *Setter* | set_disabled(value) |
  43. +-----------+---------------------+
  44. | *Getter* | is_disabled() |
  45. +-----------+---------------------+
  46. If ``true``, no collision will be produced.
  47. ----
  48. .. _class_CollisionPolygon_property_margin:
  49. - :ref:`float<class_float>` **margin**
  50. +-----------+-------------------+
  51. | *Default* | ``0.04`` |
  52. +-----------+-------------------+
  53. | *Setter* | set_margin(value) |
  54. +-----------+-------------------+
  55. | *Getter* | get_margin() |
  56. +-----------+-------------------+
  57. The collision margin for the generated :ref:`Shape<class_Shape>`. See :ref:`Shape.margin<class_Shape_property_margin>` for more details.
  58. ----
  59. .. _class_CollisionPolygon_property_polygon:
  60. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  61. +-----------+--------------------------+
  62. | *Default* | ``PoolVector2Array( )`` |
  63. +-----------+--------------------------+
  64. | *Setter* | set_polygon(value) |
  65. +-----------+--------------------------+
  66. | *Getter* | get_polygon() |
  67. +-----------+--------------------------+
  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.)`