build/browser/index.js
/**
     * This seems a bit hacky. Maybe we need an abstraction that recognizes the existence of
     * geometric numbers for vertex attributes, but allows us to extract the vector (grade-1) part?
     * @hidden
     */
This seems a bit hacky. Maybe we need an abstraction that recognizes the existence of
geometric numbers for vertex attributes, but allows us to extract the vector (grade-1) part.
@hidden
This seems a bit hacky . Maybe we need an abstraction that recognizes the existence of geometric numbers for vertex attributes but allows us to extract the vector ( grade - 1 ) part . @hidden
function dataLength(source) {
        if (source instanceof Geometric3) {
            if (source.length !== 8) {
                throw new Error("source.length (" + source.length + ") is expected to be 8");
            }
            return 3;
        }
        else if (source instanceof Geometric2) {
            if (source.length !== 4) {
                throw new Error("source.length (" + source.length + ") is expected to be 4");
            }
            return 2;
        }
        else if (source instanceof Vector3) {
            if (source.length !== 3) {
                throw new Error("source.length (" + source.length + ") is expected to be 3");
            }
            return 3;
        }
        else if (source instanceof Vector2) {
            if (source.length !== 2) {
                throw new Error("source.length (" + source.length + ") is expected to be 2");
            }
            return 2;
        }
        else {
            if (source.length === 1) {
                return 1;
            }
            else if (source.length === 2) {
                return 2;
            }
            else if (source.length === 3) {
                return 3;
            }
            else if (source.length === 4) {
                return 4;
            }
            else {
                throw new Error("dataLength(source: VectorN<number>): AttributeSizeType, source.length => " + source.length);
            }
        }
    }
function dataLength ( source ) { if ( source instanceof Geometric3 ) { if ( source . length !== 8 ) { throw new Error ( "source.length (" + source . length + ") is expected to be 8" ) ; } return 3 ; } else if ( source instanceof Geometric2 ) { if ( source . length !== 4 ) { throw new Error ( "source.length (" + source . length + ") is expected to be 4" ) ; } return 2 ; } else if ( source instanceof Vector3 ) { if ( source . length !== 3 ) { throw new Error ( "source.length (" + source . length + ") is expected to be 3" ) ; } return 3 ; } else if ( source instanceof Vector2 ) { if ( source . length !== 2 ) { throw new Error ( "source.length (" + source . length + ") is expected to be 2" ) ; } return 2 ; } else { if ( source . length === 1 ) { return 1 ; } else if ( source . length === 2 ) { return 2 ; } else if ( source . length === 3 ) { return 3 ; } else if ( source . length === 4 ) { return 4 ; } else { throw new Error ( "dataLength(source: VectorN<number>): AttributeSizeType, source.length => " + source . length ) ; } } }
This seems a bit hacky.
This seems a bit hacky .