babylon.quarks - v1.0.0
    Preparing search index...

    Class QuarksUtil

    Helpers that act on a whole effect: every particle system under a root node, as a loaded effect or a hand-built tree has them.

    Index
    • Seconds until the effect under root is over when it plays from the start: for each system its start delay, its duration and its longest particle life, divided by its playback speed; a sub emitter target goes on emitting for its own duration after the last of its parents' particles and ends a particle life after that, wherever it sits in the scene. Infinity when a system loops, since such an effect only ends on endEmit, or when one is frozen at playback speed 0.

      Random values count at their maximum, so this is an upper bound; curves are sampled. A runtime ParticleSystem.timeDilation is not counted: this is the effect's own length. Particles cut short by collisions or culling only make the real effect shorter.

      Parameters

      • root: Node

      Returns number

    • A deep copy of an effect: the node tree under root with every particle system cloned, sub emitter links pointing at the copies, and the same transforms and enabled state. Meshes are cloned as meshes that share the source's geometry and material, instances of a mesh in the tree as instances of its copy, and a mesh surface shape that emits from a mesh in the tree emits from its copy. An instance of a mesh outside the tree stays an instance of that mesh, and goes when it is disposed. The copy holds the source's textures and materials, so disposing the source leaves the copy whole. It is not added to any renderer. Nodes that are neither transform nodes nor emitters, such as lights and cameras, are skipped.

      Parameters

      • root: TransformNode
      • Optionalname: string

      Returns TransformNode

    • True when every system under root is finished: non-looping ones that ran their course, looping ones whose emission was ended (see endEmit) and whose particles are gone. A looping system still emitting keeps the effect unfinished.

      Parameters

      • root: Node

      Returns boolean

    • Gives target a hold on the textures and materials of the loaded effect source belongs to (the nearest loaded root at or above source), so they stay while target does. For a node kept after its effect's root goes: taken out of the effect, or made the root in place of a wrapper that is then disposed. Each hold is let go when its node is disposed; a node outside any loaded effect gives nothing.

      Parameters

      • source: TransformNode
      • target: TransformNode

      Returns void