threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
1 год назад
12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. prev:
  3. text: 'PointerLockControlsPlugin'
  4. link: './PointerLockControlsPlugin'
  5. next:
  6. text: 'GLTFKHRMaterialVariantsPlugin'
  7. link: './GLTFKHRMaterialVariantsPlugin'
  8. ---
  9. # ThreeFirstPersonControlsPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#three-first-person-controls-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/interaction/ThreeFirstPersonControlsPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/ThreeFirstPersonControlsPlugin.html)
  14. ThreeFirstPersonControlsPlugin adds support for using FirstPersonControls from three.js. It works similar to idle look around in first person games, it does not capture the mouse pointer.
  15. After the plugin is added, it adds support for setting `threeFirstPerson` as the key in `scene.mainCamera.controlMode`.
  16. Sample Usage
  17. ```typescript
  18. import {ThreeViewer, ThreeFirstPersonControlsPlugin, Mesh2} from 'threepipe'
  19. const viewer = new ThreeViewer({...})
  20. viewer.addPluginSync(ThreeFirstPersonControlsPlugin)
  21. // after some user action
  22. viewer.scene.mainCamera.controlsMode = 'threeFirstPerson'
  23. // switch back to default orbit controls
  24. viewer.scene.mainCamera.controlsMode = 'orbit'
  25. ```