CSGShape.xml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CSGShape" inherits="VisualInstance" category="Core" version="3.1">
  3. <brief_description>
  4. The CSG base class.
  5. </brief_description>
  6. <description>
  7. This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_collision_layer_bit" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <argument index="0" name="bit" type="int">
  18. </argument>
  19. <description>
  20. Returns an individual bit on the collision mask.
  21. </description>
  22. </method>
  23. <method name="get_collision_mask_bit" qualifiers="const">
  24. <return type="bool">
  25. </return>
  26. <argument index="0" name="bit" type="int">
  27. </argument>
  28. <description>
  29. Returns an individual bit on the collision mask.
  30. </description>
  31. </method>
  32. <method name="is_root_shape" qualifiers="const">
  33. <return type="bool">
  34. </return>
  35. <description>
  36. Returns true if this is a root shape and is thus the object that is rendered.
  37. </description>
  38. </method>
  39. <method name="set_collision_layer_bit">
  40. <return type="void">
  41. </return>
  42. <argument index="0" name="bit" type="int">
  43. </argument>
  44. <argument index="1" name="value" type="bool">
  45. </argument>
  46. <description>
  47. Sets individual bits on the layer mask. Use this if you only need to change one layer's value.
  48. </description>
  49. </method>
  50. <method name="set_collision_mask_bit">
  51. <return type="void">
  52. </return>
  53. <argument index="0" name="bit" type="int">
  54. </argument>
  55. <argument index="1" name="value" type="bool">
  56. </argument>
  57. <description>
  58. Sets individual bits on the collision mask. Use this if you only need to change one layer's value.
  59. </description>
  60. </method>
  61. </methods>
  62. <members>
  63. <member name="calculate_tangents" type="bool" setter="set_calculate_tangents" getter="is_calculating_tangents">
  64. 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.
  65. </member>
  66. <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
  67. The physics layers this area is in.
  68. 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.
  69. 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.
  70. </member>
  71. <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
  72. The physics layers this CSG shape scans for collisions.
  73. </member>
  74. <member name="operation" type="int" setter="set_operation" getter="get_operation" enum="CSGShape.Operation">
  75. 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.
  76. </member>
  77. <member name="snap" type="float" setter="set_snap" getter="get_snap">
  78. </member>
  79. <member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision">
  80. 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.
  81. </member>
  82. </members>
  83. <constants>
  84. <constant name="OPERATION_UNION" value="0" enum="Operation">
  85. Geometry of both primitives is merged, intersecting geometry is removed.
  86. </constant>
  87. <constant name="OPERATION_INTERSECTION" value="1" enum="Operation">
  88. Only intersecting geometry remains, the rest is removed.
  89. </constant>
  90. <constant name="OPERATION_SUBTRACTION" value="2" enum="Operation">
  91. The second shape is susbtracted from the first, leaving a dent with it's shape.
  92. </constant>
  93. </constants>
  94. </class>