IntAttribute

Per point integer data for Geometry.

Constructor

new L3D.IntAttribute()

Extends

Properties

Overrides:
data object

The data for the attribute, stored in a typed array.

Overrides:
dataType class

The class of the data of the attribute, such as Float32Array.

Overrides:
elementSize number

The number of components per logical element. A Vec3Attribute has an elementSize of 3, for example.

Overrides:
length number

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:
name String

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.

Parameters
count number
Returns
number

append(other)

Overrides:

Append the data from the given attribute to this attribute.

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

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

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

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

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

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

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

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