diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-15 00:46:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-15 00:46:48 +0100 |
commit | a0519c7c3170ff0c54e9b9a376ab865795630f5f (patch) | |
tree | 7859ca687d9457020774a0ed2cec0ff9c9bd8785 /modules/csg/doc_classes | |
parent | cf124b1415c4718325514ec32794fb0587885e3b (diff) | |
parent | 005993064462426ead1e3ed28ec6d3b9883f9bc0 (diff) |
Merge pull request #22973 from cyclopsian/csg-collision-fix
Add support for collision layers and masks in CSG shapes
Diffstat (limited to 'modules/csg/doc_classes')
-rw-r--r-- | modules/csg/doc_classes/CSGShape.xml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/csg/doc_classes/CSGShape.xml b/modules/csg/doc_classes/CSGShape.xml index ac3c2342fc..9a6671c67e 100644 --- a/modules/csg/doc_classes/CSGShape.xml +++ b/modules/csg/doc_classes/CSGShape.xml @@ -18,6 +18,46 @@ Returns true if this is a root shape and is thus the object that is rendered. </description> </method> + <method name="get_collision_layer_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + Returns an individual bit on the collision mask. + </description> + </method> + <method name="get_collision_mask_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + Returns an individual bit on the collision mask. + </description> + </method> + <method name="set_collision_layer_bit"> + <return type="void"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + Sets individual bits on the layer mask. Use this if you only need to change one layer's value. + </description> + </method> + <method name="set_collision_mask_bit"> + <return type="void"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + Sets individual bits on the collision mask. Use this if you only need to change one layer's value. + </description> + </method> </methods> <members> <member name="calculate_tangents" type="bool" setter="set_calculate_tangents" getter="is_calculating_tangents"> @@ -31,6 +71,15 @@ <member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision"> 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. </member> + <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer"> + The physics layers this area is in. + 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. + 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. + </member> + <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask"> + The physics layers this CSG shape scans for collisions. + </member> + </members> </members> <constants> <constant name="OPERATION_UNION" value="0" enum="Operation"> |