class_csgshape.rst 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CSGShape.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CSGShape:
  5. CSGShape
  6. ========
  7. **Inherits:** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`CSGCombiner<class_CSGCombiner>`, :ref:`CSGPrimitive<class_CSGPrimitive>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. The CSG base class.
  13. Properties
  14. ----------
  15. +-------------------------------------------+-----------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`calculate_tangents<class_CSGShape_property_calculate_tangents>` |
  17. +-------------------------------------------+-----------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`collision_layer<class_CSGShape_property_collision_layer>` |
  19. +-------------------------------------------+-----------------------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`collision_mask<class_CSGShape_property_collision_mask>` |
  21. +-------------------------------------------+-----------------------------------------------------------------------+
  22. | :ref:`Operation<enum_CSGShape_Operation>` | :ref:`operation<class_CSGShape_property_operation>` |
  23. +-------------------------------------------+-----------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`snap<class_CSGShape_property_snap>` |
  25. +-------------------------------------------+-----------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`use_collision<class_CSGShape_property_use_collision>` |
  27. +-------------------------------------------+-----------------------------------------------------------------------+
  28. Methods
  29. -------
  30. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_CSGShape_method_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** const |
  32. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_CSGShape_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** const |
  34. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Array<class_Array>` | :ref:`get_meshes<class_CSGShape_method_get_meshes>` **(** **)** const |
  36. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`is_root_shape<class_CSGShape_method_is_root_shape>` **(** **)** const |
  38. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_collision_layer_bit<class_CSGShape_method_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  40. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_collision_mask_bit<class_CSGShape_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  42. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Enumerations
  44. ------------
  45. .. _enum_CSGShape_Operation:
  46. .. _class_CSGShape_constant_OPERATION_UNION:
  47. .. _class_CSGShape_constant_OPERATION_INTERSECTION:
  48. .. _class_CSGShape_constant_OPERATION_SUBTRACTION:
  49. enum **Operation**:
  50. - **OPERATION_UNION** = **0** --- Geometry of both primitives is merged, intersecting geometry is removed.
  51. - **OPERATION_INTERSECTION** = **1** --- Only intersecting geometry remains, the rest is removed.
  52. - **OPERATION_SUBTRACTION** = **2** --- The second shape is susbtracted from the first, leaving a dent with it's shape.
  53. Description
  54. -----------
  55. This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
  56. Property Descriptions
  57. ---------------------
  58. .. _class_CSGShape_property_calculate_tangents:
  59. - :ref:`bool<class_bool>` **calculate_tangents**
  60. +----------+-------------------------------+
  61. | *Setter* | set_calculate_tangents(value) |
  62. +----------+-------------------------------+
  63. | *Getter* | is_calculating_tangents() |
  64. +----------+-------------------------------+
  65. Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child.
  66. .. _class_CSGShape_property_collision_layer:
  67. - :ref:`int<class_int>` **collision_layer**
  68. +----------+----------------------------+
  69. | *Setter* | set_collision_layer(value) |
  70. +----------+----------------------------+
  71. | *Getter* | get_collision_layer() |
  72. +----------+----------------------------+
  73. The physics layers this area is in.
  74. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
  75. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
  76. .. _class_CSGShape_property_collision_mask:
  77. - :ref:`int<class_int>` **collision_mask**
  78. +----------+---------------------------+
  79. | *Setter* | set_collision_mask(value) |
  80. +----------+---------------------------+
  81. | *Getter* | get_collision_mask() |
  82. +----------+---------------------------+
  83. The physics layers this CSG shape scans for collisions.
  84. .. _class_CSGShape_property_operation:
  85. - :ref:`Operation<enum_CSGShape_Operation>` **operation**
  86. +----------+----------------------+
  87. | *Setter* | set_operation(value) |
  88. +----------+----------------------+
  89. | *Getter* | get_operation() |
  90. +----------+----------------------+
  91. The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
  92. .. _class_CSGShape_property_snap:
  93. - :ref:`float<class_float>` **snap**
  94. +----------+-----------------+
  95. | *Setter* | set_snap(value) |
  96. +----------+-----------------+
  97. | *Getter* | get_snap() |
  98. +----------+-----------------+
  99. .. _class_CSGShape_property_use_collision:
  100. - :ref:`bool<class_bool>` **use_collision**
  101. +----------+--------------------------+
  102. | *Setter* | set_use_collision(value) |
  103. +----------+--------------------------+
  104. | *Getter* | is_using_collision() |
  105. +----------+--------------------------+
  106. Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden.
  107. Method Descriptions
  108. -------------------
  109. .. _class_CSGShape_method_get_collision_layer_bit:
  110. - :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** const
  111. Returns an individual bit on the collision mask.
  112. .. _class_CSGShape_method_get_collision_mask_bit:
  113. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** const
  114. Returns an individual bit on the collision mask.
  115. .. _class_CSGShape_method_get_meshes:
  116. - :ref:`Array<class_Array>` **get_meshes** **(** **)** const
  117. .. _class_CSGShape_method_is_root_shape:
  118. - :ref:`bool<class_bool>` **is_root_shape** **(** **)** const
  119. Returns ``true`` if this is a root shape and is thus the object that is rendered.
  120. .. _class_CSGShape_method_set_collision_layer_bit:
  121. - void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  122. Sets individual bits on the layer mask. Use this if you only need to change one layer's value.
  123. .. _class_CSGShape_method_set_collision_mask_bit:
  124. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  125. Sets individual bits on the collision mask. Use this if you only need to change one layer's value.