Exhibit

Exhibit

This class represents one exhibit with all 3D objects (artworks) and physical sensors (collision area and activation zones).

Constructor

new Exhibit(id, model)

Description:
  • This class represents an exhibit, its 3D objects and sensors needed for optical display and physical behaviour.

Source:
Parameters:
Name Type Description
id number

Unique ID for the exhibit

model ExhibitionItemModel

Model which contains all important backend data

Extends

  • EventTarget

Members

activatedByVisitor :boolean

Description:
  • Value defines if user (vistito object) entered the activation zone

Source:

Value defines if user (vistito object) entered the activation zone

Type:
  • boolean

(private) animationObjects_ :Map.<string, {index:number, objects:Array.<THREE.Object3D>}>

Description:
  • List of objects for each artwork (THREE.Plane) that display an optical image animation. For this purpose, only one plane from the list is displayed at a time for 3 seconds. For a THREE.Plane to be included in the list, the name must start with "still_".

Source:

List of objects for each artwork (THREE.Plane) that display an optical image animation. For this purpose, only one plane from the list is displayed at a time for 3 seconds. For a THREE.Plane to be included in the list, the name must start with "still_".

Type:
  • Map.<string, {index:number, objects:Array.<THREE.Object3D>}>

attraction

Description:
  • Setter

Source:

Setter

attraction

Description:
  • Getter

Source:

Getter

(private) attraction_ :number

Description:
  • Value for physical attraction of the exhibit

Source:

Value for physical attraction of the exhibit

Type:
  • number

(private) colliderHeight_ :number

Description:
  • THREE collider object height

Source:

THREE collider object height

Type:
  • number

collisionObjects

Description:
  • Getter

Source:

Getter

(private) collisionObjects_ :Array.<THREE.Object3D>

Description:
  • THREE object which are used for raycast callision detection.

Source:

THREE object which are used for raycast callision detection.

Type:
  • Array.<THREE.Object3D>

(private) disappearingObjects_ :Array.<THREE.Object3D>

Description:
  • 3D objects which are only visible at the beginning and will be disappear reshuffling starts. Opposite behaviour to hidden objects.

Source:

3D objects which are only visible at the beginning and will be disappear reshuffling starts. Opposite behaviour to hidden objects.

Type:
  • Array.<THREE.Object3D>

enabled

Description:
  • Getter

Source:

Getter

(private) enabled_ :boolean

Description:
  • Determines whether the exhibit should be displayed in the 3D scene and considered for further interaction.

Source:

Determines whether the exhibit should be displayed in the 3D scene and considered for further interaction.

Type:
  • boolean

enteredByVisitor :boolean

Description:
  • Value defines if user (visitor object) entered the collider zone

Source:

Value defines if user (visitor object) entered the collider zone

Type:
  • boolean

(private) exhibitionProvider_ :ExhibitionProvider

Description:
  • Reference to ExhibitionProvider to communicate with the backend and provide and monitor all information that dynamically changes the application.

Source:

Reference to ExhibitionProvider to communicate with the backend and provide and monitor all information that dynamically changes the application.

Type:

(private) hasInteractionObjects_ :boolean

Description:
  • Defines if an object is enabled. If the value is false the exhibit is later disabled in the method checkObjectsAfterFirstInteraction.

Source:

Defines if an object is enabled. If the value is false the exhibit is later disabled in the method checkObjectsAfterFirstInteraction.

Type:
  • boolean

(private) hiddenObjects_ :Array.<THREE.Object3D>

Description:
  • 3D objects which are hidden at the beginning. This is determined by the 3D object having "_appear" or "_dublicated_wall" in its name. As soon as reshuffling starts, these elements are made visible. An example of use is separating artworks that visually share a wall at the beginning and need a separate wall for each when they are separated.

Source:

3D objects which are hidden at the beginning. This is determined by the 3D object having "_appear" or "_dublicated_wall" in its name. As soon as reshuffling starts, these elements are made visible. An example of use is separating artworks that visually share a wall at the beginning and need a separate wall for each when they are separated.

Type:
  • Array.<THREE.Object3D>

