rhodonite
    Preparing search index...

    Class VrmImporter

    A utility class for importing and processing VRM (Virtual Reality Model) files. This class handles the conversion of VRM data into Rhodonite's internal representation, including materials, spring bones, expressions, constraints, and humanoid structures.

    Index

    Methods

    • Imports a VRM model from a glTF structure and sets up all VRM-specific components. This method processes materials, spring bones, expressions, constraints, and humanoid data.

      Parameters

      • engine: Engine

        The engine instance

      • gltfModel: RnM2

        The parsed glTF model containing VRM extensions

      • renderPasses: RenderPass[]

        Array of render passes to add the imported model to

      Returns Promise<void>

      Promise that resolves when the import process is complete

    • Creates sampler objects from the glTF model data. Also generates dummy samplers for default texture sampling configuration.

      Parameters

      • engine: Engine
      • gltfModel: RnM2

        The glTF model containing sampler data

      Returns Sampler[]

      Array of created Sampler objects

    • Creates texture objects from the glTF model data. Also generates dummy white and black textures for default material properties.

      Parameters

      • engine: Engine
      • gltfModel: RnM2

        The glTF model containing texture data

      Returns Promise<Texture[]>

      Promise resolving to an array of created Texture objects

    • Reads and processes VRM constraint data from the model. Supports roll, aim, and rotation constraints as defined in the VRMC_node_constraint extension.

      Parameters

      • gltfModel: Vrm1

        The VRM model containing constraint data

      Returns void

    • Reads and processes VRM facial expressions (blend shapes) from the model. Creates VrmExpression objects and attaches them to the root entity's VrmComponent.

      Parameters

      • gltfModel: Vrm1

        The VRM model containing expression data

      • rootEntity: ISceneGraphEntity

        The root entity to attach the VRM component to

      Returns void

    • Reads and processes VRM spring bone physics data from the model. Sets up collider groups, spring bones, and physics components for dynamic hair and cloth simulation.

      Parameters

      • engine: Engine

        The engine instance

      • gltfModel: Vrm1

        The VRM model containing spring bone data

      Returns void

    • Reads and processes VRM humanoid bone mapping information. Creates a mapping between bone names and node indices for humanoid structure.

      Parameters

      • gltfModel: Vrm1

        The VRM model containing humanoid data

      • OptionalrootEntity: ISceneGraphEntity

        Optional root entity to tag with humanoid information

      Returns void

    • Imports only the JSON data structure of a VRM file without processing the full model. This is useful for extracting metadata and structure information without full rendering setup.

      Parameters

      • uri: string

        The URI or path to the VRM file

      • Optionaloptions: GltfLoadOption

        Optional import configuration

      Returns Promise<Vrm1>

      Promise resolving to the VRM JSON structure