mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 13:39:40 +00:00
Read bhkBallSocketConstraintChain and BSProceduralLightingController
This commit is contained in:
parent
02c895c107
commit
285eafbf66
7 changed files with 133 additions and 0 deletions
|
@ -553,6 +553,49 @@ namespace Nif
|
||||||
nif->read(mMaximumDistance);
|
nif->read(mMaximumDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BSProceduralLightningController::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
NiTimeController::read(nif);
|
||||||
|
|
||||||
|
mGenerationInterp.read(nif);
|
||||||
|
mMutationInterp.read(nif);
|
||||||
|
mSubdivisionInterp.read(nif);
|
||||||
|
mNumBranchesInterp.read(nif);
|
||||||
|
mNumBranchesVarInterp.read(nif);
|
||||||
|
mLengthInterp.read(nif);
|
||||||
|
mLengthVarInterp.read(nif);
|
||||||
|
mWidthInterp.read(nif);
|
||||||
|
mArcOffsetInterp.read(nif);
|
||||||
|
nif->read(mSubdivisions);
|
||||||
|
nif->read(mNumBranches);
|
||||||
|
nif->read(mNumBranchesVar);
|
||||||
|
nif->read(mLength);
|
||||||
|
nif->read(mLengthVar);
|
||||||
|
nif->read(mWidth);
|
||||||
|
nif->read(mChildWidthMult);
|
||||||
|
nif->read(mArcOffset);
|
||||||
|
nif->read(mFadeMainBolt);
|
||||||
|
nif->read(mFadeChildBolts);
|
||||||
|
nif->read(mAnimateArcOffset);
|
||||||
|
mShaderProperty.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSProceduralLightningController::post(Reader& nif)
|
||||||
|
{
|
||||||
|
NiTimeController::post(nif);
|
||||||
|
|
||||||
|
mGenerationInterp.post(nif);
|
||||||
|
mMutationInterp.post(nif);
|
||||||
|
mSubdivisionInterp.post(nif);
|
||||||
|
mNumBranchesInterp.post(nif);
|
||||||
|
mNumBranchesVarInterp.post(nif);
|
||||||
|
mLengthInterp.post(nif);
|
||||||
|
mLengthVarInterp.post(nif);
|
||||||
|
mWidthInterp.post(nif);
|
||||||
|
mArcOffsetInterp.post(nif);
|
||||||
|
mShaderProperty.post(nif);
|
||||||
|
}
|
||||||
|
|
||||||
void NiControllerManager::read(NIFStream* nif)
|
void NiControllerManager::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
NiTimeController::read(nif);
|
NiTimeController::read(nif);
|
||||||
|
|
|
@ -354,6 +354,34 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BSProceduralLightningController : NiTimeController
|
||||||
|
{
|
||||||
|
NiInterpolatorPtr mGenerationInterp;
|
||||||
|
NiInterpolatorPtr mMutationInterp;
|
||||||
|
NiInterpolatorPtr mSubdivisionInterp;
|
||||||
|
NiInterpolatorPtr mNumBranchesInterp;
|
||||||
|
NiInterpolatorPtr mNumBranchesVarInterp;
|
||||||
|
NiInterpolatorPtr mLengthInterp;
|
||||||
|
NiInterpolatorPtr mLengthVarInterp;
|
||||||
|
NiInterpolatorPtr mWidthInterp;
|
||||||
|
NiInterpolatorPtr mArcOffsetInterp;
|
||||||
|
uint16_t mSubdivisions;
|
||||||
|
uint16_t mNumBranches;
|
||||||
|
uint16_t mNumBranchesVar;
|
||||||
|
float mLength;
|
||||||
|
float mLengthVar;
|
||||||
|
float mWidth;
|
||||||
|
float mChildWidthMult;
|
||||||
|
float mArcOffset;
|
||||||
|
bool mFadeMainBolt;
|
||||||
|
bool mFadeChildBolts;
|
||||||
|
bool mAnimateArcOffset;
|
||||||
|
BSShaderPropertyPtr mShaderProperty;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
void post(Reader& nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
struct NiControllerManager : public NiTimeController
|
struct NiControllerManager : public NiTimeController
|
||||||
{
|
{
|
||||||
bool mCumulative;
|
bool mCumulative;
|
||||||
|
|
|
@ -138,6 +138,8 @@ namespace Nif
|
||||||
{ "BSFrustumFOVController", &construct<NiFloatInterpController, RC_BSFrustumFOVController> },
|
{ "BSFrustumFOVController", &construct<NiFloatInterpController, RC_BSFrustumFOVController> },
|
||||||
{ "BSKeyframeController", &construct<BSKeyframeController, RC_BSKeyframeController> },
|
{ "BSKeyframeController", &construct<BSKeyframeController, RC_BSKeyframeController> },
|
||||||
{ "BSLagBoneController", &construct<BSLagBoneController, RC_BSLagBoneController> },
|
{ "BSLagBoneController", &construct<BSLagBoneController, RC_BSLagBoneController> },
|
||||||
|
{ "BSProceduralLightningController",
|
||||||
|
&construct<BSProceduralLightningController, RC_BSProceduralLightningController> },
|
||||||
{ "BSMaterialEmittanceMultController",
|
{ "BSMaterialEmittanceMultController",
|
||||||
&construct<NiFloatInterpController, RC_BSMaterialEmittanceMultController> },
|
&construct<NiFloatInterpController, RC_BSMaterialEmittanceMultController> },
|
||||||
{ "BSNiAlphaPropertyTestRefController",
|
{ "BSNiAlphaPropertyTestRefController",
|
||||||
|
@ -391,6 +393,7 @@ namespace Nif
|
||||||
|
|
||||||
// Constraint records, Bethesda
|
// Constraint records, Bethesda
|
||||||
{ "bhkBallAndSocketConstraint", &construct<bhkBallAndSocketConstraint, RC_bhkBallAndSocketConstraint> },
|
{ "bhkBallAndSocketConstraint", &construct<bhkBallAndSocketConstraint, RC_bhkBallAndSocketConstraint> },
|
||||||
|
{ "bhkBallSocketConstraintChain", &construct<bhkBallSocketConstraintChain, RC_bhkBallSocketConstraintChain> },
|
||||||
{ "bhkHingeConstraint", &construct<bhkHingeConstraint, RC_bhkHingeConstraint> },
|
{ "bhkHingeConstraint", &construct<bhkHingeConstraint, RC_bhkHingeConstraint> },
|
||||||
{ "bhkLimitedHingeConstraint", &construct<bhkLimitedHingeConstraint, RC_bhkLimitedHingeConstraint> },
|
{ "bhkLimitedHingeConstraint", &construct<bhkLimitedHingeConstraint, RC_bhkLimitedHingeConstraint> },
|
||||||
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
|
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
|
||||||
|
|
|
@ -448,6 +448,17 @@ namespace Nif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkConstraintChainCInfo::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
readRecordList(nif, mEntities);
|
||||||
|
mInfo.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkConstraintChainCInfo::post(Reader& nif)
|
||||||
|
{
|
||||||
|
postRecordList(nif, mEntities);
|
||||||
|
}
|
||||||
|
|
||||||
/// Record types
|
/// Record types
|
||||||
|
|
||||||
void bhkCollisionObject::read(NIFStream* nif)
|
void bhkCollisionObject::read(NIFStream* nif)
|
||||||
|
@ -842,6 +853,27 @@ namespace Nif
|
||||||
mConstraint.read(nif);
|
mConstraint.read(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkBallSocketConstraintChain::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
uint32_t numPivots = nif->get<uint32_t>();
|
||||||
|
if (numPivots % 2 != 0)
|
||||||
|
throw Nif::Exception(
|
||||||
|
"Invalid number of constraints in bhkBallSocketConstraintChain", nif->getFile().getFilename());
|
||||||
|
mConstraints.resize(numPivots / 2);
|
||||||
|
for (bhkBallAndSocketConstraintCInfo& info : mConstraints)
|
||||||
|
info.read(nif);
|
||||||
|
nif->read(mTau);
|
||||||
|
nif->read(mDamping);
|
||||||
|
nif->read(mConstraintForceMixing);
|
||||||
|
nif->read(mMaxErrorDistance);
|
||||||
|
mConstraintChainInfo.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkBallSocketConstraintChain::post(Reader& nif)
|
||||||
|
{
|
||||||
|
mConstraintChainInfo.post(nif);
|
||||||
|
}
|
||||||
|
|
||||||
void bhkStiffSpringConstraint::read(NIFStream* nif)
|
void bhkStiffSpringConstraint::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
bhkConstraint::read(nif);
|
bhkConstraint::read(nif);
|
||||||
|
|
|
@ -421,6 +421,15 @@ namespace Nif
|
||||||
void read(NIFStream* nif);
|
void read(NIFStream* nif);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct bhkConstraintChainCInfo
|
||||||
|
{
|
||||||
|
bhkRigidBodyList mEntities;
|
||||||
|
bhkConstraintCInfo mInfo;
|
||||||
|
|
||||||
|
void read(NIFStream* nif);
|
||||||
|
void post(Reader& nif);
|
||||||
|
};
|
||||||
|
|
||||||
/// Record types
|
/// Record types
|
||||||
|
|
||||||
// Abstract Bethesda Havok object
|
// Abstract Bethesda Havok object
|
||||||
|
@ -764,6 +773,19 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct bhkBallSocketConstraintChain : bhkSerializable
|
||||||
|
{
|
||||||
|
std::vector<bhkBallAndSocketConstraintCInfo> mConstraints;
|
||||||
|
float mTau;
|
||||||
|
float mDamping;
|
||||||
|
float mConstraintForceMixing;
|
||||||
|
float mMaxErrorDistance;
|
||||||
|
bhkConstraintChainCInfo mConstraintChainInfo;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
void post(Reader& nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
struct bhkStiffSpringConstraint : bhkConstraint
|
struct bhkStiffSpringConstraint : bhkConstraint
|
||||||
{
|
{
|
||||||
bhkStiffSpringConstraintCInfo mConstraint;
|
bhkStiffSpringConstraintCInfo mConstraint;
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace Nif
|
||||||
RC_MISSING = 0,
|
RC_MISSING = 0,
|
||||||
RC_AvoidNode,
|
RC_AvoidNode,
|
||||||
RC_bhkBallAndSocketConstraint,
|
RC_bhkBallAndSocketConstraint,
|
||||||
|
RC_bhkBallSocketConstraintChain,
|
||||||
RC_bhkBlendCollisionObject,
|
RC_bhkBlendCollisionObject,
|
||||||
RC_bhkBlendController,
|
RC_bhkBlendController,
|
||||||
RC_bhkBoxShape,
|
RC_bhkBoxShape,
|
||||||
|
@ -98,6 +99,7 @@ namespace Nif
|
||||||
RC_BSNiAlphaPropertyTestRefController,
|
RC_BSNiAlphaPropertyTestRefController,
|
||||||
RC_BSPackedAdditionalGeometryData,
|
RC_BSPackedAdditionalGeometryData,
|
||||||
RC_BSParentVelocityModifier,
|
RC_BSParentVelocityModifier,
|
||||||
|
RC_BSProceduralLightningController,
|
||||||
RC_BSPSysArrayEmitter,
|
RC_BSPSysArrayEmitter,
|
||||||
RC_BSPSysInheritVelocityModifier,
|
RC_BSPSysInheritVelocityModifier,
|
||||||
RC_BSPSysLODModifier,
|
RC_BSPSysLODModifier,
|
||||||
|
|
|
@ -150,6 +150,7 @@ namespace Nif
|
||||||
struct bhkSerializable;
|
struct bhkSerializable;
|
||||||
struct bhkEntity;
|
struct bhkEntity;
|
||||||
struct bhkConvexShape;
|
struct bhkConvexShape;
|
||||||
|
struct bhkRigidBody;
|
||||||
struct hkPackedNiTriStripsData;
|
struct hkPackedNiTriStripsData;
|
||||||
struct NiAccumulator;
|
struct NiAccumulator;
|
||||||
struct NiInterpolator;
|
struct NiInterpolator;
|
||||||
|
@ -198,6 +199,7 @@ namespace Nif
|
||||||
using bhkShapePtr = RecordPtrT<bhkShape>;
|
using bhkShapePtr = RecordPtrT<bhkShape>;
|
||||||
using bhkEntityPtr = RecordPtrT<bhkEntity>;
|
using bhkEntityPtr = RecordPtrT<bhkEntity>;
|
||||||
using bhkConvexShapePtr = RecordPtrT<bhkConvexShape>;
|
using bhkConvexShapePtr = RecordPtrT<bhkConvexShape>;
|
||||||
|
using bhkRigidBodyPtr = RecordPtrT<bhkRigidBody>;
|
||||||
using hkPackedNiTriStripsDataPtr = RecordPtrT<hkPackedNiTriStripsData>;
|
using hkPackedNiTriStripsDataPtr = RecordPtrT<hkPackedNiTriStripsData>;
|
||||||
using NiAccumulatorPtr = RecordPtrT<NiAccumulator>;
|
using NiAccumulatorPtr = RecordPtrT<NiAccumulator>;
|
||||||
using NiInterpolatorPtr = RecordPtrT<NiInterpolator>;
|
using NiInterpolatorPtr = RecordPtrT<NiInterpolator>;
|
||||||
|
@ -218,6 +220,7 @@ namespace Nif
|
||||||
using bhkShapeList = RecordListT<bhkShape>;
|
using bhkShapeList = RecordListT<bhkShape>;
|
||||||
using bhkSerializableList = RecordListT<bhkSerializable>;
|
using bhkSerializableList = RecordListT<bhkSerializable>;
|
||||||
using bhkEntityList = RecordListT<bhkEntity>;
|
using bhkEntityList = RecordListT<bhkEntity>;
|
||||||
|
using bhkRigidBodyList = RecordListT<bhkEntity>;
|
||||||
using NiControllerSequenceList = RecordListT<NiControllerSequence>;
|
using NiControllerSequenceList = RecordListT<NiControllerSequence>;
|
||||||
using NiPSysModifierList = RecordListT<NiPSysModifier>;
|
using NiPSysModifierList = RecordListT<NiPSysModifier>;
|
||||||
using NiTriBasedGeomList = RecordListT<NiTriBasedGeom>;
|
using NiTriBasedGeomList = RecordListT<NiTriBasedGeom>;
|
||||||
|
|
Loading…
Reference in a new issue