class_separationrayshape2d.rst 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SeparationRayShape2D.xml.
  6. .. _class_SeparationRayShape2D:
  7. SeparationRayShape2D
  8. ====================
  9. **Inherits:** :ref:`Shape2D<class_Shape2D>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Separation ray shape resource for 2D physics.
  11. Description
  12. -----------
  13. 2D separation ray 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. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters.
  14. \ **Performance:** Being a primitive collision shape, ``SeparationRayShape2D`` is fast to check collisions against.
  15. Properties
  16. ----------
  17. +---------------------------+---------------------------------------------------------------------------+-----------+
  18. | :ref:`float<class_float>` | :ref:`length<class_SeparationRayShape2D_property_length>` | ``20.0`` |
  19. +---------------------------+---------------------------------------------------------------------------+-----------+
  20. | :ref:`bool<class_bool>` | :ref:`slide_on_slope<class_SeparationRayShape2D_property_slide_on_slope>` | ``false`` |
  21. +---------------------------+---------------------------------------------------------------------------+-----------+
  22. Property Descriptions
  23. ---------------------
  24. .. _class_SeparationRayShape2D_property_length:
  25. - :ref:`float<class_float>` **length**
  26. +-----------+-------------------+
  27. | *Default* | ``20.0`` |
  28. +-----------+-------------------+
  29. | *Setter* | set_length(value) |
  30. +-----------+-------------------+
  31. | *Getter* | get_length() |
  32. +-----------+-------------------+
  33. The ray's length.
  34. ----
  35. .. _class_SeparationRayShape2D_property_slide_on_slope:
  36. - :ref:`bool<class_bool>` **slide_on_slope**
  37. +-----------+---------------------------+
  38. | *Default* | ``false`` |
  39. +-----------+---------------------------+
  40. | *Setter* | set_slide_on_slope(value) |
  41. +-----------+---------------------------+
  42. | *Getter* | get_slide_on_slope() |
  43. +-----------+---------------------------+
  44. If ``false`` (default), the shape always separates and returns a normal along its own direction.
  45. If ``true``, the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes.
  46. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  47. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  48. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  49. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  50. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  51. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`