Extends
Classes
Members
# __uid__ :number
- Source:
- Inherited From:
Type:
- number
# attributes :Object.<string, clay.GeometryBase.Attribute>
- Source:
Attributes of geometry.
Type:
- Object.<string, clay.GeometryBase.Attribute>
# dynamic :boolean
- Source:
Is vertices data dynamically updated. Attributes value can't be changed after first render if dyanmic is false.
Type:
- boolean
# indices :Uint16Array|Uint32Array
- Source:
Indices of geometry.
Type:
- Uint16Array | Uint32Array
# mainAttribute :string
- Source:
Main attribute will be used to count vertex number
Type:
- string
# (nullable) pick :function
- Source:
User defined picking algorithm instead of default triangle ray intersection x, y are NDC.
(x, y, renderer, camera, renderable, out) => boolean
Type:
- function
# (nullable) pickByRay :function
- Source:
User defined ray picking algorithm instead of default triangle ray intersection
(ray: clay.Ray, renderable: clay.Renderable, out: Array) => boolean
Type:
- function
# (readonly) triangleCount :number
- Source:
Type:
- number
# (readonly) vertexCount :number
- Source:
Type:
- number
Methods
# after(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('after' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# before(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('before' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# createAttribute(name, type, size, semanticopt)
- Source:
Create a new attribute
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
type |
string | ||
size |
number | ||
semantic |
string |
<optional> |
# dirty()
- Source:
Mark attributes and indices in geometry needs to update. Usually called after you change the data in attributes.
# dirtyAttribute(attrNameopt)
- Source:
Mark the attributes needs to update.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
attrName |
string |
<optional> |
# dirtyIndices()
- Source:
Mark the indices needs to update.
# dispose(renderer)
- Source:
Dispose geometry data in GL context.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
clay.Renderer |
# error(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('error')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# getAttribute(name) → {clay.GeometryBase.Attribute}
- Source:
Get attribute
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
Returns:
# getEnabledAttributes() → {Array.<string>}
- Source:
Get enabled attributes name list Attribute which has the same vertex number with position is treated as a enabled attribute
Returns:
- Type
- Array.<string>
# getTriangleIndices(idx, out) → {Array.<number>}
- Source:
Get indices of triangle at given index.
Parameters:
Name | Type | Description |
---|---|---|
idx |
number | |
out |
Array.<number> |
Returns:
- Type
- Array.<number>
# has(name, action) → {boolean}
- Source:
- Inherited From:
- Mixes In:
If registered the event handler
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
action |
function |
Returns:
- Type
- boolean
# initIndicesFromArray(array)
- Source:
Initialize indices from an array.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array |
# off(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Remove event listener
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# on(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event handler
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# once(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event, event will only be triggered once and then removed
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# removeAttribute(name)
- Source:
Remove attribute
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
# setTriangleIndices(idx, arr)
- Source:
Set indices of triangle at given index.
Parameters:
Name | Type | Description |
---|---|---|
idx |
number | |
arr |
Array.<number> |
# success(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('success')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# trigger(name)
- Source:
- Inherited From:
- Mixes In:
Trigger event
Parameters:
Name | Type | Description |
---|---|---|
name |
string |