API

Interface IWebXRVertexData

A babylon interface for a XR mesh's vertex data.

interface IWebXRVertexData {
    id: number;
    indices?: Uint32Array<ArrayBufferLike>;
    mesh?: Mesh;
    normals?: Float32Array<ArrayBufferLike>;
    positions?: Float32Array<ArrayBufferLike>;
    semanticLabel?: string | null;
    transformationMatrix?: Matrix;
    worldParentNode?: TransformNode;
    xrMesh: XRMesh;
}
Index
id: number

A babylon-assigned ID for this mesh

indices?: Uint32Array<ArrayBufferLike>

An array of indices in babylon space. Indices have a counterclockwise winding order. Indices will only be populated if convertCoordinateSystems is set to true in the IWebXRMeshDetectorOptions.

mesh?: Mesh

If generateMeshes is set to true in the IWebXRMeshDetectorOptions, this will be the generated mesh. This mesh will be updated with the vertex data provided and not regenerated every time.

normals?: Float32Array<ArrayBufferLike>

An array of vertex normals in babylon space. right/left hand system is taken into account. Normals will not be calculated if convertCoordinateSystems is undefined in the IWebXRMeshDetectorOptions. Different platforms may or may not support mesh normals when convertCoordinateSystems is set to true.

positions?: Float32Array<ArrayBufferLike>

An array of vertex positions in babylon space. right/left hand system is taken into account. Positions will only be calculated if convertCoordinateSystems is set to true in the IWebXRMeshDetectorOptions.

semanticLabel?: string | null

The semantic classification supplied by the XR runtime. This is undefined when the runtime does not expose semantic labels and null when the mesh has no known classification.

transformationMatrix?: Matrix

A transformation matrix to apply on the mesh that will be built using the meshDefinition. Local vs. World are decided if worldParentNode was provided or not in the options when constructing the module. TransformationMatrix will only be calculated if convertCoordinateSystems is set to true in the IWebXRMeshDetectorOptions.

worldParentNode?: TransformNode

The node to use to transform the local results to world coordinates. WorldParentNode will only exist if it was declared in the IWebXRMeshDetectorOptions.

xrMesh: XRMesh

Data required for constructing a mesh in Babylon.js.