Home Reference Source
import {Utils} from 'bimsurfer3/viewer/utils.js'
public class | source

Utils

Generic utils

Static Method Summary

Static Public Methods
public static

calculateBytesUsed(settings: *, nrVertices: *, nrColors: *, nrIndices: *, nrNormals: *): *

public static

createBuffer(gl: *, data: *, numElements: *, bufferType: *, components: *, srcStart: *, attribType: *, js_type: *): *

Create a new GPU buffer, keep in mind that some extra attributes are being set on the returned GLBuffer object

public static

createEmptyBuffer(gl: *, numElements: *, bufferType: *, components: *, attribType: *, js_type: *): *

Create a new GPU empty buffer, keep in mind that some extra attributes are being set on the returned GLBuffer object.

public static

createIndexBuffer(gl: *, data: *, n: *): *

public static

emptyAabb(): *

public static

glTypeToTypedArray(glType: *): *

public static

hash(input: *): *

public static

request(options: *): *

public static

sortMapKeys(inputMap: *): *

public static

toArray(matrix: *): *

Converts the given 4x4 mat4 to an array

public static

transformBounds(inputBounds: *, transformation: *): undefined[]

public static

typedArrayToGlType(typedArrayType: *): *

public static

unionAabb(a: *, b: *): *

public static

updateBuffer(gl: *, targetGlBuffer: *, data: *, pos: *, numElements: *)

Update a GPU buffer

Static Public Methods

public static calculateBytesUsed(settings: *, nrVertices: *, nrColors: *, nrIndices: *, nrNormals: *): * source

Params:

NameTypeAttributeDescription
settings *
nrVertices *
nrColors *
nrIndices *
nrNormals *

Return:

*

public static createBuffer(gl: *, data: *, numElements: *, bufferType: *, components: *, srcStart: *, attribType: *, js_type: *): * source

Create a new GPU buffer, keep in mind that some extra attributes are being set on the returned GLBuffer object

Params:

NameTypeAttributeDescription
gl *
data *
numElements *
bufferType *
components *
srcStart *
attribType *
js_type *

Return:

*

public static createEmptyBuffer(gl: *, numElements: *, bufferType: *, components: *, attribType: *, js_type: *): * source

Create a new GPU empty buffer, keep in mind that some extra attributes are being set on the returned GLBuffer object. This method is usually used in order to create buffers that will be later be filled by calls to bufferSubData (via Utils.updateBuffer)

Params:

NameTypeAttributeDescription
gl *
numElements *
bufferType *
components *
attribType *
js_type *

Return:

*

public static createIndexBuffer(gl: *, data: *, n: *): * source

Params:

NameTypeAttributeDescription
gl *
data *
n *

Return:

*

public static emptyAabb(): * source

Return:

*

public static glTypeToTypedArray(glType: *): * source

Params:

NameTypeAttributeDescription
glType *

Return:

*

public static hash(input: *): * source

Params:

NameTypeAttributeDescription
input *

Return:

*

public static request(options: *): * source

Params:

NameTypeAttributeDescription
options *

Return:

*

public static sortMapKeys(inputMap: *): * source

Params:

NameTypeAttributeDescription
inputMap *

Return:

*

public static toArray(matrix: *): * source

Converts the given 4x4 mat4 to an array

Params:

NameTypeAttributeDescription
matrix *

Return:

*

public static transformBounds(inputBounds: *, transformation: *): undefined[] source

Params:

NameTypeAttributeDescription
inputBounds *
transformation *

Return:

undefined[]

public static typedArrayToGlType(typedArrayType: *): * source

Params:

NameTypeAttributeDescription
typedArrayType *

Return:

*

public static unionAabb(a: *, b: *): * source

Params:

NameTypeAttributeDescription
a *
b *

Return:

*

public static updateBuffer(gl: *, targetGlBuffer: *, data: *, pos: *, numElements: *) source

Update a GPU buffer

Params:

NameTypeAttributeDescription
gl *
targetGlBuffer *
data *
pos *
numElements *