Read bhkNPCollisionObject, bhkPhysicsSystem and bhkRagdollSystem

macos_ci_fix
Alexei Kotov 1 year ago
parent b5f1d0a91b
commit 1aabc9aee5

@ -283,6 +283,7 @@ namespace Nif
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
{ "bhkPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
{ "bhkSPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
{ "bhkNPCollisionObject", &construct<bhkNPCollisionObject, RC_bhkCollisionObject> },
{ "bhkBlendCollisionObject", &construct<bhkBlendCollisionObject, RC_bhkBlendCollisionObject> },
// Constraint records, Bethesda
@ -313,6 +314,10 @@ namespace Nif
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
// Physics system records, Bethesda
{ "bhkPhysicsSystem", &construct<bhkPhysicsSystem, RC_bhkPhysicsSystem> },
{ "bhkRagdollSystem", &construct<bhkRagdollSystem, RC_bhkRagdollSystem> },
// PROPERTIES
// 4.0.0.2

@ -342,6 +342,22 @@ namespace Nif
mBody.read(nif);
}
void bhkNPCollisionObject::read(NIFStream* nif)
{
NiCollisionObject::read(nif);
nif->read(mFlags);
mData.read(nif);
nif->read(mBodyID);
}
void bhkNPCollisionObject::post(Reader& nif)
{
NiCollisionObject::post(nif);
mData.post(nif);
}
void bhkBlendCollisionObject::read(NIFStream* nif)
{
bhkCollisionObject::read(nif);
@ -353,6 +369,16 @@ namespace Nif
nif->skip(8); // Unknown
}
void bhkPhysicsSystem::read(NIFStream* nif)
{
nif->readVector(mData, nif->get<uint32_t>());
}
void bhkRagdollSystem::read(NIFStream* nif)
{
nif->readVector(mData, nif->get<uint32_t>());
}
void bhkWorldObject::read(NIFStream* nif)
{
mShape.read(nif);

@ -370,6 +370,11 @@ namespace Nif
{
};
// Abstract physics system
struct bhkSystem : public Record
{
};
// Generic collision object
struct NiCollisionObject : public Record
{
@ -394,6 +399,16 @@ namespace Nif
}
};
struct bhkNPCollisionObject : NiCollisionObject
{
uint16_t mFlags;
bhkSystemPtr mData;
uint32_t mBodyID;
void read(NIFStream* nif) override;
void post(Reader& nif) override;
};
struct bhkBlendCollisionObject : bhkCollisionObject
{
float mHeirGain;
@ -402,6 +417,20 @@ namespace Nif
void read(NIFStream* nif) override;
};
struct bhkPhysicsSystem : public bhkSystem
{
std::vector<uint8_t> mData;
void read(NIFStream* nif) override;
};
struct bhkRagdollSystem : public bhkSystem
{
std::vector<uint8_t> mData;
void read(NIFStream* nif) override;
};
// Abstract Havok shape info record
struct bhkWorldObject : public bhkSerializable
{

@ -54,7 +54,9 @@ namespace Nif
RC_bhkMoppBvTreeShape,
RC_bhkNiTriStripsShape,
RC_bhkPackedNiTriStripsShape,
RC_bhkPhysicsSystem,
RC_bhkRagdollConstraint,
RC_bhkRagdollSystem,
RC_bhkRigidBody,
RC_bhkRigidBodyT,
RC_bhkSimpleShapePhantom,

@ -136,6 +136,7 @@ namespace Nif
struct BSShaderProperty;
struct NiAlphaProperty;
struct NiCollisionObject;
struct bhkSystem;
struct bhkWorldObject;
struct bhkShape;
struct bhkSerializable;
@ -176,6 +177,7 @@ namespace Nif
using BSShaderPropertyPtr = RecordPtrT<BSShaderProperty>;
using NiAlphaPropertyPtr = RecordPtrT<NiAlphaProperty>;
using NiCollisionObjectPtr = RecordPtrT<NiCollisionObject>;
using bhkSystemPtr = RecordPtrT<bhkSystem>;
using bhkWorldObjectPtr = RecordPtrT<bhkWorldObject>;
using bhkShapePtr = RecordPtrT<bhkShape>;
using bhkEntityPtr = RecordPtrT<bhkEntity>;

Loading…
Cancel
Save