Skip to content

Camera Presets

Ready-to-use camera configurations for common game perspectives.

import { createCameraPreset, CameraPresets } from '@strata-game-library/presets/camera';
<CameraController {...CameraPresets.THIRD_PERSON} />
PresetDescriptionUse Case
FIRST_PERSONEye-level viewFPS games
THIRD_PERSONOver shoulderAction games
TOP_DOWNBirds eyeStrategy, RPG
ISOMETRIC45° angleTactics, city builders
ORBITFree rotationViewers, editors
CINEMATICSmooth dollyCutscenes
SIDE_SCROLLER2D perspectivePlatformers
CameraPresets.THIRD_PERSON = {
type: 'follow',
offset: [0, 2, -5],
lookAtOffset: [0, 1.5, 0],
smoothing: {
position: 0.1,
rotation: 0.05,
},
limits: {
minDistance: 2,
maxDistance: 10,
minPolarAngle: 0.2,
maxPolarAngle: Math.PI / 2,
},
collision: {
enabled: true,
radius: 0.3,
},
input: {
mouseSensitivity: 0.002,
zoomSpeed: 1,
},
};
CameraPresets.CINEMATIC = {
type: 'path',
smoothing: {
position: 0.02,
rotation: 0.01,
},
depthOfField: {
enabled: true,
focusDistance: 10,
aperture: 0.025,
},
motionBlur: {
enabled: true,
amount: 0.5,
},
letterbox: {
enabled: true,
aspect: 2.35,
},
};
import { CameraController } from '@strata-game-library/core';
import { CameraPresets } from '@strata-game-library/presets/camera';
<CameraController
{...CameraPresets.THIRD_PERSON}
target={playerRef}
/>