GPUParticles3D

    A 3D particle emitter.

    GPUParticles3D.swift:19
    class GPUParticles3D

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

    Use processMaterial to add a ParticleProcessMaterial to configure particle appearance and behavior. Alternatively, you can add a ShaderMaterial which will be applied to all particles.

    This object emits the following signals:

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • 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 Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Types

    Type members

    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 if amountRatio 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 to amount * amount_ratio. Unlike changing amount, changing amountRatio 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 is ParticleProcessMaterial/CollisionMode/collisionRigid or ParticleProcessMaterial/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, if oneShot is true setting emitting to true will not restart the emission cycle until after all active particles finish processing. You can 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. If 1, all particles are emitted simultaneously.

    • var finished: SimpleSignal

      Emitted when all active particles have finished processing. When oneShot is disabled, particles will process continuously, so this is never emitted.

    • 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 the GPUParticles3D node (and its parents) when it is moved or rotated. If false, particles use global coordinates; they will not move or rotate along the GPUParticles3D node (and its parents) when it is moved or rotated.

    • var oneShot: Bool

      If true, only the number of particles equal to amount 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 a ParticleProcessMaterial or a ShaderMaterial.

    • 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 (see subEmitterMode). 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 with RibbonTrailMesh and TubeTrailMesh.

    • var trailLifetime: Double

      The amount of time the particle’s trail should represent (in seconds). Only effective if trailEnabled is true.

    • 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 and custom are applied depends on the value of flags. See EmitFlags.

    • func restart()

      Restarts the particle emission, clearing existing particles.