ParticleMissileDemo

Overview

This demo creates missiles from particles. Use the +Control Pad to control the direction of emission. Press the A Button to fire a missile, and press the B button to delete all missiles.

How to Use

Description

This section describes the main points of the demo.

Number of Instances

This demo only generates one ParticleModel instance, and one ParticleEmitter instance. Missiles are emitted and killed on a per-particle basis.

Adjusting the Firing Angle

The demo adjusts the firing angle by applying a rotation transform to the ParticleEmitter. The missile speed is specified in the data as (0.0f, 1.0f, 0.0f), and this vector is affected by the emitter's angle of rotation.

Firing

The demo fires missiles from the ParticleEmitter by emitting them.

// Sample emission code
nw::gfx::ParticleEmitter* emitter;
emitter->UpdateParticleFrame();
emitter->Emission(particleContext);
emitter->Reset();

Adjusting the Working Memory

The data's runtime working memory must be adjusted depending on the number of missiles on-screen that can be fired simultaneously.

Deleting Missiles

The demo uses the nw::gfx::ParticleCollection::KillParticle function to delete missiles. This function allows for deletion on a per-particle basis. The demo uses the nw::gfx::ParticleCollection::KillParticles function to delete all missiles at once.


CONFIDENTIAL