Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
A handle to in-memory mesh data in a GraphicsModel.Create using the Graphics API, GraphicsModel.cloneModel, or GraphicsMesh.cloneMesh.
Properties
Name | Type | Summary |
---|---|---|
numParts | number |
The number of mesh parts. Read-only. |
parts | Array.<GraphicsMeshPart> |
The mesh parts. Read-only. |
numIndices | number |
The total number of vertex indices in the mesh. Read-only. |
numVertices | number |
The total number of vertices in the mesh. Read-only. |
numAttributes | number |
The number of vertex attributes. Read-only. |
attributeNames | Array.<Graphics.BufferTypeName> |
The names of the vertex attributes. Read-only. |
valid | boolean |
|
strong | boolean |
|
extents | Graphics.MeshExtents |
The mesh extents, in model coordinates. Read-only. |
bufferFormats | Object.<Graphics.BufferTypeName, Graphics.BufferFormat> |
Details of the buffers used for the mesh. Read-only. |
Methods
Name | Return Value | Summary |
---|---|---|
addAttribute
|
number |
Adds an attribute for all vertices. |
cloneMesh
|
GraphicsMesh |
Makes a copy of the mesh. |
fillAttribute
|
number |
Sets the value of an attribute for all vertices. |
findNearbyVertexIndices
|
Array.<number> |
Gets the indices of nearby vertices. |
forEachVertex
|
number |
Calls a function for each vertex. |
getIndices
|
Array.<number> |
Gets the vertex indices. |
getMeshPointer
|
undefined |
Deprecated: This method is deprecated and will be removed. |
getModelBasePointer
|
undefined |
Deprecated: This method is deprecated and will be removed. |
getModelProviderPointer
|
undefined |
Deprecated: This method is deprecated and will be removed. |
getParentModel
|
GraphicsModel |
Gets the model the mesh is part of. Currently doesn't work. |
getVertexAttributes
|
Object.<Graphics.BufferTypeName, Graphics.BufferType> |
Gets the attributes and attribute values of a vertex. |
getVertexProperty
|
Graphics.BufferType |
Gets the value of a vertex's attribute. |
isValidIndex
|
boolean |
Checks if an index is valid and, optionally, that vertex has a particular attribute. |
queryVertexAttributes
|
Array.<Graphics.BufferType> |
Gets the value of an attribute for all vertices. |
removeAttribute
|
boolean |
Removes an attribute from all vertices. Note: The |
setVertexAttributes
|
boolean |
Updates attribute values of a vertex. |
setVertexProperty
|
boolean |
Sets the value of a vertex's attribute. |
updateVertexAttributes
|
number |
Updates vertex attributes by calling a function for each vertex. The function can return modified attributes to update the vertex with. |
Type Definitions
forEachVertextCallback( attributes, index, properties )
Type: function |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Called for each vertex when GraphicsMesh.updateVertexAttributes is called. Parameters
|
updateVertexAttributesCallback( attributes, index, properties ) → {Object.<Graphics.BufferTypeName, Graphics.BufferType>|boolean}
Returns: The attribute values to update the vertex with, or false to not update the vertex.
Type: function |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Called for each vertex when GraphicsMesh.updateVertexAttributes is called. The value returned by the script function
should be the modified attributes to update the vertex with, or Parameters
|
Method Details
(static) addAttribute( name, defaultValueopt ) → {number}
Returns: The number of vertices the attribute was added to, 0 if the name was
invalid or all vertices already had the attribute.
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds an attribute for all vertices. Parameters
|
(static) cloneMesh( ) → {GraphicsMesh}
Returns: A copy of the mesh. |
---|
Makes a copy of the mesh. |
(static) fillAttribute( name, value ) → {number}
Returns: 1 if the attribute name was valid and the attribute values were set, 0
otherwise.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the value of an attribute for all vertices. Parameters
|
(static) findNearbyVertexIndices( origin, epsilonopt ) → {Array.<number>}
Returns: The indices of nearby vertices. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the indices of nearby vertices. Parameters
|
(static) forEachVertex( callback ) → {number}
Returns: The number of vertices the callback was called for. |
||||||
---|---|---|---|---|---|---|
Calls a function for each vertex. Parameters
|
(static) getIndices( ) → {Array.<number>}
Returns: The vertex indices. |
---|
Gets the vertex indices. |
(static) getMeshPointer( ) → {undefined}
Returns: undefined |
---|
Deprecated: This method is deprecated and will be removed. |
(static) getModelBasePointer( ) → {undefined}
Returns: undefined |
---|
Deprecated: This method is deprecated and will be removed. |
(static) getModelProviderPointer( ) → {undefined}
Returns: undefined |
---|
Deprecated: This method is deprecated and will be removed. |
(static) getParentModel( ) → {GraphicsModel}
Returns: The model the mesh is part of, null if it isn't part of a model.
|
---|
Gets the model the mesh is part of. Currently doesn't work. |
(static) getVertexAttributes( index ) → {Object.<Graphics.BufferTypeName, Graphics.BufferType>}
Returns: The attribute names and values for the vertex. |
||||||
---|---|---|---|---|---|---|
Gets the attributes and attribute values of a vertex. Throws
Throws an error if the
index is invalid.
Parameters
|
(static) getVertexProperty( index, name ) → {Graphics.BufferType}
Returns: The value of the vertex attribute. |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the value of a vertex's attribute. Throws
Throws an error if the
index is invalid or name is invalid or isn't used in the
mesh.
Parameters
|
(static) isValidIndex( index, attributeopt ) → {boolean}
Returns: true if the index is valid and that vertex has the attribute if specified.
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Checks if an index is valid and, optionally, that vertex has a particular attribute. Throws
Throws an error if the
index if invalid or name is invalid or isn't used in the
mesh.
Parameters
|
(static) queryVertexAttributes( name ) → {Array.<Graphics.BufferType>}
Returns: The attribute values for all vertices. |
||||||
---|---|---|---|---|---|---|
Gets the value of an attribute for all vertices. Throws
Throws an error if the
name is invalid or isn't used in the mesh.
Parameters
|
(static) removeAttribute( name ) → {boolean}
Returns: true if the attribute existed and was removed, false otherwise.
|
||||||
---|---|---|---|---|---|---|
Removes an attribute from all vertices. Note: The Parameters
|
(static) setVertexAttributes( index, values ) → {boolean}
Returns: true if the index and the attribute names and values were valid and the vertex was
updated, false otherwise.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Updates attribute values of a vertex. Throws
Throws an error if the
index is invalid or one of the attribute names is invalid or isn't used
in the mesh.
Parameters
|
(static) setVertexProperty( index, name, value ) → {boolean}
Returns: true if the vertex attribute value was set, false if it wasn't.
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the value of a vertex's attribute. Throws
Throws an error if the
index is invalid or name is invalid or isn't used in the
mesh.
Parameters
|
(static) updateVertexAttributes( callback ) → {number}
Returns: The number of vertices the callback was called for. |
||||||
---|---|---|---|---|---|---|
Updates vertex attributes by calling a function for each vertex. The function can return modified attributes to update the vertex with. Parameters
|