roavatar-renderer
    Preparing search index...

    Class RBFDeformerPatch

    The deformer used for layered clothing

    Index

    Constructors

    • Creates the deformer and prepares for deformation

      Parameters

      • refMesh: FileMesh

        The reference cage

      • distMesh: FileMesh

        The destination cage

      • mesh: FileMesh

        The mesh to deform

      • ignoredIndices: number[] = []

        Indices in the reference cage to ignore

      • patchCount: number = FLAGS.RBF_PATCH_COUNT

        Amount of patches spread around the mesh, each one solves a linear equation

      • detailsCount: number = FLAGS.RBF_PATCH_DETAIL_SAMPLES

        Amount of close vertices in each patch

      • importantsCount: number = FLAGS.RBF_PATCH_SHAPE_SAMPLES

        Amount of far away vertices in each patch

      Returns RBFDeformerPatch

    Properties

    affectBones: boolean = true
    controlKD: KDNode | null = null
    distVerts: Float32Array = ...
    epsilon: number = 1e-6
    hasSolved: boolean = false
    id: number = ...
    importantIndices: Uint16Array = ...
    K: number
    mesh: FileMesh
    meshBones: Float32Array
    meshVerts: Float32Array
    nearestPatch?: Uint16Array<ArrayBufferLike>
    neighborIndices?: Uint16Array<ArrayBufferLike>[]
    patchCount: number
    patchKD: KDNode | null = null
    refVerts: Float32Array = ...
    weights?: Float32Array<ArrayBufferLike>[]

    Methods

    • solveAsync() needs to be called before this Deforms the position of something inside the mesh

      Parameters

      • i: number

        The index of the vert to deform, if it is outside the range of vertices it will be a bone instead. For example vertices range from 1 - 100, and bones range from 101 - 110. Then index 101 will represent the first bone

      Returns Vec3

      New position after deformation

    • solveAsync() needs to be called before this Deforms vertices and bones in mesh (if this.affectBones = true)

      Returns void

    • Solves the linear equations asynchronously, required before deformation

      Returns Promise<void>

      void