@pixi/3d
    Preparing search index...

    Class SphereShape

    Spawns inside (or on) a sphere and heads radially outward

    Good for explosions, sparks and ambient motes.

    const explosion = new ParticleSystem3D({ shape: new SphereShape({ radius: 0.2 }), speed: [4, 8] });
    

    Implements

    Index
    radius: number = 0

    Sphere radius

    shockwave.radius += growth * dt;
    
    shell: boolean

    Whether spawns land on the surface instead of through the volume

    aura.shell = true;
    
    defaultOptions: SphereShapeOptions = ...

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

    SphereShape.defaultOptions.radius = 0.5;
    
    • Advanced

      Draws a point spread evenly in or on the sphere, heading radially outward

      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 MyDomeShape implements EmitterShape {
      private readonly _sphere = new SphereShape({ radius: 3, shell: true });

      public sample(rng: () => number, outPos: Vector3, outDir: Vector3): void {
      this._sphere.sample(rng, outPos, outDir);
      outPos.y = Math.abs(outPos.y);
      outDir.y = Math.abs(outDir.y);
      }
      }