Class: MeshPrimitive
WebSG.MeshPrimitive
The MeshPrimitive class represents a single primitive of a mesh.
Table of contents
Constructors
Accessors
Methods
Constructors
constructor
• new MeshPrimitive()
Accessors
indices
• get indices(): undefined | Accessor
Returns the Accessor for the indices of the mesh primitive.
Returns
undefined | Accessor
Defined in
material
• get material(): undefined | Material
Returns the Material of the mesh primitive.
Returns
undefined | Material
Defined in
• set material(material): void
Sets the Material for the mesh primitive.
Parameters
| Name | Type | Description |
|---|---|---|
material | undefined | Material | The Material to set. |
Returns
void
Defined in
mode
• get mode(): MeshPrimitiveMode
Returns the current rendering mode of the mesh primitive.
Returns
Defined in
Methods
getAttribute
▸ getAttribute(name): undefined | Accessor
Returns the Accessor for the specified attribute name.
Parameters
| Name | Type | Description |
|---|---|---|
name | MeshPrimitiveAttribute | The attribute name. |
Returns
undefined | Accessor
The Accessor for the attribute or undefined if not found.
Defined in
setDrawRange
▸ setDrawRange(start, count): MeshPrimitive
Sets the draw range for the mesh primitive.
Parameters
| Name | Type | Description |
|---|---|---|
start | number | The starting index for the draw range. |
count | number | The number of indices in the draw range. |
Returns
Defined in
thirdroomSetHologramMaterialEnabled
▸ thirdroomSetHologramMaterialEnabled(enabled): MeshPrimitive
Enables or disables the hologram material for the mesh primitive.
Parameters
| Name | Type | Description |
|---|---|---|
enabled | boolean | Whether to enable or disable the hologram material. This API is experimental and may change or be removed in future releases. |