Read new nodes pt1

revert-6246b479
alekulyn 1 year ago
parent d9027f7eef
commit 7ea2ea96b6

@ -5,6 +5,7 @@
#include <algorithm>
#include <array>
#include <components/nif/node.hpp>
#include <limits>
#include <map>
#include <sstream>
@ -139,6 +140,8 @@ namespace Nif
{ "BSFadeNode", &construct<NiNode, RC_NiNode> },
{ "BSLeafAnimNode", &construct<NiNode, RC_NiNode> },
{ "BSTreeNode", &construct<BSTreeNode, RC_NiNode> },
{ "BSValueNode", &construct<BSValueNode, RC_NiNode> },
{ "BSOrderedNode", &construct<BSOrderedNode, RC_NiNode> },
{ "BSMultiBoundNode", &construct<BSMultiBoundNode, RC_NiNode> },
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
{ "NiFloatInterpolator", &construct<NiFloatInterpolator, RC_NiFloatInterpolator> },
@ -158,6 +161,7 @@ namespace Nif
{ "BSFurnitureMarkerNode", &construct<BSFurnitureMarker, RC_BSFurnitureMarker> },
{ "NiCollisionObject", &construct<NiCollisionObject, RC_NiCollisionObject> },
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
{ "bhkSPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
{ "BSDismemberSkinInstance", &construct<BSDismemberSkinInstance, RC_BSDismemberSkinInstance> },
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
@ -166,6 +170,8 @@ namespace Nif
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },

@ -89,6 +89,7 @@ namespace Nif
}
void read(osg::Vec3f& data) { readLittleEndianBufferOfType<3, float>(inp, data._v); }
void read(osg::Vec4f& data) { readLittleEndianBufferOfType<4, float>(inp, data._v); }
template <class T>
T get()

@ -483,4 +483,18 @@ namespace Nif
nif->read(mEyeData);
}
}
void BSValueNode::read(NIFStream* nif)
{
NiNode::read(nif);
nif->read(mValue);
nif->read(mValueFlags);
}
void BSOrderedNode::read(NIFStream* nif)
{
NiNode::read(nif);
nif->read(mAlphaSortBound);
nif->read(mStaticBound);
}
}

@ -377,5 +377,20 @@ namespace Nif
void post(Reader& nif) override;
};
struct BSValueNode : NiNode
{
unsigned int mValue;
char mValueFlags;
void read(NIFStream* nif) override;
};
struct BSOrderedNode : NiNode
{
osg::Vec4f mAlphaSortBound;
char mStaticBound;
void read(NIFStream* nif) override;
};
} // Namespace
#endif

@ -440,4 +440,12 @@ namespace Nif
mBodyFlags = nif->getUShort();
}
void bhkSimpleShapePhantom::read(NIFStream* nif)
{
bhkWorldObject::read(nif);
nif->skip(8); // Unused
std::vector<float> mat;
nif->readVector(mat, 16);
mTransform.set(mat.data());
}
} // Namespace

@ -426,5 +426,10 @@ namespace Nif
void read(NIFStream* nif) override;
};
struct bhkSimpleShapePhantom : public bhkWorldObject
{
osg::Matrixf mTransform;
void read(NIFStream* nif) override;
};
} // Namespace
#endif

@ -138,6 +138,7 @@ namespace Nif
RC_hkPackedNiTriStripsData,
RC_bhkConvexVerticesShape,
RC_bhkConvexTransformShape,
RC_bhkSimpleShapePhantom,
RC_bhkBoxShape,
RC_bhkCapsuleShape,
RC_bhkSphereShape,

Loading…
Cancel
Save