class_collisionpolygon.rst 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CollisionPolygon.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CollisionPolygon:
  5. CollisionPolygon
  6. ================
  7. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Editor-only class for defining a collision polygon in 3D space.
  12. Properties
  13. ----------
  14. +-------------------------------------------------+-----------------------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`depth<class_CollisionPolygon_property_depth>` |
  16. +-------------------------------------------------+-----------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon_property_disabled>` |
  18. +-------------------------------------------------+-----------------------------------------------------------+
  19. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon_property_polygon>` |
  20. +-------------------------------------------------+-----------------------------------------------------------+
  21. Description
  22. -----------
  23. 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.
  24. Property Descriptions
  25. ---------------------
  26. .. _class_CollisionPolygon_property_depth:
  27. - :ref:`float<class_float>` **depth**
  28. +----------+------------------+
  29. | *Setter* | set_depth(value) |
  30. +----------+------------------+
  31. | *Getter* | get_depth() |
  32. +----------+------------------+
  33. Length that the resulting collision extends in either direction perpendicular to its polygon.
  34. .. _class_CollisionPolygon_property_disabled:
  35. - :ref:`bool<class_bool>` **disabled**
  36. +----------+---------------------+
  37. | *Setter* | set_disabled(value) |
  38. +----------+---------------------+
  39. | *Getter* | is_disabled() |
  40. +----------+---------------------+
  41. If ``true``, no collision will be produced.
  42. .. _class_CollisionPolygon_property_polygon:
  43. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  44. +----------+--------------------+
  45. | *Setter* | set_polygon(value) |
  46. +----------+--------------------+
  47. | *Getter* | get_polygon() |
  48. +----------+--------------------+
  49. 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.