Noise
Adds camera shake on top of the shot.
Noise shakes the camera on top of everything else, so the shot stays framed correctly underneath. You can add as many as you like to one virtual camera. Noise runs after every Extension, and addNoise returns a function that removes one.
Which one?
Usage
import { BasicMultiChannelPerlinNoise } from '@pmndrs/klipp';
camera.addNoise(new BasicMultiChannelPerlinNoise({ positionAmplitude: [0.1, 0.1, 0], rotationAmplitude: [0.5, 0.5, 0] }));
import { Vector3 } from 'three';
import { BasicMultiChannelPerlinNoiseThree } from '@pmndrs/klipp/three';
camera.addNoise(new BasicMultiChannelPerlinNoiseThree({ positionAmplitude: new Vector3(0.1, 0.1, 0), rotationAmplitude: new Vector3(0.5, 0.5, 0) }));
import { Noise } from '@pmndrs/klipp/react';
<VirtualCamera name="follow" priority={10}>
<Body.Follow target={playerRef} offset={[0, 3, 8]} />
<Aim.HardLookAt target={playerRef} />
<Noise.BasicMultiChannelPerlin positionAmplitude={[0.1, 0.1, 0]} rotationAmplitude={[0.5, 0.5, 0]} />
</VirtualCamera>