diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 4b77fe471d..6201c4df44 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -290,6 +290,7 @@ namespace Nif // Physics geometry records, Bethesda { "bhkBoxShape", &construct }, { "bhkCapsuleShape", &construct }, + { "bhkCylinderShape", &construct }, { "bhkCompressedMeshShape", &construct }, { "bhkCompressedMeshShapeData", &construct }, { "bhkConvexTransformShape", &construct }, diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index 95786cb247..03f196bd53 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -512,6 +512,17 @@ namespace Nif nif->read(mRadius2); } + void bhkCylinderShape::read(NIFStream* nif) + { + bhkConvexShape::read(nif); + + nif->skip(8); // Unused + nif->read(mVertexA); + nif->read(mVertexB); + nif->read(mCylinderRadius); + nif->skip(12); // Unused + } + void bhkListShape::read(NIFStream* nif) { readRecordList(nif, mSubshapes); diff --git a/components/nif/physics.hpp b/components/nif/physics.hpp index 7c7c3df21e..18d9d23249 100644 --- a/components/nif/physics.hpp +++ b/components/nif/physics.hpp @@ -524,6 +524,15 @@ namespace Nif void read(NIFStream* nif) override; }; + // A cylinder + struct bhkCylinderShape : public bhkConvexShape + { + osg::Vec4f mVertexA, mVertexB; + float mCylinderRadius; + + void read(NIFStream* nif) override; + }; + // A sphere using bhkSphereShape = bhkConvexShape; diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 115d6827c2..23bdebb7f7 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -39,6 +39,7 @@ namespace Nif RC_bhkBlendController, RC_bhkBoxShape, RC_bhkCapsuleShape, + RC_bhkCylinderShape, RC_bhkCollisionObject, RC_bhkCompressedMeshShape, RC_bhkCompressedMeshShapeData,