mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-24 06:23:07 +00:00
Read new nodes pt1
This commit is contained in:
parent
d9027f7eef
commit
7ea2ea96b6
7 changed files with 50 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <components/nif/node.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -139,6 +140,8 @@ namespace Nif
|
||||||
{ "BSFadeNode", &construct<NiNode, RC_NiNode> },
|
{ "BSFadeNode", &construct<NiNode, RC_NiNode> },
|
||||||
{ "BSLeafAnimNode", &construct<NiNode, RC_NiNode> },
|
{ "BSLeafAnimNode", &construct<NiNode, RC_NiNode> },
|
||||||
{ "BSTreeNode", &construct<BSTreeNode, RC_NiNode> },
|
{ "BSTreeNode", &construct<BSTreeNode, RC_NiNode> },
|
||||||
|
{ "BSValueNode", &construct<BSValueNode, RC_NiNode> },
|
||||||
|
{ "BSOrderedNode", &construct<BSOrderedNode, RC_NiNode> },
|
||||||
{ "BSMultiBoundNode", &construct<BSMultiBoundNode, RC_NiNode> },
|
{ "BSMultiBoundNode", &construct<BSMultiBoundNode, RC_NiNode> },
|
||||||
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
|
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
|
||||||
{ "NiFloatInterpolator", &construct<NiFloatInterpolator, RC_NiFloatInterpolator> },
|
{ "NiFloatInterpolator", &construct<NiFloatInterpolator, RC_NiFloatInterpolator> },
|
||||||
|
|
@ -158,6 +161,7 @@ namespace Nif
|
||||||
{ "BSFurnitureMarkerNode", &construct<BSFurnitureMarker, RC_BSFurnitureMarker> },
|
{ "BSFurnitureMarkerNode", &construct<BSFurnitureMarker, RC_BSFurnitureMarker> },
|
||||||
{ "NiCollisionObject", &construct<NiCollisionObject, RC_NiCollisionObject> },
|
{ "NiCollisionObject", &construct<NiCollisionObject, RC_NiCollisionObject> },
|
||||||
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
||||||
|
{ "bhkSPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
||||||
{ "BSDismemberSkinInstance", &construct<BSDismemberSkinInstance, RC_BSDismemberSkinInstance> },
|
{ "BSDismemberSkinInstance", &construct<BSDismemberSkinInstance, RC_BSDismemberSkinInstance> },
|
||||||
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
|
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
|
||||||
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
||||||
|
|
@ -166,6 +170,8 @@ namespace Nif
|
||||||
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
||||||
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
||||||
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
||||||
|
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
||||||
|
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
|
||||||
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
|
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
|
||||||
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
|
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
|
||||||
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
|
{ "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::Vec3f& data) { readLittleEndianBufferOfType<3, float>(inp, data._v); }
|
||||||
|
void read(osg::Vec4f& data) { readLittleEndianBufferOfType<4, float>(inp, data._v); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
T get()
|
T get()
|
||||||
|
|
|
||||||
|
|
@ -483,4 +483,18 @@ namespace Nif
|
||||||
nif->read(mEyeData);
|
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;
|
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
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -440,4 +440,12 @@ namespace Nif
|
||||||
mBodyFlags = nif->getUShort();
|
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
|
} // Namespace
|
||||||
|
|
|
||||||
|
|
@ -426,5 +426,10 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct bhkSimpleShapePhantom : public bhkWorldObject
|
||||||
|
{
|
||||||
|
osg::Matrixf mTransform;
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ namespace Nif
|
||||||
RC_hkPackedNiTriStripsData,
|
RC_hkPackedNiTriStripsData,
|
||||||
RC_bhkConvexVerticesShape,
|
RC_bhkConvexVerticesShape,
|
||||||
RC_bhkConvexTransformShape,
|
RC_bhkConvexTransformShape,
|
||||||
|
RC_bhkSimpleShapePhantom,
|
||||||
RC_bhkBoxShape,
|
RC_bhkBoxShape,
|
||||||
RC_bhkCapsuleShape,
|
RC_bhkCapsuleShape,
|
||||||
RC_bhkSphereShape,
|
RC_bhkSphereShape,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue