Documentation
¶
Overview ¶
Package CSGShape3D provides methods for working with CSGShape3D object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsCSGShape3D() Instance
- func (self *Extension[T]) AsGeometryInstance3D() GeometryInstance3D.Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsNode3D() Node3D.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance
- type ID
- type Instance
- func (self Instance) AsCSGShape3D() Instance
- func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
- func (self Instance) BakeCollisionShape() ConcavePolygonShape3D.Instance
- func (self Instance) BakeStaticMesh() ArrayMesh.Instance
- func (self Instance) CalculateTangents() bool
- func (self Instance) CollisionLayer() int
- func (self Instance) CollisionMask() int
- func (self Instance) CollisionPriority() Float.X
- func (self Instance) GetCollisionLayerValue(layer_number int) bool
- func (self Instance) GetCollisionMaskValue(layer_number int) bool
- func (self Instance) GetMeshes() []any
- func (self Instance) ID() ID
- func (self Instance) IsRootShape() bool
- func (self Instance) Operation() Operation
- func (self Instance) SetCalculateTangents(value bool)
- func (self Instance) SetCollisionLayer(value int)
- func (self Instance) SetCollisionLayerValue(layer_number int, value bool)
- func (self Instance) SetCollisionMask(value int)
- func (self Instance) SetCollisionMaskValue(layer_number int, value bool)
- func (self Instance) SetCollisionPriority(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOperation(value Operation)
- func (self Instance) SetSnap(value Float.X)
- func (self Instance) SetUseCollision(value bool)
- func (self Instance) Snap() Float.X
- func (self Instance) UseCollision() bool
- func (self Instance) Virtual(name string) reflect.Value
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCSGShape3D ¶
func (*Extension[T]) AsGeometryInstance3D ¶
func (self *Extension[T]) AsGeometryInstance3D() GeometryInstance3D.Instance
func (*Extension[T]) AsVisualInstance3D ¶
func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.CSGShape3D
This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. [b]Performance:[/b] CSG nodes are only intended for prototyping as they have a significant CPU performance cost. Consider baking final CSG operation results into static geometry that replaces the CSG nodes. Individual CSG root node results can be baked to nodes with static resources with the editor menu that appears when a CSG root node is selected. Individual CSG root nodes can also be baked to static resources with scripts by calling [method bake_static_mesh] for the visual mesh or [method bake_collision_shape] for the physics collision. Entire scenes of CSG nodes can be baked to static geometry and exported with the editor gltf scene exporter.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCSGShape3D ¶
func (Instance) AsGeometryInstance3D ¶
func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance
func (Instance) AsVisualInstance3D ¶
func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
func (Instance) BakeCollisionShape ¶
func (self Instance) BakeCollisionShape() ConcavePolygonShape3D.Instance
Returns a baked physics [ConcavePolygonShape3D] of this node's CSG operation result. Returns an empty shape if the node is not a CSG root node or has no valid geometry. [b]Performance:[/b] If the CSG operation results in a very detailed geometry with many faces physics performance will be very slow. Concave shapes should in general only be used for static level geometry and not with dynamic objects that are moving.
func (Instance) BakeStaticMesh ¶
Returns a baked static [ArrayMesh] of this node's CSG operation result. Materials from involved CSG nodes are added as extra mesh surfaces. Returns an empty mesh if the node is not a CSG root node or has no valid geometry.
func (Instance) CalculateTangents ¶
func (Instance) CollisionLayer ¶
func (Instance) CollisionMask ¶
func (Instance) CollisionPriority ¶
func (Instance) GetCollisionLayerValue ¶
Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.
func (Instance) GetCollisionMaskValue ¶
Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.
func (Instance) GetMeshes ¶
Returns an [Array] with two elements, the first is the [Transform3D] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape.
func (Instance) IsRootShape ¶
Returns [code]true[/code] if this is a root shape and is thus the object that is rendered.
func (Instance) SetCalculateTangents ¶
func (Instance) SetCollisionLayer ¶
func (Instance) SetCollisionLayerValue ¶
Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
func (Instance) SetCollisionMask ¶
func (Instance) SetCollisionMaskValue ¶
Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
func (Instance) SetCollisionPriority ¶
func (Instance) SetOperation ¶
func (Instance) SetUseCollision ¶
func (Instance) UseCollision ¶
type Operation ¶
type Operation int //gd:CSGShape3D.Operation
const ( /*Geometry of both primitives is merged, intersecting geometry is removed.*/ OperationUnion Operation = 0 /*Only intersecting geometry remains, the rest is removed.*/ OperationIntersection Operation = 1 /*The second shape is subtracted from the first, leaving a dent with its shape.*/ OperationSubtraction Operation = 2 )