You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
49
-
50
-
#### Return Value
51
-
52
-
The first element of the given attribute value. (Type: number)
53
-
54
-
<aname='H3DU.BufferHelper_getVec'></a>
55
-
### H3DU.BufferHelper#getVec(a, index, vec)
56
-
57
-
Gets the elements of a vertex attribute value.
58
-
59
-
Note that currently, this method does no bounds checking beyond the
60
-
checking naturally done when accessing the attribute's buffer.
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
66
-
*`vec` (Type: Array.<number>)<br>An array whose elements will be set to those of the value at the given index. The number of elements copied to this array is the attribute's count per value (see <ahref="H3DU.BufferAccessor.md#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>).
67
-
68
-
#### Return Value
69
-
70
-
The parameter "vec". (Type: Array.<number>)
71
-
72
33
<aname='H3DU.BufferHelper_makeIndices'></a>
73
34
### H3DU.BufferHelper#makeIndices(numIndices)
74
35
@@ -120,41 +81,4 @@ of the semantic and semantic index, respectively, described in
120
81
the "name" and "index" parameters. Returns null if "name" is a string,
121
82
but doesn't describe a valid semantic. (Type: Array.<number>)
122
83
123
-
<aname='H3DU.BufferHelper_set'></a>
124
-
### H3DU.BufferHelper#set(a, index, value)
125
-
126
-
Sets the first element of the attribute value with the given vertex index.
127
-
128
-
Note that currently, this method does no bounds checking beyond the
129
-
checking naturally done when writing to the attribute's buffer.
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
135
-
*`value` (Type: number)<br>The number to set the first element to.
136
-
137
-
#### Return Value
138
-
139
-
This object. (Type: <ahref="H3DU.BufferHelper.md">H3DU.BufferHelper</a>)
140
-
141
-
<aname='H3DU.BufferHelper_setVec'></a>
142
-
### H3DU.BufferHelper#setVec(a, index, vec)
143
-
144
-
Sets the elements of a vertex attribute value.
145
-
146
-
Note that currently, this method does no bounds checking beyond the
147
-
checking naturally done when writing to the attribute's buffer, except
*`index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
154
-
*`vec` (Type: Array.<number>)<br>An array containing the elements to copy to the value at the given index. The number of elements copied is this array's length or the attribute's count per value (see <ahref="H3DU.BufferAccessor.md#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>), whichever is less.
<!DOCTYPE html><html><head><metacharset=utf-8><title>H3DU.BufferHelper</title></head><body><h1> H3DU.BufferHelper</h1><p><ahref='index.html'>Back to documentation index.</a></p><aname='H3DU.BufferHelper'></a>
2
-
<h3> H3DU.BufferHelper()</h3>A helper class for accessing and setting data in vertex attributes.<p><h3> Methods</h3><ul><li><ahref='#H3DU.BufferHelper_copy'>copy</a><br>Copies the values of a vertex attribute into a new vertex attribute object.<li><ahref='#H3DU.BufferHelper_get'>get</a><br>Gets the first element of the attribute value with the given vertex index.<li><ahref='#H3DU.BufferHelper_getVec'>getVec</a><br>Gets the elements of a vertex attribute value.<li><ahref='#H3DU.BufferHelper_makeIndices'>makeIndices</a><br>Generates an array of increasing vertex indices<li><ahref='#H3DU.BufferHelper_merge'>merge</a><br>Merges two vertex attributes, whose vertices can be indexed differently, into one
2
+
<h3> H3DU.BufferHelper()</h3>A helper class for accessing and setting data in vertex attributes.<p><h3> Methods</h3><ul><li><ahref='#H3DU.BufferHelper_copy'>copy</a><br>Copies the values of a vertex attribute into a new vertex attribute object.<li><ahref='#H3DU.BufferHelper_makeIndices'>makeIndices</a><br>Generates an array of increasing vertex indices<li><ahref='#H3DU.BufferHelper_merge'>merge</a><br>Merges two vertex attributes, whose vertices can be indexed differently, into one
3
3
combined vertex attribute.<li><ahref='#H3DU.BufferHelper_resolveSemantic'>resolveSemantic</a><br>Resolves an attribute semantic and semantic index, which
4
4
may optionally be given as a string instead, into two numbers giving
5
-
the semantic and index.<li><ahref='#H3DU.BufferHelper_set'>set</a><br>Sets the first element of the attribute value with the given vertex index.<li><ahref='#H3DU.BufferHelper_setVec'>setVec</a><br>Sets the elements of a vertex attribute value.</ul><aname='H3DU.BufferHelper_copy'></a>
6
-
<h3> H3DU.BufferHelper#copy(attr)</h3>Copies the values of a vertex attribute into a new vertex attribute object.<h4> Parameters</h4><ul><li><code>attr</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.</ul><h4> Return Value</h4>A copy of the vertex attribute object. (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<aname='H3DU.BufferHelper_get'></a>
7
-
<h3> H3DU.BufferHelper#get(a, index)</h3>Gets the first element of the attribute value with the given vertex index.
8
-
<p>Note that currently, this method does no bounds checking beyond the
9
-
checking naturally done when accessing the attribute's buffer.<h4> Parameters</h4><ul><li><code>a</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.<li><code>index</code> (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.</ul><h4> Return Value</h4>The first element of the given attribute value. (Type: number)<aname='H3DU.BufferHelper_getVec'></a>
10
-
<h3> H3DU.BufferHelper#getVec(a, index, vec)</h3>Gets the elements of a vertex attribute value.<p>
11
-
Note that currently, this method does no bounds checking beyond the
12
-
checking naturally done when accessing the attribute's buffer.<h4> Parameters</h4><ul><li><code>a</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.<li><code>index</code> (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.<li><code>vec</code> (Type: Array.<number>)<br>An array whose elements will be set to those of the value at the given index. The number of elements copied to this array is the attribute's count per value (see <ahref="H3DU.BufferAccessor.html#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>).</ul><h4> Return Value</h4>The parameter "vec". (Type: Array.<number>)<aname='H3DU.BufferHelper_makeIndices'></a>
5
+
the semantic and index.</ul><aname='H3DU.BufferHelper_copy'></a>
6
+
<h3> H3DU.BufferHelper#copy(attr)</h3>Copies the values of a vertex attribute into a new vertex attribute object.<h4> Parameters</h4><ul><li><code>attr</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.</ul><h4> Return Value</h4>A copy of the vertex attribute object. (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<aname='H3DU.BufferHelper_makeIndices'></a>
13
7
<h3> H3DU.BufferHelper#makeIndices(numIndices)</h3>Generates an array of increasing vertex indices<h4> Parameters</h4><ul><li><code>numIndices</code> (Type: number)<br>The number of vertex indices to generate. The array will range from 0 to the number of vertex indices minus 1.</ul><h4> Return Value</h4>An array of vertex indices. (Type: Uint16Array | Uint32Array)<aname='H3DU.BufferHelper_merge'></a>
14
8
<h3> H3DU.BufferHelper#merge(attr1, indices1, attr2, indices2)</h3>Merges two vertex attributes, whose vertices can be indexed differently, into one
15
9
combined vertex attribute.<h4> Parameters</h4><ul><li><code>attr1</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor for the first vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.<li><code>indices1</code> (Type: Array.<number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the first vertex attribute.<li><code>attr2</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor for the second vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.<li><code>indices2</code> (Type: Array.<number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the second vertex attribute.</ul><h4> Return Value</h4>The merged attribute, where the vertices from the first vertex
@@ -20,11 +14,4 @@ <h3> H3DU.BufferHelper#resolveSemantic(name, [index])</h3>Resolves an attribute
20
14
the semantic and index.<h4> Parameters</h4><ul><li><code>name</code> (Type: number | string)<br>An attribute semantic, such as <ahref="H3DU.Semantic.html#H3DU.Semantic.POSITION">H3DU.Semantic.POSITION</a>, "POSITION", or "TEXCOORD_0". Throws an error if this value is a string and the string is invalid.<li><code>index</code> (Type: number) (optional)<br>The set index of the attribute for the given semantic. 0 is the first index of the attribute, 1 is the second, and so on. This is ignored if "name" is a string. Otherwise, if this value is null, undefined, or omitted, the default is 0.</ul><h4> Return Value</h4>A two-element array consisting
21
15
of the semantic and semantic index, respectively, described in
22
16
the "name" and "index" parameters. Returns null if "name" is a string,
23
-
but doesn't describe a valid semantic. (Type: Array.<number>)<aname='H3DU.BufferHelper_set'></a>
24
-
<h3> H3DU.BufferHelper#set(a, index, value)</h3>Sets the first element of the attribute value with the given vertex index.
25
-
<p>Note that currently, this method does no bounds checking beyond the
26
-
checking naturally done when writing to the attribute's buffer.<h4> Parameters</h4><ul><li><code>a</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.<li><code>index</code> (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.<li><code>value</code> (Type: number)<br>The number to set the first element to.</ul><h4> Return Value</h4>This object. (Type: <ahref="H3DU.BufferHelper.html">H3DU.BufferHelper</a>)<aname='H3DU.BufferHelper_setVec'></a>
27
-
<h3> H3DU.BufferHelper#setVec(a, index, vec)</h3>Sets the elements of a vertex attribute value.<p>
28
-
Note that currently, this method does no bounds checking beyond the
29
-
checking naturally done when writing to the attribute's buffer, except
30
-
where noted otherwise.<h4> Parameters</h4><ul><li><code>a</code> (Type: <ahref="H3DU.BufferAccessor.html">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.<li><code>index</code> (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.<li><code>vec</code> (Type: Array.<number>)<br>An array containing the elements to copy to the value at the given index. The number of elements copied is this array's length or the attribute's count per value (see <ahref="H3DU.BufferAccessor.html#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>), whichever is less.</ul><h4> Return Value</h4>This object. (Type: BufferHelper)<p><ahref='index.html'>Back to documentation index.</a></p></body></html>
17
+
but doesn't describe a valid semantic. (Type: Array.<number>)<p><ahref='index.html'>Back to documentation index.</a></p></body></html>
0 commit comments