build/browser/index.js
/**
     * This helper function converts Vertex (VectorN) attributes into the Primitive (number[]) format.
     * There is some magic in the conversion of various types (Geometric2, Geometric3, Vector2, Vector3)
     * to number[], but the basic rule is that the vector grade is extracted and used in a way that is
     * consistent with the linear dimension (2,3), so there should be no surprises.
     * @hidden
     */
This helper function converts Vertex (VectorN) attributes into the Primitive (number[]) format.
There is some magic in the conversion of various types (Geometric2, Geometric3, Vector2, Vector3)
to number[], but the basic rule is that the vector grade is extracted and used in a way that is
consistent with the linear dimension (2,3), so there should be no surprises.
@hidden
This helper function converts Vertex ( VectorN ) attributes into the Primitive ( number [] ) format . There is some magic in the conversion of various types ( Geometric2 Geometric3 Vector2 Vector3 ) to number [] but the basic rule is that the vector grade is extracted and used in a way that is consistent with the linear dimension ( 2 3 ) so there should be no surprises . @hidden
function attributes(elements, vertices) {
        mustBeArray('elements', elements);
        var attribs = {};
        var iLen = vertices.length;
        for (var i = 0; i < iLen; i++) {
            var vertex = vertices[i];
            var names = Object.keys(vertex.attributes);
            var jLen = names.length;
            for (var j = 0; j < jLen; j++) {
                var name_1 = names[j];
                var data = dataFromVectorN(vertex.attributes[name_1]);
                var size = checkSize(data.length);
                var attrib = attribs[name_1];
                if (!attrib) {
                    attrib = attribs[name_1] = new DrawAttribute([], size, exports.DataType.FLOAT);
                }
                for (var k = 0; k < size; k++) {
                    attrib.values.push(data[k]);
                }
            }
        }
        return attribs;
    }
function attributes ( elements , vertices ) { mustBeArray ( 'elements' , elements ) ; var attribs = { } ; var iLen = vertices . length ; for ( var i = 0 ; i < iLen ; i ++ ) { var vertex = vertices [ i ] ; var names = Object . keys ( vertex . attributes ) ; var jLen = names . length ; for ( var j = 0 ; j < jLen ; j ++ ) { var name_1 = names [ j ] ; var data = dataFromVectorN ( vertex . attributes [ name_1 ] ) ; var size = checkSize ( data . length ) ; var attrib = attribs [ name_1 ] ; if ( ! attrib ) { attrib = attribs [ name_1 ] = new DrawAttribute ( [ ] , size , exports . DataType . FLOAT ) ; } for ( var k = 0 ; k < size ; k ++ ) { attrib . values . push ( data [ k ] ) ; } } } return attribs ; }
This helper function converts Vertex (VectorN) attributes into the Primitive (number[]) format.
This helper function converts Vertex ( VectorN ) attributes into the Primitive ( number [] ) format .