diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index fbbc459ab2..fddaaa8cc1 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -29,4 +29,26 @@ namespace Nif shape.post(nif); } + void bhkEntity::read(NIFStream *nif) + { + bhkWorldObject::read(nif); + responseType = static_cast(nif->getChar()); + nif->skip(1); // Unused + processContactDelay = nif->getUShort(); + } + + void HavokMaterial::read(NIFStream *nif) + { + if (nif->getVersion() <= NIFFile::NIFVersion::VER_OB_OLD) + nif->skip(4); // Unknown + material = nif->getUInt(); + } + + void hkSubPartData::read(NIFStream *nif) + { + havokFilter = nif->getUInt(); + numVertices = nif->getUInt(); + material.read(nif); + } + } // Namespace \ No newline at end of file diff --git a/components/nif/physics.hpp b/components/nif/physics.hpp index a8f053b3be..ae7da6d141 100644 --- a/components/nif/physics.hpp +++ b/components/nif/physics.hpp @@ -57,5 +57,33 @@ struct bhkWorldObject : public Record struct bhkShape : public Record {}; +enum class hkResponseType : uint8_t +{ + Invalid = 0, + SimpleContact = 1, + Reporting = 2, + None = 3 +}; + +struct bhkEntity : public bhkWorldObject +{ + hkResponseType responseType; + unsigned short processContactDelay; + void read(NIFStream *nif) override; +}; + +struct HavokMaterial +{ + unsigned int material; + void read(NIFStream *nif); +}; + +struct hkSubPartData +{ + HavokMaterial material; + unsigned int numVertices, havokFilter; + void read(NIFStream *nif); +}; + } // Namespace #endif \ No newline at end of file