Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
DrawOrder
GPUParticles3D.swift:27enum DrawOrder
Cases
case index
Particles are drawn in the order emitted.
case lifetime
Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front.
case reverseLifetime
Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front.
case viewDepth
Particles are drawn in order of depth.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (37) members.
Types
Type members
static let maxDrawPasses: Int
Maximum number of draw passes supported.
class var godotClassName: StringName
Instance members
var amount: Int32
The number of particles to emit in one emission cycle. The effective emission rate is
(amount * amount_ratio) / lifetime
particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or ifamountRatio
is decreased.var amountRatio: Double
The ratio of particles that should actually be emitted. If set to a value lower than
1.0
, this will set the amount of emitted particles throughout the lifetime toamount * amount_ratio
. Unlike changingamount
, changingamountRatio
while emitting does not affect already-emitted particles and doesn’t cause the particle system to restart.amountRatio
can be used to create effects that make the number of emitted particles vary over time.var collisionBaseSize: Double
The base diameter for particle collision in meters. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if
collisionMode
isParticleProcessMaterial/CollisionMode/collisionRigid
orParticleProcessMaterial/CollisionMode/collisionHideOnContact
.var drawOrder: GPUParticles3D.DrawOrder
Particle draw order. Uses
DrawOrder
values.var drawPass1: Mesh?
Mesh
that is drawn for the first draw pass.var drawPass2: Mesh?
Mesh
that is drawn for the second draw pass.var drawPass3: Mesh?
Mesh
that is drawn for the third draw pass.var drawPass4: Mesh?
Mesh
that is drawn for the fourth draw pass.var drawPasses: Int32
The number of draw passes when rendering particles.
var drawSkin: Skin?
var emitting: Bool
If
true
, particles are being emitted.emitting
can be used to start and stop particles from emitting. However, ifoneShot
istrue
settingemitting
totrue
will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing.var explosiveness: Double
Time ratio between each emission. If
0
, particles are emitted continuously. If1
, all particles are emitted simultaneously.var finished: SimpleSignal
Emitted when all active particles have finished processing. To immediately emit new particles, call
restart
.var fixedFps: Int32
The particle system’s frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself.
var fractDelta: Bool
If
true
, results in fractional delta calculation which has a smoother particles display effect.var interpToEnd: Double
Causes all the particles in this node to interpolate towards the end of their lifetime.
var interpolate: Bool
Enables particle interpolation, which makes the particle movement smoother when their
fixedFps
is lower than the screen refresh rate.var lifetime: Double
The amount of time each particle will exist (in seconds). The effective emission rate is
(amount * amount_ratio) / lifetime
particles per second.var localCoords: Bool
If
true
, particles use the parent node’s coordinate space (known as local coordinates). This will cause particles to move and rotate along theGPUParticles3D
node (and its parents) when it is moved or rotated. Iffalse
, particles use global coordinates; they will not move or rotate along theGPUParticles3D
node (and its parents) when it is moved or rotated.var oneShot: Bool
If
true
, only the number of particles equal toamount
will be emitted.var preprocess: Double
Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting.
var processMaterial: Material?
Material
for processing particles. Can be aParticleProcessMaterial
or aShaderMaterial
.var randomness: Double
Emission randomness ratio.
var speedScale: Double
Speed scaling ratio. A value of
0
can be used to pause the particles.var subEmitter: NodePath
Path to another
GPUParticles3D
node that will be used as a subemitter (seesubEmitterMode
). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more.var trailEnabled: Bool
If
true
, enables particle trails using a mesh skinning system. Designed to work withRibbonTrailMesh
andTubeTrailMesh
.var trailLifetime: Double
The amount of time the particle’s trail should represent (in seconds). Only effective if
trailEnabled
istrue
.var transformAlign: GPUParticles3D.TransformAlign
var visibilityAabb: AABB
The
AABB
that determines the node’s region which needs to be visible on screen for the particle system to be active.extraCullMargin
is added on each of the AABB’s axes. Particle collisions and attraction will only occur within this area.func captureAabb(
) -> AABB Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.
func convertFromParticles(Node?
) Sets this node’s properties to match a given
CPUParticles3D
node.func emitParticle(xform: Transform3D, velocity: Vector3, color: Color, custom: Color, flags: UInt32
) Emits a single particle. Whether
xform
,velocity
,color
andcustom
are applied depends on the value offlags
. SeeEmitFlags
.func restart(
) Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.