Constructor Summary
Public Constructor | ||
public |
constructor(options: Object, element: HTMLElement) |
Member Summary
Public Members | ||
public |
|
|
public |
models: *[] |
|
public |
|
Method Summary
Public Methods | ||
public |
Does the actual rendering |
Inherited Summary
From class Render | ||
public |
element: HTMLElement DOM Element to attach the renderer to |
|
public |
options: { Combined options |
|
public |
|
|
public |
addToScene(toAdd: *) Adds an object to the scene & sets userData.renderType to this renderer's type |
|
public |
clearScene(onlySelfType: *, filterFn: *) Clears the scene |
|
public |
dispose() |
|
public |
Export the current scene content in the .gltf format (geometries + textures) |
|
public |
|
|
public |
Export the current scene content in the .obj format (only geometries, no textures) |
|
public |
toPLY(exportOptions: *): * |
|
protected |
Initializes the scene |
Public Constructors
public constructor(options: Object, element: HTMLElement) source
Override:
Render#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options for this renderer, see defaultOptions |
options.assetRoot | string |
|
root to get asset files from |
element | HTMLElement |
|
DOM Element to attach the renderer to - defaults to document.body |
Public Members
public models: *[] source
Public Methods
public render(models: string[] | Object[], cb: function) source
Does the actual rendering
Params:
Name | Type | Attribute | Description |
models | string[] | Object[] | Array of models to render - Either strings in the format <block|item>/<model name> or objects |
|
models[].type | string |
|
either 'block' or 'item' |
models[].model | string | if 'type' is given, just the block/item name otherwise '<block|item>/<model name>' |
|
models[].offset | number[] |
|
[x,y,z] array of the offset |
models[].rotation | number[] |
|
[x,y,z] array of the rotation |
models[].blockstate | string |
|
name of a blockstate to be used to determine the models (only for blocks) |
models[].variant | string |
|
if 'blockstate' is given, the block variant to use |
cb | function |
|
Callback when rendering finished |