VFXAircraft
The VFXAircraft
aircraft is a module of the WASMAircraft modular aircraft, which shows show the use of the WebAssembly VFX API. Once the WASM Aircraft package has been built, this module will be available for flying from the aircraft selection screen:
Once you have selected the aircraft we recommend that you start a Free Flight at LXGB (Gibraltar AB) airport, as one of the effects this example showcases is designed to be spawned there.
When you start the flight, you will see the following three displays in the aircraft cockpit:
- This display permits you to spawn particles at a specific location in the world, or at specific locations on the aircraft. If you click on the text at the top - "Spawn FX In Gibraltar" - a blue particle will spawn above the position of the aircraft on the runway. Pressing this repeatedly will move up the position of the spawn point for the VFX. You may need to change to the external camera to be able to see it. If you click any of the segments around the aircraft diagram, particles will spawn in those areas of the aircraft. You can click on the "Clear All" button to clear all particles and reset the buttons.
NOTE: The "Spawn FX In Gibraltar" button, will only work or be visible if you are actually on the Gibraltar AB airport runway, at the start.
- The second screen gives you direct control over a single particle instance, and shows information regarding that instance. Clicking the add button "🞥" will spawn the particle (which will play automatically). Clicking the stop button "◼", will stop the particle emitting but not remove the instance. Pressing the play button "▶" start the instance emitting particles again (unless it has been destroyed). Finally, clicking on the destroy button "✖" will remove the particle instance. Note that if you add a particle instance then - after the "Is Playing" parameter shows false - leave it for a few seconds, you can see how the simulation removes the instance automatically to save memory.
- This screen shows you how you can create a particle instance in the world then manipulate its position and rotation. Click the "On/Off" button to toggle the effect on or off (the light in the corner will be green if it's on, and red if it's off), then press and hold any of the directional buttons to move the particle instance around on a 2D plane. Pressing and holding the rotate button "↺" will cause the particle instance rotation to oscillate between set angles.