new ManoeuvreController()
Class that contstructs the tube and tube mesh from the array of manoeuvres parsed from user input.
the ManoeuvreController#addTube method loops through the OLAN moves entererd, and breaks these
down to their instructions, and creates an overall tube. This class is a subclass of AnimationController.
- Source:
Methods
addGeometry(geometry, colour, parent)
Creates an object that represents a 3D model of a manoeuvre. Creates a mesh based on colour, and adds
this to the scene (parent).
Parameters:
Name | Type | Description |
---|---|---|
geometry |
TubeGeometry | Geometry of a move, used to build up the tube |
colour |
Hex | Hexadecimal colour code |
parent |
Parent | The parent object containing all the manoeuvres and cameras |
- Source:
addTube(values, parent)
Function responsible for creating geometry lines based on an array of instructions. Combines this with
interopobility to smooth out edges. Gets parameters from GUI options to set segment/ radius sengment amounts.
Creates geometry and then passes to tube constructor.
Parameters:
Name | Type | Description |
---|---|---|
values |
Array | Array of objects represting a move, containing name, description and instructions |
parent |
Parent | The parent object containing all the manoeuvres and cameras |
- Source:
calculateSpacer(spacer, linePoints)
Function for creating the vectors for spacers entered by the user. Gets the
amount of X and Y to move the next vector by, in order to create a virtual 'spacer'.
Parameters:
Name | Type | Description |
---|---|---|
spacer |
Array | An array containing the amount to move the proceeding vector by in X and Y. |
linePoints |
Array | Array of current vectors for the manoeuvre. |
- Source:
calculateVector(vector, pitch, roll, yaw, length)
The method for recalcuating the vector based on the next set of
instructions from the JSON file. Does this by creating an euler,
which means pitch, roll and yaw can all be done in one.
Parameters:
Name | Type | Description |
---|---|---|
vector |
Vector | The current vector to be changed |
pitch |
Integer | Negative or positive pitch to be added |
roll |
Integer | Negative or positive roll to be added |
yaw |
Integer | Negative or positive yaw to be added |
length |
Integer | Length of the manoeuvre after translation |
- Source:
checkWarning(extrudePath) → {Boolean}
Method for checking if any points along the manoeuvre are negative, or below the ground level.
If so, true is returned, and then used to show the GUI warning pop up to the user.
Parameters:
Name | Type | Description |
---|---|---|
extrudePath |
SplineCurve3 | The current spline cuvre representing the manoeuvre. |
- Source:
Returns:
bool Whether the manoeuvre triggers the warning of negative values.
- Type
- Boolean
createTube(extrudePath, segments, radiusSegments, parent)
Adds the tube and tubemesh to the parent based on parameters given. Also checks to see if the tube
should be invisible if the user wishes so. Assigns both the tube and tubemesh to their respective
arrays.
Parameters:
Name | Type | Description |
---|---|---|
extrudePath |
Parent | The curve created based on the array of manoeuvre vectors |
segments |
Parent | Defines the smoothness of the cuvre when adding the the parent |
radiusSegments |
Parent | How many sides the tube mesh should have, 2 would be a ribbon, 4 a cuboid etc. |
parent |
Parent | The parent object containing all the manoeuvres and cameras |
- Source:
getTube() → {Array}
The getter for the array of tubes created based on the manoeuvres.
- Source:
Returns:
tube Array of tubes to move the aeroplace along
- Type
- Array
getTubeMesh() → {Array}
The getter for the array of tube meshes created based on the manoeuvres.
- Source:
Returns:
tubeMesh An array of meshes to be drawn on the canvas representing
manoeuvres
- Type
- Array
removeTube(Parent)
Public method for emptying the tubes object, for refreshing the scene.
Parameters:
Name | Type | Description |
---|---|---|
Parent |
Parent | Holds all the objects on the scene. |
- Source:
removeTubes(parent)
Used when refreshing the scene, is called to clear the arrays of the manoeuvre tubes and also
remove them from the parent. This is done to stop repeated moves when adding new ones.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Parent | The parent object containing all the manoeuvres and cameras |
- Source: