fast-mesh-wasm
    Preparing search index...

    Interface FastMeshProps

    Props of FastMesh: R3F's pointer events are passed through to the mesh.

    interface FastMeshProps {
        color?: ColorRepresentation;
        edgeSoftness?: number;
        material?:
            | MeshStandardMaterial
            | MeshPhongMaterial
            | MeshLambertMaterial
            | MeshBasicMaterial;
        mesh: MeshHandle;
        onBind?: (bound: BoundMesh | null) => void;
        onClick?: (event: ThreeEvent<MouseEvent>) => void;
        onContextMenu?: (event: ThreeEvent<MouseEvent>) => void;
        onDoubleClick?: (event: ThreeEvent<MouseEvent>) => void;
        onLostPointerCapture?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerCancel?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerDown?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerEnter?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerLeave?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerMissed?: (event: MouseEvent) => void;
        onPointerMove?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerOut?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerOver?: (event: ThreeEvent<PointerEvent>) => void;
        onPointerUp?: (event: ThreeEvent<PointerEvent>) => void;
        onWheel?: (event: ThreeEvent<WheelEvent>) => void;
        shading?: "vertex" | "fragment";
        store?: SceneStore;
        visible?: boolean;
    }

    Hierarchy

    • EventHandlers
      • FastMeshProps
    Index
    color?: ColorRepresentation

    The colour while the mesh has no colouring (see BindMeshOptions.color).

    edgeSoftness?: number

    Fragment shading's edge softness in distance units (see BindMeshOptions.edgeSoftness); 0 (the default) is a hard edge. Changing it never rebinds. NaN, an infinite or a negative width draws as 0, with a console warning (bindMesh would throw).

    material?:
        | MeshStandardMaterial
        | MeshPhongMaterial
        | MeshLambertMaterial
        | MeshBasicMaterial

    The material (see BindMeshOptions.material): give each <FastMesh> its own, and dispose it yourself. Changing it rebinds the mesh.

    The scene mesh to draw; added through the store (store.addMesh).

    onBind?: (bound: BoundMesh | null) => void

    Called with the binding once the mesh is bound, and with null when that binding is disposed (unmount, removal, or a rebind, which then delivers the new one). Pass it to bindSection or attachTransformControls. bindSection clips the materials it sees when it is called, so bind the section again when a new binding arrives. A new callback never rebinds.

    onClick?: (event: ThreeEvent<MouseEvent>) => void
    onContextMenu?: (event: ThreeEvent<MouseEvent>) => void
    onDoubleClick?: (event: ThreeEvent<MouseEvent>) => void
    onLostPointerCapture?: (event: ThreeEvent<PointerEvent>) => void
    onPointerCancel?: (event: ThreeEvent<PointerEvent>) => void
    onPointerDown?: (event: ThreeEvent<PointerEvent>) => void
    onPointerEnter?: (event: ThreeEvent<PointerEvent>) => void
    onPointerLeave?: (event: ThreeEvent<PointerEvent>) => void
    onPointerMissed?: (event: MouseEvent) => void
    onPointerMove?: (event: ThreeEvent<PointerEvent>) => void
    onPointerOut?: (event: ThreeEvent<PointerEvent>) => void
    onPointerOver?: (event: ThreeEvent<PointerEvent>) => void
    onPointerUp?: (event: ThreeEvent<PointerEvent>) => void
    onWheel?: (event: ThreeEvent<WheelEvent>) => void
    shading?: "vertex" | "fragment"

    How a colouring is drawn (see BindMeshOptions.shading): "vertex" (the default) or "fragment". Changing it rebinds the mesh.

    store?: SceneStore

    The store; defaults to the nearest SceneProvider's.

    visible?: boolean

    A visibility override, ANDed with the store display's visible (unset shows). The store still hides the mesh while set; changing it never rebinds.