Interface IGetSetVerticesData
getIndices(
copyWhenShared?: boolean,
forceCopy?: boolean,
): Nullable<IndicesArray>;
getVerticesData(
kind: string,
copyWhenShared?: boolean,
forceCopy?: boolean,
): Nullable<FloatArray>;
isVerticesDataPresent(kind: string): boolean;
setIndices(
indices: IndicesArray,
totalVertices: Nullable<number>,
updatable?: boolean,
): void;
setVerticesData(
kind: string,
data: FloatArray,
updatable: boolean,
stride?: number,
): void;
updateVerticesData(
kind: string,
data: FloatArray,
updateExtends?: boolean,
makeItUnique?: boolean,
): void;
}
Implemented by
Methods
get Indices
-
Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
Parameters
OptionalcopyWhenShared: booleanIf true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
OptionalforceCopy: booleandefines a boolean indicating that the returned array must be cloned upon returning it
Returns Nullable<IndicesArray>
the indices array or an empty array if the mesh has no geometry
get Vertices Data
-
getVerticesData(
kind: string,
copyWhenShared?: boolean,
forceCopy?: boolean,
): Nullable<FloatArray>Gets a specific vertex data attached to this geometry. Float data is constructed if the vertex buffer data cannot be returned directly.
Parameters
- kind: string
defines the data kind (Position, normal, etc...)
OptionalcopyWhenShared: booleandefines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes
OptionalforceCopy: booleandefines a boolean indicating that the returned array must be cloned upon returning it
Returns Nullable<FloatArray>
a float array containing vertex data
- kind: string
is Vertices Data Present
-
Gets a boolean indicating if specific vertex data is present
Parameters
- kind: string
defines the vertex data kind to use
Returns boolean
true is data kind is present
- kind: string
set Indices
-
Creates a new index buffer
Parameters
- indices: IndicesArray
defines the indices to store in the index buffer
- totalVertices: Nullable<number>
defines the total number of vertices (could be null)
Optionalupdatable: booleandefines if the index buffer must be flagged as updatable (false by default)
Returns void
- indices: IndicesArray
set Vertices Data
-
Set specific vertex data
Parameters
- kind: string
defines the data kind (Position, normal, etc...)
- data: FloatArray
defines the vertex data to use
- updatable: boolean
defines if the vertex must be flagged as updatable (false as default)
Optionalstride: numberdefines the stride to use (0 by default). This value is deduced from the kind value if not specified
Returns void
- kind: string
update Vertices Data
-
updateVerticesData(
kind: string,
data: FloatArray,
updateExtends?: boolean,
makeItUnique?: boolean,
): voidUpdate a specific associated vertex buffer
Parameters
- kind: string
defines which buffer to write to (positions, indices, normals, etc). Possible
kindvalues :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
- data: FloatArray
defines the data source
OptionalupdateExtends: booleandefines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
OptionalmakeItUnique: booleandefines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
Returns void
- kind: string
Define an interface for all classes that will get and set the data on vertices