Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
193 lines (125 sloc) 8.99 KB

CSGShape

Inherits: :ref:`GeometryInstance<class_GeometryInstance>` < :ref:`VisualInstance<class_VisualInstance>` < :ref:`Spatial<class_Spatial>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

Inherited By: :ref:`CSGCombiner<class_CSGCombiner>`, :ref:`CSGPrimitive<class_CSGPrimitive>`

Category: Core

Brief Description

The CSG base class.

Properties

:ref:`bool<class_bool>` :ref:`calculate_tangents<class_CSGShape_property_calculate_tangents>`
:ref:`int<class_int>` :ref:`collision_layer<class_CSGShape_property_collision_layer>`
:ref:`int<class_int>` :ref:`collision_mask<class_CSGShape_property_collision_mask>`
:ref:`Operation<enum_CSGShape_Operation>` :ref:`operation<class_CSGShape_property_operation>`
:ref:`float<class_float>` :ref:`snap<class_CSGShape_property_snap>`
:ref:`bool<class_bool>` :ref:`use_collision<class_CSGShape_property_use_collision>`

Methods

:ref:`bool<class_bool>` :ref:`get_collision_layer_bit<class_CSGShape_method_get_collision_layer_bit>` ( :ref:`int<class_int>` bit ) const
:ref:`bool<class_bool>` :ref:`get_collision_mask_bit<class_CSGShape_method_get_collision_mask_bit>` ( :ref:`int<class_int>` bit ) const
:ref:`Array<class_Array>` :ref:`get_meshes<class_CSGShape_method_get_meshes>` ( ) const
:ref:`bool<class_bool>` :ref:`is_root_shape<class_CSGShape_method_is_root_shape>` ( ) const
void :ref:`set_collision_layer_bit<class_CSGShape_method_set_collision_layer_bit>` ( :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value )
void :ref:`set_collision_mask_bit<class_CSGShape_method_set_collision_mask_bit>` ( :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value )

Enumerations

enum Operation:

  • OPERATION_UNION = 0 --- Geometry of both primitives is merged, intersecting geometry is removed.
  • OPERATION_INTERSECTION = 1 --- Only intersecting geometry remains, the rest is removed.
  • OPERATION_SUBTRACTION = 2 --- The second shape is susbtracted from the first, leaving a dent with it's shape.

Description

This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.

Property Descriptions

Setter set_calculate_tangents(value)
Getter is_calculating_tangents()

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.

Setter set_collision_layer(value)
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.

Setter set_collision_mask(value)
Getter get_collision_mask()

The physics layers this CSG shape scans for collisions.

Setter set_operation(value)
Getter get_operation()

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.

Setter set_snap(value)
Getter get_snap()
Setter set_use_collision(value)
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.

Method Descriptions

Returns an individual bit on the collision mask.

Returns an individual bit on the collision mask.

Returns true if this is a root shape and is thus the object that is rendered.

Sets individual bits on the layer mask. Use this if you only need to change one layer's value.

Sets individual bits on the collision mask. Use this if you only need to change one layer's value.

You can’t perform that action at this time.