CSGPolygon3D

package
v0.0.0-...-535787f Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also graphics.gd/classdb/CSGMesh3D for using 3D meshes as CSG nodes.

Note: CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a graphics.gd/classdb/MeshInstance3D with a graphics.gd/classdb/PrimitiveMesh. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.

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
	AsCSGPolygon3D() 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]) AsCSGPolygon3D

func (self *Extension[T]) AsCSGPolygon3D() Instance

func (*Extension[T]) AsCSGPrimitive3D

func (self *Extension[T]) AsCSGPrimitive3D() CSGPrimitive3D.Instance

func (*Extension[T]) AsCSGShape3D

func (self *Extension[T]) AsCSGShape3D() CSGShape3D.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.CSGPolygon3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsCSGPolygon3D

func (self Instance) AsCSGPolygon3D() Instance

func (Instance) AsCSGPrimitive3D

func (self Instance) AsCSGPrimitive3D() CSGPrimitive3D.Instance

func (Instance) AsCSGShape3D

func (self Instance) AsCSGShape3D() CSGShape3D.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) Depth

func (self Instance) Depth() Float.X

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Material

func (self Instance) Material() Material.Instance

func (Instance) Mode

func (self Instance) Mode() Mode

func (Instance) PathContinuousU

func (self Instance) PathContinuousU() bool

func (Instance) PathInterval

func (self Instance) PathInterval() Float.X

func (Instance) PathIntervalType

func (self Instance) PathIntervalType() PathIntervalType

func (Instance) PathJoined

func (self Instance) PathJoined() bool

func (Instance) PathLocal

func (self Instance) PathLocal() bool

func (Instance) PathNode

func (self Instance) PathNode() string

func (Instance) PathRotation

func (self Instance) PathRotation() PathRotation

func (Instance) PathRotationAccurate

func (self Instance) PathRotationAccurate() bool

func (Instance) PathSimplifyAngle

func (self Instance) PathSimplifyAngle() Angle.Radians

func (Instance) PathUDistance

func (self Instance) PathUDistance() Float.X

func (Instance) Polygon

func (self Instance) Polygon() []Vector2.XY

func (Instance) SetDepth

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

func (Instance) SetMaterial

func (self Instance) SetMaterial(value Material.Instance)

func (Instance) SetMode

func (self Instance) SetMode(value Mode)

func (*Instance) SetObject

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

func (Instance) SetPathContinuousU

func (self Instance) SetPathContinuousU(value bool)

func (Instance) SetPathInterval

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

func (Instance) SetPathIntervalType

func (self Instance) SetPathIntervalType(value PathIntervalType)

func (Instance) SetPathJoined

func (self Instance) SetPathJoined(value bool)

func (Instance) SetPathLocal

func (self Instance) SetPathLocal(value bool)

func (Instance) SetPathNode

func (self Instance) SetPathNode(value string)

func (Instance) SetPathRotation

func (self Instance) SetPathRotation(value PathRotation)

func (Instance) SetPathRotationAccurate

func (self Instance) SetPathRotationAccurate(value bool)

func (Instance) SetPathSimplifyAngle

func (self Instance) SetPathSimplifyAngle(value Angle.Radians)

func (Instance) SetPathUDistance

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

func (Instance) SetPolygon

func (self Instance) SetPolygon(value []Vector2.XY)

func (Instance) SetSmoothFaces

func (self Instance) SetSmoothFaces(value bool)

func (Instance) SetSpinDegrees

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

func (Instance) SetSpinSides

func (self Instance) SetSpinSides(value int)

func (Instance) SmoothFaces

func (self Instance) SmoothFaces() bool

func (Instance) SpinDegrees

func (self Instance) SpinDegrees() Float.X

func (Instance) SpinSides

func (self Instance) SpinSides() int

func (Instance) Virtual

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

type Mode

type Mode int //gd:CSGPolygon3D.Mode
const (
	// The [Instance.Polygon] shape is extruded along the negative Z axis.
	ModeDepth Mode = 0
	// The [Instance.Polygon] shape is extruded by rotating it around the Y axis.
	ModeSpin Mode = 1
	// The [Instance.Polygon] shape is extruded along the [graphics.gd/classdb/Path3D] specified in [Instance.PathNode].
	ModePath Mode = 2
)

type PathIntervalType

type PathIntervalType int //gd:CSGPolygon3D.PathIntervalType
const (
	// When [Instance.Mode] is set to [ModePath], [Instance.PathInterval] will determine the distance, in meters, each interval of the path will extrude.
	PathIntervalDistance PathIntervalType = 0
	// When [Instance.Mode] is set to [ModePath], [Instance.PathInterval] will subdivide the polygons along the path.
	PathIntervalSubdivide PathIntervalType = 1
)

type PathRotation

type PathRotation int //gd:CSGPolygon3D.PathRotation
const (
	// The [Instance.Polygon] shape is not rotated.
	//
	// Note: Requires the path Z coordinates to continually decrease to ensure viable shapes.
	PathRotationPolygon PathRotation = 0
	// The [Instance.Polygon] shape is rotated along the path, but it is not rotated around the path axis.
	//
	// Note: Requires the path Z coordinates to continually decrease to ensure viable shapes.
	PathRotationPath PathRotation = 1
	// The [Instance.Polygon] shape follows the path and its rotations around the path axis.
	PathRotationPathFollow PathRotation = 2
)

Jump to

Keyboard shortcuts

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