InstancedBufferAttribute
An instanced version of BufferAttribute.
An instanced version of BufferAttribute.
Extends
Type Parameters
T
T extends TypedArray = TypedArray
Constructors
Constructor
new InstancedBufferAttribute<
T>(data,itemSize,meshPerAttribute?):InstancedBufferAttribute<T>
Parameters
data
T
itemSize
number
meshPerAttribute?
number
Returns
InstancedBufferAttribute<T>
Overrides
Properties
_array
_array:
T
The geometry attribute data store as TypedArray.
Inherited from
itemSize
itemSize:
number
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
normalized
normalized:
boolean
If attribute data is normalized.
Inherited from
count
count:
number
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
dynamic
dynamic:
boolean
The data of this buffer always need update.
Deprecated
will not take effect, update attribute.array if need to reupload
Inherited from
updateRange
updateRange:
object
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).
offset
offset:
number
count
count:
number
Deprecated
will not take effect, update attribute.array instead
Inherited from
isBufferAttribute
isBufferAttribute:
boolean
Used to check type of this or extended instance. This value should not be changed by user.
Inherited from
BufferAttribute.isBufferAttribute
isDataDropped
isDataDropped:
boolean
When the data is cleared from memory, this mark will be set true.
Deprecated
never updated, always false.
Inherited from
removeDataAfterUpload
removeDataAfterUpload:
boolean
Remove the data after it is uploaded to GPU memory.
Deprecated
will not take effect
Inherited from
BufferAttribute.removeDataAfterUpload
version
version:
number
A version number, incremented every time the needsUpdate property is set to true.
Inherited from
onUpdateCallback
onUpdateCallback: () =>
void
A callback function for updating. It will be called after needsUpdate.
Returns
void
Inherited from
BufferAttribute.onUpdateCallback
onUploadCallback
onUploadCallback: () =>
void
A callback function for uploading. It will be called after the data uploaded to WebGL.
Returns
void
Inherited from
BufferAttribute.onUploadCallback
meshPerAttribute
meshPerAttribute:
number
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.
isInstancedBufferAttribute
isInstancedBufferAttribute:
boolean
Used to check type of this or extended instance. This value should not be changed by user.
userData
readonlyuserData:Record<keyofany,any>
Inherited from
_uuid
_uuid:
any
Inherited from
uuid
uuid:
string
Inherited from
_listeners
_listeners:
Map<Symbol,Listener<never>[]>
Inherited from
Accessors
array
Get Signature
get array():
T
The geometry attribute data store as TypedArray.
Returns
T
Set Signature
set array(
v):void
Parameters
v
T
Returns
void
Inherited from
needsUpdate
Set Signature
set needsUpdate(
value):void
When this attribute is set to true, the version will be change.
Parameters
value
boolean
Returns
void
Inherited from
businessTag
Get Signature
get businessTag():
string
Returns
string
Set Signature
set businessTag(
v):void
Parameters
v
string
Returns
void
Inherited from
Methods
notifyContentChange()
notifyContentChange():
void
Returns
void
Inherited from
BufferAttribute.notifyContentChange
setArray()
setArray(
array):this
Change the data of array.
Parameters
array
T
Returns
this
Inherited from
setDynamic()
setDynamic(
value):this
Change the state of dynamic.
Parameters
value
boolean
Returns
this
Inherited from
copyAt()
copyAt(
index1,attribute,index2):this
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
the start position of this array.
index2
number
the start position of source array.
Returns
this
Inherited from
copyArray()
copyArray(
array):this
Copy the data from given array to this array.
Parameters
array
TypedArray | number[]
the start position of this array.
Returns
this
Inherited from
copyColorArray()
copyColorArray(
colors):this
Copy the data from given array to this array.
Parameters
colors
Color[]
the start position of this array.
Returns
this
Inherited from
BufferAttribute.copyColorArray
copyVector2Array()
copyVector2Array(
vectors):this
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
copyVector3Array()
copyVector3Array(
vectors):this
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
copyVector4Array()
copyVector4Array(
vectors):this
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
set()
set(
value,offset?):this
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
getX()
getX(
index):number
Return the x component of all items.
Parameters
index
number
Returns
number
Inherited from
setX()
setX(
index,x):this
Set the x component of the vector at the given index.
Parameters
index
number
x
number
Returns
this
Inherited from
getY()
getY(
index):number
Return the y component of all vectors.
Parameters
index
number
Returns
number
Inherited from
setY()
setY(
index,y):this
Set the y component of the vector at the given index.
Parameters
index
number
y
number
Returns
this
Inherited from
getZ()
getZ(
index):number
Return the z component of all vectors.
Parameters
index
number
Returns
number
Inherited from
setZ()
setZ(
index,z):this
Set the z component of the vector at the given index.
Parameters
index
number
z
number
Returns
this
Inherited from
getW()
getW(
index):number
Return the w component of all vectors.
Parameters
index
number
Returns
number
Inherited from
setW()
setW(
index,w):this
Set the w component of the vector at the given index.
Parameters
index
number
w
number
Returns
this
Inherited from
setXY()
setXY(
index,x,y):this
Set the x and y component of the vector at the given index.
Parameters
index
number
x
number
y
number
Returns
this
Inherited from
setXYZ()
setXYZ(
index,x,y,z):this
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
setXYZW()
setXYZW(
index,x,y,z,w):this
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
getVector2()
getVector2(
index,out?):Vector2
Return the vector2 at specific position.
Parameters
index
number
out?
Returns
Inherited from
clone()
clone():
BufferAttribute<T>
Return a clone of this object.
Returns
Inherited from
destroy()
destroy():
void
Release the memory which is occupied by this instance from CPU and GPU.
Returns
void
Inherited from
freeGPU()
freeGPU():
void
Returns
void
Inherited from
copy()
copy(
source):this
Copy the data to this object from source.
Parameters
source
InstancedBufferAttribute
the data source.
Returns
this
Overrides
markBusinessTag()
markBusinessTag(
v):this
Parameters
v
string
Returns
this
Inherited from
BufferAttribute.markBusinessTag
isDestroyed()
isDestroyed():
boolean
Returns
boolean
Inherited from
validate()
validate():
void
Returns
void
Inherited from
destroyAllResourcesOwned()
destroyAllResourcesOwned():
void
Returns
void
Inherited from
BufferAttribute.destroyAllResourcesOwned
freeAllGpuResourceOwned()
freeAllGpuResourceOwned():
void
Returns
void
Inherited from
BufferAttribute.freeAllGpuResourceOwned
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
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
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
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
emit()
Call Signature
emit(
type):void
Active the event and call the registered listener.
Parameters
type
EventType<never>
Returns
void
Inherited from
Call Signature
emit<
T>(type,payload):void
Type Parameters
T
T
Parameters
type
EventType<T>
payload
T
Returns
void
Inherited from
clearAllListeners()
clearAllListeners():
void
Removes all listeners from listening list.
Returns
void