threepipe
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ThreeFirstPersonControlsPlugin.md 1.2KB


prev:

text: 'PointerLockControlsPlugin'
link: './PointerLockControlsPlugin'

next:

text: 'GLTFKHRMaterialVariantsPlugin'
link: './GLTFKHRMaterialVariantsPlugin'

ThreeFirstPersonControlsPlugin

ExampleSource CodeAPI Reference

ThreeFirstPersonControlsPlugin adds support for using FirstPersonControls from three.js. It works similar to idle look around in first person games, it does not captures the mouse pointer.

After the plugin is added, it adds support for setting threeFirstPerson as the key in scene.mainCamera.controlMode.

Sample Usage

import {ThreeViewer, ThreeFirstPersonControlsPlugin, Mesh2} from 'threepipe'

const viewer = new ThreeViewer({...})

viewer.addPluginSync(ThreeFirstPersonControlsPlugin)

// after some user action
viewer.scene.mainCamera.controlsMode = 'threeFirstPerson'

// switch back to default orbit controls
viewer.scene.mainCamera.controlsMode = 'orbit'