Constructor
new MyVehicle(scene, positionY)
Initializes a new vehicle instance.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scene |
CGFscene
|
the scene | |
positionY |
number
|
10 | the height/y position of the vehicle |
Methods
accelerate(value)
Increases or decreases the speed of the vehicle.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
number
|
the increase/decrease value |
applyAutoPilot(radius, time, timeElapsed)
Turns on the vehicle auto-pilot.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
radius |
number
|
the radius of the rotation |
time |
integer
|
the time the rotation takes |
timeElapsed |
integer
|
the elapsed time |
brake(amount)
Breaks the vehicle.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
amount |
number
|
the break multiplier |
displayWithShaders()
Displays the part of the vehicle that requires shaders.
- Source:
initMovement()
Initializes the movement of the wings, defining constants and relevant variables.
- Source:
turn(value)
Turns the vehicle.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
number
|
the turn multiplier |
update(t)
Updates the movement of the vehicle.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
t |
integer
|
the current time in milliseconds |