Home Reference Source
import {ShockWaveEffect} from 'postprocessing'
public class | source

ShockWaveEffect

Extends:

three~EventDispatcherEffect → ShockWaveEffect

Indirect Implements:

A shock wave effect.

Based on a Gist by Jean-Philippe Sarda: https://gist.github.com/jpsarda/33cea67a9f2ecb0a0eda

Constructor Summary

Public Constructor
public

constructor(camera: Camera, position: Vector3, options: Object)

Constructs a new shock wave effect.

Member Summary

Public Members
public get

The amplitude.

public set
public get

epicenter: Vector3

this get was deprecated. Use position instead.

The position of the shock wave.

public set
public set
public get

The maximum radius.

public set
public

position: Vector3

The position of the shock wave.

public

The speed of the shock wave animation.

public get

The wave size.

public set

Method Summary

Public Methods
public

Emits the shock wave.

public

getPosition(): Vector3

this method was deprecated. Use position instead.

Returns the position of the shock wave.

public
this method was deprecated. Use speed instead.

Returns the speed of the shock wave.

public

setPosition(value: Vector3)

this method was deprecated. Use position instead.

Sets the position of the shock wave.

public

setSpeed(value: Number)

this method was deprecated. Use speed instead.

Sets the speed of the shock wave.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number)

Updates this effect.

Inherited Summary

From class Effect
public get

inputColorSpace: ColorSpace

this get is experimental.

The input color space.

public set

mainCamera: Camera

Sets the main camera.

public set

mainScene: Scene

Sets the main scene.

public get

outputColorSpace: ColorSpace

this get is experimental.

The output color space.

protected set

inputColorSpace: ColorSpace

this set is experimental.
protected set

outputColorSpace: ColorSpace

this set is experimental.
public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

WebGL extensions that are required by this effect.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

public

Performs a shallow search for properties that define a dispose method and deletes them.

public

Returns the effect attributes.

public
this method was deprecated. Use blendMode instead.

Returns the blend mode.

public
this method was deprecated. Use defines instead.

Returns the preprocessor macro definitions.

public
this method was deprecated. Use extensions instead.

Returns the WebGL extensions that are required by this effect.

public

Returns the fragment shader.

public
this method was deprecated. Use name instead.

Returns the name of this effect.

public

getUniforms(): Map<String, Uniform>

this method was deprecated. Use uniforms instead.

Returns the uniforms of this effect.

public

Returns the vertex shader.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategies)

Sets the depth texture.

public

setRenderer(renderer: WebGLRenderer)

this method was deprecated.

Sets the renderer.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect by performing supporting operations.

protected

Sets the effect attributes.

protected

Informs the associated EffectPass that this effect requires a shader recompilation.

protected

setFragmentShader(fragmentShader: String)

Sets the fragment shader.

protected

setVertexShader(vertexShader: String)

Sets the vertex shader.

Public Constructors

public constructor(camera: Camera, position: Vector3, options: Object) source

Constructs a new shock wave effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
camera Camera

The main camera.

position Vector3
  • optional

The world position of the shock wave.

options Object
  • optional

The options.

options.speed Number
  • optional
  • default: 2.0

The animation speed.

options.maxRadius Number
  • optional
  • default: 1.0

The extent of the shock wave.

options.waveSize Number
  • optional
  • default: 0.2

The wave size.

options.amplitude Number
  • optional
  • default: 0.05

The distortion amplitude.

Public Members

public get amplitude: Number source

The amplitude.

public set amplitude source

public get epicenter: Vector3 source

this get was deprecated. Use position instead.

The position of the shock wave.

public set epicenter source

public set mainCamera source

Sets the main camera.

Override:

Effect#mainCamera

public get maxRadius: Number source

The maximum radius.

public set maxRadius source

public position: Vector3 source

The position of the shock wave.

public speed: Number source

The speed of the shock wave animation.

public get waveSize: Number source

The wave size.

public set waveSize source

Public Methods

public explode() source

Emits the shock wave.

public getPosition(): Vector3 source

this method was deprecated. Use position instead.

Returns the position of the shock wave.

Return:

Vector3

The position.

public getSpeed(): Number source

this method was deprecated. Use speed instead.

Returns the speed of the shock wave.

Return:

Number

The speed.

public setPosition(value: Vector3) source

this method was deprecated. Use position instead.

Sets the position of the shock wave.

Params:

NameTypeAttributeDescription
value Vector3

The position.

public setSpeed(value: Number) source

this method was deprecated. Use speed instead.

Sets the speed of the shock wave.

Params:

NameTypeAttributeDescription
value Number

The speed.

public update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number) source

Updates this effect.

Override:

Effect#update

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

A frame buffer that contains the result of the previous pass.

delta Number
  • optional

The time between the last frame and the current one in seconds.