Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 2.78 KB

three-story-controls.storypointscontrols.md

File metadata and controls

73 lines (49 loc) · 2.78 KB

Home > three-story-controls > StoryPointsControls

StoryPointsControls class

Control scheme to transition the camera between given points in world space.

Signature:

export declare class StoryPointsControls extends EventDispatcher implements BaseControls 

Extends: EventDispatcher

Implements: BaseControls

Remarks

See StoryPointsControlsProps for all properties that can be passed to the constructor.

See StoryPointMarker for POI properties.

DEMO

Example

const pois = [
 { position: new Vector3(...), quaternion: new Quaternion(...) },
 { position: new Vector3(...), quaternion: new Quaternion(...) },
]
const scene = new Scene()
const camera = new PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
const cameraRig = new CameraRig(camera, scene)
const controls = new StoryPointsControls(cameraRig, pois)

controls.enable()
controls.goToPOI(0)

// Assuming DOM elements with classes 'nextBtn' and 'prevBtn' have been created
document.querySelector('.nextBtn').on('click', () => controls.nextPOI() )
document.querySelector('.prevBtn').on('click', () => controls.prevPOI() )

Constructors

Constructor Modifiers Description
(constructor)(cameraRig, pois, props) Constructs a new instance of the StoryPointsControls class

Properties

Property Modifiers Type Description
cameraRig CameraRig

Methods

Method Modifiers Description
disable()
enable()
getCurrentIndex()
goToPOI(index)
isEnabled()
nextPOI()
prevPOI()
update()