Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
CSGShape3D¶
Inherits: GeometryInstance3D < VisualInstance3D < Node3D < Node < Object
Inherited By: CSGCombiner3D, CSGPrimitive3D
The CSG base class.
Description¶
This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
Note: CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a MeshInstance3D with a PrimitiveMesh. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
get_collision_layer_value ( int layer_number ) const |
|
get_collision_mask_value ( int layer_number ) const |
|
get_meshes ( ) const |
|
is_root_shape ( ) const |
|
void |
set_collision_layer_value ( int layer_number, bool value ) |
void |
set_collision_mask_value ( int layer_number, bool value ) |
Enumerations¶
enum Operation:
Operation OPERATION_UNION = 0
Geometry of both primitives is merged, intersecting geometry is removed.
Operation OPERATION_INTERSECTION = 1
Only intersecting geometry remains, the rest is removed.
Operation OPERATION_SUBTRACTION = 2
The second shape is subtracted from the first, leaving a dent with its shape.
Property Descriptions¶
bool calculate_tangents = true
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.
int collision_layer = 1
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. See Collision layers and masks in the documentation for more information.
int collision_mask = 1
The physics layers this CSG shape scans for collisions. Only effective if use_collision is true
. See Collision layers and masks in the documentation for more information.
float collision_priority = 1.0
The priority used to solve colliding when occurring penetration. Only effective if use_collision is