Class

Geometry

Geometry()

A geometry

Constructor

new Geometry()

Constructor

View Source Geometry.js, line 10

Extends

Members

number

UID

Unique identifier
Inherited From:

View Source ContextResource.js, line 19

Methods

static createCube(widthopt, heightopt, depthopt) → {Geometry}

Create a cube
Parameters:
Name Type Attributes Default Description
width number <optional>
1 Width
height number <optional>
1 Height
depth number <optional>
1 Depth

View Source Geometry.js, line 234

A Geometry instance
Geometry

static createRectangle(width, height) → {Geometry}

Create a rectangle
Parameters:
Name Type Description
width number Width
height number Height

View Source Geometry.js, line 398

A Geometry instance
Geometry

getIndexCount() → {number}

Return index count

View Source Geometry.js, line 177

Indices array's length
number

getIndices() → {Uint16Array}

Return the indices

View Source Geometry.js, line 186

Indices array
Uint16Array

getUID() → {number}

Get unique ID
Inherited From:

View Source ContextResource.js, line 29

An unsigned integer
number

getVertexFormat() → {VertexFormat}

Get format

View Source Geometry.js, line 168

A VertexFormat instance
VertexFormat

getVerticesColors() → {Float32Array}

Return an array with the color for each vertex

View Source Geometry.js, line 195

An array with the format [r, g, b, a, r, g, b, a, …]
Float32Array

getVerticesNormals() → {Float32Array}

Return an array with the normal for each vertex

View Source Geometry.js, line 213

An array with the format [x, y, z, x, y, z, …]
Float32Array

getVerticesPositions() → {Float32Array}

Return an array with the position for each vertex

View Source Geometry.js, line 204

An array with the format [x, y, z, x, y, z, …]
Float32Array

getVerticesUVs() → {Float32Array}

Return an array with the texture coordinates for each vertex

View Source Geometry.js, line 222

An array with the format [u, v, u, v, …]
Float32Array

setColors(colors) → {Geometry}

Set vertices colors
Parameters:
Name Type Description
colors Float32Array An array of float values representing colors (r, g, b, a, r, g, b, a, …)

View Source Geometry.js, line 72

A reference to the instance
Geometry

setIndices(indices) → {Geometry}

Set indices
Parameters:
Name Type Description
indices Uint16Array An array of unsigned integer values representing indices order

View Source Geometry.js, line 89

A reference to the instance
Geometry

setNormals(normals) → {Geometry}

Set vertices normals
Parameters:
Name Type Description
normals Float32Array An array of float values representing normals (x, y, z, x, y, z, …)

View Source Geometry.js, line 106

A reference to the instance
Geometry

setPositions(positions) → {Geometry}

Set vertices positions
Parameters:
Name Type Description
positions Float32Array An array of float values representing positions (x, y, z, x, y, z, …)

View Source Geometry.js, line 123

A reference to the instance
Geometry

setTextureUVs(uvs) → {Geometry}

Set texture coordinates (uvs) for each vertex
Parameters:
Name Type Description
uvs Float32Array An array of float values representing texture coordinates (u, v, u, v, …)

View Source Geometry.js, line 140

A reference to the instance
Geometry

setVertexFormat(vertexFormat) → {Geometry}

Set geometry's format
Parameters:
Name Type Description
vertexFormat VertexFormat A VertexFormat instance

View Source Geometry.js, line 157

A reference to the instance
Geometry