new CameraController()
Camera handler class fro creating and modifyng cameras in the scene. This includes the
aeroplane, which is created from a model and added to the environment. Contains all the
initialisers for each camera, edit methdods, and get methods.
- Source:
Methods
cameraReset()
Resets the position of the aeroplane/camera eye. This is called when any changes to path is perfomred.
- Source:
getCameraHelper() → {CameraHelper}
Returns guides to be shown along the camer path.
- Source:
Returns:
cameraHelper Draws lines and shows current tradgectory of spline camera
- Type
- CameraHelper
getIsLookAhead() → {Boolean}
Returns the boolean saying if on board camera is looking forward.
- Source:
Returns:
lookahead Whether camera is looking ahead or not.
- Type
- Boolean
getIsOnboard() → {Boolean}
Returns the boolean saying if on board camera is enabled.
- Source:
Returns:
onboard Whether camera view is on-board.
- Type
- Boolean
getSplineCamera() → {PerspectiveCamera}
Returns the camera to run along the spline.
- Source:
Returns:
splineCamera Camera responsible for working out where to place aeroplane
- Type
- PerspectiveCamera
getStandardCamera() → {PerspectiveCamera}
Returns the standard camera.
- Source:
Returns:
standardCamera Standard birds eye view camera
- Type
- PerspectiveCamera
initCameras(parent)
Initiates the creation of all the different camera elements.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Parent | Three.js 3D scene to have aeroplane added to. |
- Source:
resetCameraEye()
Resets the location and rotation of the aeroplane on the canvas, after each
change to OLAN input, or on completion of a flight.
- Source:
setCameraEyePosition(pos)
Sets the location of the aeroplane passed from the spline camera's location.
Parameters:
Name | Type | Description |
---|---|---|
pos |
Vector | Vector position |
- Source:
setOnboardCamera(toggle)
A toggle function for switching to the onboard camera on the aeroplane. Gets toggle view from
parameter and then sets the switch in the GUI to reflect this.
Parameters:
Name | Type | Description |
---|---|---|
toggle |
Boolean | Used to set onboard camera on or off |
- Source:
setRenderCamerasRotation()
Sets the rotation of the spline camera whilst animating along a manoeuvre.
Also rotates the aeroplane accordingly.
- Source:
setSplineCameraLookAt(lookAt, normal)
Ensures the aeroplane looks in the correct directoion when naviagting a manoeuvre.
Parameters:
Name | Type | Description |
---|---|---|
lookAt |
Vector | A vector ahead of the current position for the camera to be looking towards. |
normal |
Vector |
- Source:
setSplineCameraPosition(pos)
Sets the location of the spline camera based on the current manoeuvre in relation to time.
Parameters:
Name | Type | Description |
---|---|---|
pos |
Vector | Vector position |
- Source:
setupCameraEye(parent)
Creates the areoplane model in the scene, by loading up an external JSON file containing a model.
Sets initial rotation and location values.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Parent | Three.js 3D scene to have aeroplane added to. |
- Source:
setupCameraHelper()
Camera Helper created, and sets the spline camera to stick to the edge of the manoeuvre line.
- Source:
setupSplineCamera(parent)
Creates the camera to look along the tube splines. Used to calculate where the plane should be in
relation to time. Adds to the parent.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Parent | Three.js 3D scene to have aeroplane added to. |
- Source:
setupStandardCamera() → {Object}
Returns the aeroplane.
- Source:
Returns:
cameraEye Aeroplane model for animating
- Type
- Object
setupStandardCamera()
Creates the birds eye view camera, looking over the entire scene. Sets the initial camera location and
how far it can see.
- Source:
showCamera(toggle)
Toggles the visibilty of the camera (aeroplane) to true or false. Also gets the value of the
look-ahead checkbox to set this on update of the scene.
Parameters:
Name | Type | Description |
---|---|---|
toggle |
Boolean | Turns camera view on or off |
- Source:
showCameraHelper()
Shows the guide lines in the front of the aeroplane, gives indications of rotationa and moving
direction.
- Source: