metaforce/Runtime/Particle/CParticleGlobals.hpp

55 lines
1.4 KiB
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CPARTICLEGLOBALS_HPP__
#define __PSHAG_CPARTICLEGLOBALS_HPP__
2016-02-05 08:34:14 +00:00
2016-02-06 07:31:53 +00:00
#include "CVector3f.hpp"
2016-02-13 09:02:47 +00:00
namespace pshag
2016-02-05 08:34:14 +00:00
{
class CParticleGlobals
{
public:
2016-02-09 22:52:33 +00:00
static int g_EmitterTime;
static float g_EmitterTimeReal;
2016-02-05 08:34:14 +00:00
static void SetEmitterTime(int frame)
{
2016-02-09 22:52:33 +00:00
g_EmitterTime = frame;
g_EmitterTimeReal = frame;
2016-02-05 08:34:14 +00:00
}
2016-02-09 22:52:33 +00:00
static int g_ParticleLifetime;
static float g_ParticleLifetimeReal;
2016-02-05 08:34:14 +00:00
static void SetParticleLifetime(int frame)
{
2016-02-09 22:52:33 +00:00
g_ParticleLifetime = frame;
g_ParticleLifetimeReal = frame;
2016-02-05 08:34:14 +00:00
}
2016-02-09 22:52:33 +00:00
static int g_ParticleLifetimePercentage;
static float g_ParticleLifetimePercentageReal;
static float g_ParticleLifetimePercentageRemainder;
2016-02-05 08:34:14 +00:00
static void UpdateParticleLifetimeTweenValues(int frame)
{
2016-02-09 22:52:33 +00:00
float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f;
g_ParticleLifetimePercentageReal = 100.0f * frame / lt;
g_ParticleLifetimePercentage = g_ParticleLifetimePercentageReal;
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
2016-02-05 08:34:14 +00:00
}
2016-02-06 07:31:53 +00:00
static float* g_papValues;
struct SParticleMetrics
{
Zeus::CVector3f x0_ploc;
Zeus::CVector3f x10_plco;
Zeus::CVector3f x1c_pvel;
float x2c_psll;
float x30_prlw;
};
static SParticleMetrics* g_particleMetrics;
2016-02-05 08:34:14 +00:00
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CPARTICLEGLOBALS_HPP__