EXTMeshFeatures

  • experimental

EXT_mesh_features defines a means of assigning identifiers to geometry and subcomponents of geometry within a glTF 2.0 asset.

Properties:

Example

// Create an Extension attached to the Document.
const meshFeaturesExt = document.createExtension(EXTMeshFeatures);

// Define per-vertex Feature IDs.
const idArray = new Int16Array([12, 23, 34, 45, 56, 78, 78, 89, 90]);
const idAttribute = document.createAccessor()
    .setBuffer(document.listBuffers()[0])
    .setType(Accessor.Type.SCALAR)
    .setArray(idArray);
const featureID = meshFeaturesExt.createFeatureID()
    .setFeatureCount(idArray.length)
    .setAttribute(0); // _FEATURE_ID_0

// Primitives reference a set of >=1 FeatureID properties. Each property
// defines a mapping from a part of the Primitive to an ID.
const features = meshFeaturesExt.createMeshFeatures()
    .addFeatureID(featureID);

// Assign FeatureID properties to the Primitive.
primitive
    .setAttribute(`_FEATURE_ID_0`, idAttribute)
    .setExtension("EXT_mesh_features", features);

Hierarchy

Static properties

EXTENSION_NAME: string

Properties

extensionName: "EXT_mesh_features"

Methods

  • dispose(): void
  • isRequired(): boolean
  • Indicates to the client whether it is OK to load the asset when this extension is not recognized. Optional extensions are generally preferred, if there is not a good reason to require a client to completely fail when an extension isn't known.

  • listProperties(): ExtensionProperty[]
  • Indicates to the client whether it is OK to load the asset when this extension is not recognized. Optional extensions are generally preferred, if there is not a good reason to require a client to completely fail when an extension isn't known.

Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.