diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index a3033357ec..903cf7710c 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -460,6 +460,50 @@ namespace Nif mData.post(nif); } + void NiBoneLODController::read(NIFStream* nif) + { + NiTimeController::read(nif); + + nif->read(mLOD); + mNodeGroups.resize(nif->get()); + nif->read(mNumNodeGroups); + for (NiAVObjectList& group : mNodeGroups) + readRecordList(nif, group); + + if (nif->getBethVersion() != 0 || nif->getVersion() < NIFStream::generateVersion(4, 2, 2, 0)) + return; + + mSkinnedShapeGroups.resize(nif->get()); + for (std::vector& group : mSkinnedShapeGroups) + { + group.resize(nif->get()); + for (SkinInfo& info : group) + { + info.mShape.read(nif); + info.mSkin.read(nif); + } + } + readRecordList(nif, mShapeGroups); + } + + void NiBoneLODController::post(Reader& nif) + { + NiTimeController::post(nif); + + for (NiAVObjectList& group : mNodeGroups) + postRecordList(nif, group); + + for (std::vector& group : mSkinnedShapeGroups) + { + for (SkinInfo& info : group) + { + info.mShape.post(nif); + info.mSkin.post(nif); + } + } + postRecordList(nif, mShapeGroups); + } + void bhkBlendController::read(NIFStream* nif) { NiTimeController::read(nif); @@ -509,6 +553,49 @@ namespace Nif 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) { NiTimeController::read(nif); @@ -600,6 +687,26 @@ namespace Nif mPercentData.post(nif); } + void NiLookAtInterpolator::read(NIFStream* nif) + { + nif->read(mLookAtFlags); + mLookAt.read(nif); + nif->read(mLookAtName); + if (nif->getVersion() <= NIFStream::generateVersion(20, 4, 0, 12)) + nif->read(mTransform); + mTranslation.read(nif); + mRoll.read(nif); + mScale.read(nif); + } + + void NiLookAtInterpolator::post(Reader& nif) + { + mLookAt.post(nif); + mTranslation.post(nif); + mRoll.post(nif); + mScale.post(nif); + } + void NiBlendInterpolator::read(NIFStream* nif) { if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 112)) diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index 8a7d306a85..33c04a6d35 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -300,6 +300,24 @@ namespace Nif void post(Reader& nif) override; }; + struct NiBoneLODController : NiTimeController + { + struct SkinInfo + { + NiTriBasedGeomPtr mShape; + NiSkinInstancePtr mSkin; + }; + + uint32_t mLOD; + uint32_t mNumNodeGroups; + std::vector mNodeGroups; + std::vector> mSkinnedShapeGroups; + NiTriBasedGeomList mShapeGroups; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct bhkBlendController : public NiTimeController { void read(NIFStream* nif) override; @@ -336,6 +354,34 @@ namespace Nif 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 { bool mCumulative; @@ -419,6 +465,21 @@ namespace Nif void post(Reader& nif) override; }; + struct NiLookAtInterpolator : NiInterpolator + { + // Uses the same flags as NiLookAtController + uint16_t mLookAtFlags{ 0 }; + NiAVObjectPtr mLookAt; + std::string mLookAtName; + NiQuatTransform mTransform; + NiInterpolatorPtr mTranslation; + NiInterpolatorPtr mRoll; + NiInterpolatorPtr mScale; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + // Abstract struct NiBlendInterpolator : public NiInterpolator { diff --git a/components/nif/data.cpp b/components/nif/data.cpp index 9aa61b4db7..62a2a9cce3 100644 --- a/components/nif/data.cpp +++ b/components/nif/data.cpp @@ -19,7 +19,7 @@ namespace Nif switch (recType) { case RC_NiPSysData: - // case RC_NiMeshPSysData: + case RC_NiMeshPSysData: case RC_BSStripPSysData: isPSysData = true; break; diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index f526c1e3d4..0106f47e2f 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -72,6 +72,7 @@ namespace Nif { "BSDebrisNode", &construct }, { "BSFadeNode", &construct }, { "BSLeafAnimNode", &construct }, + { "BSMasterParticleSystem", &construct }, { "BSMultiBoundNode", &construct }, { "BSOrderedNode", &construct }, { "BSRangeNode", &construct }, @@ -117,6 +118,7 @@ namespace Nif { "NiVisController", &construct }, // Gamebryo + { "NiBoneLODController", &construct }, { "NiControllerManager", &construct }, { "NiLightDimmerController", &construct }, { "NiTransformController", &construct }, @@ -136,6 +138,8 @@ namespace Nif { "BSFrustumFOVController", &construct }, { "BSKeyframeController", &construct }, { "BSLagBoneController", &construct }, + { "BSProceduralLightningController", + &construct }, { "BSMaterialEmittanceMultController", &construct }, { "BSNiAlphaPropertyTestRefController", @@ -153,6 +157,7 @@ namespace Nif { "BSLightingShaderPropertyFloatController", &construct }, { "bhkBlendController", &construct }, + { "NiBSBoneLODController", &construct }, // Interpolators, Gamebryo { "NiBlendBoolInterpolator", &construct }, @@ -164,6 +169,7 @@ namespace Nif { "NiBoolTimelineInterpolator", &construct }, { "NiColorInterpolator", &construct }, { "NiFloatInterpolator", &construct }, + { "NiLookAtInterpolator", &construct }, { "NiPathInterpolator", &construct }, { "NiPoint3Interpolator", &construct }, { "NiTransformInterpolator", &construct }, @@ -281,6 +287,7 @@ namespace Nif { "NiParticleSystem", &construct }, { "NiMeshParticleSystem", &construct }, { "NiPSysData", &construct }, + { "NiMeshPSysData", &construct }, // Geometry, Bethesda { "BSStripParticleSystem", &construct }, @@ -303,8 +310,11 @@ namespace Nif { "NiPSysPositionModifier", &construct }, { "NiPSysRotationModifier", &construct }, { "NiPSysSpawnModifier", &construct }, + { "NiPSysMeshUpdateModifier", &construct }, // Modifiers, Bethesda + { "BSParentVelocityModifier", &construct }, + { "BSPSysHavokUpdateModifier", &construct }, { "BSPSysInheritVelocityModifier", &construct }, { "BSPSysLODModifier", &construct }, @@ -350,6 +360,10 @@ namespace Nif { "NiPSysInitialRotAngleVarCtlr", &construct }, { "NiPSysModifierActiveCtlr", &construct }, + // Modifier controllers, Bethesda + { "BSPSysMultiTargetEmitterCtlr", + &construct }, + // Modifier controller data, Gamebryo { "NiPSysEmitterCtlrData", &construct }, @@ -383,10 +397,15 @@ namespace Nif // Constraint records, Bethesda { "bhkBallAndSocketConstraint", &construct }, + { "bhkBallSocketConstraintChain", + &construct }, { "bhkHingeConstraint", &construct }, { "bhkLimitedHingeConstraint", &construct }, { "bhkRagdollConstraint", &construct }, { "bhkStiffSpringConstraint", &construct }, + { "bhkPrismaticConstraint", &construct }, + { "bhkMalleableConstraint", &construct }, + { "bhkBreakableConstraint", &construct }, // Physics body records, Bethesda { "bhkRigidBody", &construct }, @@ -404,9 +423,11 @@ namespace Nif { "bhkConvexVerticesShape", &construct }, { "bhkListShape", &construct }, { "bhkMoppBvTreeShape", &construct }, + { "bhkMultiSphereShape", &construct }, { "bhkNiTriStripsShape", &construct }, { "bhkPackedNiTriStripsShape", &construct }, { "hkPackedNiTriStripsData", &construct }, + { "bhkPlaneShape", &construct }, { "bhkSimpleShapePhantom", &construct }, { "bhkSphereShape", &construct }, { "bhkTransformShape", &construct }, diff --git a/components/nif/particle.cpp b/components/nif/particle.cpp index 0d3545acd5..d74473f468 100644 --- a/components/nif/particle.cpp +++ b/components/nif/particle.cpp @@ -150,6 +150,21 @@ namespace Nif nif->readVector(mRotations, mNumVertices); } + void BSMasterParticleSystem::read(NIFStream* nif) + { + NiNode::read(nif); + + nif->read(mMaxEmitters); + readRecordList(nif, mParticleSystems); + } + + void BSMasterParticleSystem::post(Reader& nif) + { + NiNode::post(nif); + + postRecordList(nif, mParticleSystems); + } + void NiParticleSystem::read(NIFStream* nif) { // Weird loading to account for inheritance differences starting from SSE @@ -215,6 +230,26 @@ namespace Nif } } + void NiMeshPSysData::read(NIFStream* nif) + { + NiPSysData::read(nif); + + if (nif->getVersion() >= NIFStream::generateVersion(10, 2, 0, 0)) + { + nif->read(mDefaultPoolSize); + nif->read(mFillPoolsOnLoad); + nif->readVector(mGenerations, nif->get()); + } + mParticleMeshes.read(nif); + } + + void NiMeshPSysData::post(Reader& nif) + { + NiPSysData::post(nif); + + mParticleMeshes.post(nif); + } + void BSStripPSysData::read(NIFStream* nif) { NiPSysData::read(nif); @@ -347,6 +382,20 @@ namespace Nif nif->read(mBaseScale); } + void NiPSysMeshUpdateModifier::read(NIFStream* nif) + { + NiPSysModifier::read(nif); + + readRecordList(nif, mMeshes); + } + + void NiPSysMeshUpdateModifier::post(Reader& nif) + { + NiPSysModifier::post(nif); + + postRecordList(nif, mMeshes); + } + void NiPSysRotationModifier::read(NIFStream* nif) { NiPSysModifier::read(nif); @@ -383,6 +432,27 @@ namespace Nif nif->read(mLifespanVariation); } + void BSParentVelocityModifier::read(NIFStream* nif) + { + NiPSysModifier::read(nif); + + nif->read(mDamping); + } + + void BSPSysHavokUpdateModifier::read(NIFStream* nif) + { + NiPSysMeshUpdateModifier::read(nif); + + mModifier.read(nif); + } + + void BSPSysHavokUpdateModifier::post(Reader& nif) + { + NiPSysMeshUpdateModifier::post(nif); + + mModifier.post(nif); + } + void BSPSysInheritVelocityModifier::read(NIFStream* nif) { NiPSysModifier::read(nif); @@ -575,6 +645,21 @@ namespace Nif mVisInterpolator.post(nif); } + void BSPSysMultiTargetEmitterCtlr::read(NIFStream* nif) + { + NiPSysEmitterCtlr::read(nif); + + nif->read(mMaxEmitters); + mMasterPSys.read(nif); + } + + void BSPSysMultiTargetEmitterCtlr::post(Reader& nif) + { + NiPSysEmitterCtlr::post(nif); + + mMasterPSys.post(nif); + } + void NiPSysEmitterCtlrData::read(NIFStream* nif) { mFloatKeyList = std::make_shared(); diff --git a/components/nif/particle.hpp b/components/nif/particle.hpp index 8fc24ee407..45b6296891 100644 --- a/components/nif/particle.hpp +++ b/components/nif/particle.hpp @@ -115,6 +115,15 @@ namespace Nif void read(NIFStream* nif) override; }; + struct BSMasterParticleSystem : NiNode + { + uint16_t mMaxEmitters; + NiAVObjectList mParticleSystems; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct NiParticleSystem : NiParticles { osg::BoundingSpheref mBoundingSphere; @@ -138,6 +147,17 @@ namespace Nif void read(NIFStream* nif) override; }; + struct NiMeshPSysData : NiPSysData + { + uint32_t mDefaultPoolSize; + bool mFillPoolsOnLoad; + std::vector mGenerations; + NiAVObjectPtr mParticleMeshes; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct BSStripPSysData : NiPSysData { uint16_t mMaxPointCount; @@ -252,6 +272,14 @@ namespace Nif void read(NIFStream* nif) override; }; + struct NiPSysMeshUpdateModifier : NiPSysModifier + { + NiAVObjectList mMeshes; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct NiPSysRotationModifier : NiPSysModifier { float mRotationSpeed; @@ -279,6 +307,21 @@ namespace Nif void read(NIFStream* nif) override; }; + struct BSParentVelocityModifier : NiPSysModifier + { + float mDamping; + + void read(NIFStream* nif) override; + }; + + struct BSPSysHavokUpdateModifier : NiPSysMeshUpdateModifier + { + NiPSysModifierPtr mModifier; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct BSPSysInheritVelocityModifier : NiPSysModifier { NiAVObjectPtr mInheritObject; @@ -460,6 +503,15 @@ namespace Nif void post(Reader& nif) override; }; + struct BSPSysMultiTargetEmitterCtlr : NiPSysEmitterCtlr + { + uint16_t mMaxEmitters; + BSMasterParticleSystemPtr mMasterPSys; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct NiPSysEmitterCtlrData : Record { FloatKeyMapPtr mFloatKeyList; diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index f97b4b6169..4969bf2cb9 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -345,6 +345,120 @@ namespace Nif nif->read(mLength); } + void bhkPrismaticConstraintCInfo::read(NIFStream* nif) + { + if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB) + { + nif->read(mDataA.mPivot); + nif->read(mDataA.mRotation); + nif->read(mDataA.mPlane); + nif->read(mDataA.mSliding); + nif->read(mDataB.mSliding); + nif->read(mDataB.mPivot); + nif->read(mDataB.mRotation); + nif->read(mDataB.mPlane); + } + else + { + nif->read(mDataA.mSliding); + nif->read(mDataA.mRotation); + nif->read(mDataA.mPlane); + nif->read(mDataA.mPivot); + nif->read(mDataB.mSliding); + nif->read(mDataB.mRotation); + nif->read(mDataB.mPlane); + nif->read(mDataB.mPivot); + } + nif->read(mMinDistance); + nif->read(mMaxDistance); + nif->read(mFriction); + if (nif->getVersion() >= NIFFile::NIFVersion::VER_BGS && nif->getBethVersion() >= 17) + mMotor.read(nif); + } + + void bhkMalleableConstraintCInfo::read(NIFStream* nif) + { + mType = static_cast(nif->get()); + mInfo.read(nif); + switch (mType) + { + case hkConstraintType::BallAndSocket: + mBallAndSocketInfo.read(nif); + break; + case hkConstraintType::Hinge: + mHingeInfo.read(nif); + break; + case hkConstraintType::LimitedHinge: + mLimitedHingeInfo.read(nif); + break; + case hkConstraintType::Prismatic: + mPrismaticInfo.read(nif); + break; + case hkConstraintType::Ragdoll: + mRagdollInfo.read(nif); + break; + case hkConstraintType::StiffSpring: + mStiffSpringInfo.read(nif); + break; + default: + throw Nif::Exception( + "Unrecognized constraint type in bhkMalleableConstraint", nif->getFile().getFilename()); + } + if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB) + { + nif->read(mTau); + nif->read(mDamping); + } + else + { + nif->read(mStrength); + } + } + + void bhkWrappedConstraintData::read(NIFStream* nif) + { + mType = static_cast(nif->get()); + mInfo.read(nif); + switch (mType) + { + case hkConstraintType::BallAndSocket: + mBallAndSocketInfo.read(nif); + break; + case hkConstraintType::Hinge: + mHingeInfo.read(nif); + break; + case hkConstraintType::LimitedHinge: + mLimitedHingeInfo.read(nif); + break; + case hkConstraintType::Prismatic: + mPrismaticInfo.read(nif); + break; + case hkConstraintType::Ragdoll: + mRagdollInfo.read(nif); + break; + case hkConstraintType::StiffSpring: + mStiffSpringInfo.read(nif); + break; + case hkConstraintType::Malleable: + mMalleableInfo.read(nif); + break; + default: + throw Nif::Exception( + "Unrecognized constraint type in bhkWrappedConstraintData", nif->getFile().getFilename()); + } + } + + void bhkConstraintChainCInfo::read(NIFStream* nif) + { + readRecordList(nif, mEntities); + mInfo.read(nif); + } + + void bhkConstraintChainCInfo::post(Reader& nif) + { + postRecordList(nif, mEntities); + } + /// Record types void bhkCollisionObject::read(NIFStream* nif) @@ -602,6 +716,29 @@ namespace Nif nif->skip(12); // Unused } + void bhkHeightfieldShape::read(NIFStream* nif) + { + mHavokMaterial.read(nif); + } + + void bhkPlaneShape::read(NIFStream* nif) + { + bhkHeightfieldShape::read(nif); + + nif->skip(12); // Unused + mPlane = osg::Plane(nif->get()); + nif->read(mExtents); + nif->read(mCenter); + } + + void bhkMultiSphereShape::read(NIFStream* nif) + { + bhkSphereRepShape::read(nif); + + mShapeProperty.read(nif); + nif->readVector(mSpheres, nif->get()); + } + void bhkListShape::read(NIFStream* nif) { readRecordList(nif, mSubshapes); @@ -739,6 +876,27 @@ namespace Nif mConstraint.read(nif); } + void bhkBallSocketConstraintChain::read(NIFStream* nif) + { + uint32_t numPivots = nif->get(); + 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) { bhkConstraint::read(nif); @@ -746,4 +904,27 @@ namespace Nif mConstraint.read(nif); } + void bhkPrismaticConstraint::read(NIFStream* nif) + { + bhkConstraint::read(nif); + + mConstraint.read(nif); + } + + void bhkMalleableConstraint::read(NIFStream* nif) + { + bhkConstraint::read(nif); + + mConstraint.read(nif); + } + + void bhkBreakableConstraint::read(NIFStream* nif) + { + bhkConstraint::read(nif); + + mConstraint.read(nif); + nif->read(mThreshold); + nif->read(mRemoveWhenBroken); + } + } // Namespace diff --git a/components/nif/physics.hpp b/components/nif/physics.hpp index cdfb3cc1fb..6f7b14f1ee 100644 --- a/components/nif/physics.hpp +++ b/components/nif/physics.hpp @@ -5,6 +5,7 @@ #include "record.hpp" #include "recordptr.hpp" +#include #include #include #include @@ -363,6 +364,73 @@ namespace Nif void read(NIFStream* nif); }; + struct bhkPrismaticConstraintCInfo + { + struct Data + { + osg::Vec4f mSliding; + osg::Vec4f mRotation; + osg::Vec4f mPlane; + osg::Vec4f mPivot; + }; + + Data mDataA; + Data mDataB; + float mMinDistance, mMaxDistance; + float mFriction; + bhkConstraintMotorCInfo mMotor; + + void read(NIFStream* nif); + }; + + enum class hkConstraintType : uint32_t + { + BallAndSocket = 0, + Hinge = 1, + LimitedHinge = 2, + Prismatic = 6, + Ragdoll = 7, + StiffSpring = 8, + Malleable = 13, + }; + + struct bhkWrappedConstraintDataBase + { + hkConstraintType mType; + bhkConstraintCInfo mInfo; + bhkBallAndSocketConstraintCInfo mBallAndSocketInfo; + bhkHingeConstraintCInfo mHingeInfo; + bhkLimitedHingeConstraintCInfo mLimitedHingeInfo; + bhkPrismaticConstraintCInfo mPrismaticInfo; + bhkRagdollConstraintCInfo mRagdollInfo; + bhkStiffSpringConstraintCInfo mStiffSpringInfo; + }; + + struct bhkMalleableConstraintCInfo : bhkWrappedConstraintDataBase + { + float mTau; + float mDamping; + float mStrength; + + void read(NIFStream* nif); + }; + + struct bhkWrappedConstraintData : bhkWrappedConstraintDataBase + { + bhkMalleableConstraintCInfo mMalleableInfo; + + void read(NIFStream* nif); + }; + + struct bhkConstraintChainCInfo + { + bhkRigidBodyList mEntities; + bhkConstraintCInfo mInfo; + + void read(NIFStream* nif); + void post(Reader& nif); + }; + /// Record types // Abstract Bethesda Havok object @@ -609,9 +677,36 @@ namespace Nif void read(NIFStream* nif) override; }; + // Abstract shape that can collide with an array of spheres + struct bhkHeightfieldShape : bhkShape + { + HavokMaterial mHavokMaterial; + + void read(NIFStream* nif) override; + }; + + // A plane bounded by an AABB + struct bhkPlaneShape : bhkHeightfieldShape + { + osg::Plane mPlane; + osg::Vec4f mExtents; + osg::Vec4f mCenter; + + void read(NIFStream* nif) override; + }; + // A sphere using bhkSphereShape = bhkConvexShape; + // Multiple spheres + struct bhkMultiSphereShape : bhkSphereRepShape + { + bhkWorldObjCInfoProperty mShapeProperty; + std::vector mSpheres; + + void read(NIFStream* nif) override; + }; + // A list of shapes struct bhkListShape : public bhkShapeCollection { @@ -706,6 +801,19 @@ namespace Nif void read(NIFStream* nif) override; }; + struct bhkBallSocketConstraintChain : bhkSerializable + { + std::vector mConstraints; + float mTau; + float mDamping; + float mConstraintForceMixing; + float mMaxErrorDistance; + bhkConstraintChainCInfo mConstraintChainInfo; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + struct bhkStiffSpringConstraint : bhkConstraint { bhkStiffSpringConstraintCInfo mConstraint; @@ -713,5 +821,28 @@ namespace Nif void read(NIFStream* nif) override; }; + struct bhkPrismaticConstraint : bhkConstraint + { + bhkPrismaticConstraintCInfo mConstraint; + + void read(NIFStream* nif) override; + }; + + struct bhkMalleableConstraint : bhkConstraint + { + bhkMalleableConstraintCInfo mConstraint; + + void read(NIFStream* nif) override; + }; + + struct bhkBreakableConstraint : bhkConstraint + { + bhkWrappedConstraintData mConstraint; + float mThreshold; + bool mRemoveWhenBroken; + + void read(NIFStream* nif) override; + }; + } // Namespace #endif diff --git a/components/nif/record.hpp b/components/nif/record.hpp index f7bb4fa648..331c2ff645 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -37,9 +37,11 @@ namespace Nif RC_MISSING = 0, RC_AvoidNode, RC_bhkBallAndSocketConstraint, + RC_bhkBallSocketConstraintChain, RC_bhkBlendCollisionObject, RC_bhkBlendController, RC_bhkBoxShape, + RC_bhkBreakableConstraint, RC_bhkCapsuleShape, RC_bhkCylinderShape, RC_bhkCollisionObject, @@ -52,10 +54,14 @@ namespace Nif RC_bhkHingeConstraint, RC_bhkLimitedHingeConstraint, RC_bhkListShape, + RC_bhkMalleableConstraint, RC_bhkMoppBvTreeShape, + RC_bhkMultiSphereShape, RC_bhkNiTriStripsShape, RC_bhkPackedNiTriStripsShape, + RC_bhkPlaneShape, RC_bhkPhysicsSystem, + RC_bhkPrismaticConstraint, RC_bhkRagdollConstraint, RC_bhkRagdollSystem, RC_bhkRigidBody, @@ -94,9 +100,13 @@ namespace Nif RC_BSMultiBoundSphere, RC_BSNiAlphaPropertyTestRefController, RC_BSPackedAdditionalGeometryData, + RC_BSParentVelocityModifier, + RC_BSProceduralLightningController, RC_BSPSysArrayEmitter, + RC_BSPSysHavokUpdateModifier, RC_BSPSysInheritVelocityModifier, RC_BSPSysLODModifier, + RC_BSPSysMultiTargetEmitterCtlr, RC_BSPSysRecycleBoundModifier, RC_BSPSysScaleModifier, RC_BSPSysSimpleColorModifier, @@ -129,6 +139,7 @@ namespace Nif RC_NiBlendFloatInterpolator, RC_NiBlendPoint3Interpolator, RC_NiBlendTransformInterpolator, + RC_NiBoneLODController, RC_NiBoolData, RC_NiBooleanExtraData, RC_NiBoolInterpolator, @@ -172,8 +183,10 @@ namespace Nif RC_NiLinesData, RC_NiLODNode, RC_NiLookAtController, + RC_NiLookAtInterpolator, RC_NiMaterialColorController, RC_NiMaterialProperty, + RC_NiMeshPSysData, RC_NiMorphData, RC_NiMultiTargetTransformController, RC_NiNode, @@ -223,6 +236,7 @@ namespace Nif RC_NiPSysInitialRotAngleCtlr, RC_NiPSysInitialRotAngleVarCtlr, RC_NiPSysMeshEmitter, + RC_NiPSysMeshUpdateModifier, RC_NiPSysModifierActiveCtlr, RC_NiPSysPlanarCollider, RC_NiPSysPositionModifier, diff --git a/components/nif/recordptr.hpp b/components/nif/recordptr.hpp index 50d16d5eac..b847f609a4 100644 --- a/components/nif/recordptr.hpp +++ b/components/nif/recordptr.hpp @@ -129,6 +129,7 @@ namespace Nif struct NiSourceTexture; struct NiPalette; struct NiParticleModifier; + struct BSMasterParticleSystem; struct NiParticleSystem; struct NiPSysCollider; struct NiPSysColliderManager; @@ -138,6 +139,7 @@ namespace Nif struct NiBoolData; struct NiSkinPartition; struct BSShaderTextureSet; + struct NiTriBasedGeom; struct NiGeometryData; struct BSShaderProperty; struct NiAlphaProperty; @@ -148,6 +150,7 @@ namespace Nif struct bhkSerializable; struct bhkEntity; struct bhkConvexShape; + struct bhkRigidBody; struct hkPackedNiTriStripsData; struct NiAccumulator; struct NiInterpolator; @@ -177,14 +180,17 @@ namespace Nif using NiSourceTexturePtr = RecordPtrT; using NiPalettePtr = RecordPtrT; using NiParticleModifierPtr = RecordPtrT; + using BSMasterParticleSystemPtr = RecordPtrT; using NiParticleSystemPtr = RecordPtrT; using NiPSysColliderPtr = RecordPtrT; using NiPSysColliderManagerPtr = RecordPtrT; using NiPSysEmitterCtlrDataPtr = RecordPtrT; + using NiPSysModifierPtr = RecordPtrT; using NiPSysSpawnModifierPtr = RecordPtrT; using NiBoolDataPtr = RecordPtrT; using NiSkinPartitionPtr = RecordPtrT; using BSShaderTextureSetPtr = RecordPtrT; + using NiTriBasedGeomPtr = RecordPtrT; using NiGeometryDataPtr = RecordPtrT; using BSShaderPropertyPtr = RecordPtrT; using NiAlphaPropertyPtr = RecordPtrT; @@ -194,6 +200,7 @@ namespace Nif using bhkShapePtr = RecordPtrT; using bhkEntityPtr = RecordPtrT; using bhkConvexShapePtr = RecordPtrT; + using bhkRigidBodyPtr = RecordPtrT; using hkPackedNiTriStripsDataPtr = RecordPtrT; using NiAccumulatorPtr = RecordPtrT; using NiInterpolatorPtr = RecordPtrT; @@ -214,8 +221,10 @@ namespace Nif using bhkShapeList = RecordListT; using bhkSerializableList = RecordListT; using bhkEntityList = RecordListT; + using bhkRigidBodyList = RecordListT; using NiControllerSequenceList = RecordListT; using NiPSysModifierList = RecordListT; + using NiTriBasedGeomList = RecordListT; } // Namespace #endif