Pangea is an web simulator for panoramic navigation.
Pangea's core functionality is contained within index.js
.
An environment for panoramic navigation.
graph
- A graph where nodes are panoramas and edges indicate navigability.loader
- An panorama loader.
Note that the graph must contain the following node properties.
matrix: THREE.Matrix4
- The camera pose matrix.inverse: THREE.Matrix4
- The inverse of the camera pose matrix.url: string
orArray<string>
- The panorama url for the loader.height: number
- The height of the camera from ground level.
See constructor.
See constructor.
The environment camera.
The environment scene.
The node in the graph the environment is set to. Default is null
.
A cache that maps nodes to panoramas.
node
- A node in the graph.objects
- The objects in the scene.
Transforms the pose the camera and given objects to be relative to the pose of the given node, then sets the background of the scene to the panorama of the given node.
snapshot
- An output of.snapshot
from an environment with the same graph.objects
- The objects in the scene.
Sets the environment from a snapshot.
digit
- The number of digits to round a number to.
Returns a snapshot of the environment containing the following properties.
node: string
- The node in the graph the environment is set to.aspect: number
- The aspect ratio of the camera.fov: number
- The horizontal field of view of the camera.direction: Array(number)
- The direction the camera is facing relative to the pose of the current node.
.tween(node: string, objects: Array(THREE.Object3D), onStart: Function, onComplete: Function, duration: number): TWEEN.Tween
node
- A node in the graph.objects
- The objects in the scene.onStart
- A function which takes no arguments that is called upon starting the tween.onComplete
- A function which takes no arguments that is called upon completing the tween.duration
- The duration of the animation in milliseconds.
Similar to .set
, but returns an animation tween that rotates and zooms the
camera towards the given node.
A general purpose graph implementation.
Creates an empty graph.
A nested object mapping nodes to edge objects that map neighbors to data objects.
A nested object mapping nodes to data objects.
source
- A node to add an outgoing edge.target
- A node to add an incoming edge.data
- An object containing data about the edge.
Adds an edge to the graph.
node
- A node to add to the graph.data
- An object containing data about the node.
Adds a node to the graph.
source
- The node to remove an outgoing edge.target
- The node to remove an incoming edge.
Removes an edge from the graph.
node
- The node to remove from the graph.
Removes a node from the graph.
A general purpose time series logger.
equals
- A function that compares two entries. Returns true if two entries are equal and false otherwise. By default this is a function that always returns false.minTimeDelta
- The minimum time that must elapse between two consecutive entries.
See constructor.
See constructor.
An array of timestamp-entry pairs.
entry
- An entry to be logged.
Logs an entry if the minimum time has elapsed and the entry is not redundant.