BufferGeometry

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

Core Class

Extends

  • BufferGeometryBase

Extended by

Type Parameters

T

T extends Topology = TriangleList

Constructors

Constructor

new BufferGeometry<T>(): BufferGeometry<T>

Returns

BufferGeometry<T>

Inherited from

BufferGeometryBase.constructor

Properties

name

name: string

The name of viewer, which could be empty.

Inherited from

BufferGeometryBase.name


type

type: string

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

Inherited from

BufferGeometryBase.type


isBufferGeometry

isBufferGeometry: boolean

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

Inherited from

BufferGeometryBase.isBufferGeometry


parameters

parameters: object

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.

Inherited from

FatLineBufferGeometry.parameters


meshBVH?

optional meshBVH?: MeshBVH

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

Inherited from

BufferGeometryBase.meshBVH


_index

_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.

Default Value

null

Inherited from

BufferGeometryBase._index


attributes

attributes: object

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

Index Signature

[index: string]: BufferAttribute<TypedArray>

Tips

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

Remarks

See BufferAttribute for more details.

Inherited from

BufferGeometryBase.attributes


drawRange

drawRange: BufferRange

Determines which part of buffer will be rendered.

Deprecated

Default Value

{ start: 0, count: Infinity } All data will be uploaded.

Inherited from

BufferGeometryBase.drawRange


__topologyMark

__topologyMark: T


id

id: number

Inherited from

BufferGeometryBase.id


userData

readonly userData: Record<keyof any, any>

Inherited from

BufferGeometryBase.userData


_uuid

_uuid: any

Inherited from

BufferGeometryBase._uuid


uuid

uuid: string

Inherited from

BufferGeometryBase.uuid


_listeners

_listeners: Map<Symbol, Listener<never>[]>

Inherited from

BufferGeometryBase._listeners

Accessors

index

Get Signature

get index(): IndexBufferAttribute

Returns

IndexBufferAttribute

Set Signature

set index(v): void

Parameters
v

IndexBufferAttribute

Returns

void

Inherited from

BufferGeometryBase.index


position

Get Signature

get position(): BufferAttribute<TypedArray>

Returns

BufferAttribute<TypedArray>

Inherited from

BufferGeometryBase.position


uv

Get Signature

get uv(): BufferAttribute<TypedArray>

Returns

BufferAttribute<TypedArray>

Inherited from

BufferGeometryBase.uv


businessTag

Get Signature

get businessTag(): string

Returns

string

Set Signature

set businessTag(v): void

Parameters
v

string

Returns

void

Inherited from

BufferGeometryBase.businessTag

Methods

getGroup()

getGroup(index): BufferGroup | undefined

get group at index

Parameters

index

number

Returns

BufferGroup | undefined

Inherited from

BufferGeometryBase.getGroup


setGroup()

setGroup(group, index): void

Split the data into different groups.

Parameters

group

BufferGroup

index

number

Returns

void

Inherited from

BufferGeometryBase.setGroup


setGroups()

setGroups(groups): this

set entire groups

Parameters

groups

BufferGroup[]

Returns

this

Inherited from

BufferGeometryBase.setGroups


pushGroup()

pushGroup(group): this

push a group

Parameters

group

BufferGroup

Returns

this

Inherited from

BufferGeometryBase.pushGroup


addGroup()

addGroup(start, count, materialIndex?): void

Split geometry data to a new group.

Parameters

start

number

count

number

materialIndex?

number

Returns

void

Remarks

See groups| groups for more details.

Inherited from

BufferGeometryBase.addGroup


clearGroups()

clearGroups(): void

Clean all objects in the groups| groups.

Returns

void

Inherited from

BufferGeometryBase.clearGroups


getBoundingBox()

getBoundingBox(): Box3

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

Returns

Box3

Inherited from

BufferGeometryBase.getBoundingBox


getBoundingSphere()

getBoundingSphere(): Sphere

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

Returns

Sphere

Inherited from

BufferGeometryBase.getBoundingSphere


notifyShapeChanged()

notifyShapeChanged(): void

Clear the bounding box and sphere and recalculate them later.

Returns

void

Inherited from

BufferGeometryBase.notifyShapeChanged


getAttributeLayoutKey()

getAttributeLayoutKey(): string

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

Returns

string

Inherited from

BufferGeometryBase.getAttributeLayoutKey


className()

className(): string

The name of instance’s class.

Returns

string

Inherited from

BufferGeometryBase.className


attributeChanged()

attributeChanged(): void

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

Returns

void

Inherited from

BufferGeometryBase.attributeChanged


getBufferGeometry()

getBufferGeometry(): this

Return current instance of this class.

Returns

this

Inherited from

BufferGeometryBase.getBufferGeometry


getLineBufferGeometry()

getLineBufferGeometry(): this

Return current instance of this class.

Returns

this

Inherited from

BufferGeometryBase.getLineBufferGeometry


getIndex()

getIndex(): IndexBufferAttribute

Return the instance of index| index.

Returns

IndexBufferAttribute

Inherited from

BufferGeometryBase.getIndex


onAttributeUpdate()

onAttributeUpdate(): void

Call this method to let engine refresh data of meshBVH.

Returns

void

Inherited from

BufferGeometryBase.onAttributeUpdate


setIndex()

setIndex(index): this

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

Parameters

index

TypedArray | number[] | IndexBufferAttribute

source data of the index.

Returns

this

Inherited from

