mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 16:29:55 +00:00
Merge branch 'ragdollsupportscheduledfortwentyninety' into 'master'
Parse bhkRagdollTemplate/bhkRagdollTemplateData See merge request OpenMW/openmw!4375
This commit is contained in:
commit
5a4e5cccc6
4 changed files with 55 additions and 0 deletions
|
@ -477,6 +477,10 @@ namespace Nif
|
|||
{ "bhkLiquidAction", &construct<bhkLiquidAction, RC_bhkLiquidAction> },
|
||||
{ "bhkOrientHingedBodyAction", &construct<bhkOrientHingedBodyAction, RC_bhkOrientHingedBodyAction> },
|
||||
|
||||
// Ragdoll template records
|
||||
{ "bhkRagdollTemplate", &construct<bhkRagdollTemplate, RC_bhkRagdollTemplate> },
|
||||
{ "bhkRagdollTemplateData", &construct<bhkRagdollTemplateData, RC_bhkRagdollTemplateData> },
|
||||
|
||||
// PROPERTIES
|
||||
|
||||
// 4.0.0.2
|
||||
|
|
|
@ -986,4 +986,31 @@ namespace Nif
|
|||
nif->skip(8); // Unused
|
||||
}
|
||||
|
||||
void bhkRagdollTemplate::read(NIFStream* nif)
|
||||
{
|
||||
Extra::read(nif);
|
||||
|
||||
readRecordList(nif, mBones);
|
||||
}
|
||||
|
||||
void bhkRagdollTemplate::post(Reader& nif)
|
||||
{
|
||||
Extra::post(nif);
|
||||
|
||||
postRecordList(nif, mBones);
|
||||
}
|
||||
|
||||
void bhkRagdollTemplateData::read(NIFStream* nif)
|
||||
{
|
||||
nif->read(mName);
|
||||
nif->read(mMass);
|
||||
nif->read(mRestitution);
|
||||
nif->read(mFriction);
|
||||
nif->read(mRadius);
|
||||
mHavokMaterial.read(nif);
|
||||
mConstraints.resize(nif->get<uint32_t>());
|
||||
for (bhkWrappedConstraintData& constraint : mConstraints)
|
||||
constraint.read(nif);
|
||||
}
|
||||
|
||||
} // Namespace
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef OPENMW_COMPONENTS_NIF_PHYSICS_HPP
|
||||
#define OPENMW_COMPONENTS_NIF_PHYSICS_HPP
|
||||
|
||||
#include "extra.hpp"
|
||||
#include "niftypes.hpp"
|
||||
#include "record.hpp"
|
||||
#include "recordptr.hpp"
|
||||
|
@ -908,5 +909,26 @@ namespace Nif
|
|||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct bhkRagdollTemplate : Extra
|
||||
{
|
||||
NiAVObjectList mBones;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct bhkRagdollTemplateData : Record
|
||||
{
|
||||
std::string mName;
|
||||
float mMass;
|
||||
float mRestitution;
|
||||
float mFriction;
|
||||
float mRadius;
|
||||
HavokMaterial mHavokMaterial;
|
||||
std::vector<bhkWrappedConstraintData> mConstraints;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
} // Namespace
|
||||
#endif
|
||||
|
|
|
@ -68,6 +68,8 @@ namespace Nif
|
|||
RC_bhkPrismaticConstraint,
|
||||
RC_bhkRagdollConstraint,
|
||||
RC_bhkRagdollSystem,
|
||||
RC_bhkRagdollTemplate,
|
||||
RC_bhkRagdollTemplateData,
|
||||
RC_bhkRigidBody,
|
||||
RC_bhkRigidBodyT,
|
||||
RC_bhkSimpleShapePhantom,
|
||||
|
|
Loading…
Reference in a new issue