(private) hightResolutionState_ :Map.<string, boolean>

Description:
  • Sets the activation state for high resolution artworks. Its a map because an exhibit can have multiple artworks (3d objects).

Source:

Sets the activation state for high resolution artworks. Its a map because an exhibit can have multiple artworks (3d objects).

Type:
  • Map.<string, boolean>

id

Description:
  • Getter

Source:

Getter

(private) id_ :number

Description:
  • Unique ID for the exhibit

Source:

Unique ID for the exhibit

Type:
  • number

isActive

Description:
  • Getter

Source:

Getter

(private) isActive_ :boolean

Description:
  • Indicates whether the exhibit has been activated by the user (entering the activation zone).

Source:

Indicates whether the exhibit has been activated by the user (entering the activation zone).

Type:
  • boolean

isImmovable

Description:
  • Getter

Source:

Getter

(private) isImmovable_ :boolean

Description:
  • Value which defines if the exhibit is movable or fixed

Source:

Value which defines if the exhibit is movable or fixed

Type:
  • boolean

(private) loadCompleters_ :Map.<string, Completer>

Description:
  • Completer is a helper which returns a promise. Its solved if all is loaded.

Source:

Completer is a helper which returns a promise. Its solved if all is loaded.

Type:
  • Map.<string, Completer>

model

Description:
  • Getter

Source:

Getter

(private) model_ :ExhibitionItemModel

Description:
  • Model which contains all important backend data

Source:

Model which contains all important backend data

Type:

object3D

Description:
  • Getter

Source:

Getter

object3D_ :THREE.Object3D

Description:
  • Main 3d object container

Source:

Main 3d object container

Type:
  • THREE.Object3D

physicBodies

Description:
  • Getter

Source:

Getter

(private) physicBodies_ :Map.<string, CANNON.Body>

Description:
  • Additional Cannon mass object for calculating the physic behaviour of the exhibit.

Source:

Additional Cannon mass object for calculating the physic behaviour of the exhibit.

Type:
  • Map.<string, CANNON.Body>

physicColliders

Description:
  • Getter

Source:

Getter

(private) physicColliders_ :Map.<string, CANNON.Body>

Description:
  • Additional Cannon mass objects. Used for special interactive artworks.

Source:

Additional Cannon mass objects. Used for special interactive artworks.

Type:
  • Map.<string, CANNON.Body>

physicMassBody

Description:
  • Getter

Source:

Getter

physicMassBodyScale

Description:
  • Getter

Source:

Getter

(private) physicMassBodyScale_ :number

Description:
  • Value of physical mass object scale

Source:

Value of physical mass object scale

Type:
  • number

(private) physicMassBody_ :CANNON.Body

Description:
  • Cannon mass object which is used for calculating the physic behaviour of the exhibit.

Source:

Cannon mass object which is used for calculating the physic behaviour of the exhibit.

Type:
  • CANNON.Body

progress

Description:
  • Getter

Source:

Getter

(private) progressElements_ :Array.<number>

Description:
  • Loading progress for each artwork element (glb files) as a list. Artworkes are defined in the backend.

Source:

Loading progress for each artwork element (glb files) as a list. Artworkes are defined in the backend.

Type:
  • Array.<number>

(private) progressShadowTexture_ :number

Description:
  • Value for loading progress of shadow texture file

Source:

Value for loading progress of shadow texture file

Type:
  • number

(private) progressTransformFile_ :number

Description:
  • Value for loading progress of trasform file

Source:

Value for loading progress of trasform file

Type:
  • number

(private) worldProvider_ :WorldProvider

Description:
  • Reference to the WorldProvider for monitoring actions, loading processes and status changes of the created THREE.Scene.

Source:

Reference to the WorldProvider for monitoring actions, loading processes and status changes of the created THREE.Scene.

Type:

Methods

(async) build() → {Promise}

Description:
  • Loads the transform glb file and all artwork glb files. The 3D objects are placed in a common THREE.Container. In addition, collider boxes for raycasting detection and Cannon physics objects are created based on the 3D elements. The object is used as a collider if it has "collider" in its name. It is treated as a shadow if it has "ground_shadow" in its name. If "activity_zone" is included in the name it will be used to create the Cannon sensor of the activity zone.

