Read bhkConvexTransformShape

7220-lua-add-a-general-purpose-lexical-parser
Alexei Kotov 2 years ago
parent 138e7b7daa
commit 115c30a573

@ -161,6 +161,7 @@ namespace Nif
{ "bhkPackedNiTriStripsShape", &construct<bhkPackedNiTriStripsShape, RC_bhkPackedNiTriStripsShape> },
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },

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

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

@ -137,6 +137,7 @@ namespace Nif
RC_bhkPackedNiTriStripsShape,
RC_hkPackedNiTriStripsData,
RC_bhkConvexVerticesShape,
RC_bhkConvexTransformShape,
RC_bhkBoxShape,
RC_bhkCapsuleShape,
RC_bhkSphereShape,

Loading…
Cancel
Save