@newkrok/three-particles - v2.16.1
    Preparing search index...

    Type Alias ForceFieldConfig

    Configuration for a force field that affects particle velocities. Force fields can attract, repel, or push particles in a direction.

    // Point attractor at origin
    const attractor: ForceFieldConfig = {
    type: ForceFieldType.POINT,
    position: new THREE.Vector3(0, 0, 0),
    strength: 5.0,
    range: 10,
    falloff: ForceFieldFalloff.QUADRATIC,
    };

    // Repulsion shield
    const shield: ForceFieldConfig = {
    type: ForceFieldType.POINT,
    position: new THREE.Vector3(0, 0, 0),
    strength: -3.0,
    range: 5,
    falloff: ForceFieldFalloff.LINEAR,
    };

    // Wind effect
    const wind: ForceFieldConfig = {
    type: ForceFieldType.DIRECTIONAL,
    direction: new THREE.Vector3(1, 0, 0),
    strength: 2.0,
    };
    type ForceFieldConfig = {
        direction?: THREE.Vector3;
        falloff?: ForceFieldFalloff;
        isActive?: boolean;
        position?: THREE.Vector3;
        range?: number;
        strength?: Constant | RandomBetweenTwoConstants | LifetimeCurve;
        type?: ForceFieldType;
    }
    Index

    Properties

    direction?: THREE.Vector3

    Direction vector for DIRECTIONAL type force fields.

    (0,1,0)
    
    falloff?: ForceFieldFalloff

    How force diminishes with distance for POINT type.

    ForceFieldFalloff.LINEAR
    
    isActive?: boolean

    Whether this force field is active.

    true
    
    position?: THREE.Vector3

    Position in 3D space for POINT type force fields.

    (0,0,0)
    
    range?: number

    Maximum effective range for POINT type. Particles beyond this distance are unaffected.

    Infinity
    

    Force strength. Positive = attract (POINT) or push along direction (DIRECTIONAL). Negative = repel (POINT) or push against direction (DIRECTIONAL). Supports constant, random range, or lifetime curve (evaluated against system lifetime).

    1
    
    type?: ForceFieldType

    Type of the force field.

    ForceFieldType.POINT