API

Class SolidParser

Class used to load mesh data from OBJ content

Index
  • Creates a new SolidParser

    Parameters

    • materialToUse: string[]

      defines the array to fill with the list of materials to use (it will be filled by the parse function)

    • babylonMeshesArray: Mesh[]

      defines the array to fill with the list of loaded meshes (it will be filled by the parse function)

    • loadingOptions: OBJLoadingOptions

      defines the loading options to use

    Returns SolidParser

FacePattern1: RegExp = ...

Pattern used to detect a first kind of face (f vertex vertex vertex)

FacePattern2: RegExp = ...

Pattern used to detect a second kind of face (f vertex/uvs vertex/uvs vertex/uvs)

FacePattern3: RegExp = ...

Pattern used to detect a third kind of face (f vertex/uvs/normal vertex/uvs/normal vertex/uvs/normal)

FacePattern4: RegExp = ...

Pattern used to detect a fourth kind of face (f vertex//normal vertex//normal vertex//normal)

FacePattern5: RegExp = ...

Pattern used to detect a fifth kind of face (f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal)

GroupDescriptor: RegExp = ...

Group descriptor

LinePattern1: RegExp = ...

Pattern used to detect a line(l vertex vertex)

LinePattern2: RegExp = ...

Pattern used to detect a second kind of line (l vertex/uvs vertex/uvs)

LinePattern3: RegExp = ...

Pattern used to detect a third kind of line (l vertex/uvs/normal vertex/uvs/normal)

MtlLibGroupDescriptor: RegExp = ...

Material lib descriptor

NormalPattern: RegExp = ...

Pattern used to detect a normal

ObjectDescriptor: RegExp = ...

Object descriptor

SmoothDescriptor: RegExp = ...

Smooth descriptor

UseMtlDescriptor: RegExp = ...

Use a material descriptor

UVPattern: RegExp = ...

Pattern used to detect a UV set

VertexPattern: RegExp = ...

Pattern used to detect a vertex

  • Function used to parse an OBJ string

    Parameters

    • meshesNames: any

      defines the list of meshes to load (all if not defined)

    • data: string

      defines the OBJ string

    • scene: Scene

      defines the hosting scene

    • assetContainer: Nullable<AssetContainer>

      defines the asset container to load data in

    • onFileToLoadFound: (fileToLoad: string) => void

      defines a callback that will be called if a MTL file is found

    Returns void