class_collisionshape.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/CollisionShape.xml.
  6. .. _class_CollisionShape:
  7. CollisionShape
  8. ==============
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Node that represents collision shape data in 3D space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Editor facility for creating and editing collision shapes in 3D space. Set the :ref:`shape<class_CollisionShape_property_shape>` property to configure the shape. **IMPORTANT**: this is an Editor-only helper to create shapes, use :ref:`CollisionObject.shape_owner_get_shape<class_CollisionObject_method_shape_owner_get_shape>` to get the actual shape.
  15. You can use this node to represent all sorts of collision shapes, for example, add this to an :ref:`Area<class_Area>` to give it a detection shape, or add it to a :ref:`PhysicsBody<class_PhysicsBody>` to create a solid object.
  16. \ **Warning:** A non-uniformly scaled CollisionShape3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size of its :ref:`shape<class_CollisionShape_property_shape>` resource instead.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Physics introduction <../tutorials/physics/physics_introduction>`
  21. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  22. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  23. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  24. .. rst-class:: classref-reftable-group
  25. Properties
  26. ----------
  27. .. table::
  28. :widths: auto
  29. +---------------------------+---------------------------------------------------------+-----------+
  30. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionShape_property_disabled>` | ``false`` |
  31. +---------------------------+---------------------------------------------------------+-----------+
  32. | :ref:`Shape<class_Shape>` | :ref:`shape<class_CollisionShape_property_shape>` | |
  33. +---------------------------+---------------------------------------------------------+-----------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +------+----------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`make_convex_from_brothers<class_CollisionShape_method_make_convex_from_brothers>` **(** **)** |
  41. +------+----------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`resource_changed<class_CollisionShape_method_resource_changed>` **(** :ref:`Resource<class_Resource>` resource **)** |
  43. +------+----------------------------------------------------------------------------------------------------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Property Descriptions
  48. ---------------------
  49. .. _class_CollisionShape_property_disabled:
  50. .. rst-class:: classref-property
  51. :ref:`bool<class_bool>` **disabled** = ``false``
  52. .. rst-class:: classref-property-setget
  53. - void **set_disabled** **(** :ref:`bool<class_bool>` value **)**
  54. - :ref:`bool<class_bool>` **is_disabled** **(** **)**
  55. A disabled collision shape has no effect in the world.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_CollisionShape_property_shape:
  59. .. rst-class:: classref-property
  60. :ref:`Shape<class_Shape>` **shape**
  61. .. rst-class:: classref-property-setget
  62. - void **set_shape** **(** :ref:`Shape<class_Shape>` value **)**
  63. - :ref:`Shape<class_Shape>` **get_shape** **(** **)**
  64. The actual shape owned by this collision shape.
  65. .. rst-class:: classref-section-separator
  66. ----
  67. .. rst-class:: classref-descriptions-group
  68. Method Descriptions
  69. -------------------
  70. .. _class_CollisionShape_method_make_convex_from_brothers:
  71. .. rst-class:: classref-method
  72. void **make_convex_from_brothers** **(** **)**
  73. Sets the collision shape's shape to the addition of all its convexed :ref:`MeshInstance<class_MeshInstance>` siblings geometry.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_CollisionShape_method_resource_changed:
  77. .. rst-class:: classref-method
  78. void **resource_changed** **(** :ref:`Resource<class_Resource>` resource **)**
  79. If this method exists within a script it will be called whenever the shape resource has been modified.
  80. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  81. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  82. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  83. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`