如视 Five SDK
    Preparing search index...

    Class InstancedPrefabBufferGeometry

    Hierarchy

    • InstancedBufferGeometry
      • InstancedPrefabBufferGeometry
    Index

    Constructors

    • A wrapper around THREE.InstancedBufferGeometry, which is more memory efficient than PrefabBufferGeometry, but requires the ANGLE_instanced_arrays extension.

      Parameters

      • prefab: BufferGeometry

        The Geometry instance to repeat.

      • count: number

        The number of times to repeat the geometry.

      Returns InstancedPrefabBufferGeometry

    Properties

    prefabCount: number
    prefabGeometry: BufferGeometry

    Methods

    • Creates a BufferAttribute on this geometry instance.

      Parameters

      • name: string

        Name of the attribute.

      • itemSize: number

        Number of floats per vertex (typically 1, 2, 3 or 4).

      • Optionalfactory: (data: any[], index: number, prefabCount: number) => void

        Function that will be called for each prefab upon creation. Accepts 3 arguments: data[], index and prefabCount. Calls setPrefabData.

      Returns InstancedBufferAttribute

    • Sets data for a prefab at a given index. Usually called in a loop.

      Parameters

      • attribute: string | InstancedBufferAttribute

        The attribute or attribute name where the data is to be stored.

      • prefabIndex: number

        Index of the prefab in the buffer geometry.

      • data: any[]

        Array of data. Length should be equal to item size of the attribute.

      Returns void