class_staticbody2d.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the StaticBody2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_StaticBody2D:
  5. StaticBody2D
  6. ============
  7. **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>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Static body for 2D Physics.
  12. Properties
  13. ----------
  14. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`bounce<class_StaticBody2D_property_bounce>` |
  16. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  17. | :ref:`float<class_float>` | :ref:`constant_angular_velocity<class_StaticBody2D_property_constant_angular_velocity>` |
  18. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  19. | :ref:`Vector2<class_Vector2>` | :ref:`constant_linear_velocity<class_StaticBody2D_property_constant_linear_velocity>` |
  20. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`friction<class_StaticBody2D_property_friction>` |
  22. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  23. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`physics_material_override<class_StaticBody2D_property_physics_material_override>` |
  24. +-----------------------------------------------+-----------------------------------------------------------------------------------------+
  25. Description
  26. -----------
  27. 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.
  28. 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).
  29. Property Descriptions
  30. ---------------------
  31. .. _class_StaticBody2D_property_bounce:
  32. - :ref:`float<class_float>` **bounce**
  33. +----------+-------------------+
  34. | *Setter* | set_bounce(value) |
  35. +----------+-------------------+
  36. | *Getter* | get_bounce() |
  37. +----------+-------------------+
  38. The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness).
  39. .. _class_StaticBody2D_property_constant_angular_velocity:
  40. - :ref:`float<class_float>` **constant_angular_velocity**
  41. +----------+--------------------------------------+
  42. | *Setter* | set_constant_angular_velocity(value) |
  43. +----------+--------------------------------------+
  44. | *Getter* | get_constant_angular_velocity() |
  45. +----------+--------------------------------------+
  46. Constant angular velocity for the body. This does not rotate the body, but affects colliding bodies, as if it were rotating.
  47. .. _class_StaticBody2D_property_constant_linear_velocity:
  48. - :ref:`Vector2<class_Vector2>` **constant_linear_velocity**
  49. +----------+-------------------------------------+
  50. | *Setter* | set_constant_linear_velocity(value) |
  51. +----------+-------------------------------------+
  52. | *Getter* | get_constant_linear_velocity() |
  53. +----------+-------------------------------------+
  54. Constant linear velocity for the body. This does not move the body, but affects colliding bodies, as if it were moving.
  55. .. _class_StaticBody2D_property_friction:
  56. - :ref:`float<class_float>` **friction**
  57. +----------+---------------------+
  58. | *Setter* | set_friction(value) |
  59. +----------+---------------------+
  60. | *Getter* | get_friction() |
  61. +----------+---------------------+
  62. The body's friction. Values range from ``0`` (no friction) to ``1`` (full friction).
  63. .. _class_StaticBody2D_property_physics_material_override:
  64. - :ref:`PhysicsMaterial<class_PhysicsMaterial>` **physics_material_override**
  65. +----------+--------------------------------------+
  66. | *Setter* | set_physics_material_override(value) |
  67. +----------+--------------------------------------+
  68. | *Getter* | get_physics_material_override() |
  69. +----------+--------------------------------------+