class_worldboundaryshape2d.rst 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/WorldBoundaryShape2D.xml.
  6. .. _class_WorldBoundaryShape2D:
  7. WorldBoundaryShape2D
  8. ====================
  9. **Inherits:** :ref:`Shape2D<class_Shape2D>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. World boundary (infinite plane) shape resource for 2D physics.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 2D world boundary shape to be added as a *direct* child of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`Area2D<class_Area2D>` using a :ref:`CollisionShape2D<class_CollisionShape2D>` node. **WorldBoundaryShape2D** works like an infinite plane and will not allow any physics body to go to the negative side. Note that the :ref:`normal<class_WorldBoundaryShape2D_property_normal>` matters; anything "below" the plane will collide with it. If the **WorldBoundaryShape2D** is used in a :ref:`PhysicsBody2D<class_PhysicsBody2D>`, it will cause colliding objects placed "below" it to teleport "above" the plane.
  15. \ **Performance:** Being a primitive collision shape, **WorldBoundaryShape2D** is fast to check collisions against.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------+---------------------------------------------------------------+--------------------+
  22. | :ref:`float<class_float>` | :ref:`distance<class_WorldBoundaryShape2D_property_distance>` | ``0.0`` |
  23. +-------------------------------+---------------------------------------------------------------+--------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`normal<class_WorldBoundaryShape2D_property_normal>` | ``Vector2(0, -1)`` |
  25. +-------------------------------+---------------------------------------------------------------+--------------------+
  26. .. rst-class:: classref-section-separator
  27. ----
  28. .. rst-class:: classref-descriptions-group
  29. Property Descriptions
  30. ---------------------
  31. .. _class_WorldBoundaryShape2D_property_distance:
  32. .. rst-class:: classref-property
  33. :ref:`float<class_float>` **distance** = ``0.0``
  34. .. rst-class:: classref-property-setget
  35. - void **set_distance** **(** :ref:`float<class_float>` value **)**
  36. - :ref:`float<class_float>` **get_distance** **(** **)**
  37. The line's distance from the origin.
  38. .. rst-class:: classref-item-separator
  39. ----
  40. .. _class_WorldBoundaryShape2D_property_normal:
  41. .. rst-class:: classref-property
  42. :ref:`Vector2<class_Vector2>` **normal** = ``Vector2(0, -1)``
  43. .. rst-class:: classref-property-setget
  44. - void **set_normal** **(** :ref:`Vector2<class_Vector2>` value **)**
  45. - :ref:`Vector2<class_Vector2>` **get_normal** **(** **)**
  46. The line's normal. Defaults to ``Vector2.UP``.
  47. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  48. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  49. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  50. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  51. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  52. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`