@pixi/3d
    Preparing search index...

    Class ConeShape

    Spawns on a disc in the XZ plane and heads up within angle degrees of +Y

    The workhorse for fire, smoke plumes, exhaust and sprays.

    const plume = new ParticleSystem3D({ shape: new ConeShape({ angle: 12, radius: 0.3 }), speed: 2 });
    

    Implements

    Index
    angle: number = 0

    Half-angle of the spray, in degrees

    nozzle.angle = 40;
    
    radius: number = 0

    Radius of the spawn disc

    nozzle.radius = 0.1;
    
    defaultOptions: ConeShapeOptions = ...

    Defaults for every new ConeShape; an option passed as undefined keeps its default

    ConeShape.defaultOptions.angle = 15;
    
    • Advanced

      Draws a point on the spawn disc, heading up within the cone; both spread evenly

      Parameters

      • rng: () => number

        The system's random source

      • outPos: Vector3

        Receives the spawn offset, relative to the emitter

      • outDir: Vector3

        Receives a unit direction

      Returns void

      class MyTwinJetShape implements EmitterShape {
      private readonly _cone = new ConeShape({ angle: 10 });

      public sample(rng: () => number, outPos: Vector3, outDir: Vector3): void {
      this._cone.sample(rng, outPos, outDir);
      if (rng() < 0.5) outDir.y = -outDir.y;
      }
      }