Source:
Returns:
Type
Promise

checkObjectsAfterFirstInteraction()

Description:
  • Checks whether certain 3D elements can be removed after the first interaction with an artwork.

Source:

(private) createPhysicFromBoxMesh_(object, boxopt) → {CANNON.Body}

Description:
  • Method creates a Cannon body based on the bounding box of an THREE object or a box object to be used for the physical collision calculation.

Source:
Parameters:
Name Type Attributes Default Description
object THREE.Mesh

3D object whose bounding box serves as the basis for the creation of the Cannon body.

box THREE.Box3 <optional>
null

Alternative box object if the bounding box of a 3D object shouldn't be used.

Returns:
Type
CANNON.Body

enableInteraction()

Description:
  • Activates sensor objects for THREE raycast check.

Source:

enableMaterialEnvMap(value)

Description:
  • Method to enable and disable the reflection environment texture.

Source:
Parameters:
Name Type Description
value boolean

getArtwork3D(elementId) → {THREE.Object3D}

Description:
  • Gets an specific 3D artwork element by its id

Source:
Parameters:
Name Type Description
elementId number

Artwork id

Returns:
Type
THREE.Object3D

getHightResolutionState(elementId) → {boolean}

Description:
  • Returns the display status. Is the high resolution or the normal variant displayed?

Source:
Parameters:
Name Type Description
elementId number

Artwork id

Returns:
Type
boolean

getInteractionDistance(elementId, point) → {number}

Description:
  • Gets the distance (world space) for a point (world space) to an element selected by its artork id

Source:
Parameters:
Name Type Description
elementId number

Artwork id

point THREE.Vector3

Position to check in world space

Returns:
Type
number

getOrbitViewOfElement(elementId) → {ExhibitionElementOrbitViewModel}

Description:
  • Gets an orbit view configuration model for a given artwork id

Source:
Parameters:
Name Type Description
elementId number

Artwork id

Returns:
Type
ExhibitionElementOrbitViewModel

getWorldPositionOf(name) → {THREE.Vector3}

Description:
  • Gets the global position of a 3D element by a given element name

Source:
Parameters:
Name Type Description
name string

THREE element name

Returns:
Type
THREE.Vector3

loadHighresObject(elementId, progressCallbackopt) → {Promise}

Description:
  • Starts the loading of a alternative highresultion object (if defined) for a given artwork id

Source:
Parameters:
Name Type Attributes Default Description
elementId number

Artwork id

progressCallback function <optional>
null

Progress callback function.

Returns:
Type
Promise

setImmovable(isImmovable)

Description:
  • Method determines whether an exhibit is physically movable or fixed. The artwork activated by the visitor is always fixed while all artworks around it move due to their attraction.

Source:
Parameters:
Name Type Description
isImmovable boolean

shouldTestColliding(positions) → {boolean}

Description:
  • method checks if the given positions (world space) is within the collision area (largest extent of an exhibit) and if so the defined collisions elements should be used for the collision raycast check.

Source:
Parameters:
Name Type Description
positions Array.<THREE.Vector3>
Returns:
Type
boolean

switchObjectResolution(elementId, enableHighresolutionopt)

Description:
  • When it is possible show the high resolution or the normal version of a specified artwork.

Source:
Parameters:
Name Type Attributes Default Description
elementId number

Artwork id

enableHighresolution boolean <optional>
false

update(clock)

Description:
  • method is called in the main render process by the WebGLRenderer and matches THREE objects to the Cannon physics objecte. It also swaps the defined animation planes every 3 seconds.

Source:
Parameters:
Name Type Description
clock THREE.Clock

updateMassBodyScale(value)

Description:
  • The collision area and thus its main Cannon mass are scaled very small at the beginning and only grow to the normal scaling of 1 when reshuffling starts. This method updates the scaling value.

Source:
Parameters:
Name Type Description
value number

Scale value of the Cannon collision mass

updateVisibilities()

Description:
  • Method is called when reshuffling starts and hidden objects can now be displayed or certain other objects must disappear.

Source: