Read bhkHingeConstraint

revert-6246b479
Alexei Kotov 1 year ago
parent 83be42893d
commit eb3e762c50

@ -180,6 +180,7 @@ namespace Nif
{ "bhkRigidBody", &construct<bhkRigidBody, RC_bhkRigidBody> },
{ "bhkRigidBodyT", &construct<bhkRigidBody, RC_bhkRigidBodyT> },
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
{ "bhkHingeConstraint", &construct<bhkHingeConstraint, RC_bhkHingeConstraint> },
{ "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> },
{ "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> },
{ "NiSortAdjustNode", &construct<NiSortAdjustNode, RC_NiSortAdjustNode> },

@ -284,6 +284,28 @@ namespace Nif
mMotor.read(nif);
}
void bhkHingeConstraintCInfo::read(NIFStream* nif)
{
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB)
{
nif->read(mDataA.mPivot);
nif->read(mDataA.mPerpAxis1);
nif->read(mDataA.mPerpAxis2);
nif->read(mDataB.mPivot);
nif->read(mDataB.mAxis);
}
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);
}
}
/// Record types
void bhkCollisionObject::read(NIFStream* nif)
@ -562,4 +584,10 @@ namespace Nif
mConstraint.read(nif);
}
void bhkHingeConstraint::read(NIFStream* nif)
{
bhkConstraint::read(nif);
mConstraint.read(nif);
}
} // Namespace

@ -290,6 +290,20 @@ namespace Nif
void read(NIFStream* nif);
};
struct bhkHingeConstraintCInfo
{
struct HingeData
{
osg::Vec4f mPivot;
osg::Vec4f mAxis;
osg::Vec4f mPerpAxis1;
osg::Vec4f mPerpAxis2;
};
HingeData mDataA;
HingeData mDataB;
void read(NIFStream* nif);
};
/// Record types
// Abstract Bethesda Havok object
@ -526,5 +540,11 @@ namespace Nif
void read(NIFStream* nif) override;
};
struct bhkHingeConstraint : public bhkConstraint
{
bhkHingeConstraintCInfo mConstraint;
void read(NIFStream* nif) override;
};
} // Namespace
#endif

@ -146,6 +146,7 @@ namespace Nif
RC_bhkRigidBody,
RC_bhkRigidBodyT,
RC_bhkRagdollConstraint,
RC_bhkHingeConstraint,
RC_BSLightingShaderProperty,
RC_BSEffectShaderProperty,
RC_NiClusterAccumulator,

Loading…
Cancel
Save