class_collisionpolygon.rst 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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>` | 1.0 |
  17. +-------------------------------------------------+-----------------------------------------------------------+----------------------+
  18. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon_property_disabled>` | false |
  19. +-------------------------------------------------+-----------------------------------------------------------+----------------------+
  20. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon_property_polygon>` | PoolVector2Array( ) |
  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 run-time. 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. | *Default* | 1.0 |
  31. +-----------+------------------+
  32. | *Setter* | set_depth(value) |
  33. +-----------+------------------+
  34. | *Getter* | get_depth() |
  35. +-----------+------------------+
  36. Length that the resulting collision extends in either direction perpendicular to its polygon.
  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. .. _class_CollisionPolygon_property_polygon:
  48. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  49. +-----------+----------------------+
  50. | *Default* | PoolVector2Array( ) |
  51. +-----------+----------------------+
  52. | *Setter* | set_polygon(value) |
  53. +-----------+----------------------+
  54. | *Getter* | get_polygon() |
  55. +-----------+----------------------+
  56. Array of vertices which define the polygon.
  57. **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.