mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Read Gamebryo particle colliders and a few more modifiers
This commit is contained in:
parent
120223d8df
commit
5de3bdd2bc
@ -305,8 +305,11 @@ namespace Nif
|
||||
{ "BSPSysInheritVelocityModifier",
|
||||
&construct<BSPSysInheritVelocityModifier, RC_BSPSysInheritVelocityModifier> },
|
||||
{ "BSPSysLODModifier", &construct<BSPSysLODModifier, RC_BSPSysLODModifier> },
|
||||
{ "BSPSysRecycleBoundModifier", &construct<BSPSysRecycleBoundModifier, RC_BSPSysRecycleBoundModifier> },
|
||||
{ "BSPSysScaleModifier", &construct<BSPSysScaleModifier, RC_BSPSysScaleModifier> },
|
||||
{ "BSPSysSimpleColorModifier", &construct<BSPSysSimpleColorModifier, RC_BSPSysSimpleColorModifier> },
|
||||
{ "BSPSysStripUpdateModifier", &construct<BSPSysStripUpdateModifier, RC_BSPSysStripUpdateModifier> },
|
||||
{ "BSPSysSubTexModifier", &construct<BSPSysSubTexModifier, RC_BSPSysSubTexModifier> },
|
||||
|
||||
// Emitters
|
||||
{ "NiPSysBoxEmitter", &construct<NiPSysBoxEmitter, RC_NiPSysBoxEmitter> },
|
||||
@ -347,6 +350,11 @@ namespace Nif
|
||||
{ "NiPlanarCollider", &construct<NiPlanarCollider, RC_NiPlanarCollider> },
|
||||
{ "NiSphericalCollider", &construct<NiSphericalCollider, RC_NiSphericalCollider> },
|
||||
|
||||
// Colliders, Gamebryo
|
||||
{ "NiPSysColliderManager", &construct<NiPSysColliderManager, RC_NiPSysColliderManager> },
|
||||
{ "NiPSysPlanarCollider", &construct<NiPSysPlanarCollider, RC_NiPSysPlanarCollider> },
|
||||
{ "NiPSysSphericalCollider", &construct<NiPSysSphericalCollider, RC_NiPSysSphericalCollider> },
|
||||
|
||||
// Particle system controllers, 4.0.0.2
|
||||
{ "NiParticleSystemController", &construct<NiParticleSystemController, RC_NiParticleSystemController> },
|
||||
|
||||
|
@ -364,6 +364,22 @@ namespace Nif
|
||||
nif->read(mEndSize);
|
||||
}
|
||||
|
||||
void BSPSysRecycleBoundModifier::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
|
||||
nif->read(mBoundOffset);
|
||||
nif->read(mBoundExtents);
|
||||
mBoundObject.read(nif);
|
||||
}
|
||||
|
||||
void BSPSysRecycleBoundModifier::post(Reader& nif)
|
||||
{
|
||||
NiPSysModifier::post(nif);
|
||||
|
||||
mBoundObject.post(nif);
|
||||
}
|
||||
|
||||
void BSPSysScaleModifier::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
@ -386,6 +402,26 @@ namespace Nif
|
||||
nif->skip(52); // Unknown
|
||||
}
|
||||
|
||||
void BSPSysStripUpdateModifier::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
|
||||
nif->read(mUpdateDeltaTime);
|
||||
}
|
||||
|
||||
void BSPSysSubTexModifier::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
|
||||
nif->read(mStartFrame);
|
||||
nif->read(mStartFrameFudge);
|
||||
nif->read(mEndFrame);
|
||||
nif->read(mLoopStartFrame);
|
||||
nif->read(mLoopStartFrameFudge);
|
||||
nif->read(mFrameCount);
|
||||
nif->read(mFrameCountFudge);
|
||||
}
|
||||
|
||||
void NiPSysEmitter::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
@ -496,4 +532,54 @@ namespace Nif
|
||||
mVisKeyList->mKeys[nif->get<float>()].mValue = nif->get<uint8_t>() != 0;
|
||||
}
|
||||
|
||||
void NiPSysCollider::read(NIFStream* nif)
|
||||
{
|
||||
nif->read(mBounce);
|
||||
nif->read(mCollideSpawn);
|
||||
nif->read(mCollideDie);
|
||||
mSpawnModifier.read(nif);
|
||||
mParent.read(nif);
|
||||
mNextCollider.read(nif);
|
||||
mColliderObject.read(nif);
|
||||
}
|
||||
|
||||
void NiPSysCollider::post(Reader& nif)
|
||||
{
|
||||
mSpawnModifier.post(nif);
|
||||
mParent.post(nif);
|
||||
mNextCollider.post(nif);
|
||||
mColliderObject.post(nif);
|
||||
}
|
||||
|
||||
void NiPSysColliderManager::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysModifier::read(nif);
|
||||
|
||||
mCollider.read(nif);
|
||||
}
|
||||
|
||||
void NiPSysColliderManager::post(Reader& nif)
|
||||
{
|
||||
NiPSysModifier::post(nif);
|
||||
|
||||
mCollider.post(nif);
|
||||
}
|
||||
|
||||
void NiPSysSphericalCollider::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysCollider::read(nif);
|
||||
|
||||
nif->read(mRadius);
|
||||
}
|
||||
|
||||
void NiPSysPlanarCollider::read(NIFStream* nif)
|
||||
{
|
||||
NiPSysCollider::read(nif);
|
||||
|
||||
nif->read(mWidth);
|
||||
nif->read(mHeight);
|
||||
nif->read(mXAxis);
|
||||
nif->read(mYAxis);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -268,6 +268,16 @@ namespace Nif
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct BSPSysRecycleBoundModifier : NiPSysModifier
|
||||
{
|
||||
osg::Vec3f mBoundOffset;
|
||||
osg::Vec3f mBoundExtents;
|
||||
NiAVObjectPtr mBoundObject;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct BSPSysScaleModifier : public NiPSysModifier
|
||||
{
|
||||
std::vector<float> mScales;
|
||||
@ -288,6 +298,26 @@ namespace Nif
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct BSPSysStripUpdateModifier : NiPSysModifier
|
||||
{
|
||||
float mUpdateDeltaTime;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct BSPSysSubTexModifier : public NiPSysModifier
|
||||
{
|
||||
float mStartFrame;
|
||||
float mStartFrameFudge;
|
||||
float mEndFrame;
|
||||
float mLoopStartFrame;
|
||||
float mLoopStartFrameFudge;
|
||||
float mFrameCount;
|
||||
float mFrameCountFudge;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
// Abstract
|
||||
struct NiPSysEmitter : public NiPSysModifier
|
||||
{
|
||||
@ -399,5 +429,44 @@ namespace Nif
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct NiPSysCollider : Record
|
||||
{
|
||||
float mBounce;
|
||||
bool mCollideSpawn;
|
||||
bool mCollideDie;
|
||||
NiPSysSpawnModifierPtr mSpawnModifier;
|
||||
NiPSysColliderManagerPtr mParent;
|
||||
NiPSysColliderPtr mNextCollider;
|
||||
NiAVObjectPtr mColliderObject;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct NiPSysColliderManager : NiPSysModifier
|
||||
{
|
||||
NiPSysColliderPtr mCollider;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct NiPSysPlanarCollider : NiPSysCollider
|
||||
{
|
||||
float mWidth;
|
||||
float mHeight;
|
||||
osg::Vec3f mXAxis;
|
||||
osg::Vec3f mYAxis;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct NiPSysSphericalCollider : NiPSysCollider
|
||||
{
|
||||
float mRadius;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -96,8 +96,11 @@ namespace Nif
|
||||
RC_BSPackedAdditionalGeometryData,
|
||||
RC_BSPSysInheritVelocityModifier,
|
||||
RC_BSPSysLODModifier,
|
||||
RC_BSPSysRecycleBoundModifier,
|
||||
RC_BSPSysScaleModifier,
|
||||
RC_BSPSysSimpleColorModifier,
|
||||
RC_BSPSysStripUpdateModifier,
|
||||
RC_BSPSysSubTexModifier,
|
||||
RC_BSStripParticleSystem,
|
||||
RC_BSStripPSysData,
|
||||
RC_BSRefractionFirePeriodController,
|
||||
@ -192,6 +195,7 @@ namespace Nif
|
||||
RC_NiPSysAirFieldSpreadCtlr,
|
||||
RC_NiPSysBoxEmitter,
|
||||
RC_NiPSysBoundUpdateModifier,
|
||||
RC_NiPSysColliderManager,
|
||||
RC_NiPSysCylinderEmitter,
|
||||
RC_NiPSysData,
|
||||
RC_NiPSysDragModifier,
|
||||
@ -215,10 +219,12 @@ namespace Nif
|
||||
RC_NiPSysInitialRotAngleVarCtlr,
|
||||
RC_NiPSysMeshEmitter,
|
||||
RC_NiPSysModifierActiveCtlr,
|
||||
RC_NiPSysPlanarCollider,
|
||||
RC_NiPSysPositionModifier,
|
||||
RC_NiPSysRotationModifier,
|
||||
RC_NiPSysResetOnLoopCtlr,
|
||||
RC_NiPSysSpawnModifier,
|
||||
RC_NiPSysSphericalCollider,
|
||||
RC_NiPSysSphereEmitter,
|
||||
RC_NiPSysUpdateCtlr,
|
||||
RC_NiRollController,
|
||||
|
@ -130,6 +130,8 @@ namespace Nif
|
||||
struct NiPalette;
|
||||
struct NiParticleModifier;
|
||||
struct NiParticleSystem;
|
||||
struct NiPSysCollider;
|
||||
struct NiPSysColliderManager;
|
||||
struct NiPSysEmitterCtlrData;
|
||||
struct NiPSysModifier;
|
||||
struct NiPSysSpawnModifier;
|
||||
@ -175,6 +177,8 @@ namespace Nif
|
||||
using NiPalettePtr = RecordPtrT<NiPalette>;
|
||||
using NiParticleModifierPtr = RecordPtrT<NiParticleModifier>;
|
||||
using NiParticleSystemPtr = RecordPtrT<NiParticleSystem>;
|
||||
using NiPSysColliderPtr = RecordPtrT<NiPSysCollider>;
|
||||
using NiPSysColliderManagerPtr = RecordPtrT<NiPSysColliderManager>;
|
||||
using NiPSysEmitterCtlrDataPtr = RecordPtrT<NiPSysEmitterCtlrData>;
|
||||
using NiPSysSpawnModifierPtr = RecordPtrT<NiPSysSpawnModifier>;
|
||||
using NiBoolDataPtr = RecordPtrT<NiBoolData>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user