BufferGeometryBase.setIndex


addAttribute()

addAttribute(name, attribute): this

Parameters

name

string

attribute

BufferAttribute

Returns

this

Inherited from

BufferGeometryBase.addAttribute


setAttribute()

setAttribute(name, attribute): this

Change the given attributes| attributes for geometry.

Parameters

name

string

the name of data such as position, uv and normal.

attribute

BufferAttribute

source data. see BufferAttribute for more details.

Returns

this

Inherited from

BufferGeometryBase.setAttribute


addOrSetAttribute()

addOrSetAttribute(name, array, itemSize): void

Get specified attributes| attributes from geometry.

Parameters

name

string

the name of target attributes.

array

TypedArray

itemSize

number

Returns

void

Inherited from

BufferGeometryBase.addOrSetAttribute


getAttribute()

getAttribute(name): BufferAttribute<TypedArray> | undefined

Parameters

name

string

Returns

BufferAttribute<TypedArray> | undefined

Inherited from

BufferGeometryBase.getAttribute


removeAttribute()

removeAttribute(name): this

Remove specified attributes| attributes from geometry.

Parameters

name

string

the name of target attributes.

Returns

this

Inherited from

BufferGeometryBase.removeAttribute


removeAndDestroyAttribute()

removeAndDestroyAttribute(name): this

Parameters

name

string

Returns

this

Inherited from

BufferGeometryBase.removeAndDestroyAttribute


getGroupByVertexIndex()

getGroupByVertexIndex(index): object

Find the group which the vertex belong to.

Parameters

index

number

Queried vertex index.

Returns

object

group

group: BufferGroup

groupIndex

groupIndex: number

Inherited from

BufferGeometryBase.getGroupByVertexIndex


setDrawRange()

setDrawRange(start, count): void

Change the value of drawRange.

Parameters

start

number

count

number

Returns

void

Deprecated

Inherited from

BufferGeometryBase.setDrawRange


computeBoundingBox()

computeBoundingBox(): 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

Inherited from

BufferGeometryBase.computeBoundingBox


computeBoundingSphere()

computeBoundingSphere(): 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

Inherited from

BufferGeometryBase.computeBoundingSphere


copy()

copy(source): BufferGeometryBase

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

Inherited from

BufferGeometryBase.copy


_computeGroups()

_computeGroups(geometry): void

Parameters

geometry

Geometry

Returns

void

Inherited from

BufferGeometryBase._computeGroups


getUUID()

getUUID(): string

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

Returns

string

Inherited from

BufferGeometryBase.getUUID


serialize()

serialize(ctx): void

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

Inherited from

BufferGeometryBase.serialize


deserialize()

deserialize(ctx): 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

Inherited from

BufferGeometryBase.deserialize


freeGPU()

freeGPU(): void

Clear the current geometry’s data in memory.

Returns

void

Inherited from

BufferGeometryBase.freeGPU


destroy()

destroy(): void

Returns

void

Inherited from

BufferGeometryBase.destroy


destroyAttributes()

destroyAttributes(): void

Returns

void

Inherited from

BufferGeometryBase.destroyAttributes


freeAttributesGpuResource()

freeAttributesGpuResource(): void

Returns

void

Inherited from

BufferGeometryBase.freeAttributesGpuResource


destroyAllResourcesOwned()

destroyAllResourcesOwned(): void

Returns

void

Inherited from

BufferGeometryBase.destroyAllResourcesOwned


freeAllGpuResourceOwned()

freeAllGpuResourceOwned(): void

Returns

void

Inherited from

BufferGeometryBase.freeAllGpuResourceOwned


forceCastTopology()

forceCastTopology<R>(): BufferGeometry<R>

Type Parameters

R

R extends Topology

Returns

BufferGeometry<R>

Inherited from

BufferGeometryBase.forceCastTopology


clone()

clone(): BufferGeometry<T>

Create a clone of this instance.

Returns

BufferGeometry<T>

Overrides

BufferGeometryBase.clone


notifyGeometryContentChange()

notifyGeometryContentChange(): void

Returns

void

Inherited from

BufferGeometryBase.notifyGeometryContentChange


markBusinessTag()

markBusinessTag(v): this

Parameters

v

string

Returns

this

Inherited from

BufferGeometryBase.markBusinessTag


isDestroyed()

isDestroyed(): boolean

Returns

boolean

Inherited from

BufferGeometryBase.isDestroyed


validate()

validate(): void

Returns

void

Inherited from

BufferGeometryBase.validate


on()

on<T>(_type, _listener): void

Adds a listener to an event type.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

BufferGeometryBase.on


once()

once<T>(_type, _listener): void

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

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

BufferGeometryBase.once


has()

has<T>(_type, _listener): boolean

Checks if listener is added to an event type.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

boolean

Inherited from

BufferGeometryBase.has


off()

off<T>(_type, _listener): void

Removes a listener from listening list.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

BufferGeometryBase.off


emit()

Call Signature

emit(type): void

Active the event and call the registered listener.

Parameters
type

EventType<never>

Returns

void

Inherited from

BufferGeometryBase.emit

Call Signature

emit<T>(type, payload): void

Type Parameters
T

T

Parameters
type

EventType<T>

payload

T

Returns

void

Inherited from

BufferGeometryBase.emit


clearAllListeners()

clearAllListeners(): void

Removes all listeners from listening list.

Returns

void

Inherited from

BufferGeometryBase.clearAllListeners