Constructor
Extends
Members
number
UID
Unique identifier
- Inherited From:
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 |
A Geometry instance
static createRectangle(width, height) → {Geometry}
Create a rectangle
Parameters:
Name | Type | Description |
---|---|---|
width |
number | Width |
height |
number | Height |
A Geometry instance
getIndexCount() → {number}
Return index count
Indices array's length
number
getIndices() → {Uint16Array}
Return the indices
Indices array
Uint16Array
getUID() → {number}
Get unique ID
- Inherited From:
An unsigned integer
number
getVerticesColors() → {Float32Array}
Return an array with the color for each vertex
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
An array with the format [x, y, z, x, y, z, …]
Float32Array
getVerticesPositions() → {Float32Array}
Return an array with the position for each vertex
An array with the format [x, y, z, x, y, z, …]
Float32Array
getVerticesUVs() → {Float32Array}
Return an array with the texture coordinates for each vertex
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, …) |
A reference to the instance
setIndices(indices) → {Geometry}
Set indices
Parameters:
Name | Type | Description |
---|---|---|
indices |
Uint16Array | An array of unsigned integer values representing indices order |
A reference to the instance
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, …) |
A reference to the instance
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, …) |
A reference to the instance
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, …) |
A reference to the instance
setVertexFormat(vertexFormat) → {Geometry}
Set geometry's format
Parameters:
Name | Type | Description |
---|---|---|
vertexFormat |
VertexFormat | A VertexFormat instance |
A reference to the instance