mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 07:06:43 +00:00
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
|
class NiParticleGrowFade : public Controlled
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
float growTime;
|
||||||
|
float fadeTime;
|
||||||
|
|
||||||
void read(NIFStream *nif)
|
void read(NIFStream *nif)
|
||||||
{
|
{
|
||||||
Controlled::read(nif);
|
Controlled::read(nif);
|
||||||
|
growTime = nif->getFloat();
|
||||||
// Two floats.
|
fadeTime = nif->getFloat();
|
||||||
nif->skip(8);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,14 @@ public:
|
||||||
class NiParticleSystemController : public Controller
|
class NiParticleSystemController : public Controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
struct Particle {
|
||||||
|
Ogre::Vector3 velocity;
|
||||||
|
float lifetime;
|
||||||
|
float lifespan;
|
||||||
|
float timestamp;
|
||||||
|
int vertex;
|
||||||
|
};
|
||||||
|
|
||||||
float velocity;
|
float velocity;
|
||||||
float velocityRandom;
|
float velocityRandom;
|
||||||
|
|
||||||
|
@ -88,9 +96,9 @@ public:
|
||||||
|
|
||||||
int numParticles;
|
int numParticles;
|
||||||
int activeCount;
|
int activeCount;
|
||||||
//std::vector<Particle> particles; /*numParticles*/
|
std::vector<Particle> particles;
|
||||||
|
|
||||||
RecordPtr modifier;
|
ExtraPtr extra;
|
||||||
|
|
||||||
void read(NIFStream *nif)
|
void read(NIFStream *nif)
|
||||||
{
|
{
|
||||||
|
@ -127,10 +135,21 @@ public:
|
||||||
|
|
||||||
numParticles = nif->getUShort();
|
numParticles = nif->getUShort();
|
||||||
activeCount = 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? */
|
nif->getUInt(); /* -1? */
|
||||||
modifier.read(nif);
|
extra.read(nif);
|
||||||
nif->getUInt(); /* -1? */
|
nif->getUInt(); /* -1? */
|
||||||
nif->getChar();
|
nif->getChar();
|
||||||
}
|
}
|
||||||
|
@ -139,7 +158,7 @@ public:
|
||||||
{
|
{
|
||||||
Controller::post(nif);
|
Controller::post(nif);
|
||||||
emitter.post(nif);
|
emitter.post(nif);
|
||||||
modifier.post(nif);
|
extra.post(nif);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
typedef NiParticleSystemController NiBSPArrayController;
|
typedef NiParticleSystemController NiBSPArrayController;
|
||||||
|
|
|
@ -142,7 +142,6 @@ class NiSourceTexture;
|
||||||
class NiRotatingParticlesData;
|
class NiRotatingParticlesData;
|
||||||
class NiAutoNormalParticlesData;
|
class NiAutoNormalParticlesData;
|
||||||
|
|
||||||
typedef RecordPtrT<Record> RecordPtr;
|
|
||||||
typedef RecordPtrT<Node> NodePtr;
|
typedef RecordPtrT<Node> NodePtr;
|
||||||
typedef RecordPtrT<Extra> ExtraPtr;
|
typedef RecordPtrT<Extra> ExtraPtr;
|
||||||
typedef RecordPtrT<NiUVData> NiUVDataPtr;
|
typedef RecordPtrT<NiUVData> NiUVDataPtr;
|
||||||
|
|
Loading…
Reference in a new issue