Visitor

Visitor

new Visitor()

Description:
  • This class represents the virtual visitor object (creates the THREE.Camera). The camera is nested in a container which is used for the movement through the exhibition.

Source:

Extends

  • EventTarget

Members

camera

Description:
  • Getter

Source:

Getter

cameraNormalY :number

Description:
  • Default distance of camera to the ground (default visitor height)

Source:

Default distance of camera to the ground (default visitor height)

Type:
  • number

cameraPolarAngleRange :Object

Description:
  • Range that determines the polar rotation of the camera (visitor head tilt to the bottom and top).

Source:

Range that determines the polar rotation of the camera (visitor head tilt to the bottom and top).

Type:
  • Object

cameraRangeY :Object

Description:
  • Range that determines the Y-rotation of the camera (visitor head tilt to the left and right).

Source:

Range that determines the Y-rotation of the camera (visitor head tilt to the left and right).

Type:
  • Object

(protected) camera_ :THREE.Camera

Description:
  • Main 3d camera object (view from visitor)

Source:

Main 3d camera object (view from visitor)

Type:
  • THREE.Camera

controlsAreEnabled :boolean

Description:
  • Determines whether the user can control the visitor.

Source:

Determines whether the user can control the visitor.

Type:
  • boolean

maxDistanceToExhibit :number

Description:
  • Defines the maximum distance the visitor object can move away from an exhibit. This is to prevent the user from moving too far away from the actual area of the exhibition in the open world 3d scene.

Source:

Defines the maximum distance the visitor object can move away from an exhibit. This is to prevent the user from moving too far away from the actual area of the exhibition in the open world 3d scene.

Type:
  • number

object3D

Description:
  • Getter

Source:

Getter

(private) object3D_ :THREE.Object3D

Description:
  • Main 3d container used for the application of the movement in the exhibition. All 3D objects within the Visitor class are added to this container.

Source:

Main 3d container used for the application of the movement in the exhibition. All 3D objects within the Visitor class are added to this container.

Type:
  • THREE.Object3D

physicBody

Description:
  • Getter

Source:

Getter

(private) physicBody_ :CANNON.Body

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

Source:

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

Type:
  • CANNON.Body

physicSensor

Description:
  • Getter

Source:

Getter

(private) physicSensor_ :CANNON.Body

Description:
  • Cannon sensor object which is used for physic engine hit test check.

Source:

Cannon sensor object which is used for physic engine hit test check.

Type:
  • CANNON.Body

radius

Description:
  • Getter

Source:

Getter

(private) radius_ :number

Description:
  • Radius of the cannon sphere (mass object)

Source:

Radius of the cannon sphere (mass object)

Type:
  • number

(private) sensor_ :THREE.Mesh

Description:
  • THREE sensor object which is used for raycast detection.

Source:

THREE sensor object which is used for raycast detection.

Type:
  • THREE.Mesh

(private) topViewPlane_ :THREE.Mesh

Description:
  • THREE object for the graphical representation of the visitor from the top view

Source:

THREE object for the graphical representation of the visitor from the top view

Type:
  • THREE.Mesh

(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

build(position, radius, topViewTextureopt)

Description:
  • Method creates the camera and sensors that make up the visitor in the 3D scene.

Source:
Parameters:
Name Type Attributes Default Description
position THREE.Vector3

start position in the 3d scene

radius number

Radius of the cannon sphere (mass object)

topViewTexture THREE.Texture <optional>
null

Optional texture which is used for the visitor display (THREE.Plane) in the top view

enableTopViewPlane(value, delay)

Description:
  • Method enables or disables the visitor top view display object

Source:
Parameters:
Name Type Description
value boolean

Action value for activation or deactivation

delay number

Delay for the activation or deactivation

update()

Description:
  • Method is called by the main WebGLRenderer render process. Transfers the position and rotation of the THREE sensor object to the Cannon physical body (mass).

Source: