2021-11-10 16:31:28 +00:00
|
|
|
#include "physics.hpp"
|
|
|
|
#include "node.hpp"
|
|
|
|
|
|
|
|
namespace Nif
|
|
|
|
{
|
|
|
|
void bhkCollisionObject::read(NIFStream *nif)
|
|
|
|
{
|
|
|
|
NiCollisionObject::read(nif);
|
2021-11-10 19:50:01 +00:00
|
|
|
mFlags = nif->getUShort();
|
|
|
|
mBody.read(nif);
|
2021-11-10 16:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void bhkWorldObject::read(NIFStream *nif)
|
|
|
|
{
|
2021-11-10 19:50:01 +00:00
|
|
|
mShape.read(nif);
|
2021-11-10 16:31:28 +00:00
|
|
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD)
|
|
|
|
nif->skip(4); // Unknown
|
2021-11-10 19:50:01 +00:00
|
|
|
mFlags = nif->getUInt();
|
2021-11-10 16:31:28 +00:00
|
|
|
nif->skip(4); // Unused
|
2021-11-10 19:50:01 +00:00
|
|
|
mWorldObjectInfo.mPhaseType = nif->getChar();
|
2021-11-10 16:31:28 +00:00
|
|
|
nif->skip(3); // Unused
|
2021-11-10 19:50:01 +00:00
|
|
|
mWorldObjectInfo.mData = nif->getUInt();
|
|
|
|
mWorldObjectInfo.mSize = nif->getUInt();
|
|
|
|
mWorldObjectInfo.mCapacityAndFlags = nif->getUInt();
|
2021-11-10 16:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void bhkWorldObject::post(NIFFile *nif)
|
|
|
|
{
|
2021-11-10 19:50:01 +00:00
|
|
|
mShape.post(nif);
|
2021-11-10 16:31:28 +00:00
|
|
|
}
|
|
|
|
|
2021-11-10 17:16:05 +00:00
|
|
|
void bhkEntity::read(NIFStream *nif)
|
|
|
|
{
|
|
|
|
bhkWorldObject::read(nif);
|
2021-11-10 19:50:01 +00:00
|
|
|
mResponseType = static_cast<hkResponseType>(nif->getChar());
|
2021-11-10 17:16:05 +00:00
|
|
|
nif->skip(1); // Unused
|
2021-11-10 19:50:01 +00:00
|
|
|
mProcessContactDelay = nif->getUShort();
|
2021-11-10 17:16:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void HavokMaterial::read(NIFStream *nif)
|
|
|
|
{
|
|
|
|
if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD)
|
|
|
|
nif->skip(4); // Unknown
|
2021-11-10 19:50:01 +00:00
|
|
|
mMaterial = nif->getUInt();
|
2021-11-10 17:16:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void hkSubPartData::read(NIFStream *nif)
|
|
|
|
{
|
2021-11-10 19:50:01 +00:00
|
|
|
mHavokFilter = nif->getUInt();
|
|
|
|
mNumVertices = nif->getUInt();
|
|
|
|
mHavokMaterial.read(nif);
|
2021-11-10 17:16:05 +00:00
|
|
|
}
|
|
|
|
|
2021-11-10 16:31:28 +00:00
|
|
|
} // Namespace
|