function onMouseDown(event){
        var mouse3D = getMouse3D(event, renderer, camera);

        if((isMouseOnBoard(mouse3D) || (isMouseOnInitBoard(mouse3D) && setting)) && !battle && !endGame){
            handleDown(mouse3D);
            renderer.domElement.addEventListener("mousemove", onMouseMove, false);
        } 
        if(battle && !endGame){
            var mouse3D = getYMouse3D(event, renderer, camera);
            if(isMouseOnOppBoard(mouse3D)){
                cameraController.enabled = false;
            }
        }
    }
/**
     * Listener for mouse down event.
     * Selects a piece from mouse position
     * Adds mouse move listener
     * Blocks camera rotation
     */
Listener for mouse down event.
Selects a piece from mouse position
Adds mouse move listener
Blocks camera rotation
Listener for mouse down event . Selects a piece from mouse position Adds mouse move listener Blocks camera rotation
function onMouseDown(event){
        var mouse3D = getMouse3D(event, renderer, camera);
        if((isMouseOnBoard(mouse3D) || (isMouseOnInitBoard(mouse3D) && setting)) && !battle && !endGame){
            handleDown(mouse3D);
            renderer.domElement.addEventListener("mousemove", onMouseMove, false);
        } 
        if(battle && !endGame){
            var mouse3D = getYMouse3D(event, renderer, camera);
            if(isMouseOnOppBoard(mouse3D)){
                cameraController.enabled = false;
            }
        }
    }
function onMouseDown ( event ) { var mouse3D = getMouse3D ( event , renderer , camera ) ; if ( ( isMouseOnBoard ( mouse3D ) || ( isMouseOnInitBoard ( mouse3D ) && setting ) ) && ! battle && ! endGame ) { handleDown ( mouse3D ) ; renderer . domElement . addEventListener ( "mousemove" , onMouseMove , false ) ; } if ( battle && ! endGame ) { var mouse3D = getYMouse3D ( event , renderer , camera ) ; if ( isMouseOnOppBoard ( mouse3D ) ) { cameraController . enabled = false ; } } }
Listener for mouse down event.
Listener for mouse down event .