Class: SmokeController

SmokeController

new SmokeController()

Moduel for controlling and creating the smoke trails when the aircraft flies around the canvas. Perorms creation of smoke particles, the fading out of them, and the calculates the colour of the smoke based on the rottation of the aircraft. Deletes particles at the end of the trail after a certian time to not clog up the canvas.
Source:

Methods

clearSmoke(parent)

Deletes the smoe particles from the canvas when animation is complete, or changes to OLAn input are performed.
Parameters:
Name Type Description
parent Parent The canvas holding all the smoke particles.
Source:

colourSmokeParticle(parent, cameraEye, splineCamera)

Updates the position and colour of smoke particles on the canvas. Does this twice on each iteration, in order to malke
Parameters:
Name Type Description
parent Parent The canvas holding all the smoke particles.
cameraEye Object The plane object on the canvas, used for setting location of smoke.
splineCamera PerspectiveCamera The camera animating along the spline, for setting the rotation.
Source:

colourSmokeParticle(smokeParticle)

Sets the colour of the smoke particles on the canvas, based on the current rotation of the aircraft. Red is intensified for upside down angles, green for normal rotation. same amount as the aircraft.
Parameters:
Name Type Description
smokeParticle Mesh Individual smoke particle
Source:

createSmokeParticle(parent) → {Mesh}

A getter function for retreiving the entire list of manoeuvres.
Parameters:
Name Type Description
parent Parent The parent which the smoke is added to.
Source:
Returns:
smokeParticle A mesh object represnting each particle of smoke.
Type
Mesh

fadeSmoke(parent)

Loops through all of of the smoke particles, and decreases the opacity of each one. Then checks if the amount of particles has passed 250, if so, deletes the first one in the array.
Parameters:
Name Type Description
parent Parent The parent which the smoke is removed from.
Source:

positionSmokeParticle(cube, alt, cameraEye, splineCamera)

Function for placing the smoke onto the canvas, and setting the rotation of each particle to the same amount as the aircraft.
Parameters:
Name Type Description
cube Mesh Individual smoke particle
alt Integer Makes two smoke trails, so alternates between them each time.
cameraEye Object The plane, to get the location.
splineCamera PerspectiveCamera Used to get the current rotation along the animation.
Source: