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

        if(isMouseOnBoard(mouse3D) && !battle && !endGame){
            if(isPieceOnMousePosition(mouse3D)){
                selectPiece(mouse3D, false);
                if(selectedPiece){
                    var center = worldToBoard(selectedPiece.obj.position);
                    if(callbacks.pieceCanRotate && callbacks.pieceCanRotate(selectedPiece.pieceObj, center)){
                        instance.rotatePiece(center);
                        if(callbacks.pieceDropped){
                            callbacks.pieceDropped(selectedPiece.pieceObj, selectedPiece.origOrient, selectedPiece.origPos, center, initSet);
                        }
                        selectedPiece = null;
                    }else{
                        deselectPiece();
                    }
                }else{
                    deselectPiece();
                }
            }
        }
    }
/**
     * Listener for double click event.
     * Selects piece from mouse position
     * Calls callbacks to check if piece can be rotated and saves the rotation
     * Rotates piece in the board
     * Deselects piece
     */
Listener for double click event.
Selects piece from mouse position
Calls callbacks to check if piece can be rotated and saves the rotation
Rotates piece in the board
Deselects piece
Listener for double click event . Selects piece from mouse position Calls callbacks to check if piece can be rotated and saves the rotation Rotates piece in the board Deselects piece
function onDoubleClick(event){
        var mouse3D = getMouse3D(event, renderer, camera);
        if(isMouseOnBoard(mouse3D) && !battle && !endGame){
            if(isPieceOnMousePosition(mouse3D)){
                selectPiece(mouse3D, false);
                if(selectedPiece){
                    var center = worldToBoard(selectedPiece.obj.position);
                    if(callbacks.pieceCanRotate && callbacks.pieceCanRotate(selectedPiece.pieceObj, center)){
                        instance.rotatePiece(center);
                        if(callbacks.pieceDropped){
                            callbacks.pieceDropped(selectedPiece.pieceObj, selectedPiece.origOrient, selectedPiece.origPos, center, initSet);
                        }
                        selectedPiece = null;
                    }else{
                        deselectPiece();
                    }
                }else{
                    deselectPiece();
                }
            }
        }
    }
function onDoubleClick ( event ) { var mouse3D = getMouse3D ( event , renderer , camera ) ; if ( isMouseOnBoard ( mouse3D ) && ! battle && ! endGame ) { if ( isPieceOnMousePosition ( mouse3D ) ) { selectPiece ( mouse3D , false ) ; if ( selectedPiece ) { var center = worldToBoard ( selectedPiece . obj . position ) ; if ( callbacks . pieceCanRotate && callbacks . pieceCanRotate ( selectedPiece . pieceObj , center ) ) { instance . rotatePiece ( center ) ; if ( callbacks . pieceDropped ) { callbacks . pieceDropped ( selectedPiece . pieceObj , selectedPiece . origOrient , selectedPiece . origPos , center , initSet ) ; } selectedPiece = null ; } else { deselectPiece ( ) ; } } else { deselectPiece ( ) ; } } } }
Listener for double click event.
Listener for double click event .