function placePiece(piece, mesh, myBoard){
        var x = piece.pos[0];
        var y = piece.pos[1];
        var obj = {
            piece: piece,
            pieceMesh: mesh
        }
        for(var i = 0; i < piece.type; i++ ){
            if (piece.orientation === 1){
                myBoard[x + i][y] = obj;
            } else{
                myBoard[x][y + i] = obj;
            }       
        }
    }
/**
     * Saves piece and mesh in the board according to the piece's position.
     * @param {Object} piece The piece object.
     * @param {THREE.Mesh} mesh The piece Mesh object.
     */
Saves piece and mesh in the board according to the piece's position.
@param {Object} piece The piece object.
@param {THREE.Mesh} mesh The piece Mesh object.
Saves piece and mesh in the board according to the piece ' s position . @param { Object } piece The piece object . @param { THREE . Mesh } mesh The piece Mesh object .
function placePiece(piece, mesh, myBoard){
        var x = piece.pos[0];
        var y = piece.pos[1];
        var obj = {
            piece: piece,
            pieceMesh: mesh
        }
        for(var i = 0; i < piece.type; i++ ){
            if (piece.orientation === 1){
                myBoard[x + i][y] = obj;
            } else{
                myBoard[x][y + i] = obj;
            }       
        }
    }
function placePiece ( piece , mesh , myBoard ) { var x = piece . pos [ 0 ] ; var y = piece . pos [ 1 ] ; var obj = { piece : piece , pieceMesh : mesh } for ( var i = 0 ; i < piece . type ; i ++ ) { if ( piece . orientation === 1 ) { myBoard [ x + i ] [ y ] = obj ; } else { myBoard [ x ] [ y + i ] = obj ; } } }
Saves piece and mesh in the board according to the piece's position.
Saves piece and mesh in the board according to the piece ' s position .