GPUParticles3D

package
v0.0.0-...-ff35923 Latest Latest
Warning

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

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

Documentation

Overview

3D particle node used to create a variety of particle systems and effects. graphics.gd/classdb/GPUParticles3D features an emitter that generates some number of particles at a given rate.

Use Instance.ProcessMaterial to add a graphics.gd/classdb/ParticleProcessMaterial to configure particle appearance and behavior. Alternatively, you can add a graphics.gd/classdb/ShaderMaterial which will be applied to all particles.

Index

Constants

View Source
const MaxDrawPasses int = 4 //gd:GPUParticles3D.MAX_DRAW_PASSES

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
	AsGPUParticles3D() Instance
}

type DrawOrder

type DrawOrder int //gd:GPUParticles3D.DrawOrder
const (
	// Particles are drawn in the order emitted.
	DrawOrderIndex DrawOrder = 0
	// Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front.
	DrawOrderLifetime DrawOrder = 1
	// Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front.
	DrawOrderReverseLifetime DrawOrder = 2
	// Particles are drawn in order of depth.
	DrawOrderViewDepth DrawOrder = 3
)

type EmitFlags

type EmitFlags int //gd:GPUParticles3D.EmitFlags
const (
	// Particle starts at the specified position.
	EmitFlagPosition EmitFlags = 1
	// Particle starts with specified rotation and scale.
	EmitFlagRotationScale EmitFlags = 2
	// Particle starts with the specified velocity vector, which defines the emission direction and speed.
	EmitFlagVelocity EmitFlags = 4
	// Particle starts with specified color.
	EmitFlagColor EmitFlags = 8
	// Particle starts with specified CUSTOM data.
	EmitFlagCustom EmitFlags = 16
)

type Expanded

type Expanded [1]gdclass.GPUParticles3D

func (Expanded) Restart

func (self Expanded) Restart(keep_seed bool)

Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the Instance.OnFinished signal before calling.

Note: The Instance.OnFinished signal is only emitted by Instance.OneShot emitters.

If 'keep_seed' is true, the current random seed will be preserved. Useful for seeking and playback.

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]) AsGPUParticles3D

func (self *Extension[T]) AsGPUParticles3D() 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.GPUParticles3D

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

func (self Instance) Amount() int

func (Instance) AmountRatio

func (self Instance) AmountRatio() Float.X

func (Instance) AsGPUParticles3D

func (self Instance) AsGPUParticles3D() 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) CaptureAabb

func (self Instance) CaptureAabb() AABB.PositionSize

Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.

func (Instance) CollisionBaseSize

func (self Instance) CollisionBaseSize() Float.X

func (Instance) ConvertFromParticles

func (self Instance) ConvertFromParticles(particles Node.Instance)

Sets this node's properties to match a given graphics.gd/classdb/CPUParticles3D node.

func (Instance) DrawOrder

func (self Instance) DrawOrder() DrawOrder

func (Instance) DrawPass1

func (self Instance) DrawPass1() Mesh.Instance

func (Instance) DrawPass2

func (self Instance) DrawPass2() Mesh.Instance

func (Instance) DrawPass3

func (self Instance) DrawPass3() Mesh.Instance

func (Instance) DrawPass4

func (self Instance) DrawPass4() Mesh.Instance

func (Instance) DrawPasses

func (self Instance) DrawPasses() int

func (Instance) DrawSkin

func (self Instance) DrawSkin() Skin.Instance

func (Instance) EmitParticle

func (self Instance) EmitParticle(xform Transform3D.BasisOrigin, velocity Vector3.XYZ, color Color.RGBA, custom Color.RGBA, flags int)

Emits a single particle. Whether 'xform', 'velocity', 'color' and 'custom' are applied depends on the value of 'flags'. See EmitFlags.

The default ParticleProcessMaterial will overwrite 'color' and use the contents of 'custom' as (rotation, age, animation, lifetime).

Note: Instance.EmitParticle is only supported on the Forward+ and Mobile rendering methods, not Compatibility.

func (Instance) Emitting

func (self Instance) Emitting() bool

func (Instance) Explosiveness

func (self Instance) Explosiveness() Float.X

func (Instance) FixedFps

func (self Instance) FixedFps() int

func (Instance) FractDelta

func (self Instance) FractDelta() bool

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InterpToEnd

func (self Instance) InterpToEnd() Float.X

func (Instance) Interpolate

func (self Instance) Interpolate() bool

func (Instance) Lifetime

