Find all nodes with the given validator. By default, the first argument accepts a string
that is used to find the first node with the matching name
value. For more advanced
queries, you can provide a function to validate any property to find the desired node.
- Source:
Example
// returns an array of child nodes under `Cube_1` with the `name` being `Cube_1`
$$$
.find('Cube_1')
.findAll('Cube_1');
// returns an array of child nodes under `Cube_1` with the `name` containing the word `Cube`
$$$
.find('Cube_1')
.findAll(node => ~node.name.indexOf('Cube'));
Parameters:
Name | Type | Description |
---|---|---|
name |
string | function | Either a |
Returns:
- An array of matching nodes.
- Type
- Array.<node>
- Source:
Example
// returns an array of nodes with the `name` being `Cube_1`
$$$.findAll('Cube_1');
// returns an array of nodes with the `name` containing the word `Cube`
$$$.findAll(node => ~node.name.indexOf('Cube'));
// returns an array of nodes with geometry type being 'PlaneBufferGeometry'
$$$.findAll(node => node.geometry.type === 'PlaneBufferGeometry');
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | function | Either a |
||
root |
object |
<optional> |
scene
|
The parent node to traverse the scene. By |
Returns:
- An array of matching nodes.
- Type
- Array.<node>