class_collisionpolygon.rst 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Editor-only class for defining a collision polygon in 3D space.
  13. Properties
  14. ----------
  15. +-------------------------------------------------+-----------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon_property_depth>` |
  17. +-------------------------------------------------+-----------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon_property_disabled>` |
  19. +-------------------------------------------------+-----------------------------------------------------------+
  20. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon_property_polygon>` |
  21. +-------------------------------------------------+-----------------------------------------------------------+
  22. Description
  23. -----------
  24. 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 runtime. Creates a :ref:`Shape<class_Shape>` for gameplay. Properties modified during gameplay will have no effect.
  25. Property Descriptions
  26. ---------------------
  27. .. _class_CollisionPolygon_property_depth:
  28. - :ref:`float<class_float>` **depth**
  29. +----------+------------------+
  30. | *Setter* | set_depth(value) |
  31. +----------+------------------+
  32. | *Getter* | get_depth() |
  33. +----------+------------------+
  34. Length that the resulting collision extends in either direction perpendicular to its polygon.
  35. ----
  36. .. _class_CollisionPolygon_property_disabled:
  37. - :ref:`bool<class_bool>` **disabled**
  38. +----------+---------------------+
  39. | *Setter* | set_disabled(value) |
  40. +----------+---------------------+
  41. | *Getter* | is_disabled() |
  42. +----------+---------------------+
  43. If ``true``, no collision will be produced.
  44. ----
  45. .. _class_CollisionPolygon_property_polygon:
  46. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  47. +----------+--------------------+
  48. | *Setter* | set_polygon(value) |
  49. +----------+--------------------+
  50. | *Getter* | get_polygon() |
  51. +----------+--------------------+
  52. Array of vertices which define the polygon. Note that 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.