diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 2f4d471227..6a139d970e 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -161,6 +161,7 @@ namespace Nif { "bhkPackedNiTriStripsShape", &construct }, { "hkPackedNiTriStripsData", &construct }, { "bhkConvexVerticesShape", &construct }, + { "bhkConvexTransformShape", &construct }, { "bhkBoxShape", &construct }, { "bhkCapsuleShape", &construct }, { "bhkSphereShape", &construct }, diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index 9b58585c36..6342740c94 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -281,6 +281,22 @@ namespace Nif nif->getVector4s(mNormals, numNormals); } + void bhkConvexTransformShape::read(NIFStream* nif) + { + mShape.read(nif); + mHavokMaterial.read(nif); + mRadius = nif->getFloat(); + nif->skip(8); // Unused + std::vector mat; + nif->getFloats(mat, 16); + mTransform.set(mat.data()); + } + + void bhkConvexTransformShape::post(Reader& nif) + { + mShape.post(nif); + } + void bhkBoxShape::read(NIFStream* nif) { bhkConvexShape::read(nif); diff --git a/components/nif/physics.hpp b/components/nif/physics.hpp index 6ab1415fa5..90d1ab7c0d 100644 --- a/components/nif/physics.hpp +++ b/components/nif/physics.hpp @@ -314,6 +314,16 @@ namespace Nif void read(NIFStream* nif) override; }; + struct bhkConvexTransformShape : public bhkShape + { + bhkShapePtr mShape; + HavokMaterial mHavokMaterial; + float mRadius; + osg::Matrixf mTransform; + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + // A box struct bhkBoxShape : public bhkConvexShape { diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 7a7fd5f5c8..ffa6801456 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -137,6 +137,7 @@ namespace Nif RC_bhkPackedNiTriStripsShape, RC_hkPackedNiTriStripsData, RC_bhkConvexVerticesShape, + RC_bhkConvexTransformShape, RC_bhkBoxShape, RC_bhkCapsuleShape, RC_bhkSphereShape,