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

    Interface TrailSettings

    Settings of a trail system: how each particle records and draws its ribbon.

    interface TrailSettings {
        colorFromParticle?: boolean;
        curveTension?: number;
        dieWithParticle?: boolean;
        followLocalOrigin: boolean;
        lifetime?: number;
        minVertexDistance?: number;
        recordWorldSpace?: boolean;
        sideAxis?: Vector3Like;
        startLength: ValueGenerator | FunctionValueGenerator;
        tessellation?: number;
        textureMode?: TrailTextureMode;
        textureScale?: number;
        uvFromHead?: boolean;
    }
    Index
    colorFromParticle?: boolean

    Draw the whole trail in the particle's current color, as Unity's trails do, instead of the color each sample had when it was recorded.

    curveTension?: number

    How tightly a tessellated trail's curve is drawn between its samples (Niagara's curve tension): 0 (the default) a Catmull-Rom spline, rising toward 1 for straight segments.

    dieWithParticle?: boolean

    Drop the trail the moment its particle dies, instead of letting it shrink away one sample per step.

    followLocalOrigin: boolean

    Keep each particle where it was emitted relative to the emitter, carried by the emitter's transform instead of its own velocity, so the trail draws the emitter's motion (a weapon tip) rather than the particle's travel. Defaults to false.

    lifetime?: number

    How long each recorded sample of the trail is kept, in seconds (Unity's Time): the ribbon reaches that far back in time, however many samples that is, up to startLength. Unset or 0, the default: samples are kept until the history is full, startLength samples. The WidthOverLength curve spans the samples kept.

    minVertexDistance?: number

    A new sample is only recorded once the particle has moved this far from the last one, in the space the trail is recorded in; until then the last sample follows the particle (Unity's Min Vertex Distance). Keeps a slow or standing particle from filling its history with points on one spot, so the trail keeps its length in distance rather than in steps. 0, the default: a sample every simulation step.

    recordWorldSpace?: boolean

    Record trail points in world space even though the system simulates in local space, so the trail streaks behind a moving emitter instead of moving rigidly with it (Unity's Trails > World Space).

    sideAxis?: Vector3Like

    Sweep the ribbon along this axis of the emitter instead of turning it to face the camera: every sample records the axis as the emitter held it, and the ribbon spans the particle's width along it, centred on the particle. With the emitter on a blade, the axis along the blade and the width the blade's length, the trail is the surface the blade swept, as a weapon trail (Unreal's AnimTrail) is. The emitter's scale applies to the width, and so does the axis's length: give a unit vector for the width as set. Unset (the default): a camera-facing ribbon.

    How many samples the trail keeps, rolled per particle at emission. The particle records one sample per simulation step, so in babylon.quarks, which steps at 60 Hz, 30 samples is half a second of travel. Defaults to 30 in babylon.quarks.

    tessellation?: number

    Draw each segment between two recorded samples as this many more segments, along a curve through the samples (Niagara's ribbon tessellation), so a fast or sharply turning trail stays round instead of showing the corners between frames. A whole number from 0 (the default: straight segments) to 16. The curve passes through every sample: it smooths the trail without moving it.

    textureMode?: TrailTextureMode

    How the texture's U runs along the ribbon (Unity's Texture Mode):

    • 'stretch' (the default): once along the ribbon, by distance, so a fast stretch of the trail shows more of the texture than a slow one.
    • 'distributePerSegment': once along the ribbon, each recorded segment an equal share whatever its length (Niagara's Scaled Uniformly).
    • 'tile': repeated every world unit along the ribbon, scaled by textureScale (Niagara's Tiling Distance). A sample keeps its U for as long as it lives, so the texture stays put on the trail as the trail grows. The unit is the space the trail is recorded in, scaled by the emitter for a local-space trail (as the width is).
    • 'repeatPerSegment': once per recorded segment.

    uvFromHead runs any of them from the particle back. The sprite sheet's cell is the texture's U range, so the repeating modes want a sheet of 1×1 (the default); on a larger sheet they run into the next cell.

    textureScale?: number

    Repeats of the texture along the ribbon (Unity's Texture Scale, Niagara's UV Scale): per world unit in 'tile', per recorded segment in 'repeatPerSegment' and over the whole ribbon in the other modes. Finite and above 0; the default is 1. For repeats across the ribbon use the texture's own UV layout (mapUV.tiling).

    uvFromHead?: boolean

    Run the texture's U from the particle (0) back to the tail (1), the way Unity's stretched trails map it. Off, U runs from the tail to the particle.