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
- type Advanced
- type Any
- type DrawOrder
- type EmitFlags
- type Expanded
- type Extension
- func (self *Extension[T]) AsGPUParticles3D() 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) Amount() int
- func (self Instance) AmountRatio() Float.X
- func (self Instance) AsGPUParticles3D() 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) CaptureAabb() AABB.PositionSize
- func (self Instance) CollisionBaseSize() Float.X
- func (self Instance) ConvertFromParticles(particles Node.Instance)
- func (self Instance) DrawOrder() DrawOrder
- func (self Instance) DrawPass1() Mesh.Instance
- func (self Instance) DrawPass2() Mesh.Instance
- func (self Instance) DrawPass3() Mesh.Instance
- func (self Instance) DrawPass4() Mesh.Instance
- func (self Instance) DrawPasses() int
- func (self Instance) DrawSkin() Skin.Instance
- func (self Instance) EmitParticle(xform Transform3D.BasisOrigin, velocity Vector3.XYZ, color Color.RGBA, ...)
- func (self Instance) Emitting() bool
- func (self Instance) Explosiveness() Float.X
- func (self Instance) FixedFps() int
- func (self Instance) FractDelta() bool
- func (self Instance) ID() ID
- func (self Instance) InterpToEnd() Float.X
- func (self Instance) Interpolate() bool
- func (self Instance) Lifetime() Float.X
- func (self Instance) LocalCoords() bool
- func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)
- func (self Instance) OneShot() bool
- func (self Instance) Preprocess() Float.X
- func (self Instance) ProcessMaterial() Material.Instance
- func (self Instance) Randomness() Float.X
- func (self Instance) RequestParticlesProcess(process_time Float.X)
- func (self Instance) Restart()
- func (self Instance) Seed() int
- func (self Instance) SetAmount(value int)
- func (self Instance) SetAmountRatio(value Float.X)
- func (self Instance) SetCollisionBaseSize(value Float.X)
- func (self Instance) SetDrawOrder(value DrawOrder)
- func (self Instance) SetDrawPass1(value Mesh.Instance)
- func (self Instance) SetDrawPass2(value Mesh.Instance)
- func (self Instance) SetDrawPass3(value Mesh.Instance)
- func (self Instance) SetDrawPass4(value Mesh.Instance)
- func (self Instance) SetDrawPasses(value int)
- func (self Instance) SetDrawSkin(value Skin.Instance)
- func (self Instance) SetEmitting(value bool)
- func (self Instance) SetExplosiveness(value Float.X)
- func (self Instance) SetFixedFps(value int)
- func (self Instance) SetFractDelta(value bool)
- func (self Instance) SetInterpToEnd(value Float.X)
- func (self Instance) SetInterpolate(value bool)
- func (self Instance) SetLifetime(value Float.X)
- func (self Instance) SetLocalCoords(value bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOneShot(value bool)
- func (self Instance) SetPreprocess(value Float.X)
- func (self Instance) SetProcessMaterial(value Material.Instance)
- func (self Instance) SetRandomness(value Float.X)
- func (self Instance) SetSeed(value int)
- func (self Instance) SetSpeedScale(value Float.X)
- func (self Instance) SetSubEmitter(value string)
- func (self Instance) SetTrailEnabled(value bool)
- func (self Instance) SetTrailLifetime(value Float.X)
- func (self Instance) SetTransformAlign(value TransformAlign)
- func (self Instance) SetUseFixedSeed(value bool)
- func (self Instance) SetVisibilityAabb(value AABB.PositionSize)
- func (self Instance) SpeedScale() Float.X
- func (self Instance) SubEmitter() string
- func (self Instance) TrailEnabled() bool
- func (self Instance) TrailLifetime() Float.X
- func (self Instance) TransformAlign() TransformAlign
- func (self Instance) UseFixedSeed() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VisibilityAabb() AABB.PositionSize
- type TransformAlign
Constants ¶
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 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 ¶
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 ¶
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 (*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.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 (Instance) AmountRatio ¶
func (Instance) AsGPUParticles3D ¶
func (Instance) AsGeometryInstance3D ¶
func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance
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 (Instance) ConvertFromParticles ¶
Sets this node's properties to match a given graphics.gd/classdb/CPUParticles3D node.
func (Instance) DrawPasses ¶
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) Explosiveness ¶
func (Instance) FractDelta ¶
func (Instance) InterpToEnd ¶
func (Instance) Interpolate ¶
func (Instance) LocalCoords ¶
func (Instance) OnFinished ¶
func (Instance) Preprocess ¶
func (Instance) ProcessMaterial ¶
func (Instance) Randomness ¶
func (Instance) RequestParticlesProcess ¶
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) SetAmountRatio ¶
func (Instance) SetCollisionBaseSize ¶
func (Instance) SetDrawOrder ¶
func (Instance) SetDrawPass1 ¶
func (Instance) SetDrawPass2 ¶
func (Instance) SetDrawPass3 ¶
func (Instance) SetDrawPass4 ¶
func (Instance) SetDrawPasses ¶
func (Instance) SetDrawSkin ¶
func (Instance) SetEmitting ¶
func (Instance) SetExplosiveness ¶
func (Instance) SetFixedFps ¶
func (Instance) SetFractDelta ¶
func (Instance) SetInterpToEnd ¶
func (Instance) SetInterpolate ¶
func (Instance) SetLifetime ¶
func (Instance) SetLocalCoords ¶
func (Instance) SetOneShot ¶
func (Instance) SetPreprocess ¶
func (Instance) SetProcessMaterial ¶
func (Instance) SetRandomness ¶
func (Instance) SetSpeedScale ¶
func (Instance) SetSubEmitter ¶
func (Instance) SetTrailEnabled ¶
func (Instance) SetTrailLifetime ¶
func (Instance) SetTransformAlign ¶
func (self Instance) SetTransformAlign(value TransformAlign)
func (Instance) SetUseFixedSeed ¶
func (Instance) SetVisibilityAabb ¶
func (self Instance) SetVisibilityAabb(value AABB.PositionSize)
func (Instance) SpeedScale ¶
func (Instance) SubEmitter ¶
func (Instance) TrailEnabled ¶
func (Instance) TrailLifetime ¶
func (Instance) TransformAlign ¶
func (self Instance) TransformAlign() TransformAlign
func (Instance) UseFixedSeed ¶
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 )