Home Reference Source
public class | source

Scene

Extends:

three~EventDispatcher → Scene

The Scene is a manager of Items and also links to a ThreeJS scene.

Constructor Summary

Public Constructor
public

constructor(model: *, textureDir: *)

Constructs a scene.

Member Summary

Public Members
public
public
public
public
public

items: *[]

public

loader: *

public

model: *

public
public
public

scene: *

public

Method Summary

Public Methods
public

add(mesh: *)

Adds a non-item, basically a mesh, to the scene.

public

addItem(itemType: *, fileName: *, metadata: *, position: *, rotation: *, scale: *, fixed: *, newItemDefinitions: *)

Creates an item and adds it to the scene.

public

Removes all items.

public

getItems(): *

Gets the items.

public

getScene(): *

Gets the scene.

public

itemCount(): *

Gets the count of items.

public

remove(mesh: *)

Removes a non-item, basically a mesh, from the scene.

public

removeItem(item: *, dontRemove: *)

Removes an item.

public

switchWireframe(flag: *)

Public Constructors

public constructor(model: *, textureDir: *) source

Constructs a scene.

Params:

NameTypeAttributeDescription
model *

The associated model.

textureDir *

The directory from which to load the textures.

Public Members

public gltfloader: * source

public itemLoadedCallbacks: * source

public itemLoadingCallbacks: * source

public itemRemovedCallbacks: * source

public items: *[] source

public loader: * source

public model: * source

public needsUpdate: boolean source

public objloader: * source

public scene: * source

public textureDir: * source

Public Methods

public add(mesh: *) source

Adds a non-item, basically a mesh, to the scene.

Params:

NameTypeAttributeDescription
mesh *

The mesh to be added.

public addItem(itemType: *, fileName: *, metadata: *, position: *, rotation: *, scale: *, fixed: *, newItemDefinitions: *) source

Creates an item and adds it to the scene.

Params:

NameTypeAttributeDescription
itemType *

The type of the item given by an enumerator.

fileName *

The name of the file to load.

metadata *

TODO

position *

The initial position.

rotation *

The initial rotation around the y axis.

scale *

The initial scaling.

fixed *

True if fixed.

newItemDefinitions *

Object with position and 'edge' attribute if it is a wall item

public clearItems() source

Removes all items.

public getItems(): * source

Gets the items.

Return:

*

The items.

public getScene(): * source

Gets the scene.

Return:

*

The scene.

public itemCount(): * source

Gets the count of items.

Return:

*

The count.

public remove(mesh: *) source

Removes a non-item, basically a mesh, from the scene.

Params:

NameTypeAttributeDescription
mesh *

The mesh to be removed.

public removeItem(item: *, dontRemove: *) source

Removes an item.

Params:

NameTypeAttributeDescription
item *

The item to be removed.

dontRemove *

If not set, also remove the item from the items list.

public switchWireframe(flag: *) source

Params:

NameTypeAttributeDescription
flag *