class_collisionshape.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 CollisionShape.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CollisionShape:
  6. CollisionShape
  7. ==============
  8. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Node that represents collision shape data in 3D space.
  10. Description
  11. -----------
  12. Editor facility for creating and editing collision shapes in 3D space. 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. **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.
  13. Tutorials
  14. ---------
  15. - :doc:`../tutorials/physics/physics_introduction`
  16. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  17. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  18. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  19. Properties
  20. ----------
  21. +---------------------------+---------------------------------------------------------+-----------+
  22. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionShape_property_disabled>` | ``false`` |
  23. +---------------------------+---------------------------------------------------------+-----------+
  24. | :ref:`Shape<class_Shape>` | :ref:`shape<class_CollisionShape_property_shape>` | |
  25. +---------------------------+---------------------------------------------------------+-----------+
  26. Methods
  27. -------
  28. +------+----------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`make_convex_from_brothers<class_CollisionShape_method_make_convex_from_brothers>` **(** **)** |
  30. +------+----------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`resource_changed<class_CollisionShape_method_resource_changed>` **(** :ref:`Resource<class_Resource>` resource **)** |
  32. +------+----------------------------------------------------------------------------------------------------------------------------+
  33. Property Descriptions
  34. ---------------------
  35. .. _class_CollisionShape_property_disabled:
  36. - :ref:`bool<class_bool>` **disabled**
  37. +-----------+---------------------+
  38. | *Default* | ``false`` |
  39. +-----------+---------------------+
  40. | *Setter* | set_disabled(value) |
  41. +-----------+---------------------+
  42. | *Getter* | is_disabled() |
  43. +-----------+---------------------+
  44. A disabled collision shape has no effect in the world.
  45. ----
  46. .. _class_CollisionShape_property_shape:
  47. - :ref:`Shape<class_Shape>` **shape**
  48. +----------+------------------+
  49. | *Setter* | set_shape(value) |
  50. +----------+------------------+
  51. | *Getter* | get_shape() |
  52. +----------+------------------+
  53. The actual shape owned by this collision shape.
  54. Method Descriptions
  55. -------------------
  56. .. _class_CollisionShape_method_make_convex_from_brothers:
  57. - void **make_convex_from_brothers** **(** **)**
  58. Sets the collision shape's shape to the addition of all its convexed :ref:`MeshInstance<class_MeshInstance>` siblings geometry.
  59. ----
  60. .. _class_CollisionShape_method_resource_changed:
  61. - void **resource_changed** **(** :ref:`Resource<class_Resource>` resource **)**
  62. If this method exists within a script it will be called whenever the shape resource has been modified.
  63. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  64. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  65. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`