class_staticbody2d.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 StaticBody2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_StaticBody2D:
  6. StaticBody2D
  7. ============
  8. **Inherits:** :ref:`PhysicsBody2D<class_PhysicsBody2D>` **<** :ref:`CollisionObject2D<class_CollisionObject2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Static body for 2D Physics.
  13. Properties
  14. ----------
  15. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`bounce<class_StaticBody2D_property_bounce>` |
  17. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`constant_angular_velocity<class_StaticBody2D_property_constant_angular_velocity>` |
  19. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  20. | :ref:`Vector2<class_Vector2>` | :ref:`constant_linear_velocity<class_StaticBody2D_property_constant_linear_velocity>` |
  21. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`friction<class_StaticBody2D_property_friction>` |
  23. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  24. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`physics_material_override<class_StaticBody2D_property_physics_material_override>` |
  25. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  26. Description
  27. -----------
  28. Static body for 2D Physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms.
  29. Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt).
  30. Property Descriptions
  31. ---------------------
  32. .. _class_StaticBody2D_property_bounce:
  33. - :ref:`float<class_float>` **bounce**
  34. +----------+-------------------+
  35. | *Setter* | set_bounce(value) |
  36. +----------+-------------------+
  37. | *Getter* | get_bounce() |
  38. +----------+-------------------+
  39. The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness).
  40. ----
  41. .. _class_StaticBody2D_property_constant_angular_velocity:
  42. - :ref:`float<class_float>` **constant_angular_velocity**
  43. +----------+--------------------------------------+
  44. | *Setter* | set_constant_angular_velocity(value) |
  45. +----------+--------------------------------------+
  46. | *Getter* | get_constant_angular_velocity() |
  47. +----------+--------------------------------------+
  48. Constant angular velocity for the body. This does not rotate the body, but affects colliding bodies, as if it were rotating.
  49. ----
  50. .. _class_StaticBody2D_property_constant_linear_velocity:
  51. - :ref:`Vector2<class_Vector2>` **constant_linear_velocity**
  52. +----------+-------------------------------------+
  53. | *Setter* | set_constant_linear_velocity(value) |
  54. +----------+-------------------------------------+
  55. | *Getter* | get_constant_linear_velocity() |
  56. +----------+-------------------------------------+
  57. Constant linear velocity for the body. This does not move the body, but affects colliding bodies, as if it were moving.
  58. ----
  59. .. _class_StaticBody2D_property_friction:
  60. - :ref:`float<class_float>` **friction**
  61. +----------+---------------------+
  62. | *Setter* | set_friction(value) |
  63. +----------+---------------------+
  64. | *Getter* | get_friction() |
  65. +----------+---------------------+
  66. The body's friction. Values range from ``0`` (no friction) to ``1`` (full friction).
  67. ----
  68. .. _class_StaticBody2D_property_physics_material_override:
  69. - :ref:`PhysicsMaterial<class_PhysicsMaterial>` **physics_material_override**
  70. +----------+--------------------------------------+
  71. | *Setter* | set_physics_material_override(value) |
  72. +----------+--------------------------------------+
  73. | *Getter* | get_physics_material_override() |
  74. +----------+--------------------------------------+