mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-17 07:11:28 +00:00
Load bhkMoppBvTreeShape
This commit is contained in:
parent
59ce00f742
commit
e7cc76bba2
4 changed files with 56 additions and 1 deletions
|
@ -143,6 +143,7 @@ static std::map<std::string,RecordFactoryEntry> makeFactory()
|
||||||
factory["bhkCollisionObject"] = {&construct <bhkCollisionObject> , RC_bhkCollisionObject };
|
factory["bhkCollisionObject"] = {&construct <bhkCollisionObject> , RC_bhkCollisionObject };
|
||||||
factory["BSDismemberSkinInstance"] = {&construct <BSDismemberSkinInstance> , RC_BSDismemberSkinInstance };
|
factory["BSDismemberSkinInstance"] = {&construct <BSDismemberSkinInstance> , RC_BSDismemberSkinInstance };
|
||||||
factory["NiControllerManager"] = {&construct <NiControllerManager> , RC_NiControllerManager };
|
factory["NiControllerManager"] = {&construct <NiControllerManager> , RC_NiControllerManager };
|
||||||
|
factory["bhkMoppBvTreeShape"] = {&construct <bhkMoppBvTreeShape> , RC_bhkMoppBvTreeShape };
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,17 @@ namespace Nif
|
||||||
mHavokMaterial.read(nif);
|
mHavokMaterial.read(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hkpMoppCode::read(NIFStream *nif)
|
||||||
|
{
|
||||||
|
unsigned int size = nif->getUInt();
|
||||||
|
if (nif->getVersion() >= NIFStream::generateVersion(10,1,0,0))
|
||||||
|
mOffset = nif->getVector4();
|
||||||
|
if (nif->getBethVersion() > NIFFile::BethVersion::BETHVER_FO3)
|
||||||
|
nif->getChar(); // MOPP data build type
|
||||||
|
if (size)
|
||||||
|
nif->getChars(mData, size);
|
||||||
|
}
|
||||||
|
|
||||||
void bhkEntityCInfo::read(NIFStream *nif)
|
void bhkEntityCInfo::read(NIFStream *nif)
|
||||||
{
|
{
|
||||||
mResponseType = static_cast<hkResponseType>(nif->getChar());
|
mResponseType = static_cast<hkResponseType>(nif->getChar());
|
||||||
|
@ -78,4 +89,22 @@ namespace Nif
|
||||||
mInfo.read(nif);
|
mInfo.read(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkBvTreeShape::read(NIFStream *nif)
|
||||||
|
{
|
||||||
|
mShape.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkBvTreeShape::post(NIFFile *nif)
|
||||||
|
{
|
||||||
|
mShape.post(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkMoppBvTreeShape::read(NIFStream *nif)
|
||||||
|
{
|
||||||
|
bhkBvTreeShape::read(nif);
|
||||||
|
nif->skip(12); // Unused
|
||||||
|
mScale = nif->getFloat();
|
||||||
|
mMopp.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
} // Namespace
|
} // Namespace
|
|
@ -70,6 +70,13 @@ struct bhkEntityCInfo
|
||||||
void read(NIFStream *nif);
|
void read(NIFStream *nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct hkpMoppCode
|
||||||
|
{
|
||||||
|
osg::Vec4f mOffset;
|
||||||
|
std::vector<char> mData;
|
||||||
|
void read(NIFStream *nif);
|
||||||
|
};
|
||||||
|
|
||||||
/// Record types
|
/// Record types
|
||||||
|
|
||||||
// Abstract Bethesda Havok object
|
// Abstract Bethesda Havok object
|
||||||
|
@ -131,5 +138,22 @@ struct bhkEntity : public bhkWorldObject
|
||||||
void read(NIFStream *nif) override;
|
void read(NIFStream *nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Bethesda extension of hkpBvTreeShape
|
||||||
|
// hkpBvTreeShape adds a bounding volume tree to an hkpShapeCollection
|
||||||
|
struct bhkBvTreeShape : public bhkShape
|
||||||
|
{
|
||||||
|
bhkShapePtr mShape;
|
||||||
|
void read(NIFStream *nif) override;
|
||||||
|
void post(NIFFile *nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
// bhkBvTreeShape with Havok MOPP code
|
||||||
|
struct bhkMoppBvTreeShape : public bhkBvTreeShape
|
||||||
|
{
|
||||||
|
float mScale;
|
||||||
|
hkpMoppCode mMopp;
|
||||||
|
void read(NIFStream *nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
|
@ -130,7 +130,8 @@ enum RecordType
|
||||||
RC_NiCollisionObject,
|
RC_NiCollisionObject,
|
||||||
RC_bhkCollisionObject,
|
RC_bhkCollisionObject,
|
||||||
RC_BSDismemberSkinInstance,
|
RC_BSDismemberSkinInstance,
|
||||||
RC_NiControllerManager
|
RC_NiControllerManager,
|
||||||
|
RC_bhkMoppBvTreeShape
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Base class for all records
|
/// Base class for all records
|
||||||
|
|
Loading…
Reference in a new issue