Skip to content

Commit aa70e04

Browse files
committed
Added utility methods
1 parent 4975adb commit aa70e04

File tree

3 files changed

+88
-298
lines changed

3 files changed

+88
-298
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ Use `new ModelViewer(element)` to create a new viewer. `element` must be a DOM e
2525
Method | Description
2626
--------------- | ---------------------------------------------------------------------------------------------------------------------------------------------
2727
`.load(model)` | Loads a model in the viewer. `model` must be a `JsonModel` object.
28-
`.get(name)` | Retrieves the model with the name `name`.
28+
`.get(name)` | Returns the model with the name `name`.
29+
`.getAll()` | Returns an Array with all the loaded models.
2930
`.remove(name)` | Removes the model with the name `name`.
31+
`.removeAll()` | Removes all the loaded models.
3032
`.hide(name)` | Sets the `visible` property to `false` for the model with the name `name`.
33+
`.hideAll()` | Sets the `visible` property to `false` for all the loaded models.
3134
`.show(name)` | Sets the `visible` property to `true` for the model with the name `name`.
35+
`.showAll()` | Sets the `visible` property to `true` for all the loaded models.
3236
`.resize()` | Updates the size and the aspect ratio of the viewer. Usualy bound to the `resize` event of the `window` when the viewer takes the whole page.
37+
`.reset()` | Updates the size and the aspect ratio of the viewer. Usualy bound to the `resize` event of the `window` when the viewer takes the whole page.
3338

3439
### JsonModel(name, json, textures)
3540

0 commit comments

Comments
 (0)