src/core/World.js
/**
	* Inits the controls used by the player.
	*
	* @return {World} A reference to this world object.
	*/
Inits the controls used by the player.
@return {World} A reference to this world object.
Inits the controls used by the player . @return { World } A reference to this world object .
_initControls() {
		this.fpsControls = new FirstPersonControls( this.player );
		this.fpsControls.sync();
		this.fpsControls.addEventListener( 'lock', ( ) => {
			this.useFPSControls = true;
			this.orbitControls.enabled = false;
			this.camera.matrixAutoUpdate = false;
			this.player.activate();
			this.player.head.setRenderComponent( this.camera, syncCamera );
			this.uiManager.showFPSInterface();
			if ( this.debug ) {
				this.uiManager.closeDebugUI();
			}
		} );
		this.fpsControls.addEventListener( 'unlock', () => {
			this.useFPSControls = false;
			this.orbitControls.enabled = true;
			this.camera.matrixAutoUpdate = true;
			this.player.deactivate();
			this.player.head.setRenderComponent( null, null );
			this.uiManager.hideFPSInterface();
			if ( this.debug ) {
				this.uiManager.openDebugUI();
			}
		} );
		if ( this.debug ) {
			this.orbitControls = new OrbitControls( this.camera, this.renderer.domElement );
			this.orbitControls.maxDistance = 500;
		}
		return this;
	}
_initControls ( ) { this . fpsControls = new FirstPersonControls ( this . player ) ; this . fpsControls . sync ( ) ; this . fpsControls . addEventListener ( 'lock' , ( ) => { this . useFPSControls = true ; this . orbitControls . enabled = false ; this . camera . matrixAutoUpdate = false ; this . player . activate ( ) ; this . player . head . setRenderComponent ( this . camera , syncCamera ) ; this . uiManager . showFPSInterface ( ) ; if ( this . debug ) { this . uiManager . closeDebugUI ( ) ; } } ) ; this . fpsControls . addEventListener ( 'unlock' , ( ) => { this . useFPSControls = false ; this . orbitControls . enabled = true ; this . camera . matrixAutoUpdate = true ; this . player . deactivate ( ) ; this . player . head . setRenderComponent ( null , null ) ; this . uiManager . hideFPSInterface ( ) ; if ( this . debug ) { this . uiManager . openDebugUI ( ) ; } } ) ; if ( this . debug ) { this . orbitControls = new OrbitControls ( this . camera , this . renderer . domElement ) ; this . orbitControls . maxDistance = 500 ; } return this ; }
Inits the controls used by the player.
Inits the controls used by the player .
//