func (self Instance) Lifetime() Float.X

func (Instance) LocalCoords

func (self Instance) LocalCoords() bool

func (Instance) OnFinished

func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)

func (Instance) OneShot

func (self Instance) OneShot() bool

func (Instance) Preprocess

func (self Instance) Preprocess() Float.X

func (Instance) ProcessMaterial

func (self Instance) ProcessMaterial() Material.Instance

func (Instance) Randomness

func (self Instance) Randomness() Float.X

func (Instance) RequestParticlesProcess

func (self Instance) RequestParticlesProcess(process_time Float.X)

Requests the particles to process for extra process time during a single frame.

Useful for particle playback, if used in combination with Instance.UseFixedSeed or by calling Instance.Restart with parameter keep_seed set to true.

func (Instance) Restart

func (self Instance) Restart()

Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the Instance.OnFinished signal before calling.

Note: The Instance.OnFinished signal is only emitted by Instance.OneShot emitters.

If 'keep_seed' is true, the current random seed will be preserved. Useful for seeking and playback.

func (Instance) Seed

func (self Instance) Seed() int

func (Instance) SetAmount

func (self Instance) SetAmount(value int)

func (Instance) SetAmountRatio

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

func (Instance) SetCollisionBaseSize

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

func (Instance) SetDrawOrder

func (self Instance) SetDrawOrder(value DrawOrder)

func (Instance) SetDrawPass1

func (self Instance) SetDrawPass1(value Mesh.Instance)

func (Instance) SetDrawPass2

func (self Instance) SetDrawPass2(value Mesh.Instance)

func (Instance) SetDrawPass3

func (self Instance) SetDrawPass3(value Mesh.Instance)

func (Instance) SetDrawPass4

func (self Instance) SetDrawPass4(value Mesh.Instance)

func (Instance) SetDrawPasses

func (self Instance) SetDrawPasses(value int)

func (Instance) SetDrawSkin

func (self Instance) SetDrawSkin(value Skin.Instance)

func (Instance) SetEmitting

func (self Instance) SetEmitting(value bool)

func (Instance) SetExplosiveness

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

func (Instance) SetFixedFps

func (self Instance) SetFixedFps(value int)

func (Instance) SetFractDelta

func (self Instance) SetFractDelta(value bool)

func (Instance) SetInterpToEnd

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

func (Instance) SetInterpolate

func (self Instance) SetInterpolate(value bool)

func (Instance) SetLifetime

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

func (Instance) SetLocalCoords

func (self Instance) SetLocalCoords(value bool)

func (*Instance) SetObject

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

func (Instance) SetOneShot

func (self Instance) SetOneShot(value bool)

func (Instance) SetPreprocess

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

func (Instance) SetProcessMaterial

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

func (Instance) SetRandomness

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

func (Instance) SetSeed

func (self Instance) SetSeed(value int)

func (Instance) SetSpeedScale

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

func (Instance) SetSubEmitter

func (self Instance) SetSubEmitter(value string)

func (Instance) SetTrailEnabled

func (self Instance) SetTrailEnabled(value bool)

func (Instance) SetTrailLifetime

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

func (Instance) SetTransformAlign

func (self Instance) SetTransformAlign(value TransformAlign)

func (Instance) SetUseFixedSeed

func (self Instance) SetUseFixedSeed(value bool)

func (Instance) SetVisibilityAabb

func (self Instance) SetVisibilityAabb(value AABB.PositionSize)

func (Instance) SpeedScale

func (self Instance) SpeedScale() Float.X

func (Instance) SubEmitter

func (self Instance) SubEmitter() string

func (Instance) TrailEnabled

func (self Instance) TrailEnabled() bool

func (Instance) TrailLifetime

func (self Instance) TrailLifetime() Float.X

func (Instance) TransformAlign

func (self Instance) TransformAlign() TransformAlign

func (Instance) UseFixedSeed

func (self Instance) UseFixedSeed() bool

func (Instance) Virtual

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

func (Instance) VisibilityAabb

func (self Instance) VisibilityAabb() AABB.PositionSize

type TransformAlign

type TransformAlign int //gd:GPUParticles3D.TransformAlign
const (
	TransformAlignDisabled              TransformAlign = 0
	TransformAlignZBillboard            TransformAlign = 1
	TransformAlignYToVelocity           TransformAlign = 2
	TransformAlignZBillboardYToVelocity TransformAlign = 3
)

Jump to

Keyboard shortcuts

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