Constructor
new World(container)
Parameters:
| Name | Type | Description |
|---|---|---|
container |
HTMLDivElement | Append the Scene to this container |
Methods
(async) init(spinner)
You need to call this method to initialize the world. It will create all the objects and add them to the scene.
Parameters:
| Name | Type | Description |
|---|---|---|
spinner |
HTMLElement | The spinner will be hidden after the world is initialized |
render()
This method is called every frame from the loop. It is used to update the camera position and interactions with other objects.
It also update the animation of the water.
setText(text)
Sets the text of the interaction text
Parameters:
| Name | Type | Description |
|---|---|---|
text |
String | Anzuzeigender Text |
start()
Starts the loop for animating the scene
stop()
Stops the loop for animating the scene
toggleStats()
Toggle the stats for the threejs canvas