class_physicsmaterial.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PhysicsMaterial.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PhysicsMaterial:
  6. PhysicsMaterial
  7. ===============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A material for physics properties.
  10. Description
  11. -----------
  12. Provides a means of modifying the collision properties of a :ref:`PhysicsBody<class_PhysicsBody>`.
  13. Properties
  14. ----------
  15. +---------------------------+------------------------------------------------------------+-----------+
  16. | :ref:`bool<class_bool>` | :ref:`absorbent<class_PhysicsMaterial_property_absorbent>` | ``false`` |
  17. +---------------------------+------------------------------------------------------------+-----------+
  18. | :ref:`float<class_float>` | :ref:`bounce<class_PhysicsMaterial_property_bounce>` | ``0.0`` |
  19. +---------------------------+------------------------------------------------------------+-----------+
  20. | :ref:`float<class_float>` | :ref:`friction<class_PhysicsMaterial_property_friction>` | ``1.0`` |
  21. +---------------------------+------------------------------------------------------------+-----------+
  22. | :ref:`bool<class_bool>` | :ref:`rough<class_PhysicsMaterial_property_rough>` | ``false`` |
  23. +---------------------------+------------------------------------------------------------+-----------+
  24. Property Descriptions
  25. ---------------------
  26. .. _class_PhysicsMaterial_property_absorbent:
  27. - :ref:`bool<class_bool>` **absorbent**
  28. +-----------+----------------------+
  29. | *Default* | ``false`` |
  30. +-----------+----------------------+
  31. | *Setter* | set_absorbent(value) |
  32. +-----------+----------------------+
  33. | *Getter* | is_absorbent() |
  34. +-----------+----------------------+
  35. If ``true``, subtracts the bounciness from the colliding object's bounciness instead of adding it.
  36. ----
  37. .. _class_PhysicsMaterial_property_bounce:
  38. - :ref:`float<class_float>` **bounce**
  39. +-----------+-------------------+
  40. | *Default* | ``0.0`` |
  41. +-----------+-------------------+
  42. | *Setter* | set_bounce(value) |
  43. +-----------+-------------------+
  44. | *Getter* | get_bounce() |
  45. +-----------+-------------------+
  46. The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness).
  47. ----
  48. .. _class_PhysicsMaterial_property_friction:
  49. - :ref:`float<class_float>` **friction**
  50. +-----------+---------------------+
  51. | *Default* | ``1.0`` |
  52. +-----------+---------------------+
  53. | *Setter* | set_friction(value) |
  54. +-----------+---------------------+
  55. | *Getter* | get_friction() |
  56. +-----------+---------------------+
  57. The body's friction. Values range from ``0`` (frictionless) to ``1`` (maximum friction).
  58. ----
  59. .. _class_PhysicsMaterial_property_rough:
  60. - :ref:`bool<class_bool>` **rough**
  61. +-----------+------------------+
  62. | *Default* | ``false`` |
  63. +-----------+------------------+
  64. | *Setter* | set_rough(value) |
  65. +-----------+------------------+
  66. | *Getter* | is_rough() |
  67. +-----------+------------------+
  68. If ``true``, the physics engine will use the friction of the object marked as "rough" when two objects collide. If ``false``, the physics engine will use the lowest friction of all colliding objects instead. If ``true`` for both colliding objects, the physics engine will use the highest friction.
  69. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  70. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  71. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`