1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-16 16:20:53 +00:00

Read bhkCylinderShape

This commit is contained in:
Alexei Kotov 2023-09-20 04:08:11 +03:00
parent e207285323
commit ecf644bda5
4 changed files with 22 additions and 0 deletions

View File

@ -290,6 +290,7 @@ namespace Nif
// Physics geometry records, Bethesda
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
{ "bhkCylinderShape", &construct<bhkCylinderShape, RC_bhkCylinderShape> },
{ "bhkCompressedMeshShape", &construct<bhkCompressedMeshShape, RC_bhkCompressedMeshShape> },
{ "bhkCompressedMeshShapeData", &construct<bhkCompressedMeshShapeData, RC_bhkCompressedMeshShapeData> },
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },

View File

@ -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);

View File

@ -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;

View File

@ -39,6 +39,7 @@ namespace Nif
RC_bhkBlendController,
RC_bhkBoxShape,
RC_bhkCapsuleShape,
RC_bhkCylinderShape,
RC_bhkCollisionObject,
RC_bhkCompressedMeshShape,
RC_bhkCompressedMeshShapeData,