mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 07:15:36 +00:00
Merge branch 'readingbooksbutnotquite' into 'master'
Read bhkLimitedHingeConstraint See merge request OpenMW/openmw!3254
This commit is contained in:
commit
62ef209185
4 changed files with 62 additions and 0 deletions
|
@ -187,6 +187,7 @@ namespace Nif
|
|||
{ "bhkRigidBodyT", &construct<bhkRigidBody, RC_bhkRigidBodyT> },
|
||||
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
|
||||
{ "bhkHingeConstraint", &construct<bhkHingeConstraint, RC_bhkHingeConstraint> },
|
||||
{ "bhkLimitedHingeConstraint", &construct<bhkLimitedHingeConstraint, RC_bhkLimitedHingeConstraint> },
|
||||
{ "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> },
|
||||
{ "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> },
|
||||
{ "NiSortAdjustNode", &construct<NiSortAdjustNode, RC_NiSortAdjustNode> },
|
||||
|
|
|
@ -306,6 +306,37 @@ namespace Nif
|
|||
nif->read(mDataB.mPivot);
|
||||
}
|
||||
}
|
||||
|
||||
void bhkLimitedHingeConstraintCInfo::read(NIFStream* nif)
|
||||
{
|
||||
if (nif->getBethVersion() <= 16)
|
||||
{
|
||||
nif->read(mDataA.mPivot);
|
||||
nif->read(mDataA.mAxis);
|
||||
nif->read(mDataA.mPerpAxis1);
|
||||
nif->read(mDataA.mPerpAxis2);
|
||||
nif->read(mDataB.mPivot);
|
||||
nif->read(mDataB.mAxis);
|
||||
nif->read(mDataB.mPerpAxis2);
|
||||
}
|
||||
else
|
||||
{
|
||||
nif->read(mDataA.mAxis);
|
||||
nif->read(mDataA.mPerpAxis1);
|
||||
nif->read(mDataA.mPerpAxis2);
|
||||
nif->read(mDataA.mPivot);
|
||||
nif->read(mDataB.mAxis);
|
||||
nif->read(mDataB.mPerpAxis1);
|
||||
nif->read(mDataB.mPerpAxis2);
|
||||
nif->read(mDataB.mPivot);
|
||||
}
|
||||
nif->read(mMinAngle);
|
||||
nif->read(mMaxAngle);
|
||||
nif->read(mMaxFriction);
|
||||
if (nif->getVersion() >= NIFFile::NIFVersion::VER_BGS && nif->getBethVersion() > 16)
|
||||
mMotor.read(nif);
|
||||
}
|
||||
|
||||
/// Record types
|
||||
|
||||
void bhkCollisionObject::read(NIFStream* nif)
|
||||
|
@ -590,4 +621,10 @@ namespace Nif
|
|||
mConstraint.read(nif);
|
||||
}
|
||||
|
||||
void bhkLimitedHingeConstraint::read(NIFStream* nif)
|
||||
{
|
||||
bhkConstraint::read(nif);
|
||||
mConstraint.read(nif);
|
||||
}
|
||||
|
||||
} // Namespace
|
||||
|
|
|
@ -306,6 +306,23 @@ namespace Nif
|
|||
void read(NIFStream* nif);
|
||||
};
|
||||
|
||||
struct bhkLimitedHingeConstraintCInfo
|
||||
{
|
||||
struct HingeData
|
||||
{
|
||||
osg::Vec4f mPivot;
|
||||
osg::Vec4f mAxis;
|
||||
osg::Vec4f mPerpAxis1;
|
||||
osg::Vec4f mPerpAxis2;
|
||||
};
|
||||
HingeData mDataA;
|
||||
HingeData mDataB;
|
||||
float mMinAngle, mMaxAngle;
|
||||
float mMaxFriction;
|
||||
bhkConstraintMotorCInfo mMotor;
|
||||
void read(NIFStream* nif);
|
||||
};
|
||||
|
||||
/// Record types
|
||||
|
||||
// Abstract Bethesda Havok object
|
||||
|
@ -548,5 +565,11 @@ namespace Nif
|
|||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct bhkLimitedHingeConstraint : public bhkConstraint
|
||||
{
|
||||
bhkLimitedHingeConstraintCInfo mConstraint;
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
} // Namespace
|
||||
#endif
|
||||
|
|
|
@ -149,6 +149,7 @@ namespace Nif
|
|||
RC_bhkRigidBodyT,
|
||||
RC_bhkRagdollConstraint,
|
||||
RC_bhkHingeConstraint,
|
||||
RC_bhkLimitedHingeConstraint,
|
||||
RC_BSLightingShaderProperty,
|
||||
RC_BSEffectShaderProperty,
|
||||
RC_NiClusterAccumulator,
|
||||
|
|
Loading…
Reference in a new issue