forked from teamnwah/openmw-tes3coop
Even more particle information
This commit is contained in:
parent
2f6ae4a915
commit
ac10c5f05c
3 changed files with 29 additions and 9 deletions
|
@ -66,12 +66,14 @@ typedef Named NiSequenceStreamHelper;
|
|||
class NiParticleGrowFade : public Controlled
|
||||
{
|
||||
public:
|
||||
float growTime;
|
||||
float fadeTime;
|
||||
|
||||
void read(NIFStream *nif)
|
||||
{
|
||||
Controlled::read(nif);
|
||||
|
||||
// Two floats.
|
||||
nif->skip(8);
|
||||
growTime = nif->getFloat();
|
||||
fadeTime = nif->getFloat();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -65,6 +65,14 @@ public:
|
|||
class NiParticleSystemController : public Controller
|
||||
{
|
||||
public:
|
||||
struct Particle {
|
||||
Ogre::Vector3 velocity;
|
||||
float lifetime;
|
||||
float lifespan;
|
||||
float timestamp;
|
||||
int vertex;
|
||||
};
|
||||
|
||||
float velocity;
|
||||
float velocityRandom;
|
||||
|
||||
|
@ -88,9 +96,9 @@ public:
|
|||
|
||||
int numParticles;
|
||||
int activeCount;
|
||||
//std::vector<Particle> particles; /*numParticles*/
|
||||
std::vector<Particle> particles;
|
||||
|
||||
RecordPtr modifier;
|
||||
ExtraPtr extra;
|
||||
|
||||
void read(NIFStream *nif)
|
||||
{
|
||||
|
@ -127,10 +135,21 @@ public:
|
|||
|
||||
numParticles = nif->getUShort();
|
||||
activeCount = nif->getUShort();
|
||||
nif->skip(numParticles*40);
|
||||
|
||||
particles.resize(numParticles);
|
||||
for(size_t i = 0;i < particles.size();i++)
|
||||
{
|
||||
particles[i].velocity = nif->getVector3();
|
||||
nif->getVector3(); /* unknown */
|
||||
particles[i].lifetime = nif->getFloat();
|
||||
particles[i].lifespan = nif->getFloat();
|
||||
particles[i].timestamp = nif->getFloat();
|
||||
nif->getUShort(); /* unknown */
|
||||
particles[i].vertex = nif->getUShort();
|
||||
}
|
||||
|
||||
nif->getUInt(); /* -1? */
|
||||
modifier.read(nif);
|
||||
extra.read(nif);
|
||||
nif->getUInt(); /* -1? */
|
||||
nif->getChar();
|
||||
}
|
||||
|
@ -139,7 +158,7 @@ public:
|
|||
{
|
||||
Controller::post(nif);
|
||||
emitter.post(nif);
|
||||
modifier.post(nif);
|
||||
extra.post(nif);
|
||||
}
|
||||
};
|
||||
typedef NiParticleSystemController NiBSPArrayController;
|
||||
|
|
|
@ -142,7 +142,6 @@ class NiSourceTexture;
|
|||
class NiRotatingParticlesData;
|
||||
class NiAutoNormalParticlesData;
|
||||
|
||||
typedef RecordPtrT<Record> RecordPtr;
|
||||
typedef RecordPtrT<Node> NodePtr;
|
||||
typedef RecordPtrT<Extra> ExtraPtr;
|
||||
typedef RecordPtrT<NiUVData> NiUVDataPtr;
|
||||
|
|
Loading…
Reference in a new issue