CSGShape3D

package
v0.0.0-...-a66c66c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package CSGShape3D provides methods for working with CSGShape3D object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsCSGShape3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsCSGShape3D() Instance

func (*Extension[T]) AsGeometryInstance3D

func (self *Extension[T]) AsGeometryInstance3D() GeometryInstance3D.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AsCSGShape3D

func (self Instance) AsCSGShape3D() Instance

func (Instance) AsGeometryInstance3D

func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

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

func (self Instance) BakeStaticMesh() ArrayMesh.Instance

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 (self Instance) CalculateTangents() bool

func (Instance) CollisionLayer

func (self Instance) CollisionLayer() int

func (Instance) CollisionMask

func (self Instance) CollisionMask() int

func (Instance) CollisionPriority

func (self Instance) CollisionPriority() Float.X

func (Instance) GetCollisionLayerValue

func (self Instance) GetCollisionLayerValue(layer_number int) bool

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

func (self Instance) GetCollisionMaskValue(layer_number int) bool

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

func (self Instance) GetMeshes() []any

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) ID

func (self Instance) ID() ID

func (Instance) IsRootShape

func (self Instance) IsRootShape() bool

Returns [code]true[/code] if this is a root shape and is thus the object that is rendered.

func (Instance) Operation

func (self Instance) Operation() Operation

func (Instance) SetCalculateTangents

func (self Instance) SetCalculateTangents(value bool)

func (Instance) SetCollisionLayer

func (self Instance) SetCollisionLayer(value int)

func (Instance) SetCollisionLayerValue

func (self Instance) SetCollisionLayerValue(layer_number int, value bool)

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 (self Instance) SetCollisionMask(value int)

func (Instance) SetCollisionMaskValue

func (self Instance) SetCollisionMaskValue(layer_number int, value bool)

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 (self Instance) SetCollisionPriority(value Float.X)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOperation

func (self Instance) SetOperation(value Operation)

func (Instance) SetSnap

func (self Instance) SetSnap(value Float.X)

func (Instance) SetUseCollision

func (self Instance) SetUseCollision(value bool)

func (Instance) Snap

func (self Instance) Snap() Float.X

func (Instance) UseCollision

func (self Instance) UseCollision() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL