class_staticbody2d.rst 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/StaticBody2D.xml.
  6. .. _class_StaticBody2D:
  7. StaticBody2D
  8. ============
  9. **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>`
  10. **Inherited By:** :ref:`AnimatableBody2D<class_AnimatableBody2D>`
  11. A 2D physics body that can't be moved by external forces. When moved manually, it doesn't affect other bodies in its path.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A static 2D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, :ref:`AnimationMixer<class_AnimationMixer>`\ s (with :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` set to :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS>`), and :ref:`RemoteTransform2D<class_RemoteTransform2D>`.
  16. When **StaticBody2D** is moved, it is teleported to its new position without affecting other physics bodies in its path. If this is not desired, use :ref:`AnimatableBody2D<class_AnimatableBody2D>` instead.
  17. \ **StaticBody2D** is useful for completely static objects like floors and walls, as well as moving surfaces like conveyor belts and circular revolving platforms (by using :ref:`constant_linear_velocity<class_StaticBody2D_property_constant_linear_velocity>` and :ref:`constant_angular_velocity<class_StaticBody2D_property_constant_angular_velocity>`).
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-----------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
  24. | :ref:`float<class_float>` | :ref:`constant_angular_velocity<class_StaticBody2D_property_constant_angular_velocity>` | ``0.0`` |
  25. +-----------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
  26. | :ref:`Vector2<class_Vector2>` | :ref:`constant_linear_velocity<class_StaticBody2D_property_constant_linear_velocity>` | ``Vector2(0, 0)`` |
  27. +-----------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
  28. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`physics_material_override<class_StaticBody2D_property_physics_material_override>` | |
  29. +-----------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
  30. .. rst-class:: classref-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Property Descriptions
  34. ---------------------
  35. .. _class_StaticBody2D_property_constant_angular_velocity:
  36. .. rst-class:: classref-property
  37. :ref:`float<class_float>` **constant_angular_velocity** = ``0.0`` :ref:`🔗<class_StaticBody2D_property_constant_angular_velocity>`
  38. .. rst-class:: classref-property-setget
  39. - |void| **set_constant_angular_velocity**\ (\ value\: :ref:`float<class_float>`\ )
  40. - :ref:`float<class_float>` **get_constant_angular_velocity**\ (\ )
  41. The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_StaticBody2D_property_constant_linear_velocity:
  45. .. rst-class:: classref-property
  46. :ref:`Vector2<class_Vector2>` **constant_linear_velocity** = ``Vector2(0, 0)`` :ref:`🔗<class_StaticBody2D_property_constant_linear_velocity>`
  47. .. rst-class:: classref-property-setget
  48. - |void| **set_constant_linear_velocity**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  49. - :ref:`Vector2<class_Vector2>` **get_constant_linear_velocity**\ (\ )
  50. The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_StaticBody2D_property_physics_material_override:
  54. .. rst-class:: classref-property
  55. :ref:`PhysicsMaterial<class_PhysicsMaterial>` **physics_material_override** :ref:`🔗<class_StaticBody2D_property_physics_material_override>`
  56. .. rst-class:: classref-property-setget
  57. - |void| **set_physics_material_override**\ (\ value\: :ref:`PhysicsMaterial<class_PhysicsMaterial>`\ )
  58. - :ref:`PhysicsMaterial<class_PhysicsMaterial>` **get_physics_material_override**\ (\ )
  59. The physics material override for the body.
  60. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  67. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  68. .. |void| replace:: :abbr:`void (No return value.)`