BufferGeometry

Core.BufferGeometry exported from @manycore/aholo-viewer.

Core Class

Type Parameters

  • T extends Topology = TriangleList

Hierarchy

Constructors

  • Type Parameters

    • T extends Topology = TriangleList

    Returns BufferGeometry<T>

Properties

name: string

The name of viewer, which could be empty.

type: string

The type of this instance. This will be give in extended class.

isBufferGeometry: boolean

Flag to indicate the type of this class. This value should not be changed by user.

parameters: {}

This object is used to record all parameters which are set when instance is initialized. But, change the value of this object may not change the geometry directly.

meshBVH?: MeshBVH

Use BVH to accelerate rendering. This value usually dose not need you to change it, it is built by the engine automatically.

_index: Nullable<IndexBufferAttribute>

Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
and works much the same as it does in Geometry: each triangle is associated with the indices of three vertices.
This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the renderer assumes that each three contiguous positions represent a single triangle.
This should be set by setIndex| setIndex() to avoid error.

attributes: { [index: string]: BufferAttribute<TypedArray> }

Core data of Geometry such as vertex positions, normals, UVs and color.

It's better to use addAttribute| addAttribute() or setAttribute| setAttribute() to change this.

See BufferAttribute for more details.

drawRange: BufferRange

Determines which part of buffer will be rendered.

__topologyMark: T
id: number
userData: Record<keyof any, any>
_uuid: any
uuid: string
_listeners: Map<Symbol, Listener<never>[]>

Accessors

  • get index(): IndexBufferAttribute

    Returns IndexBufferAttribute

  • set index(v: IndexBufferAttribute): void

    Parameters

    • v: IndexBufferAttribute

    Returns void

  • get businessTag(): string

    Returns string

  • set businessTag(v: string): void

    Parameters

    • v: string

    Returns void

Methods

  • get group at index

    Parameters

    • index: number

    Returns BufferGroup | undefined

  • Split the data into different groups.

    Parameters

    • group: BufferGroup
    • index: number

    Returns void

  • set entire groups

    Parameters

    • groups: BufferGroup[]

    Returns this

  • push a group

    Parameters

    • group: BufferGroup

    Returns this

  • Split geometry data to a new group.

    Parameters

    • start: number
    • count: number
    • materialIndex: number

    Returns void

    See groups| groups for more details.

  • Clean all objects in the groups| groups.

    Returns void

  • If boundingBox| boundingBox is null, it will be calculated a new one.

    Returns Box3

  • If boundingSphere| boundingSphere is null, it will be calculated a new one.

    Returns Sphere

  • Clear the bounding box and sphere and recalculate them later.

    Returns void

  • Generate a hash key according to index| index and all attributes| attributes.

    Returns string

  • The name of instance's class.

    Returns string

  • Clean old data of engine and load new data in next update.

    Returns void

  • Return current instance of this class.

    Returns this

  • Return current instance of this class.

    Returns this

  • Return the instance of index| index.

    Returns IndexBufferAttribute

  • Call this method to let engine refresh data of meshBVH.

    Returns void

  • Use this method to set new index| index for geometry.

    Parameters

    • index: TypedArray | number[] | IndexBufferAttribute

      source data of the index.

    Returns this

  • Parameters

    Returns this

  • Change the given attributes| attributes for geometry.

    Parameters

    Returns this

  • Get specified attributes| attributes from geometry.

    Parameters

    • name: string

      the name of target attributes.

    • array: TypedArray
    • itemSize: number

    Returns void

  • Parameters

    • name: string

    Returns BufferAttribute<TypedArray> | undefined

  • Remove specified attributes| attributes from geometry.

    Parameters

    • name: string

      the name of target attributes.

    Returns this

  • Parameters

    • name: string

    Returns this

  • Find the group which the vertex belong to.

    Parameters

    • index: number

      Queried vertex index.

    Returns { group: BufferGroup; groupIndex: number }

  • Change the value of drawRange.

    Parameters

    • start: number
    • count: number

    Returns void

  • Computes bounding box according to vertexes, updating boundingBox attribute. Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.

    Returns void

  • Computes bounding sphere according to vertexes, updating boundingSphere attribute. Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.

    Returns void

  • Copy the data to this object from source. This method need override in derived classes to copy extended data.

    Parameters

    • source: BufferGeometryBase

      the data source.

    Returns BufferGeometryBase

  • Parameters

    • geometry: Geometry

    Returns void

  • UUID of this BufferGeometries instance. This gets automatically assigned, so this shouldn't be edited.

    Returns string

  • Store the attributes of this class into string as serializing format.

    Parameters

    • ctx: Serializer

      this parameter has not supported external Serializer yet. It may cause that this method can not be used directly.

    Returns void

  • Parse the data for this class from string according to serializing format.

    Parameters

    • ctx: Deserializer

      this parameter has not supported external Deserializer yet. It may cause that this method can not be used directly.

    Returns void

  • Clear the current geometry's data in memory.

    Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Type Parameters

    • R extends Topology

    Returns BufferGeometry<R>

  • Returns void

  • Parameters

    • v: string

    Returns this

  • Returns boolean

  • Returns void

  • Adds a listener to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Only active the listener one times and then off it| it.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns boolean

  • Removes a listener from listening list.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Active the event and call the registered listener.

    Parameters

    • type: EventType<never>

    Returns void

  • Type Parameters

    • T

    Parameters

    • type: EventType<T>
    • payload: T

    Returns void

  • Removes all listeners from listening list.

    Returns void