Provides access to EXT_mesh_features feature ID data for a single mesh primitive.
Instances are created by GLTFMeshFeaturesExtension and attached to
mesh.userData.meshFeatures. Use getFeatures() or getFeaturesAsync() to read
feature IDs at a point on the mesh surface.
Methods
new MeshFeatures(
// The primitive's buffer geometry.
geometry: BufferGeometry,
// All GLTF textures (indexed by feature texture index).
textures: Array<Texture>,
// The raw `EXT_mesh_features` extension object for this primitive.
data: Object
)getTextures(): Array<Texture>Returns an indexed list of all textures used by features in the extension.
getFeatureInfo(): Array<FeatureInfo>Returns the feature ID info for each feature set defined on this primitive.
getFeaturesAsync(
// Triangle index from a raycast hit.
triangle: number,
// Barycentric coordinate of the hit point.
barycoord: Vector3
): Promise<Array<(number|null)>>Performs the same function as getFeatures but reads texture data asynchronously.
getFeatures(
// Triangle index from a raycast hit.
triangle: number,
// Barycentric coordinate of the hit point.
barycoord: Vector3
): Array<(number|null)>Returns the list of feature IDs at the given point on the mesh. Takes the triangle
index from a raycast result and a barycentric coordinate. Results are indexed in the
same order as the feature info returned by getFeatureInfo().
dispose(): voidDisposes all textures used by this instance.