Constructor Summary
| Public Constructor | ||
| public |
constructor(options: Object, element: HTMLElement) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
gui: * |
|
| 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 gui: * source
Public Methods
public render(layers: string[] | Object[], cb: function) source
Does the actual rendering
Params:
| Name | Type | Attribute | Description |
| layers | string[] | Object[] | Array of GUI layers - either strings or objects |
|
| layers[].texture | string | path to the layer's texture (starting at assets/minecraft/textures/), e.g. '/items/apple' |
|
| layers[].textureScale | number |
|
scale of the given texture, can be used to get different sized textures aligned proerly |
| layers[].uv | number[] |
|
[x1,y1,x2,y2] array UV mapping of the texture |
| layers[].pos | number[] |
|
[x,y] array position of the layer |
| cb | function |
|
Callback when rendering finished |
Reference
Source
