|
enum | KartGFXType {
KGFX_NITRO1 =0
, KGFX_NITRO2
, KGFX_NITROSMOKE1
, KGFX_NITROSMOKE2
,
KGFX_ZIPPER
, KGFX_TERRAIN
, KGFX_SKIDL
, KGFX_SKIDR
,
KGFX_SKID1L = KGFX_SKIDL
, KGFX_SKID1R = KGFX_SKIDR
, KGFX_SKID2L
, KGFX_SKID2R
,
KGFX_SKID0L
, KGFX_SKID0R
, KGFX_EXHAUST1
, KGFX_EXHAUST2
,
KGFX_COUNT
} |
| All particle effects supported by this object. More...
|
|
|
| KartGFX (const AbstractKart *kart, bool is_day) |
|
| ~KartGFX () |
| Destructor.
|
|
void | reset () |
| Resets all particle emitters.
|
|
void | setSkidLevel (const unsigned int level) |
| Selects the correct skidding particle type depending on skid bonus level.
|
|
void | setParticleKind (const KartGFXType type, const ParticleKind *pk) |
| Sets a new particle type to be used.
|
|
void | setXYZ (const KartGFXType type, const Vec3 &xyz) |
| Defines the new position of the specified emitter.
|
|
void | setCreationRateAbsolute (const KartGFXType type, float f) |
| Sets the absolute creation rate for the specified particle type.
|
|
void | setCreationRateRelative (const KartGFXType type, float f) |
| Sets the creation rate for the specified particle type relative to the given minimum and maximum particle rate.
|
|
void | updateTerrain (const ParticleKind *pk) |
| If necessary defines a new particle type for the terrain emitter.
|
|
void | update (float dt) |
| Updates all gfx.
|
|
void | updateNitroGraphics (float f) |
| Updates nitro dependent particle effects.
|
|
void | updateSkidLight (unsigned int level) |
| Updates the skiddng light (including disabling it).
|
|
void | getGFXStatus (int *nitro, bool *zipper, int *skidding, bool *red_skidding) const |
|
void | setGFXFromReplay (int nitro, bool zipper, int skidding, bool red_skidding) |
|
void | setGFXInvisible () |
|
|
void | addEffect (KartGFXType type, const std::string &file_name, const Vec3 &position, bool important) |
| Creates a new particle node with the specified particle kind read from the given file.
|
|
void | resizeBox (const KartGFXType type, float new_size) |
| Resize the area from which the particles are emitted: the emitter box should spread from last frame's position to the current position if we want the particles to be emitted in a smooth, continuous flame and not in blobs.
|
|
|
const ParticleKind * | m_skid_kind0 |
| The particle kind for skidding bonus level 0.
|
|
const ParticleKind * | m_skid_kind1 |
| The particle kind for skidding bonus level 1.
|
|
const ParticleKind * | m_skid_kind2 |
| The particle kind for skidding bonus level 2.
|
|
std::vector< ParticleEmitter * > | m_all_emitters |
| Vector of all particle emitters.
|
|
const AbstractKart * | m_kart |
| Pointer to the owner of this kart.
|
|
int | m_wheel_toggle |
| Used to alternate particle effects from the rear wheels.
|
|
int | m_skid_level |
| A skid level that is currently in use.
|
|
irr::scene::ISceneNode * | m_nitro_light |
| A light that's shown when the kart uses nitro.
|
|
irr::scene::ISceneNode * | m_skidding_light_1 |
| Light that is shown when the kart is skidding.
|
|
irr::scene::ISceneNode * | m_skidding_light_2 |
| A light that's shown on the second skid-level with another color.
|
|
◆ KartGFXType
All particle effects supported by this object.
Nitro, zipper, terrain, and skidding effects. Three different skid types are supported, but only one emitter node will be created. So KGFX_SKID1/2/3 store the two types, and KGFX_SKID = KGFX_SKID1 stores the actual emitter node. KGFX_COUNT is the number of entries and must therefore be last.
◆ ~KartGFX()
Destructor.
Frees all particle effects and kinds.
◆ addEffect()
void KartGFX::addEffect |
( |
KartGFXType |
type, |
|
|
const std::string & |
file_name, |
|
|
const Vec3 & |
position, |
|
|
bool |
important |
|
) |
| |
|
private |
Creates a new particle node with the specified particle kind read from the given file.
- Parameters
-
type | The KGFX_ type of this type. |
file_name | The file name of the particle specification. |
position | Where on the kart the particles should be emitted. |
◆ reset()
Resets all particle emitters.
Used at the (re)start of a race.
◆ resizeBox()
void KartGFX::resizeBox |
( |
const KartGFXType |
type, |
|
|
float |
new_size |
|
) |
| |
|
private |
Resize the area from which the particles are emitted: the emitter box should spread from last frame's position to the current position if we want the particles to be emitted in a smooth, continuous flame and not in blobs.
- Parameters
-
type | The particle effect for which to resize the emitting box. |
new_size | New size of the box, typically speed*dt. |
◆ setCreationRateAbsolute()
void KartGFX::setCreationRateAbsolute |
( |
const KartGFXType |
type, |
|
|
float |
f |
|
) |
| |
Sets the absolute creation rate for the specified particle type.
- Parameters
-
type | The particle effect for which to set the creation rate (in particles per seconds). |
f | The new creation rate. |
◆ setCreationRateRelative()
void KartGFX::setCreationRateRelative |
( |
const KartGFXType |
type, |
|
|
float |
f |
|
) |
| |
Sets the creation rate for the specified particle type relative to the given minimum and maximum particle rate.
If a negative value is specified, the creation rate will be set to 0 (absolute).
- Parameters
-
type | The particle effect for which to set the creation rate (<0 means no more particles). |
f | The new relative creation rate. |
◆ setParticleKind()
Sets a new particle type to be used.
Note that the memory of this kind must be managed by the caller.
- Parameters
-
type | The emitter type for which to set the new particle type. |
pk | The particle kind to use. |
◆ setSkidLevel()
void KartGFX::setSkidLevel |
( |
const unsigned int |
level | ) |
|
Selects the correct skidding particle type depending on skid bonus level.
- Parameters
-
level | Must be 0 (no bonus, showing tiny sparks), 1 (accumulated enough for level 1 bonus), or 2 (accumulated enough for level 2 bonus). |
◆ setXYZ()
Defines the new position of the specified emitter.
- Parameters
-
type | The emitter to set a new position for. |
xyz | The new position of the emitter. |
◆ update()
void KartGFX::update |
( |
float |
dt | ) |
|
Updates all gfx.
- Parameters
-
◆ updateNitroGraphics()
void KartGFX::updateNitroGraphics |
( |
float |
nitro_frac | ) |
|
Updates nitro dependent particle effects.
- Parameters
-
nitro_frac | Nitro fraction/ |
◆ updateSkidLight()
void KartGFX::updateSkidLight |
( |
unsigned int |
level | ) |
|
Updates the skiddng light (including disabling it).
- Parameters
-
level | Which level of light to display: 0 no light at all, 1: level 1, 2 level 2. |
◆ updateTerrain()
If necessary defines a new particle type for the terrain emitter.
Then adjusts the location of the terrain emitter to be in synch with the current wheel position, and defines the emission rate depending on speed, steering, and skidding.
- Parameters
-
The documentation for this class was generated from the following files: