InstancedBufferAttribute
An instanced version of BufferAttribute .
Type Parameters
- T extends TypedArray = TypedArray
Hierarchy
- BufferAttribute<T>
- InstancedBufferAttribute
Constructors
constructor
- new InstancedBufferAttribute<T extends TypedArray = TypedArray>(
data: T,
itemSize: number,
meshPerAttribute?: number,
): InstancedBufferAttribute<T>Type Parameters
- T extends TypedArray = TypedArray
Parameters
- data: T
- itemSize: number
- meshPerAttribute: number
Returns InstancedBufferAttribute<T>
Overrides BufferAttribute.constructor
Properties
_ array
The geometry attribute data store as TypedArray.
Inherited from BufferAttribute._array
item Size
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
Inherited from BufferAttribute.itemSize
normalized
If attribute data is normalized.
Inherited from BufferAttribute.normalized
count
Stores the array's length divided by the itemSize.
If the buffer is storing a 3-component vector (such as a position, normal, or color),
then this will count the number of such vectors stored.
Inherited from BufferAttribute.count
dynamic
The data of this buffer always need update.
Inherited from BufferAttribute.dynamic
update Range
Object containing:
offset:Integer - Default is 0. Position at which to start update.
count:Integer - Default is -1, which means don't use update ranges.
This can be used to only update some components of stored vectors (for example, just the component related to color).
Inherited from BufferAttribute.updateRange
is Buffer Attribute
Used to check type of this or extended instance. This value should not be changed by user.
Inherited from BufferAttribute.isBufferAttribute
is Data Dropped
When the data is cleared from memory, this mark will be set true.
Inherited from BufferAttribute.isDataDropped
remove Data After Upload
Remove the data after it is uploaded to GPU memory.
Inherited from BufferAttribute.removeDataAfterUpload
version
A version number, incremented every time the needsUpdate property is set to true.
Inherited from BufferAttribute.version
on Update Callback
A callback function for updating. It will be called after needsUpdate.
Inherited from BufferAttribute.onUpdateCallback
on Upload Callback
A callback function for uploading. It will be called after the data uploaded to WebGL.
Inherited from BufferAttribute.onUploadCallback
mesh Per Attribute
Defines how often a value of this buffer attribute should be repeated. A value of one means that each value of the instanced attribute is used for a single instance. A value of two means that each value is used for two consecutive instances (and so on). Default is 1.
is Instanced Buffer Attribute
Used to check type of this or extended instance. This value should not be changed by user.
Readonlyuser Data
Inherited from BufferAttribute.userData
_ uuid
Inherited from BufferAttribute._uuid
uuid
Inherited from BufferAttribute.uuid
_ listeners
Inherited from BufferAttribute._listeners
Accessors
array
needs Update
- set needsUpdate(value: boolean): void
When this attribute is set to true, the version will be change.
Parameters
- value: boolean
Returns void
Inherited from BufferAttribute.needsUpdate
business Tag
- get businessTag(): string
Returns string
Inherited from BufferAttribute.businessTag
- set businessTag(v: string): void
Parameters
- v: string
Returns void
Inherited from BufferAttribute.businessTag
Methods
notify Content Change
Returns void
Inherited from BufferAttribute.notifyContentChange
set Array
set Dynamic
Change the state of dynamic.
Parameters
- value: boolean
Returns this
Inherited from BufferAttribute.setDynamic
copy At
Copy the data at specified position. The given index is items' index, do not need to multiply with item' size.
Parameters
- index1: number
the start position of this array.
- attribute: BufferAttribute
the start position of this array.
- index2: number
the start position of source array.
Returns this
Inherited from BufferAttribute.copyAt
- index1: number
copy Array
Copy the data from given array to this array.
Parameters
- array: TypedArray | number[]
the start position of this array.
Returns this
Inherited from BufferAttribute.copyArray
- array: TypedArray | number[]
copy Color Array
Copy the data from given array to this array.
Parameters
- colors: Color[]
the start position of this array.
Returns this
Inherited from BufferAttribute.copyColorArray
- colors: Color[]
copy Vector2 Array
Copy the data which is type of Vector2 from given array to this array.
Parameters
- vectors: Vector2[]
the start position of this array.
Returns this
Inherited from BufferAttribute.copyVector2Array
- vectors: Vector2[]
copy Vector3 Array
Copy the data which is type of Vector3 from given array to this array.
Parameters
- vectors: Vector3[]
the start position of this array.
Returns this
Inherited from BufferAttribute.copyVector3Array
- vectors: Vector3[]
copy Vector4 Array
Copy the data which is type of Vector4 from given array to this array.
Parameters
- vectors: Vector4[]
the start position of this array.
Returns this
Inherited from BufferAttribute.copyVector4Array
- vectors: Vector4[]
set
Copy the data from given Array or typedArray.
Parameters
- value: ArrayLike<number>
an Array or TypedArray from which to copy values.
- offset: number
(optional) index of the array at which to start copying.
Returns this
Inherited from BufferAttribute.set
- value: ArrayLike<number>
get X
Return the x component of all items.
Parameters
- index: number
Returns number
Inherited from BufferAttribute.getX
set X
Set the x component of the vector at the given index.
Parameters
- index: number
- x: number
Returns this
Inherited from BufferAttribute.setX
get Y
Return the y component of all vectors.
Parameters
- index: number
Returns number
Inherited from BufferAttribute.getY
set Y
Set the y component of the vector at the given index.
Parameters
- index: number
- y: number
Returns this
Inherited from BufferAttribute.setY
get Z
Return the z component of all vectors.
Parameters
- index: number
Returns number
Inherited from BufferAttribute.getZ
set Z
Set the z component of the vector at the given index.
Parameters
- index: number
- z: number
Returns this
Inherited from BufferAttribute.setZ
get W
Return the w component of all vectors.
Parameters
- index: number
Returns number
Inherited from BufferAttribute.getW
set W
Set the w component of the vector at the given index.
Parameters
- index: number
- w: number
Returns this
Inherited from BufferAttribute.setW
set XY
Set the x and y component of the vector at the given index.
Parameters
- index: number
- x: number
- y: number
Returns this
Inherited from BufferAttribute.setXY
set XYZ
Set the x , y and z component of the vector at the given index.
Parameters
- index: number
- x: number
- y: number
- z: number
Returns this
Inherited from BufferAttribute.setXYZ
set XYZW
Set all component of the vector at the given index.
Parameters
- index: number
- x: number
- y: number
- z: number
- w: number
Returns this
Inherited from BufferAttribute.setXYZW
get Vector2
Return the vector2 at specific position.
Parameters
- index: number
- out: Vector2
Returns Vector2
Inherited from BufferAttribute.getVector2
clone
destroy
Release the memory which is occupied by this instance from CPU and GPU.
Returns void
Inherited from BufferAttribute.destroy
free GPU
Returns void
Inherited from BufferAttribute.freeGPU
copy
Copy the data to this object from source.
Parameters
- source: InstancedBufferAttribute
the data source.
Returns this
Overrides BufferAttribute.copy
- source: InstancedBufferAttribute
mark Business Tag
is Destroyed
Returns boolean
Inherited from BufferAttribute.isDestroyed
validate
Returns void
Inherited from BufferAttribute.validate
destroy All Resources Owned
Returns void
Inherited from BufferAttribute.destroyAllResourcesOwned
free All Gpu Resource Owned
Returns void
Inherited from BufferAttribute.freeAllGpuResourceOwned
on
once
Only active the listener one times and then off it| it.
Type Parameters
- T
Returns void
Inherited from BufferAttribute.once
has
Checks if listener is added to an event type.
Type Parameters
- T
Returns boolean
Inherited from BufferAttribute.has
off
Removes a listener from listening list.
Type Parameters
- T
Returns void
Inherited from BufferAttribute.off
emit
Active the event and call the registered listener.
Parameters
- type: EventType<never>
Returns void
Inherited from BufferAttribute.emit
clear All Listeners
Removes all listeners from listening list.
Returns void
Inherited from BufferAttribute.clearAllListeners
An instanced version of BufferAttribute .