function boardPieceToWorld (piece) {
    var x, z;
    var y = squareSize / 2 + 2.48;
    
    if(piece.orientation === 1){
        x = (piece.type / 2 + piece.pos[0]) * squareSize;
        z = piece.pos[1] * squareSize + squareSize / 2;

    } else{
        x = piece.pos[0] * squareSize + squareSize / 2;
        z = (piece.type  / 2 + piece.pos[1]) * squareSize;
    }     
    return new THREE.Vector3(x, y, z);
}
/**
 * Converts the piece board position to 3D world position.
 * @param {piece} piece objects.
 * @returns {THREE.Vector3}
 */
Converts the piece board position to 3D world position.
@param {piece} piece objects.
Converts the piece board position to 3D world position . @param { piece } piece objects .
function boardPieceToWorld (piece) {
    var x, z;
    var y = squareSize / 2 + 2.48;
    if(piece.orientation === 1){
        x = (piece.type / 2 + piece.pos[0]) * squareSize;
        z = piece.pos[1] * squareSize + squareSize / 2;
    } else{
        x = piece.pos[0] * squareSize + squareSize / 2;
        z = (piece.type  / 2 + piece.pos[1]) * squareSize;
    }     
    return new THREE.Vector3(x, y, z);
}
function boardPieceToWorld ( piece ) { var x , z ; var y = squareSize / 2 + 2.48 ; if ( piece . orientation === 1 ) { x = ( piece . type / 2 + piece . pos [ 0 ] ) * squareSize ; z = piece . pos [ 1 ] * squareSize + squareSize / 2 ; } else { x = piece . pos [ 0 ] * squareSize + squareSize / 2 ; z = ( piece . type / 2 + piece . pos [ 1 ] ) * squareSize ; } return new THREE . Vector3 ( x , y , z ) ; }
Converts the piece board position to 3D world position.
Converts the piece board position to 3D world position .