mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-23 07:11:33 +00:00
Read bhkHingeConstraint
This commit is contained in:
parent
83be42893d
commit
eb3e762c50
4 changed files with 50 additions and 0 deletions
|
@ -180,6 +180,7 @@ namespace Nif
|
||||||
{ "bhkRigidBody", &construct<bhkRigidBody, RC_bhkRigidBody> },
|
{ "bhkRigidBody", &construct<bhkRigidBody, RC_bhkRigidBody> },
|
||||||
{ "bhkRigidBodyT", &construct<bhkRigidBody, RC_bhkRigidBodyT> },
|
{ "bhkRigidBodyT", &construct<bhkRigidBody, RC_bhkRigidBodyT> },
|
||||||
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
|
{ "bhkRagdollConstraint", &construct<bhkRagdollConstraint, RC_bhkRagdollConstraint> },
|
||||||
|
{ "bhkHingeConstraint", &construct<bhkHingeConstraint, RC_bhkHingeConstraint> },
|
||||||
{ "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> },
|
{ "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> },
|
||||||
{ "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> },
|
{ "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> },
|
||||||
{ "NiSortAdjustNode", &construct<NiSortAdjustNode, RC_NiSortAdjustNode> },
|
{ "NiSortAdjustNode", &construct<NiSortAdjustNode, RC_NiSortAdjustNode> },
|
||||||
|
|
|
@ -284,6 +284,28 @@ namespace Nif
|
||||||
mMotor.read(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
|
/// Record types
|
||||||
|
|
||||||
void bhkCollisionObject::read(NIFStream* nif)
|
void bhkCollisionObject::read(NIFStream* nif)
|
||||||
|
@ -562,4 +584,10 @@ namespace Nif
|
||||||
mConstraint.read(nif);
|
mConstraint.read(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkHingeConstraint::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
bhkConstraint::read(nif);
|
||||||
|
mConstraint.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
} // Namespace
|
} // Namespace
|
||||||
|
|
|
@ -290,6 +290,20 @@ namespace Nif
|
||||||
void read(NIFStream* 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
|
/// Record types
|
||||||
|
|
||||||
// Abstract Bethesda Havok object
|
// Abstract Bethesda Havok object
|
||||||
|
@ -526,5 +540,11 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct bhkHingeConstraint : public bhkConstraint
|
||||||
|
{
|
||||||
|
bhkHingeConstraintCInfo mConstraint;
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -146,6 +146,7 @@ namespace Nif
|
||||||
RC_bhkRigidBody,
|
RC_bhkRigidBody,
|
||||||
RC_bhkRigidBodyT,
|
RC_bhkRigidBodyT,
|
||||||
RC_bhkRagdollConstraint,
|
RC_bhkRagdollConstraint,
|
||||||
|
RC_bhkHingeConstraint,
|
||||||
RC_BSLightingShaderProperty,
|
RC_BSLightingShaderProperty,
|
||||||
RC_BSEffectShaderProperty,
|
RC_BSEffectShaderProperty,
|
||||||
RC_NiClusterAccumulator,
|
RC_NiClusterAccumulator,
|
||||||
|
|
Loading…
Reference in a new issue