Read a few Gamebryo particle emitters, NiPSysResetOnLoopCtlr, NiPSysPositionModifier

macos_ci_fix
Alexei Kotov 1 year ago
parent 717b93d61e
commit c6d0df432f

@ -294,11 +294,17 @@ namespace Nif
// Modifiers, Gamebryo
{ "NiPSysAgeDeathModifier", &construct<NiPSysAgeDeathModifier, RC_NiPSysAgeDeathModifier> },
{ "NiPSysPositionModifier", &construct<NiPSysModifier, RC_NiPSysPositionModifier> },
{ "NiPSysSpawnModifier", &construct<NiPSysSpawnModifier, RC_NiPSysSpawnModifier> },
// Modifiers, Bethesda
{ "BSPSysLODModifier", &construct<BSPSysLODModifier, RC_BSPSysLODModifier> },
// Emitters
{ "NiPSysBoxEmitter", &construct<NiPSysBoxEmitter, RC_NiPSysBoxEmitter> },
{ "NiPSysCylinderEmitter", &construct<NiPSysCylinderEmitter, RC_NiPSysCylinderEmitter> },
{ "NiPSysSphereEmitter", &construct<NiPSysSphereEmitter, RC_NiPSysSphereEmitter> },
// Modifier controllers, Gamebryo
{ "NiPSysAirFieldAirFrictionCtlr", &construct<NiPSysModifierFloatCtlr, RC_NiPSysAirFieldAirFrictionCtlr> },
{ "NiPSysAirFieldInheritVelocityCtlr",
@ -336,6 +342,7 @@ namespace Nif
{ "NiParticleSystemController", &construct<NiParticleSystemController, RC_NiParticleSystemController> },
// Particle system controllers, Gamebryo
{ "NiPSysResetOnLoopCtlr", &construct<NiTimeController, RC_NiPSysResetOnLoopCtlr> },
{ "NiPSysUpdateCtlr", &construct<NiTimeController, RC_NiPSysUpdateCtlr> },
// PHYSICS

@ -277,6 +277,63 @@ namespace Nif
nif->read(mEndSize);
}
void NiPSysEmitter::read(NIFStream* nif)
{
NiPSysModifier::read(nif);
nif->read(mSpeed);
nif->read(mSpeedVariation);
nif->read(mDeclination);
nif->read(mDeclinationVariation);
nif->read(mPlanarAngle);
nif->read(mPlanarAngleVariation);
nif->read(mInitialColor);
nif->read(mInitialRadius);
if (nif->getVersion() >= NIFStream::generateVersion(10, 4, 0, 1))
nif->read(mRadiusVariation);
nif->read(mLifespan);
nif->read(mLifespanVariation);
}
void NiPSysVolumeEmitter::read(NIFStream* nif)
{
NiPSysEmitter::read(nif);
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
mEmitterObject.read(nif);
}
void NiPSysVolumeEmitter::post(Reader& nif)
{
NiPSysEmitter::post(nif);
mEmitterObject.post(nif);
}
void NiPSysBoxEmitter::read(NIFStream* nif)
{
NiPSysVolumeEmitter::read(nif);
nif->read(mWidth);
nif->read(mHeight);
nif->read(mDepth);
}
void NiPSysCylinderEmitter::read(NIFStream* nif)
{
NiPSysVolumeEmitter::read(nif);
nif->read(mRadius);
nif->read(mHeight);
}
void NiPSysSphereEmitter::read(NIFStream* nif)
{
NiPSysVolumeEmitter::read(nif);
nif->read(mRadius);
}
void NiPSysModifierCtlr::read(NIFStream* nif)
{
NiSingleInterpController::read(nif);

@ -210,6 +210,57 @@ namespace Nif
void read(NIFStream* nif) override;
};
// Abstract
struct NiPSysEmitter : public NiPSysModifier
{
float mSpeed;
float mSpeedVariation;
float mDeclination;
float mDeclinationVariation;
float mPlanarAngle;
float mPlanarAngleVariation;
osg::Vec4f mInitialColor;
float mInitialRadius;
float mRadiusVariation;
float mLifespan;
float mLifespanVariation;
void read(NIFStream* nif) override;
};
// Abstract
struct NiPSysVolumeEmitter : public NiPSysEmitter
{
NiAVObjectPtr mEmitterObject;
void read(NIFStream* nif) override;
void post(Reader& nif) override;
};
struct NiPSysBoxEmitter : public NiPSysVolumeEmitter
{
float mWidth;
float mHeight;
float mDepth;
void read(NIFStream* nif) override;
};
struct NiPSysCylinderEmitter : public NiPSysVolumeEmitter
{
float mRadius;
float mHeight;
void read(NIFStream* nif) override;
};
struct NiPSysSphereEmitter : public NiPSysVolumeEmitter
{
float mRadius;
void read(NIFStream* nif) override;
};
// Abstract
struct NiPSysModifierCtlr : NiSingleInterpController
{

@ -187,6 +187,8 @@ namespace Nif
RC_NiPSysAirFieldAirFrictionCtlr,
RC_NiPSysAirFieldInheritVelocityCtlr,
RC_NiPSysAirFieldSpreadCtlr,
RC_NiPSysBoxEmitter,
RC_NiPSysCylinderEmitter,
RC_NiPSysData,
RC_NiPSysEmitterCtlr,
RC_NiPSysEmitterCtlrData,
@ -206,7 +208,10 @@ namespace Nif
RC_NiPSysInitialRotAngleCtlr,
RC_NiPSysInitialRotAngleVarCtlr,
RC_NiPSysModifierActiveCtlr,
RC_NiPSysPositionModifier,
RC_NiPSysResetOnLoopCtlr,
RC_NiPSysSpawnModifier,
RC_NiPSysSphereEmitter,
RC_NiPSysUpdateCtlr,
RC_NiRollController,
RC_NiSequence,

Loading…
Cancel
Save