Constructor
new L3D.Vec2Attribute()
Extends
Properties
- Overrides:
The data for the attribute, stored in a typed array.
- Overrides:
The class of the data of the attribute, such as Float32Array.
- Overrides:
The number of components per logical element. A Vec3Attribute has an elementSize of 3, for example.
- Overrides:
The number of logical elements in the attribute. Some attribute types, such as Vec3Attribute, store data in a Float32Array array, but have more than one component for each element (3, in the case of Vec3Attribute).
- Overrides:
The name of the attribute. There are standard names for common attributes, such as P for positions, N for normals.
Methods
addElements(count) → number
- Overrides:
Add the given number of elements to the end of this attribute.
count |
number |
- number
append(other)
- Overrides:
Append the data from the given attribute to this attribute.
other |
GeometryAttribute |
clear()
- Overrides:
Delete all of the data from this attribute.
clone() → GeometryAttribute
- Overrides:
Create a copy of this attribute. The copy is a shallow copy, so it will share the same data buffer unless it is modified.
- GeometryAttribute
The copy of this attribute.
copy(other)
- Overrides:
Perform a shallow copy of the given attributes data to this attribute. A shallow copy has the two attributes share the same data buffer, but if one of the attributes is modified, then the data is duplicated at that time. This allows geometry structures to be copied without imposing higher memory usage for the attributes that don't change.
other |
GeometryAttribute | The attribute to copy. |
copyFrom(other, start)
- Overrides:
Copy the data from the given attribute into this attribute, starting at the given offset.
other |
GeometryAttribute | The attribute to copy |
|
start |
number |
0
|
The offset in the other attribute to start copying |
copyRange(srcStart, srcEnd, destStart, srcData, destData)
- Overrides:
Copy a range of elements from other to self.
srcStart |
number | First index of other to copy |
srcEnd |
number | Last index of other to copy |
destStart |
number | Offset into self to copy into |
srcData |
TypedArray | The data to copy to |
destData |
TypedArray | The data to copy from |
fillRange(value, start, count)
- Overrides:
Set all elements within the given range to the given value.
value |
* | The value to set. This should have the same number of components as the attribute. |
start |
number | The starting index |
count |
number | The number of elements to set. If not given, all elements from index to the end of the attribute are set. |
invalidateDisplay()
- Overrides:
Invalidate any display GL buffers referring to this attribute.
makeMutable()
- Overrides:
If the attribute is non-mutable, meaning it was shallow copied from another attribute, then make it mutable by duplicating the data.
removeRange(index, count)
- Overrides:
Remove a range of elements from this attribute.
index |
number | |
count |
number | The number of elements to remove. If not given, all elements after index will be removed. |
resize(newLength)
- Overrides:
Change the number of elements in this attribute.
newLength |
number | The new number of elements. If more than the current length, elements will be added; otherwise elements will be removed. |
zero()
- Overrides:
Set all of the data in this attribute to 0.